Skip to content

fix(tutorial): name the stage components in the language shown - #108

Merged
Rn86222 merged 2 commits into
mainfrom
fix/tutorial-component-names-follow-language
Nov 20, 2026
Merged

Rn86222 merged 2 commits into
mainfrom
fix/tutorial-component-names-follow-language

Conversation

@Rn86222

@Rn86222 Rn86222 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The stage's component and the parts it hands over were named in the language the stage was first opened in, and kept that name after switching languages. Stage 3 says "Only switch A" can be used, while the side panel could show 「A だけのスイッチ」.

  • Renamed to the language shown: on opening a stage and on each language switch, the stage's component and the parts it hands over take the current title. The player cannot rename these, so nothing of theirs is overwritten. Components the player made keep their names.
  • Not saved on its own: the rename alone does not save, so a stage that was only opened still leaves nothing in the browser's storage, and a saved stage is not rewritten just because the language changed. The auto saver gets a way to make such changes without saving; a save already waiting is kept.
  • Names that follow a rename: the editor's title bar and the Check failure message did not re-render when a component was renamed. Both now subscribe to component updates. The stage page's store scope now covers the whole page, so that the failure message can.

Not in this PR

  • In the editor's simulation error notification, a part's name can stay in the old language. The notification's sentences for both languages are made when the error happens, with the part's name at that moment, and are shown until the notification is closed or play is pressed again. For example, after a wire inside "Only switch A" is removed and play is pressed in English, switching to Japanese shows 「Only switch A 内の And の入力ピン A がつながっていません。」. Only errors inside a part name the part.

Testing

  • npx vitest run (277 tests), npx tsc -p . and npx biome check src pass. New tests cover:
    • a stage saved in another language opens with the current names, without rewriting the save
    • renaming an open stage saves nothing for a stage only opened, and leaves the player's components and their pending save as they are
    • changes made without saving, a save waiting through them, and saving again after one throws
  • In the browser, on stage 3 with "Only switch A" placed and its inputs left open:
    • switching between English and Japanese renames the title bar, the side panel, the placed part and the part in the Check failure message, and keeps the message
    • after a reload the circuit is kept and the names stay in the current language
    • opening a stage and switching languages without changing anything saves nothing for it

🤖 Generated with Claude Code

Rn86222 and others added 2 commits November 20, 2026 21:01
The stage and the parts it hands over kept the name of the language the
stage was first opened in, so the side panel and the title bar could
disagree with the stage text after switching languages. They are now
renamed on opening and on each switch, without saving, so that a stage
only opened still leaves nothing behind. The title bar now follows a
renamed component.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The failure message reads part names from the store, but was rendered
outside the store's scope and did not follow a rename, so it kept the
old language's name after a switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9ff1337
Status: ✅  Deploy successful!
Preview URL: https://c4aecf63.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev
Branch Preview URL: https://fix-tutorial-component-names.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev

View logs

@Rn86222
Rn86222 merged commit 89e1d3e into main Nov 20, 2026
2 checks passed
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