Repository navigation
fix: story layout, light-palette contrast, 3D labels without console errors - #222
Merged
Merged
Conversation
Stories: the code panel stays above the picture until 2xl, where a 62% column still draws 12-unit labels at 10px (storyLayout.ts, with the page-width model and tests). Beat counts come from the beat model. Palette: every light colour the story views draw as text reaches 4.5:1 and every mark 3:1 on each background it is drawn on; the pinned exceptions are gone. New text roles (unreachable, microtask, task) replace strokes used as text. Dark renders as before. 3D: drei Html labels are attached to the Canvas's outer element from their first render (useLabelHost), so they are never moved during the mounting commit. That removes the 'synchronously unmount a root' errors and the empty first caption, so the keyed remount is gone. Covered by a jsdom test over the real Canvas and Html. RxJS: the built-in take(3) marble diagram completes with its third value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Stories keep their picture readable. The code panel now sits above the picture until the page is 1536px wide, and beside it from there. A 12-unit label, measured in the browser on the Stack ↔ Heap story:
The agreed break was 1280px, but side by side at 1280 and 1440 still gave labels under 10px, so the break is at 1536. The Git branch-pointers story follows the same rule. The classes and the page-width model live in
src/shared/components/viz/storyLayout.ts.Light-palette contrast. Every failing light colour is darkened within its own hue. Text now reaches 4.5:1 on every background it is drawn on and strokes reach 3:1. The test enforces those floors for every pair the views draw, replacing the old "kept on purpose" exception. Three text roles are added (
text.unreachable,text.microtask,text.task) so text no longer borrows a stroke colour. The dark palette's values are unchanged.3D labels. The first caption of the Event Loop story's 3D view used to render empty, which was worked around by remounting it; that remount produced React "synchronously unmount a root" errors in development. The real cause is that drei moves every
Htmlduring the mounting commit. A stable label host (useLabelHost) removes both the workaround and the errors. A test with a real canvas and drei reproduces the empty caption and the errors without the fix.Small fixes. The Stack ↔ Heap story's beat count is derived from its beat model. The Marble Diagrams
take(3)picture completes with the third value.Checks
npx tsc -b,npm run lint,npm run test:run(1,207 tests in 90 files) andnpm run buildpass; three.js is not in the entry graph.Checked in the browser: label sizes at 1024, 1280 and 1536; the light colours on the Stack ↔ Heap story; both stories in 3D with all captions present and no console errors.
Known
🤖 Generated with Claude Code