Skip to content

Key the pieces of a translated message that holds markup - #2114

Closed
joepio wants to merge 1 commit into
developfrom
claude/project-thread-8tdupo
Closed

joepio wants to merge 1 commit into
developfrom
claude/project-thread-8tdupo

Conversation

@joepio

@joepio joepio commented Oct 6, 2026

Copy link
Copy Markdown
Member

Before: in a Vite dev build, every translated message that mixes text with an element (the icon beside "Add icon", a link inside a sentence) logs "Each child in a list should have a unique key". The atomic-saas portal e2e runs a dev server and fails on any console error, so invite-signup fails on every retry. It started with the batch of 6 October (#2085, 30 PRs combined): its wuchale patch now extracts the "Add icon" and "Add cover" labels in TitleDecorationAffordances, which used to stay untranslated plain text.

After: those messages render without the warning, so the saas portal e2e no longer trips on it (saas #196, the Firefox scrolling fix, is the PR that hit it). The same fix covers every other message that holds markup, so more of them will not surface one by one.

The wuchale JSX runtime returns the pieces of a message as an array whose elements have no key. A pnpm patch (@wuchale/jsx@0.12.5) wraps each piece in a Fragment keyed by its position, which cannot change for a given message. Children.toArray was tried first and does not help, because React still warns for elements it keys that way.

How: the patch is browser/patches/@wuchale__jsx@0.12.5.patch, registered in pnpm-workspace.yaml, with the lockfile entries added by hand in the repo's existing format and an entry in browser/patches/README.md. src/locales/wuchaleRuntime.test.tsx renders a message with an icon and fails without the patch. The AI settings e2e no longer requires the older Vite-only warning of the same kind. Checked locally: the new unit test, oxfmt, the pre-commit lint, pnpm install --frozen-lockfile, and that the Vite dev transform of ResourceDecorations.tsx imports the patched runtime. Not run here: the full e2e or the saas portal e2e. To check it, run the saas portal e2e (invite-signup) against this branch.


Generated by Claude Code

Before: in a Vite dev build, every translated message that mixes text with an
element (an icon beside "Add icon", a link inside a sentence) logged "Each
child in a list should have a unique key". The atomic-saas portal e2e runs a
dev server and fails on any console error, so invite-signup failed on every
retry once the wuchale patch of the 6 October batch started extracting such
labels in TitleDecorationAffordances.

After: those messages render without the warning. The wuchale JSX runtime
returned the pieces as an unkeyed array; a pnpm patch wraps each piece in a
Fragment keyed by its position. A unit test renders such a message and fails
without the patch. The AI settings e2e no longer requires the warning that
this fixes.

joepio commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

Closed in favour of #2118, the same commit on a branch name that no atomic-saas branch shares. This PR's Downstream check paired with a stale same-named saas branch; its main CI job was green.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant