Repository navigation
Put the dial's landing rules, Format values and link paths in one place each - #17
Merged
Merged
Conversation
The rules for what a choice does to the link lived in Picker's useCommits, and the verify world kept a hand-written copy of them. Now motion.ts has destination(commit, link), which both the store and the verify world call. The store runs the landing loop itself through a small DialPage port, and Picker only plugs the router into it. Announcements moved with it. A pick and an agent's choice now set announce on their commit like every other choice, so Picker no longer decides when to speak.
valuesOf and textContrast describe a colour, not the card, but they lived in color-card/formats.ts next to the localStorage code. The agent tools imported them from there, so they depended on the card's internals and pulled storage in with the maths. They now live in src/picker/formats.ts, which the card, the agent tools and anything else can share. The card keeps only the remembered format, in stored-format.ts. Hex is now built from the RGB already in hand instead of converting the colour twice.
The agent tools built links through router.buildLocation with the route pattern written out by hand, and the page head built the same paths with its own template strings. linkPath in color.ts now writes /hue or /hue/saturation/brightness, next to the code that parses it, and both use it. The agent tools no longer need the router at all.
The doctor looked for <title>Huebo</title>, but the home page title is now "Huebo: Dial in your colour (HSB/HSV picker)", so every doctor run said the page didn't serve Huebo. It now checks that the title starts with Huebo.
Comments that only restated the code are gone. destination is now nextLink, and the port's go is now navigate, so the names say what the comments did. The verify skill's notes follow the new names.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Summary
Three changes from an architecture review. Each one puts a rule in a single place.
The dial lands its own choices. Picker's
useCommitsdecided what a choice does to the link, andworld.tsin the verify harness kept a hand-written copy of that logic. Both now callnextLinkinmotion.ts. The store runs the landing loop itself through a small port, and Picker only plugs the router into it.Announcements moved too. Picks and an agent's choice now set
announceon their commit like every other choice, so Picker doesn't decide when to speak.A colour's Format values leave the Card. The agent tools imported
valuesOfandtextContrastfromcolor-card/formats.ts, next to thelocalStoragecode.A colour's link path is written once.
linkPath(color)incolor.tsreplaces a hand-written route pattern in the agent tools and the page head's template strings. The agent tools no longer need the router. That code only built thelinktext an agent reads back. Navigation still goes through the dial'sjumpevent.I looked at a fourth idea and dropped it: giving each dial part intent methods instead of
send(event). ADR-0002 already makes the event union the interface. Wrapping it would add a layer without making anything deeper.There's also a fix to the verify-huebo doctor. It looked for
<title>Huebo</title>, which #16 changed, so it failed on master too.Evidence
Before (master):
pnpm verifyexplores 3,700,770 states and fails only on the known open finding ("+, −, router finishes loading → 200° chosen, 205° on screen").After: the same 3,700,770 states and the same single finding. Where a commit takes the link is now checked by the real
nextLink, not a copy.After:
pnpm checkpasses, with 135 tests. New unit tests covernextLink(hue already in the link, hue-only keeps the pick, a cleared pick drops it) andlinkPath.Browser (agent-browser at 1280×900):
history.length/200/200/62/75/200/205/200, then/200/62/7573,152,191, stored formatRGBCodex review found no actionable defects.
Merge Danger
Door: two-way
It's a refactor with no stored data or URL changes, so a revert is clean.
Blast Radius: announcements
Two screen reader messages change at the edges. If an agent clears the pick at the same hue, it now hears "Selection cleared" instead of "Hue …". If the grid's pick is cleared during a coast, it now hears "Hue …", the hue it lands on. Everything else announces as before. The landing loop moved, so the verify-dial-motion coverage table now points at
dial-motion.tsanduseLinkedDial.