Skip to content

fix(client): show the progress saving notice once in the info popup - #565

Merged
joneugster merged 1 commit into
leanprover-community:mainfrom
fushanbobfan:fix/info-popup-duplicate-notice
Oct 4, 2026
Merged

joneugster merged 1 commit into
leanprover-community:mainfrom
fushanbobfan:fix/info-popup-duplicate-notice

Conversation

@fushanbobfan

Copy link
Copy Markdown
Contributor

What was wrong

The "Game Info" popup shows the "Progress saving" paragraph twice: #437 duplicated the <Trans i18nKey="Progress saving.description"> element in client/src/components/popup/info.tsx.

The same block is also wrapped in a <Trans> without a key, although every heading and paragraph inside it is already translated on its own (t(...) or <Trans i18nKey=...>). That wrapper is what npm run translate trips over in #553: i18next-scanner reports "Unsupported JSX expression ... Got CallExpression" for the four t("….translation", …) headings, and then writes an empty key "<0></0><1><0></0><1></1></1>…": "" into every locale file. At runtime no locale has that key, so the wrapper only renders its children unchanged.

What this changes

  • Removes the duplicated <Trans> for the progress-saving text.
  • Replaces the key-less outer <Trans> with a fragment. Rendered output is otherwise unchanged.
  • Fills in the empty describe('Info') block in cypress/e2e/01-basic-interface.cy.ts with a test that opens the info popup in TestGame and checks the progress-saving text appears once.

This addresses the parse errors listed in #553. It does not touch the separate problem in that issue where the scanner flattens nested keys ("Development notes": {…} → "Development notes.translation").

How it was tested

  • Cypress (Windows, Electron, dev server via npm start): the new test fails on main with expected 2 to equal 1 and passes with the change. With the change, 01-basic-interface.cy.ts passes 6/6. game-features.cy.ts gives 4 passing and 16 failing both with and without the change (on my machine the level pages never show "Assumptions:"), so I could not confirm that spec locally.
  • npx i18next-scanner --config i18next-scanner.config.cjs in client/: 4 "Unsupported JSX expression" errors before, none after; the junk key is no longer added to any of the 10 locale files, and the rest of the scanner's output is the same as before. (I reverted the locale files afterwards; this PR does not include a scanner run.)
  • npm run build:client succeeds.

The info popup rendered the "Progress saving" description twice (a
duplicated <Trans> from leanprover-community#437). Its sections were also wrapped in a
key-less <Trans> although each one is already translated on its own;
i18next-scanner cannot parse the t() calls inside it and writes an empty
junk key into every locale file. Replace the wrapper with a fragment and
drop the duplicate, and add a Cypress test for the info popup.

@joneugster joneugster left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@joneugster
joneugster merged commit fae1ad4 into leanprover-community:main Oct 4, 2026
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.

2 participants