Group the settings window into sections, and stop calling every pet a cat - #24
Merged
Conversation
…nguage Eleven cards in one 3400px column inside a window fixed at 560px meant reaching the pomodoro or the calendar was a blind scroll past ten cards you were not looking for, with nothing to aim at. The window is five tabs now - Pet, Play, Sound, Focus, Feeds - and the tallest is 1130px, with Sound fitting on screen whole. The rail is keyboard-drivable (arrows, Home/End) and carries the ARIA a tablist is supposed to. The wording was the cat's, hard-coded in the markup, so a dog owner read "your cat", "the cat calls you by it" and "Butterfly visits" while the tray, reading the species registry, already called that same toggle "Ball to chase". Those strings move into pets.js beside the tray's, so one toggle cannot be described two ways, and a test fails if any dog-facing string mentions a cat. The header also still read "pixelcat" after the 0.3.0 rename. Two bugs surfaced on the way: - The coat preview read its dog palettes off window.DOG_PATTERNS, but dog-sprite.js is a classic script whose top-level consts are global lexical bindings and never become window properties. The lookup came back undefined and the draw bailed out early and silently, so picking a breed relabelled everything and went on showing the cat. The preview had never once rendered a dog. - Only the custom-coat IPC reply rebuilt the coat dropdown, so whenever it beat the config reply a dog owner was offered the cat's coats. Also: the toggle switches are appearance:none, which had taken their focus ring with it, so tabbing through the window showed nothing; and the height is draggable now (420 min, 640 default) rather than frozen, with the width still pinned to the one-column layout.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
The settings window is the only real UI the app has, and it had drifted: eleven
cards stacked in one column, the cat's nouns hard-coded into the markup, and a
header still reading "pixelcat" three commits after the rename.
Sections instead of one long scroll
About 3400px of content sat inside a window fixed at 560px, so reaching the
pomodoro or the calendar meant scrolling past ten cards you were not looking
for, with nothing to aim at and no sense of how much was left.
Five tabs now: Pet, Play, Sound, Focus, Feeds. Tallest panel is 1130px and
Sound fits on screen whole. Break/stretch moved out of Behaviour to sit with
the pomodoro, where it belongs.
The rail is a real tablist:
role/aria-selected/aria-controls, a rovingtabindex, and arrow/Home/End keys. Panel visibility is the
hiddenattributeand nothing else, so there is no second source of truth to drift out of step.
One toggle, one description
A dog owner read "your cat", "the cat calls you by it", "Butterfly visits - a
butterfly drops by and the cat plays with it" and "Test meow", while the tray -
already reading the species registry - called that same toggle "Ball to chase".
renderer.jsgives dogs a ball, not a butterfly, so the tray was right and thesettings window was wrong.
Those strings move into
pets.jsnext to the tray's, asSETTINGS_TEXTkeyedby element id with
%token%substitution.settings-renderer.jsapplies themon every species change. Tests fail if a dog-facing string mentions a cat or a
meow, if a key targets an id the markup does not have, or if the play toggle
stops agreeing with the tray.
%percent%rather than braces on purpose: the reminders hint has to keepadvertising the
{name}/{time}/{date}placeholders thatfillPlaceholdersexpands much later, and a resolver that also ate braces wouldhave quietly deleted the documentation for them. There is a test for that too.
Two bugs found on the way
window.DOG_PATTERNS, butdog-sprite.jsis a classic script whose top-levelconsts are global lexical bindings that never become window properties. Thelookup came back undefined, the draw returned early and silently, and the
preview had never once rendered a dog.
cat-preview.jsalready reads them asbare identifiers, which is the fix.
first custom-coat list arrive as two independent IPC replies, and only the
themes reply rebuilt the dropdown, so whenever it won the race a dog owner was
offered the cat's coats.
Also: visible focus rings (the toggles are
appearance:none, which had takentheirs with it, so tabbing showed nothing), and custom coats now say they are
cat-only instead of leaving dog owners staring at a list that never grows.
Testing
npm test127 pass (10 new intests/settings-copy.test.js),npm run lintcleannpm run test:bootgreen (launches the real app)leftover tokens, keyboard arrows move the rail, no horizontal overflow at 400px,
no page errors
cat -> dog and Golden Retriever -> Dalmatian
401x802; asked for 400x300 and got 400x421
Not included
The overlay sprite art, the speech bubble and the marketing site are untouched.