Refactor acronym hero hover interaction to use absolute positioning - #569
Conversation
…ml links The homepage hero, header, and demo links all needed work. Hero acronym re-trigger: the SLASHED letter-row animated each word's real width on hover and tried to keep the hovered letter under the cursor by counter-translating the centered row by a hardcoded per-word amount. Those amounts couldn't match the real glyph widths, so siblings leapt (measured 283px) and slid under the cursor, re-firing the hover on a neighbour. Rework the reveal to be out of flow: the unfolded text is absolutely positioned and revealed with clip-path, so unfolding a word changes the size and position of nothing else — no letter ever moves under the cursor (verified 0px shift), so re-triggering is structurally impossible. Floor the hover-mode font size so the longest word (Deterministic) never clips on narrow hover-capable widths. Header padding: the header used .sf-section--xs, but that still resolves to the section vertical-rhythm scale (--sf-space-xl, ~52px a side), stacking a ~150px band around a 49px nav. Pin the header to a compact bar (94px). demo.html retirement (site links only): point every user-facing link — the homepage nav, hero CTA, docs list, and the shared _layouts nav — to the test-coverage suite / Full API Demo instead. The doc-prose references in layout/states/motion now point to the matching coverage pages. demo.html stays on disk as the internal test fixture the Playwright specs and the class-coverage gate depend on. Copy verified against source: 729 tokens, 15 layers, 6-token rebrand, exactly two components, and the Chrome 125+/Safari 18+/Firefox 129+ floor all check out and are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017iAYFfHmHUnbDTgA7LHBmx
|
Warning Review limit reached
Next review available in: 55 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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
✨ 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 |
PR Summary by QodoFix acronym hero hover by revealing unfolded words out of flow via clip-path
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
The generated full-api demos were still stamped v0.7.3 — the v0.7.5 version bump synced the version artifacts but didn't rebuild demos/, so the artifact drift gate (check-artifacts.js) failed. Regenerating via demos/generate.mjs updates only the version stamp in each file (no content change), which is what the gate prescribes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017iAYFfHmHUnbDTgA7LHBmx
Code Review by Qodo
Context used✅ Compliance rules (platform):
12 rules 1.
|
The acronym-hero collapse/unfold interaction (and the "hover the name" hint) were gated on @media (any-hover: hover), which is true on hybrid devices — a touchscreen laptop, or a phone with a stylus/mouse — even while the user is touching. That stranded the acronym in its collapsed, clipped state with no touch way to reveal the words, contradicting the page's own stated intent that touch shows the full words. Gate both the interaction and the hint on the PRIMARY input actually being a fine pointer that can hover: @media (hover: hover) and (pointer: fine). Touch / coarse-pointer devices now reliably fall through to the default in-flow state where every word is already shown. Verified: desktop mouse gets the interactive collapse + hint; a coarse-pointer phone gets full words, no hint. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017iAYFfHmHUnbDTgA7LHBmx
Summary
Replaces the acronym hero's width-based hover animation with an absolute-positioning approach. The new implementation uses
clip-pathto reveal unfolded words without affecting layout, eliminating the cursor-tracking bug where hovered words would slide and re-trigger hover on neighbours.Key changes
Acronym hero hover mechanism: Changed from animating
widthon.restelements with per-word hardcoded--wvalues to absolute positioning withclip-pathreveal--w: 8.2ch, etc.)translaterules that attempted to counter-shift the centered rowposition: relativeto.alcontainer to establish positioning context.restabsolutely atinset-inline-start: 100%(immediately after bold letter)clip-path: inset(0 100% 0 0)for hidden state,inset(0 0 0 0)for revealed statez-index: 1on hover to layer unfolded words above dimmed neighboursFont sizing: Reduced
font-sizefloor from2.75remto2.4remto ensure the longest unfolded word (Deterministic) fits without clipping on narrow hover-capable viewportsTransition timing: Adjusted transition delays (60ms instead of 120ms) and removed container-level transition delay that was coupled to the old translate mechanism
Header padding: Added compact block padding (
var(--sf-space-s)) to header with.site-navto override the default section rhythm scale, creating a symmetric 49px nav barNavigation & documentation links:
/docs/demo.htmlreferences with/docs/test-coverage.html(Coverage)test-coverage-3-layout.html,test-coverage-4-macros-states.html)Implementation details
The old approach animated real
widthvalues but couldn't match actual glyph widths, causing siblings to leap and re-trigger hover. The new approach takes unfolded text completely out of flow via absolute positioning andclip-path, so no sibling ever moves under the cursor. This is more robust and eliminates the need for per-word width calculations.https://claude.ai/code/session_017iAYFfHmHUnbDTgA7LHBmx