Enhance card hover interaction with elevation and smoother transitions#2968
Enhance card hover interaction with elevation and smoother transitions#2968ArhanAnsari wants to merge 5 commits intoappwrite:mainfrom
Conversation
… smooth transitions
Greptile SummaryThis PR adds an opt-in
Confidence Score: 3/5Not safe to merge — the broken CSS indentation will fail the CI lint gate. A P1 formatting issue (mismatched indentation in the style block) will cause src/lib/components/cardGrid.svelte — broken CSS indentation; package.json — unrelated dependency changes. Important Files Changed
Reviews (5): Last reviewed commit: "fix(card-grid): update card grid styles ..." | 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.
src/lib/components/cardGrid.svelte
Outdated
| </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.
src/lib/components/cardGrid.svelte
Outdated
| .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.
|
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. |
| "three": "^0.181.2", | ||
| "tippy.js": "^6.3.7" | ||
| "tippy.js": "^6.3.7", | ||
| "zod": "^3.25.76" |
ChiragAgg5k
left a comment
There was a problem hiding this comment.
please share a video of before and after
GH.PR.mp4@ChiragAgg5k Thanks for the suggestion — here’s a quick before vs after demo of the hover interaction. To keep the demo focused and avoid backend setup, I recorded this using a local UI setup with mocked data.
Let me know if you’d like me to apply this to specific interactive views in the console as well. |
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 optimizationScope clarification
After reviewing usage across the codebase, most
CardGridinstances are used for non-interactive settings and configuration panels.To avoid introducing misleading affordances, this PR:
interactivepropThis keeps the change safe and backward-compatible.
Impact
Testing
GH.PR.mp4