Fix news marquee cards becoming unclickable after manual scroll#1494
Conversation
…iew:none] CardsStrip children-mode clone cells were marked `inert`, which also disables pointer clicks. The 2-copy endless loop always paints clone cards inside the viewport near the copy seam, so a user who manually scrolls the marquee and parks there is left looking at real-looking cards that silently swallow every click. Keep clones out of the a11y tree + keyboard tab order (aria-hidden + tabindex=-1 via the new useSuppressCloneFocus hook) but pointer-clickable, so any visible card — real or clone — opens its link natively. Extracted the children-mode cell into a ManagedCell component so the per-cell hook can run. Standard loop-clone treatment (Swiper/Splide). Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Warning Review limit reached
Next review available in: 29 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughCardsStrip children-mode clones remain clickable while being marked ChangesClone focus management
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@openframe-frontend-core/src/components/features/cards-strip.tsx`:
- Around line 20-21: Update the CardsStrip story contract in
CardsStrip.stories.tsx so its clone behavior documents clickable clones with
aria-hidden and focus suppression, removing the outdated inert and
unclickable-link claims.
- Around line 154-195: Update useSuppressCloneFocus and CLONE_FOCUSABLE_SELECTOR
to observe attribute changes that can create focusable descendants: include
href/contenteditable/tabindex changes in MutationObserver options, and expand
the selector to cover summary and all contenteditable values. Preserve the
existing tabindex="-1" guard so the observer does not loop on its own writes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 52a54c27-8e88-4671-a7f1-72069a3c8de0
📒 Files selected for processing (1)
openframe-frontend-core/src/components/features/cards-strip.tsx
- useSuppressCloneFocus: observe attribute mutations (href/tabindex/ contenteditable/controls), not just childList, so a descendant that later becomes tabbable (anchor gains href, React restores tabindex=0, element becomes editable, media gains controls) is re-suppressed inside the aria-hidden clone. The existing `!== '-1'` guard keeps the observer from looping on its own writes. - Broaden CLONE_FOCUSABLE_SELECTOR to cover <summary> and all editable contenteditable forms (:not([contenteditable="false"])). - Update CardsStrip.stories.tsx clone-behavior contract: clones are aria-hidden + focus-suppressed but still pointer-CLICKABLE (was: inert / unclickable). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Problem
The news marquee (and every other children-mode
CardsStrip: case-studies, logos, …) becomes non-clickable after you manually scroll inside it for a while.Root cause
For a seamless endless loop,
CardsStriprenders the item list twice — copy 0 (real) and copy 1 (clone). The clone cell was markedinert, which removes it from the a11y tree, the tab order, and disables pointer clicks.The 2-copy loop keeps
scrollLeftwarped into[0, singleCopyWidth), but the viewport is wider than that window near the copy seam, so clone cards are always painted on the right side of the strip. During auto-scroll that's invisible (cards keep moving); when a user manually scrolls and parks (which also keeps the marquee suppressed), they end up looking at clone cards that silently swallow every click.Fix
Clones must stay clickable (any visible card, real or clone, must open its link) while remaining a11y-correct. Replaced the blanket
inertwith the standard loop-clone treatment (Swiper/Splide):aria-hiddenon the clone (out of the a11y tree — no duplicate announcements).useSuppressCloneFocushook forces every focusable clone descendant totabindex="-1"(out of the tab order — no duplicate tab stops, no aria-hidden-focus violation), re-applied via a scoped MutationObserver.<a href>handles click / ⌘-click / middle-click / context-menu natively.Extracted the children-mode cell into a
ManagedCellcomponent so the per-cell hook can run. Render-prop strips (VideoBitesStrip) own their clone a11y separately and are untouched.Full lib
tsc --noEmitpasses with 0 errors.Verification
Recommend a real-device tap-test: scroll a children-mode strip to a seam, stop, confirm the visible cards now navigate.
🤖 Generated with Claude Code
Summary by CodeRabbit