Repository navigation
Make the back arrow and menu follow one rule - #182
Merged
Merged
Conversation
Room and list entries said where they were opened from; pick, browse, about, near, way and the card did not, and the picker's replaceState dropped it. Anything that needs to know where Back lands now reads it off the entry instead of guessing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each screen wrote its own Back label, and roomBackLabel covered rooms alone. The list said "Back to the card" when the desktop menu opened it from a room, and after picking a building from the way. One backLabel() now reads the label off the entry's from, and showPane sets it for every screen. The deep link pushes its landing entry before painting it so the label reads the right entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
showPane, showAsk and showWay each set #back and #menu, and the CSS re-decided the room's pair per breakpoint on top of that, which is the drift index.html's own comment warns about. chromeFor() now says what the corner and the panel hold for a screen, paintChrome() applies it, and every way onto a screen calls it, as does a resize across the desktop breakpoint. The room's panel Back is hidden by default and only shown by paintChrome, so a repaint cannot bring it back on a phone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a desktop the room kept the menu in the corner and put Back in its panel, while list, near, pick, browse and about swapped the corner to Back. Two rules for one window, and a second click on the corner landed on whichever it was. The corner now holds the menu on every desktop screen, and every pane gets Back in the panel, at the same inset as the room's header. The menu loses its disc wherever it shows, and the Back offset that only existed to line the two up in the corner goes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The way kept the menu in its corner and left Back as the menu's first item, unnamed, plus a grip only a phone has. Back now sits on the plate naming the room it leaves, labelled with where it lands. The menu keeps its Back for the card, where nothing else offers one, names it the same way every other Back is named, and hides it wherever another Back shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
refresh() rewrote the way's entry into a card with replaceState, over the card the way was taken from, so history read question, card, card and the next Back looked like it did nothing. When the card is the entry underneath it now steps back onto it; from anywhere else the way is still replaced, keeping the entry's from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closing the menu handed focus back to its button, and the choice then hid that button on a phone, so a keyboard or screen reader user was left on the body after See all rooms, Browse buildings or What Vacant knows. A choice that changes the screen now moves focus to that screen's heading or first row, and Back does the same once popstate has landed it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a desktop room opened from the list, the menu's See all rooms pushed a second list over it, and list, room, list, room was a loop Back had to walk a step at a time. A menu choice naming the screen directly underneath now goes back to it, which also keeps that screen's row and scroll. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The menu is a bare 40px glyph in a 60px target at 1.1rem, and the arrow that replaces it was a 44px bordered disc at .6rem, so going from the card to a room moved the corner control 16px and turned it into a different-looking button. The arrow now takes the menu's size, place and drop shadow, and hover dims either glyph instead of growing a disc. 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.
Fixes how Vacant chooses between the hamburger menu and the back arrow, plus several Back bugs. One commit per fix.
The rule now
One function,
chromeFor(), decides it for every screen:Commits
replaceStatenow carryfrom.backLabel()replaces per-screen strings androomBackLabel. It fixes the list saying "Back to the card" when opened from a desktop room, and after picking a building from the way.chromeFor()andpaintChrome()replace the decisions inshowPane,showAsk,showWayand the per-breakpointbody.roomingCSS. A resize across the breakpoint re-decides.#sheet-backin the panel for list, near, pick, browse and about.#way-backsits on the plate. The menu's Back reads "Back to the question" and is hidden wherever another Back shows.<body>after the menu hid its own button.Testing
npm test: 938 pass. The source-pattern tests inscreens.test.mjsare updated, with new assertions for each fix.scripts/check-dead-code.mjs: clean.For review
🤖 Generated with Claude Code