viewer: Pages stepper UX — labeled Prev/Next, scalable progress, keyboard nav, nested hierarchy - #293
Merged
Merged
Conversation
… nav, nested hierarchy
The Pages pager is used heavily as a step-through debugger (nested
Pages inside Pages). Replace the numbered Pagination row with a
stepper built for that: labeled Prev/Next with focusable end-disabled
states, the current title shown prominently with an 'N of M' count,
clickable title-tooltipped dots (<=16 pages) or a progress bar plus a
jump-by-title select (>16), arrow/Home/End keys while a bar has focus
(stopPropagation keeps nested pagers independent), a subtle page-in
transition honoring prefers-reduced-motion, and depth-context sizing +
inset so inner pagers read as subordinate. Authoring contract
unchanged: {pages:[{title,node}...]} renders one lazy page at a time.
Evidence: reviews/pages-stepper/ before/after Playwright shots.
6 unit tests + 5 keyboard e2e checks added.
…ve in the PR body)
ivanmkc
marked this pull request as ready for review
July 29, 2026 15:06
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.
Improves the
Pagesrenderer's step-through ("debugger") experience. Draft for review — authoring contract is unchanged.UX review of the current stepper
Reviewed as a generic component against the live example (emberwood/synthbench, page 2 "Algorithm Debugger") and local renders:
2/5 · Algorithm Debugger (step through)— is small, dimmed, and to the right of the buttons. The current page title (the one label that says what you're looking at) is the least prominent text on the bar.before-live-debugger.png,before-nested.png)1 2 3 4 5 6 7 … 20— no sense of progress, and the collapsed middle is exactly where a debugger user lives. (before-scale20.png)before-longtitle.png)aria-currenton the active step, no live announcement on step change, and — found by the new e2e — reaching an end while keyboard-stepping dropped focus entirely (the focused button becamedisabled).What changed (
packages/viewer/src/client/renderers/pages.tsx)‹ Prev/Next ›buttons at both ends of the bar, disabled-styled at the ends but still focusable (data-disabled/aria-disabled, notdisabled) so arrow-key stepping survives hitting page 1 / page N. Each button carries the neighboring page's title as a tooltip hint.N of Mcount beside it.aria-current="page") up to 16 pages; beyond that a slim progress bar plus a jump-by-title<select>(3/20 · Step 3), which keeps random access at any page count.stopPropagationkeeps a nested pager's keys from also driving the outer one.prefers-reduced-motion.role="group"s; the top bar's title/count is a polite live region so a step change is announced once; dots and the jump select have focus-visible rings.Contract preserved:
{"type":"Pages","props":{"pages":[{title,node}...]}}is untouched; off-page trees are still never resolved (lazy pages), clamping on live-patch shrink kept, no changes to core validation or the resolver.Deliberately not done: auto-advancing an outer pager when an inner one hits its end (predictability over cleverness); swipe gestures; URL/hash persistence of the current page (worth a separate discussion — it would make deep links into a specific step shareable).
Before / after
More in
reviews/pages-stepper/— incl. the live debugger board before (before-live-debugger.png), first-page disabled state (after-p1.png), and dark theme (after-dark.png).Test plan
npm run buildclean (monorepo)npm test— 734/734 pass (6 new Pages unit tests: registration, lazy off-page content, focusable-disabled ends, dots→progress+select switchover at 16, single-page chrome, empty/untitled fallbacks)node e2e/keyboard.e2e.mjs— 19/19 (5 new: arrow step fwd/back, nested isolation, Home/End; the Home/End check caught the focus-loss-on-disabledbug)