fix(perf): card spread layout & safari perf#504
Conversation
Drop React state and width animation for a checkbox-driven grid. Stack offsets use transform; deck centers on large screens; narrow viewports scroll horizontally. Fixes Safari jitter from width tween. Co-authored-by: Cursor <cursoragent@cursor.com>
Use deck calc() offsets on all breakpoints instead of absolute-to-grid snap. Add grid min-width so narrow containers keep correct stack math. Co-authored-by: Cursor <cursoragent@cursor.com>
Deploying animata with
|
| Latest commit: |
1e11334
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3c882765.animata.pages.dev |
| Branch Preview URL: | https://feat-card-spread-layout.animata.pages.dev |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughConvert Card Spread from React-driven transforms to a CSS-first design: a checkbox toggle and ChangesCard Spread Animation Refactoring
Sequence DiagramsequenceDiagram
participant User
participant Toggle as Checkbox Toggle
participant CSS as :has() Selectors
participant Layout as Card Transforms
User->>Toggle: Click open button
Toggle->>CSS: Toggle checked state
CSS->>Layout: Activate spread rules (nth-child transforms + rotate)
Layout->>Layout: Apply translate3d() and rotate()
User->>Toggle: Hover card (deck state)
CSS->>Layout: Apply peek rotation for hovered nth-child
User->>Toggle: Click open button again
Toggle->>CSS: Uncheck toggle
CSS->>Layout: Activate deck rules (gather transforms)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
content/docs/card/card-spread.mdx (1)
23-29:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAlign the manual install path with the actual source tree.
components/animata/carddoesn’t match the file locations shown below or the component source underanimata/card. Update the manual instructions so users create and paste the files in the same place. Cross-checked againstanimata/card/card-spread.tsxandanimata/card/card-spread.css.💡 Proposed fix
-This creates `card-spread.tsx` and `card-spread.css` in `components/animata/card`. +This creates `card-spread.tsx` and `card-spread.css` in `animata/card`. -mkdir -p components/animata/card && touch components/animata/card/card-spread.tsx components/animata/card/card-spread.css +mkdir -p animata/card && touch animata/card/card-spread.tsx animata/card/card-spread.css🤖 Prompt for 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. In `@content/docs/card/card-spread.mdx` around lines 23 - 29, The manual install path is incorrect—update the documentation so the mkdir/touch command and the written instructions create the files under animata/card (matching the source), not components/animata/card; specifically change references of components/animata/card to animata/card and ensure the command creates animata/card/card-spread.tsx and animata/card/card-spread.css to align with the actual files (card-spread.tsx and card-spread.css) shown and imported elsewhere.
🤖 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 `@animata/card/card-spread.css`:
- Around line 87-90: Stylelint reports a declaration-spacing error for the
transition line inside .card-spread-item__internal; fix it by adding a single
blank line immediately before the "transition: transform 520ms
var(--ease-gather);" declaration so the block has an empty line between the
`@apply` rule and the transition declaration (adjust the
.card-spread-item__internal block accordingly).
In `@animata/card/card-spread.tsx`:
- Around line 48-60: The map is using item.component.name as the React key which
can break in production when names are minified; update the cards data (the
cards tuple/array) to include a stable unique identifier property (e.g., id or
key) for each entry (for entries like Reminders, RemodelNotes and other
components), then change the render to use that stable property (e.g., item.id)
instead of item.component.name in the key attribute inside the cards.map block
so reconciliation is based on an explicit, non-minified identifier.
---
Outside diff comments:
In `@content/docs/card/card-spread.mdx`:
- Around line 23-29: The manual install path is incorrect—update the
documentation so the mkdir/touch command and the written instructions create the
files under animata/card (matching the source), not components/animata/card;
specifically change references of components/animata/card to animata/card and
ensure the command creates animata/card/card-spread.tsx and
animata/card/card-spread.css to align with the actual files (card-spread.tsx and
card-spread.css) shown and imported elsewhere.
🪄 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
Run ID: 23848817-3403-43ac-a7ee-e0dcc1cd1bce
📒 Files selected for processing (4)
animata/card/card-spread.cssanimata/card/card-spread.tsxcontent/docs/card/card-spread.mdxcontent/docs/changelog/2026-06.mdx
Add blank line between @apply and transition in deck motion CSS. Use explicit card ids for React keys instead of minified names. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary by CodeRabbit
Refactor
Bug Fixes
Documentation