Skip to content

Visible input errors, touch-sized controls, quieter LeetCode links, heading order - #5

Merged
devmtnaing merged 3 commits into
mainfrom
input-touch-headings
Sep 28, 2026
Merged

devmtnaing merged 3 commits into
mainfrom
input-touch-headings

Conversation

@devmtnaing

Copy link
Copy Markdown
Owner

What this changes

Items 6, 7, 10 and 11 from the x-sum UI/UX review. The changes are in the shared stepper, layout and styles, so all 46 lessons get them. Only x-sum's own brute-force step headings needed a lesson edit.

Stacked on #3 and #4. Until those merge, this diff also shows their commits. Merge in order (#3 → #4 → this) and it shrinks to its own commit.

6 · Bad input is visible (stepper.js, lesson.css)

  • The stepper added a bad class to a rejected field, but no CSS rule used it, so the field looked unchanged. Now a field that doesn't parse gets a red border, aria-invalid="true", and aria-describedby pointing at the warning.
  • The warning is a polite live region. It adds "The walkthrough below still shows the last input that worked" (with a Burmese version), and the strip, narration and stage dim to 50% until the input is fixed.
  • A valid edit in a second field no longer clears the first field's warning. Fixing the field or loading a preset clears everything.

7 · Touch-sized controls (lesson.css, site.css)

  • Under (pointer: coarse), (max-width: 560px), these grow to 40px tall: preset chips, language tabs, the English/မြန်မာ switch, Copy, "Load into the stepper", the jump chips, the masthead links and the theme button.
  • They grow taller, not wider, so rows keep their line breaks and the masthead stays one row at 320px.

10 · LeetCode links look different from section links (Walkthrough.astro, lesson.css)

  • The 1/2/3 section chips stay as pills. After a thin divider, the "View on LeetCode ↗" links are plain muted text links. The nav gets aria-label="On this page".

11 · Headings nest in order (stepper.js, stage.js, Walkthrough.astro, base.css, x-sum)

  • Part 1's "The problem" and widget title become h3. Inside "2·2 Watch it run" (an h3), the array, stage panels, answer and live code become h4. Part 3's solution titles become h3. x-sum's brute-force steps become h5.
  • New .as-h2 and .as-h3 classes keep each re-levelled heading looking exactly as before, and the tag-based selectors (.src-head, x-sum's .bf-step, the Burmese font rule) now match the new tags.

Checked

  • npm run check, npm run build, then npm run audit (axe in both themes): passed, 46 pages.
  • Headings: I captured every heading's computed font, size, weight, spacing, colour, margin and position on all 46 lessons (2 widths × 2 languages = 184 page states) before and after. None changed, and no heading skips a level.
  • Bad input, checked on every lesson: junk in a field, a valid edit in another field, then a preset. The two lessons whose input takes any string have no invalid state to show.
  • Tap targets: at 390px with touch emulation, no targeted control is under 40px on any lesson. The masthead is 57px at 320px (56px plus its 1px border).
  • Stepper keys, screen-reader narration and native dark controls #3's keyboard test and Sticky player controls and a wrapping array strip #4's narrow-width test still pass with nothing new, and there were 0 page errors.

- 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.
…eading order

- A field that does not parse gets a red border, aria-invalid and
  aria-describedby to a live warning; the stage, strip and narration dim
  while any field is bad, and the warning says the walkthrough still shows
  the last input that worked. A valid edit elsewhere no longer clears it.
- On touch screens and at <=560px, chips, language tabs, the page-language
  switch, Copy, example buttons, jump chips, masthead links and the theme
  button are 40px tall.
- The jump nav's "View on LeetCode" links are plain links past a divider,
  not pills like the in-page part chips; the nav is labelled.
- Headings nest without skipping a level (2·2's panels are h4, part 3's
  solutions h3, x-sum's steps h5); .as-h2/.as-h3 keep their old look.
@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: 12236428-cbc8-4180-adfc-8c588ac81345


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 ↗ 92d07c2 2026-09-27T02:42:28.962Z Visit the dashboard ↗

@devmtnaing
devmtnaing merged commit c460f43 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