Skip to content

Frame pager: one width for the name, so ‹ › stay put; h k / l j step frames - #101

Merged
jamescalam merged 2 commits into
mainfrom
skill-462-fixed-pager
Dec 4, 2026
Merged

jamescalam merged 2 commits into
mainfrom
skill-462-fixed-pager

Conversation

@jamescalam

@jamescalam jamescalam commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

The frame pager (‹ name · n of N ▾ ›) changed width with every frame name, so › moved under the pointer while stepping through frames. This keeps the middle at one width and adds letter keys for stepping.

What changed (base.html, and the same lines in starter.html)

  • One width. The name and the place each sit in a .pager-cell grid with a hidden twin (.pager-fit, aria-hidden) laid over them. The name's twin holds every name the pager can say (All N frames and each frame's label); the place's holds N of N. The cell takes the widest, and the name is centred in it.
  • Cap. The name cell stops at 24ch; a longer name ends in …, and .pager-now's title holds it whole.
  • Even figures. .pager-of and its twin use tabular-nums, so 10 of 13 is as wide as 13 of 13. Without the twin's figures, frames 10 to 13 were 3.4 px wider.
  • Keys. h or k steps to the frame before, l or j to the next. They're skipped in an input, textarea, select, contenteditable or textbox, in a menu (focused or open), in the Prototype bar (.tweaks) and Spacesheep's UI ([data-ss-ui]), with any modifier held, or when a frame's own handler already took the key (defaultPrevented). The listener is on the document in the bubble phase, behind ssPagerHops. The arrows' titles name the keys, and they carry aria-keyshortcuts.

Measured in Chromium (13-frame page, Spacesheep's canvas stood in for)

Width › x before (v1.2.62) › x after
1440 13 positions, 249.6 to 328.6 px 340 px for all 13
390 (frame open, pager on its own row) 350 px 350 px
1440 → 390 → 1440, after document.fonts.ready 340 / 350 / 340

l l j k h with focus on the page stepped as expected. With focus in an <input>, l was typed and the frame stayed.

The overview's All 13 frames keeps the same width too. ‹ and › still move once when the first frame opens, because Back appears to the pager's left; that was already the case before this change.

Tests

  • New test in check.test.js: the twins' content and aria-hidden, the CSS rules, the name's title, the arrows' titles, and the keys. It also checks the keys are skipped in input, textarea and select, in the Prototype bar, with each modifier, after defaultPrevented, and with the menu open. Removing the field guard fails it ("typing in a input").
  • The listener test counts the new document keydown.
  • 172 of 176 tests pass in a full run. The two failures (a folder from before run records… and a page made before groups gains…) pass when run alone: one timed out under load, the other saw a stray process in the listing.

jamescalam and others added 2 commits December 4, 2026 17:45
…can say, so ‹ and › stay put; h or k steps to the frame before, l or j to the next

Each of the pager's two cells lays a hidden twin under its text (aria-hidden), holding every name it can say (All N frames and each frame's name) or the longest place (N of N), so the cell is as wide as the widest and the name sits centred in it. The name stops at 24ch with an ellipsis and its title holds it whole. The place and its twin use tabular figures, so 10 of 13 is as wide as 13 of 13.

h or k steps to the frame before and l or j to the next, from anywhere on the page but a field (input, textarea, select, contenteditable, a textbox), a menu (open or focused), the Prototype bar or Spacesheep's own UI, and never with a modifier held or after a frame's own handler took the key. The listener is on the document, bubbling, behind its own flag. The arrows' titles name the keys, and aria-keyshortcuts says them.

Measured in Chromium on a 13-frame page: › at one x across all 13 frames at 1440 (340 px) and 390 (350 px), after document.fonts.ready and after resizing 1440 to 390 and back; before, it took 13 positions from 250 to 329 px at 1440.

Co-authored-by: Pointman <noreply@pointman.ai>
Co-authored-by: Claude <noreply@anthropic.com>
…en frame doesn't

Co-authored-by: Pointman <noreply@pointman.ai>
Co-authored-by: Claude <noreply@anthropic.com>
@jamescalam
jamescalam force-pushed the skill-462-fixed-pager branch from 547cf5a to a7a869d Compare December 4, 2026 09:45
@jamescalam
jamescalam merged commit b4ccea4 into main Dec 4, 2026
4 checks passed
@jamescalam jamescalam mentioned this pull request Dec 4, 2026
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