Repository navigation
Shareable walkthrough links - #6
Merged
Merged
Conversation
- 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.
The walkthrough's place lives in the query string: approach, step, code language and any input the reader typed, e.g. /leetcode/x-sum?approach=heap&step=7&lang=python&nums=1,1,2,2,3 - Read before the first paint; unknown values fall back to the defaults and the step is clamped. Values at their defaults are left out, so an untouched page keeps its plain address. - Written with replaceState after each paint, debounced (Safari throws when replaceState is called too often during a scrubber drag). - Opening a shared link scrolls to the player; reload and Back do not. - "Report an issue" carries the same state in its page URL. - Comma lists travel without spaces when the field parses them the same.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
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.
What this changes
Item 13 from the x-sum UI/UX review. A walkthrough link now reopens at the exact place you were: the approach, step, code language and any input you typed. The change is in
src/lib/stepper.jsonly, so all 46 lessons get it.history.replaceStateafter each step, approach, language or input change, the same pattern the home page uses for its filters. It's debounced by 150 ms, because Safari throws whenreplaceStateis called too often, as it would be during a scrubber drag. It never adds Back-button entries.#part-…anchor does not.1, 2, 3travels as1,2,3whenever the field reads it back the same. Free text such as "A man, a plan" keeps its spaces.Checked
npm run check,npm run build, thennpm run audit(axe in both themes): passed, 46 pages.approach=nope&lang=cobol&step=99999, input@@@) fall back to the defaults and clamp the step, with no errors.