Skip to content

Sticky player controls and a wrapping array strip - #4

Merged
devmtnaing merged 2 commits into
mainfrom
sticky-player-mobile-strip
Sep 28, 2026
Merged

devmtnaing merged 2 commits into
mainfrom
sticky-player-mobile-strip

Conversation

@devmtnaing

Copy link
Copy Markdown
Owner

What this changes

Two layout fixes from the x-sum UI/UX review. Both are in src/styles/lesson.css, so all 46 lessons get them; no lesson file changed.

Stacked on #3. This branch starts from #3's branch, so until #3 merges this diff also shows its commit (Stepper keys, screen-reader narration and native dark controls). Merge #3 first, and this PR shrinks to the one CSS commit.

Controls stay visible while you step

  • Desktop and tablet: Back/Play/Next, the scrubber and the narration stick under the masthead while you scroll the stage and code, and let go at the end of the player. At 1440×900 the controls, narration, stage and highlighted code line are now on screen together; before, stepping meant scrolling up and down. Switched off on windows shorter than 600px.
  • Phones (≤560px): only the buttons stick, as one 57px row. With the narration included it was about 250px, a third of the screen. The narration stays in the flow above the stage, and the buttons are 40px tall so they're easier to tap.
  • Focusable elements in the stage get a scroll-margin-top, so keyboard focus scrolls clear of the bar instead of landing behind it.

The array strip wraps instead of scrolling sideways

  • 27 of 46 lessons had a strip that scrolled sideways at 390px, by 18px up to 1,122px (valid-palindrome). Now none do.
  • Rows leave room for pointer labels (ch, lo/hi, …), and cells shrink slightly on phones (42×50 → 36×44).

Checked

  • npm run check, npm run build, then npm run audit (axe in both themes, 400px overflow): passed, 46 pages.
  • A one-off Playwright run on every lesson at 320, 360 and 390px, in both languages, across every preset and through each walkthrough: nothing wider than the screen, no strip scrolls sideways, and no pointer label overlaps a cell.
  • Stepper keys, screen-reader narration and native dark controls #3's keyboard test still passes on all 46 lessons.

Known limits

  • On 320px phones the button bar goes to two rows (84px).
  • At 360px, coin-change also goes to two rows once its step counter reaches three digits.
  • On phones the narration isn't sticky, so it scrolls out of view while you read the code.

- Space on a focused button, link or disclosure presses it instead of
  toggling playback; Alt/Ctrl/Cmd combos go to the browser (Alt+← is Back).
- Approach and language tabs take ←/→/Home/End and use a roving tabindex,
  so only the selected tab is a Tab stop.
- The narration is a polite live region, muted while autoplay runs; the
  scrubber announces "Step 2 of 12: tally" via aria-valuetext.
- tokens.css sets color-scheme per theme, so scrollbars, range tracks and
  spinners are drawn dark on the dark theme.
- The transport and narration stick under the masthead while the reader
  scrolls the stage and code, and let go at the end of the player; not on
  windows shorter than 600px.
- On phones only the buttons stick, as one 40px-tall row; the narration
  stays in the flow above the stage.
- Focusable elements in the stage scroll clear of the sticky bar.
- The array strip wraps onto more rows instead of scrolling sideways, with
  room under each row for pointer labels; cells shrink a little on phones.
@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 6037e0d6-e3a3-42a2-aec5-ad8ee18e5cae


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 7182bde 2026-09-27T01:58:18.700Z Visit the dashboard ↗

@devmtnaing
devmtnaing merged commit eb3b20b into main Sep 28, 2026
52 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