Skip to content

feat:dashboard-cards-hover-animation - #163

Open
Parshant-12 wants to merge 1 commit into
7-Blocks:mainfrom
Parshant-12:feat/hover-animation-on-dashboard
Open

feat:dashboard-cards-hover-animation#163
Parshant-12 wants to merge 1 commit into
7-Blocks:mainfrom
Parshant-12:feat/hover-animation-on-dashboard

Conversation

@Parshant-12

@Parshant-12 Parshant-12 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

User description

Summary

This PR adds smooth, lightweight hover animations to the main dashboard cards in Dashboard.tsx to improve visual interactivity while keeping performance high and avoiding layout shifts.

Specifically:

  • KPI Cards: Enhanced framer-motion hover dynamics (y: -3, scale: 1.02), added shadow elevation, subtle border glow (hover:border-white/20), and icon scaling (group-hover:scale-110).
  • Live Collision Timeline Cards: Wrapped cards with motion.div to provide consistent elevation (y: -3, scale: 1.02) and smooth border glow on hover.
  • AI Reasoning Stream: Added subtle hover shifts (x: 2) and hover background highlights for reasoning stream entries.

Related Issue

Fixed #82

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 📚 Documentation update
  • 🚀 Performance improvement
  • 🎨 UI/UX enhancement
  • 🔧 Refactoring
  • 🧹 Chore / Maintenance
  • 🔒 Security improvement

Screenshots / Screen Recordings

N/A — Added GPU-accelerated hover lift (y, scale), border glow, and shadow elevation across dashboard cards.

Testing Performed

  • Tested locally
  • Tested relevant functionality
  • Checked for linting errors
  • Checked for TypeScript/build errors
  • Tested responsive behavior (if applicable)

Breaking Changes

NO

Checklist

  • I have read and followed the contributing guidelines.
  • My code follows the project's coding standards and guidelines.
  • I have completed testing of my changes.
  • I have updated documentation where applicable.
  • I have checked that my changes do not introduce unintended regressions.

ECSoC26 Submission

ECSoC26 contributors only — select your difficulty level by checking exactly one box below.
Leaving all boxes unchecked, or checking more than one, will cause the automation to fail.

  • ECSoC26-L1 – Beginner
  • ECSoC26-L2 – Intermediate
  • ECSoC26-L3 – Advanced

CodeAnt-AI Description

Add responsive hover feedback across dashboard cards

What Changed

  • Dashboard KPI and collision-risk cards now lift, gently scale, gain a stronger shadow, and show a brighter border when hovered
  • KPI icons enlarge and brighten during hover
  • AI reasoning entries shift slightly and highlight their background on hover
  • Hover transitions are applied consistently across the dashboard without changing the displayed data

Impact

✅ Clearer card interactivity
✅ Easier scanning of collision risks
✅ More responsive dashboard navigation

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • Style
    • Enhanced Dashboard cards with smoother hover animations, transitions, and shadows.
    • Improved visual feedback for collision cards with interactive borders and icons.
    • Added responsive hover effects to agent reasoning entries while preserving existing risk indicators and data.

@codeant-ai

codeant-ai Bot commented Aug 3, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR f40bc9d Aug 03, 2026 · 16:33 16:34

@codeant-ai

codeant-ai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@github-actions github-actions Bot added AI Artificial Intelligence and Machine Learning bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request frontend Frontend development size/M Medium-sized contribution. size:M This PR changes 30-99 lines, ignoring generated files type:bug Fixes an existing bug or unexpected behavior. type:documentation Improves project documentation. type:feature Introduces a new feature or enhancement. type:frontend Changes frontend or client-side code. ECSoC26 Official label for ECSoC26 event contributions. ECSoC26-L1 Level 1 contribution for the ECSoC26 event. labels Aug 3, 2026
@codeant-ai codeant-ai Bot added size:M This PR changes 30-99 lines, ignoring generated files and removed size:M This PR changes 30-99 lines, ignoring generated files labels Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Dashboard now adds hover animations to KPI cards, collision cards, the AI reasoning panel, and agent reasoning entries. Existing risk-based visualization and reasoning content remain unchanged.

Changes

Dashboard interaction styling

Layer / File(s) Summary
KPI card animations
frontend/src/pages/Dashboard.tsx
KPI cards and icons now animate on hover with scaling, transitions, border changes, shadows, and brightness changes.
Collision card animations
frontend/src/pages/Dashboard.tsx
Collision cards now use animated wrappers and hover styling while preserving existing risk-based content.
Reasoning entry animations
frontend/src/pages/Dashboard.tsx
The AI reasoning panel and agent entries now use hover borders, shadows, horizontal movement, transitions, and category-specific backgrounds.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: thelinuxguy-ssh, sumittiwari1302

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the dashboard card hover animation change.
Description check ✅ Passed The description includes the required summary, issue, change type, testing, breaking changes, checklist, and ECSoC26 selection.
Linked Issues check ✅ Passed The implementation satisfies issue #82 by adding smooth, consistent, lightweight hover animations without changing card data.
Out of Scope Changes check ✅ Passed The changes are limited to dashboard card hover animations and align with the scope of issue #82.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

<motion.div
key={idx}
whileHover={{ y: -2 }}
whileHover={{ y: -3, scale: 1.02 }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The hover transform is unconditional and does not respect the user's prefers-reduced-motion setting. Users who request reduced motion will still see the KPI card lift and scale on pointer hover; the collision cards and reasoning entries add the same regression. Use useReducedMotion or an equivalent media-query guard to disable these hover animations when reduced motion is preferred. [possible bug]

Severity Level: Major ⚠️
- ⚠️ Dashboard KPI cards ignore reduced-motion preferences.
- ⚠️ Collision timeline cards still lift and scale.
- ⚠️ AI reasoning entries still shift horizontally.
- ⚠️ Accessibility behavior differs from existing motion-aware components.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** frontend/src/pages/Dashboard.tsx
**Line:** 145:145
**Comment:**
	*Possible Bug: The hover transform is unconditional and does not respect the user's `prefers-reduced-motion` setting. Users who request reduced motion will still see the KPI card lift and scale on pointer hover; the collision cards and reasoning entries add the same regression. Use `useReducedMotion` or an equivalent media-query guard to disable these hover animations when reduced motion is preferred.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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 `@frontend/src/pages/Dashboard.tsx`:
- Around line 222-226: Add top padding to the scroll container that wraps the
cards rendered by the motion.div elements, ensuring enough vertical space for
the whileHover y: -3 transform and shadow without clipping. Preserve the
existing horizontal scrolling and card layout behavior.
🪄 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: 19ca9907-7499-42eb-9a26-0a1f09a9bfcb

📥 Commits

Reviewing files that changed from the base of the PR and between 262d3f5 and f40bc9d.

📒 Files selected for processing (1)
  • frontend/src/pages/Dashboard.tsx

Comment on lines +222 to +226
<motion.div
key={conj.id}
gradientColor={
conj.risk_level === 'CRITICAL' || conj.risk_level === 'HIGH'
? '#FF3B30'
: conj.risk_level === 'MEDIUM'
? '#FF9500'
: '#00e5ff'
}
gradientSize={200}
gradientOpacity={0.3}
className="w-64 sm:w-72 shrink-0 rounded-xl border border-white/10"
fillClassName="bg-[#0A0F1A]"
whileHover={{ y: -3, scale: 1.02 }}
transition={{ duration: 0.2, ease: 'easeOut' }}
className="shrink-0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep the collision hover transform inside the scroll container.

Line 202 has no top padding. The y: -3 transform can clip the card top edge and elevated shadow at the scrollport boundary. Add vertical space above the cards.

Proposed fix
-          <div className="flex-1 overflow-x-auto pb-4 custom-scrollbar">
+          <div className="flex-1 overflow-x-auto pt-3 pb-4 custom-scrollbar">
🤖 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 `@frontend/src/pages/Dashboard.tsx` around lines 222 - 226, Add top padding to
the scroll container that wraps the cards rendered by the motion.div elements,
ensuring enough vertical space for the whileHover y: -3 transform and shadow
without clipping. Preserve the existing horizontal scrolling and card layout
behavior.

@krishkhinchi krishkhinchi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please attach screenshots/screen recording of the cards hover animation along with your PR. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Artificial Intelligence and Machine Learning bug Something isn't working documentation Improvements or additions to documentation ECSoC26-L1 Level 1 contribution for the ECSoC26 event. ECSoC26 Official label for ECSoC26 event contributions. enhancement New feature or request frontend Frontend development size/M Medium-sized contribution. size:M This PR changes 30-99 lines, ignoring generated files type:bug Fixes an existing bug or unexpected behavior. type:documentation Improves project documentation. type:feature Introduces a new feature or enhancement. type:frontend Changes frontend or client-side code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Hover Animations to Dashboard Cards

2 participants