Enhance card hover interaction with elevation and smoother transitions#2968
Enhance card hover interaction with elevation and smoother transitions#2968ArhanAnsari wants to merge 3 commits intoappwrite:mainfrom
Conversation
… smooth transitions
Greptile SummaryThis PR adds a hover/active lift animation to
Confidence Score: 2/5Not safe to merge — the hover lift on a widely-shared layout primitive creates a misleading interactive affordance across 119+ non-interactive settings cards in the console. The P1 finding (hover lift applied universally to all cardGrid usages including non-interactive settings cards) is a present UX defect that will affect the perceived interactivity of the entire console settings UI. Combined with the unresolved issues from prior review threads (zod dependency, rolldown-vite override removal), the PR needs rework before it can be merged. src/lib/components/cardGrid.svelte — the hover effect needs to be scoped to only interactive card instances, not applied globally to the shared layout primitive.
|
| Filename | Overview |
|---|---|
| src/lib/components/cardGrid.svelte | Added hover/active lift animation via a new wrapper div and scoped :global(.card) CSS; effect is applied globally to all 119+ usages including non-interactive settings cards, which creates a misleading interactive affordance |
| package.json | Adds zod as a production dependency (unrelated to this visual PR) and issues flagged in prior threads remain unresolved |
Reviews (3): Last reviewed commit: "fix(card-grid): update box-shadow proper..." | Re-trigger Greptile
There was a problem hiding this comment.
Pull request overview
This PR aims to enhance the visual hover/active interaction for the CardGrid component by adding elevation and smooth transitions, while also introducing unrelated dependency/tooling changes in package.json.
Changes:
- Added a wrapper plus scoped global CSS to animate card elevation (
transform) andbox-shadowon hover/active incardGrid.svelte. - Added
zodto dependencies. - Removed the
viteoverride (previously pointing torolldown-vite) frompackage.json.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/lib/components/cardGrid.svelte |
Adds hover/active elevation + transitions using :global(.card) selectors scoped under a wrapper element. |
package.json |
Adds zod and removes the vite override entry under overrides. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </div> | ||
|
|
||
| <style> | ||
| .card-grid-wrapper :global(.card) { |
There was a problem hiding this comment.
The selector .card-grid-wrapper :global(.card) will match any .card nested inside the CardGrid slots (e.g., inner <Card.Base> cards in the aside slot), so the hover/transition styles will leak to unintended child cards. Consider narrowing the selector to only the CardGrid’s root card (e.g., direct child) or applying a dedicated class to the specific Card.Base you want to animate.
| transition: | ||
| transform 200ms cubic-bezier(0.4, 0, 0.2, 1), | ||
| box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1); | ||
| will-change: transform, box-shadow; | ||
| } |
There was a problem hiding this comment.
will-change: transform, box-shadow is applied unconditionally, which can increase GPU memory usage and keep the element on a compositor layer even when it’s not interacting. Prefer applying will-change only during interaction (hover/focus) and consider disabling these transitions under prefers-reduced-motion: reduce for accessibility.
| .card-grid-wrapper :global(.card:active) { | ||
| transform: translateY(0); | ||
| box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); | ||
| } |
There was a problem hiding this comment.
:active on the card will typically only apply when the card element itself is the active target; clicking/pressing interactive children (buttons/links in the card) usually won’t trigger the parent .card:active. If the intent is “pressed” feedback when interacting anywhere inside the card, use a selector that reflects descendant active/focus state (e.g., via :has() / :focus-within) or handle it via pointer events.
| "remarkable": "^2.0.1", | ||
| "svelte-confetti": "^1.4.0", | ||
| "three": "^0.181.2", | ||
| "tippy.js": "^6.3.7" | ||
| "tippy.js": "^6.3.7", | ||
| "zod": "^3.25.76" | ||
| }, |
There was a problem hiding this comment.
zod is added as a dependency but there are no runtime imports/usages in src/ (only a TODO comment mentions it). If this PR is meant to be purely visual, consider removing this dependency; otherwise include the related code changes and ensure the lockfile(s) used in CI (bun.lock with frozen lockfile) are updated accordingly.
| "overrides": { | ||
| "vite": "npm:rolldown-vite@latest", | ||
| "minimatch": "10.2.3", | ||
| "brace-expansion": ">=5.0.5", | ||
| "immutable": "^5.1.5", |
There was a problem hiding this comment.
The repo docs indicate Vite is overridden to rolldown-vite, and bun.lock currently contains a vite override. Removing the overrides.vite entry from package.json will likely desync package.json/bun.lock and can break CI installs that use a frozen lockfile. Either keep the override (and update locks consistently) or update the docs/lockfiles as part of this change.
|
Tip: Greploop — Automatically fix all review issues by running Use the Greptile plugin for Claude Code to query reviews, search comments, and manage custom context directly from your terminal. |
What
Improves the hover interaction of cards in the card grid component by:
Why
This enhances the overall user experience by making cards feel more interactive and responsive, aligning with modern UI patterns.
Changes
will-changefor performance optimizationImpact
Testing