Skip to content

feat(tutorial): show the table a stage asks for under its goal - #99

Merged
Rn86222 merged 6 commits into
mainfrom
feat/stage-goal-table
Nov 19, 2026
Merged

Rn86222 merged 6 commits into
mainfrom
feat/stage-goal-table

Conversation

@Rn86222

@Rn86222 Rn86222 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A visitor who knows nothing about logic has to work out what to build from the goal's sentence alone. This PR shows each stage's goal as a truth table too, which can be compared with the tables of the parts, and makes the stage's left column read as sections now that it holds several tables.

  • Goal table: a "Goal" section holds the goal text and, under it, the table of ON and OFF the circuit has to follow. The table is built from the stage's check (truthTableOfCheck), so it always matches what Check expects, and every stage defined with a check gets one. A stage whose pins carry more than one bit gets none.
  • Headings: the stage title, "Goal" and "Available parts" (previously a faint "Parts you can use in this stage") are bold headings, in descending size. The heading elements go h2, h3, h4.
  • Part names: the name of each part is a bold heading over its summary and table, on the stage and in the side panel's info popover. It used to look like a line of the summary.
  • One table component: the table rendering moves out of PartDescription into TruthTableView, used by both the part descriptions and the stage page.
  • A check missing an output: building the table now throws for it, as checking a circuit already did. Both use one lookup.

Not in this PR

  • Stage 1's goal text is mostly how to operate the editor, and nothing says in words that the table is what Check looks for. Both will be dealt with when stages 1 to 3 are rebuilt, where stage 1's text is split into numbered steps.
  • Stages with multi-bit pins will show a few examples instead of a table. They come with those stages.
  • The bold headings are only on the stage page. Other pages keep the theme's weights.

Testing

  • npx vitest run (181 tests), npx tsc -p . and npx biome check src pass. New tests cover:
    • the table of the XOR stage, in the order Check tries the inputs
    • no table for a multi-bit input or output
    • an error for a check missing an output
  • Checked in the browser with screenshots, in English and Japanese:
    • stages 1 and 2 show the Goal section with its table, and the headings fit on one line
    • the info popover in the side panel shows the part name as a heading within its 280px width

🤖 Generated with Claude Code

Rn86222 and others added 2 commits November 19, 2026 23:14
The part tables now come from one TruthTableView, shared with the stage page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dress the review

The goal table used to drop silently when a check gave no value for an output,
while checking the circuit threw for the same mistake. Both now share one lookup.
TruthTable.tsx is renamed after the component it exports.

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

cloudflare-workers-and-pages Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

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

Latest commit: f7ec972
Status: ✅  Deploy successful!
Preview URL: https://5bcace89.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev
Branch Preview URL: https://feat-stage-goal-table.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev

View logs

Rn86222 and others added 4 commits November 19, 2026 23:22
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ections

Their labels were faint captions, weaker than the part names under them.
They are now bold headings, and the stage title is bold to stay above them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A sentence made a poor heading and wrapped mid-word in Japanese. The goal text
and its table now share one "Goal" section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ading apart from the goal text

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rn86222
Rn86222 merged commit eb5f0cd into main Nov 19, 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