Repository navigation
feat(carousel): count the slides in view, page with Home and End, and peek at the next slide on narrow pages - #476
Conversation
… peek at the next slide on narrow pages
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Important
Fix the visible range calculation and backward paging after End before merging. Both failures reproduce in Chromium outside the new test cases.
Approach: Keeping native scroll snapping and sharing the changes across renderers is sound, but the counter and keyboard handling need to agree with where the track can actually stop.
Reviewed changes across all six files, including annotate’s use of the shared carousel. All 59 Chromium e2e tests and 99 unit tests passed, with one unit test skipped; the inline findings come from additional browser checks.
- Visible range: Checked the live counter at wide and narrow widths, including percentage gaps and custom peeks.
- Keyboard navigation: Checked
Home/End, reversal at the last snap position, and native page scrolling when all slides fit. - Responsive peek: Checked the narrow track layout and backward paging, and reviewed the updated accessibility and theming docs.
gpt-6.2-sol(high) | 𝕏
comark-annotate
comark-badge
comark-bundle
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-motion
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
Latest result Pull request merged. Final answersSession Pull request merged. PR #476 is ready to merge. All hosted checks passed, every review thread is resolved, and no actionable findings remain. The 18 carousel unit tests and repository lint passed using the installed binaries after pnpm’s preflight failed to open its local SQLite database. No new commit was needed. Pushed 320c834 to fix the P1 padded-track paging bug and resolved the review thread. Paging now measures stops from the scrollport, with regression tests for narrow LTR and RTL tracks and wide padded tracks. Geometry checks, 102 unit tests, and lint passed. Local browser setup failed, and sandbox restrictions blocked two Annotate CLI tests. Hosted CI is pending. Session Pull request evidence changed. Session Pull request evidence changed. Session Pull request evidence changed. |
There was a problem hiding this comment.
Important
The new paging logic skips a reachable range in a scaled carousel and can jump past the last full range when slide content overflows.
Approach: Keep native scroll snap, but derive the paging stops from the slide panels rather than from a mismeasured column count or the raw scroll limit.
Reviewed changes in 85e945f since the prior review. All 64 targeted Chromium e2e tests and all five new Firefox regression tests passed; the inline findings come from additional browser checks.
- Measured full slides from rendered pitch instead of parsing the computed gap.
- Mapped paging targets to reachable slide starts and cleared pending smooth-scroll targets on no-op requests.
- Restored native keyboard behavior on tracks without overflow and added regression coverage for the original findings.
gpt-6.2-sol(high) | 𝕏
There was a problem hiding this comment.
Important
A themed track with inline padding can announce the final page and disable Next while that page is still offscreen.
Approach: Deriving the stops from the panel geometry keeps paging independent of overflowing content, but the stop positions need to use the track’s scroll origin.
Reviewed changes in c5f4d6d since the previous review. All 67 targeted Chromium end-to-end tests and 103 unit tests passed (one skipped). Additional checks in Chromium and Firefox reproduced the inline finding.
- Unified paging geometry. Converted rendered panel distances into scroll coordinates and shared the resulting stops across paging, the counter, and the arrow states.
- Aligned the final narrow snap. Snapped the last panel by its end edge and let the browser handle keys when the carousel cannot page.
- Added regression coverage. Tested paging under
transform: scale()and CSSzoom, and verified that wide slide content does not extend the last page.
gpt-6.2-sol(high) | 𝕏
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes in 320c834 since the prior review. The workspace build, 70 Chromium end-to-end tests, and all three new Firefox regression tests passed. The full Firefox carousel suite had two failures involving focus and scrollbar behavior; both also reproduce with the prior runtime.
- Measured paging stops from the scrollport. Verified that padded tracks reach every slide or full range in both directions and that the counter matches the slides in view.
- Disabled Previous at the first reachable stop. Verified that returning home disables Previous even when leading padding puts the first stop past scroll offset zero.
- Added regression tests. Covered narrow padded tracks in LTR and RTL and verified that a wide track with leading padding reaches its final full range.
gpt-6.2-sol(high) | 𝕏

With
columns=2and 3 slides, one click on Next takes the counter from1 / 3straight to3 / 3. The end of the track counts as the last slide, so slide 2 never appears in the counter even though it stays on screen. On a phone, each slide fills the column, and only the counter hints that there are more.This PR borrows three ideas from AeroSlider, which also uses native scroll and CSS snap:
1–3 / 5→2–4 / 5→3–5 / 5. It works out how many slides fit from the track's width, not from what's on screen, so it doesn't flicker mid-scroll. With one slide per view it reads2 / 5as before.HomeandEndgo to the first and last slide, with the same guards as the arrow keys (modifiers, form fields, sideways-scrolling code).--cc-peek(default3rem) narrower than the column, so about 2rem of the next one shows past the gap. A carousel with one slide still fills the column, and--cc-peek: 0pxturns the peek off. Annotate's::comparegets it too, when its two screenshots show one at a time.There's no markup change, so the Vue, React and Svelte renderers pick this up through the shared script and CSS.
I compared the options on a prototype with the real carousel CSS: counter as range vs stops, phone full width vs peek, and two thumbnail styles. I left thumbnails out: the zoomed view already has a thumbnail strip, and adding one to the carousel means new markup in all four renderers.
e2e/carousel.e2e.tsreplaces the "end counts as the last slide" test with the range counter and adds tests for the peek width and for Home/End. Those three fail onmain. The carousel, annotate and zoom e2e suites pass (59 tests), and so do the carousel and annotate unit tests. I haven't run the fullpnpm ready. CI does.