Skip to content

feat(tutorial): draw names, values and controls in stage texts as on screen - #111

Merged
Rn86222 merged 6 commits into
mainfrom
feat/stage-text-markup
Nov 20, 2026
Merged

Rn86222 merged 6 commits into
mainfrom
feat/stage-text-markup

Conversation

@Rn86222

@Rn86222 Rn86222 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Summary

In the stage texts, pin and part names, values such as ON and 0011, and buttons such as Check were all set like the text around them, which made the long texts of the later stages hard to follow.

  • Marks in the stage texts. The texts mark names as {Start}, values as [ON] or [0011], and controls as <check> or <play>.
    • Names are set in weight 500.
    • Values are bold, with the ON bits in the green of the truth tables, which now share the way they draw a value.
    • Text buttons (Check, the Apply of a value box, the Apply of a pin's bit width, Auto) are drawn with the same components and looks as the real ones, smaller, not clickable, out of the tab order, and read out by their label. Their labels come from the same messages as the real buttons. The play and pencil buttons are drawn as their icon in a circle of the same colour, the step arrows as their icons, and the Enter key as a key.
    • The looks of those four buttons are defined once and used by both the real controls and the texts, so that changing one changes the other.
  • Tests check that every stage text parses, with no unknown or unfinished mark, and that English and Japanese mark the same values and controls in each text. This found that the first stage's fourth step did not name the play button in English.
  • Less crowded goals and steps. The goals of stages 4, 7, 8 and 9 are split into paragraphs by what they explain, such as what to build and what Check looks at. Steps are further apart.
  • Roboto is loaded with the weights 400, 500 and 700. It was named first among the Latin fonts but never loaded, so English fell back to system fonts without weight 500, in which names looked like the text around them. English text now uses Roboto everywhere, so MUI's weight-500 text, such as buttons and dialog titles, is slightly bolder than before.

Not in this PR

  • The part descriptions and the pin note are not marked yet.

Testing

  • npx vitest run (299 tests), npx tsc -p . and npx biome check src pass.
  • With the marks taken off, every stage text reads as before, except for the play button added to stage 1's fourth step in English.
  • In the browser, in English and Japanese, stages 1, 7, 8 and 9 show the names, values and controls as described, with the lines of text evenly spaced. The accessibility tree reads each control once by its label, for example "…書きかえて、適用を押します".

🤖 Generated with Claude Code

Rn86222 and others added 6 commits November 21, 2026 00:04
… on screen

Stage texts mark pin and part names as {Start}, values as [ON] or
[0011], and controls as <check> or <play>. Names are bold, values look
as in the tables, and controls are drawn like the real buttons and
icons, smaller and not clickable. The labels of text buttons come from
the same messages as the buttons. Tests check that every stage text
parses and that both languages mark the same values and controls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A value of OFFs or 0s was plain like the text around it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The buttons in stage texts copied the real ones' colours, so a change to a
real button would not reach them. The looks of Check, the two Apply
buttons and Auto are now defined once, used by the real controls, and
drawn in stage texts with the same components, smaller and inert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Roboto was named first but never loaded, so English fell back to the
system's fonts, most of which have no weight 500. Stage texts set names
in 500, which then looked the same as the text around them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Goals that explain several things are split into paragraphs: what to
  build, what the parts already placed are for, and what Check looks at.
- Steps are further apart.
- Names are set in weight 500, lighter than values, as some steps name a
  pin or a part every few words.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ines even

- The controls drawn in stage texts were inert, which also hid their
  labels from screen readers. They are now hidden from screen readers and
  out of the tab order, with the label read from a hidden copy.
- Their own size overrides the padding of the shared look, so that the
  Const Apply button no longer makes its line taller.
- The sx of a shared look is merged with any other, not replaced.
- The FlipFlop's first output in the counter stage is four bits.

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: eb381ea
Status: ✅  Deploy successful!
Preview URL: https://c6c46d4a.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev
Branch Preview URL: https://feat-stage-text-markup.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev

View logs

@Rn86222
Rn86222 merged commit 663bba1 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