Skip to content

Make the back arrow and menu follow one rule - #182

Merged
KadyrovAkram merged 9 commits into
mainfrom
fix/nav-chrome
Oct 15, 2026
Merged

KadyrovAkram merged 9 commits into
mainfrom
fix/nav-chrome

Conversation

@KadyrovAkram

Copy link
Copy Markdown
Collaborator

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:

  • Phone: the card and the way keep ☰ in the corner. Every screen below them gets ← in the same corner.
  • Desktop: the corner always holds ☰. Back goes in the panel, at the same inset as the room's header, on every pane.
  • Way: keeps ☰, and has its own ← on the plate naming the room.

Commits

  1. Record the screen underneath on every history entry. pick, browse, about, near, way, card and the picker's replaceState now carry from.
  2. Name every Back from the entry it lands on. One backLabel() replaces per-screen strings and roomBackLabel. It fixes the list saying "Back to the card" when opened from a desktop room, and after picking a building from the way.
  3. Decide a screen's way out in one function. chromeFor() and paintChrome() replace the decisions in showPane, showAsk, showWay and the per-breakpoint body.rooming CSS. A resize across the breakpoint re-decides.
  4. Keep the desktop corner for the menu on every screen. Adds #sheet-back in the panel for list, near, pick, browse and about.
  5. Give the way a Back of its own, and name the menu's. #way-back sits on the plate. The menu's Back reads "Back to the question" and is hidden wherever another Back shows.
  6. Step back onto the card when Check again loses the way's room. Previously history became question → card → card, and the next Back appeared to do nothing.
  7. Land focus on the screen a menu choice opens. Focus used to drop to <body> after the menu hid its own button.
  8. Return to the screen underneath instead of stacking a copy. Fixes the list → room → list loop from the desktop menu.
  9. Draw the phone's corner arrow the way the menu is drawn. Same 60px target, 40px glyph and position, so the corner no longer jumps 16px from card to room.

Testing

  • npm test: 938 pass. The source-pattern tests in screens.test.mjs are updated, with new assertions for each fix.
  • scripts/check-dead-code.mjs: clean.
  • Driven by hand at 375×812 and 1400×900 with the dev clock on a Wednesday at 11:00: corner positions, labels, focus, history length after Check again, and the menu returning to the list.

For review

  • On a phone, the plate's side inset makes names like "University Hall 043" wrap onto two lines.
  • Hovering ← or ☰ now dims the glyph instead of showing a filled disc.

🤖 Generated with Claude Code

KadyrovAkram and others added 9 commits October 15, 2026 00:12
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>
@KadyrovAkram
KadyrovAkram merged commit c492a65 into main Oct 15, 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