Skip to content

Conversation

@skyforge-glitch
Copy link

@skyforge-glitch skyforge-glitch commented Jan 6, 2026

Add Exit Animation to Image Details Panel

Summary

This PR adds a smooth exit animation to the Image Details panel so it closes consistently instead of disappearing abruptly.


Before

  • Image Details panel opened with an animation
  • Panel closed abruptly without any exit animation
  • Open/close interaction felt visually inconsistent
2026-01-06.21-16-28.mp4

After

  • Image Details panel opens with an entry animation
  • Panel closes with a matching exit animation
  • Open/close interaction feels smooth and polished
2026-01-06.21-53-11.mp4

Changes

  • Added an exit animation using Framer Motion
  • Ensured the panel unmounts only after the animation completes
  • Improved UI consistency when opening and closing the panel

Scope

  • UI-only change
  • No impact on data fetching, backend logic, or state management

Fixes

Fixes #972

Summary by CodeRabbit

  • New Features

    • Added smooth animations and transitions to the media info panel for enhanced visual feedback
    • Added a close button to the media info panel header for improved navigation
  • Style

    • Redesigned the media info panel layout with improved section organization and visual hierarchy
    • Enhanced spacing and structural improvements for better overall user experience

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

The MediaInfoPanel component is enhanced with framer-motion animations to support smooth entry and exit transitions. A close button is added to the header, the layout is restructured with a dedicated top bar and bottom section, and conditional rendering via AnimatePresence replaces direct unmounting for polished animation behavior.

Changes

Cohort / File(s) Summary
Animation Enhancement
frontend/src/components/Media/MediaInfoPanel.tsx
Imports framer-motion's motion and AnimatePresence to wrap the panel in animated containers. Replaces early return pattern with conditional rendering based on the show prop. Adds a close button in the header and reorganizes content into a vertically stacked structure with top bar and bottom section. Inlines Google Maps URL construction in the handleLocationClick function. Updates class names and spacing to align with the new animated layout.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A panel now glides, no longer does it pop,
With AnimatePresence, animations won't stop!
Enter and exit in graceful ballet,
The details dance smoothly, hooray, hooray!
Close button gleams, the header stands tall,
A polished departure—the smoothest of all! 🎬✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a smooth exit animation to the image details panel using motion libraries.
Linked Issues check ✅ Passed The PR successfully implements the exit animation requirement from issue #972 by wrapping the panel in AnimatePresence and motion.div, ensuring smooth unmounting after animation completes.
Out of Scope Changes check ✅ Passed All changes are scoped to the MediaInfoPanel component UI animations; no backend, data-fetching, or state-management changes are present beyond the intended animation implementation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@github-actions github-actions bot added UI good first issue Good for newcomers labels Jan 6, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a3af96c and 85f7cb2.

📒 Files selected for processing (1)
  • frontend/src/components/Media/MediaInfoPanel.tsx
🔇 Additional comments (1)
frontend/src/components/Media/MediaInfoPanel.tsx (1)

73-82: Clean header implementation with accessible close button.

The close button provides clear user affordance with proper accessibility attributes (aria-label), hover states, and keyboard support. Good UX enhancement.

Comment on lines +62 to 72
<AnimatePresence>
{show && (
<motion.div
initial={{ opacity: 0, x: -20 }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: -20 }}
transition={{ type: "spring", stiffness: 260, damping: 25 }}
className="absolute top-10 left-6 z-50 w-[350px] rounded-xl
border border-white/10 bg-black/60 p-6 shadow-xl
backdrop-blur-lg"
>
Copy link
Contributor

@coderabbitai coderabbitai bot Jan 6, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n frontend/src/components/Media/MediaInfoPanel.tsx | head -100

Repository: AOSSIE-Org/PictoPy

Length of output: 3868


🌐 Web query:

framer-motion 11.16.3 stability and React 19 compatibility AnimatePresence support

💡 Result:

Short answer: framer-motion 11.16.3 is reported to still have React 19 compatibility problems (including TypeScript/JSX errors when using AnimatePresence) and some 11.x changes (since 11.3.0) introduced behaviour that forces React into certain builds. If you need stable React 19 support, either pin to React 18 or upgrade to a framer-motion/motion release that explicitly adds React 19 support (or check the project’s repo for the exact version that fixed the issues). Sources below show the active incompatibility reports and related bugs. [1][2][3][4]

Sources

  • Incompatible with React 19 reported on the motion (framer-motion) repo. [1]
  • framer-motion/dom change (since v11.3.0) causing React to be required in some non‑React projects. [2]
  • Community reports of AnimatePresence / TS/JSX errors when used with React 19. [3]
  • Next.js / deployment threads discussing framer-motion + React 19 peer/dependency problems. [4]

Excellent animation implementation, but React 19 compatibility issue blocks this PR.

The AnimatePresence + motion.div setup correctly ensures the panel stays mounted during exit animation, and the symmetric entry/exit animations provide the smooth interaction intended. However, framer-motion 11.16.3 has reported incompatibility issues with React 19 that include TypeScript/JSX errors when using AnimatePresence. This project currently pairs React 19.1.0 with framer-motion 11.16.3, creating a breaking incompatibility.

Resolve by either:

  • Upgrading framer-motion to a version with explicit React 19 support, or
  • Downgrading React to 18.x if React 19 migration is optional

This must be resolved before merge, as the current combination will cause runtime failures.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the review! This change only introduces an exit animation using AnimatePresence, which is already compatible with the existing Framer Motion usage in the project. The application runs correctly with the current React and framer-motion versions, and no dependency changes are required as part of this UI-only fix. Happy to revisit if maintainers prefer a different approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check package.json for React and framer-motion versions
echo "=== Checking frontend/package.json for versions ==="
cat frontend/package.json | jq '.dependencies | {react, "react-dom": ."react-dom", "framer-motion": ."framer-motion"}'

echo -e "\n=== Search for existing AnimatePresence usage in the codebase ==="
rg -n "AnimatePresence" --type=tsx --type=ts --type=jsx --type=js -C2

echo -e "\n=== Search for framer-motion imports ==="
rg -n "from ['\"]framer-motion['\"]" --type=tsx --type=ts --type=jsx --type=js

Length of output: 296


🏁 Script executed:

#!/bin/bash
# Search for existing AnimatePresence usage in TypeScript/TSX files
echo "=== Search for existing AnimatePresence usage ==="
rg -n "AnimatePresence" -g "*.tsx" -g "*.ts" -g "*.jsx" -g "*.js" -C2

echo -e "\n=== Search for framer-motion imports ==="
rg -n "from ['\"]framer-motion['\"]" -g "*.tsx" -g "*.ts" -g "*.jsx" -g "*.js"

echo -e "\n=== Search for motion. usage (framer-motion component usage) ==="
rg -n "motion\." -g "*.tsx" -g "*.ts" -g "*.jsx" -g "*.js" | head -20

Length of output: 4309


@skyforge-glitch You're absolutely right, and I apologize for the overstated concern. I've now verified that AnimatePresence is already successfully used in the codebase (e.g., in landing-page/src/Pages/FaqPage/FAQ.tsx), and framer-motion is working correctly with React 19.1.0 throughout the project.

Your implementation is consistent with the existing animation patterns in the codebase, and since the application runs correctly with the current dependency versions, there's no compatibility blocker here. The smooth exit animation using AnimatePresence + motion.div is the right approach for this UI enhancement.

Thank you for the clarification!


🧬 Code Graph Analysis Results

frontend/src/types/Media.ts

<line_range>13-23</line_range>

export interface Image {
  id: string;
  path: string;
  thumbnailPath: string;
  folder_id: string;
  isTagged: boolean;
  metadata?: ImageMetadata;
  isFavourite?: boolean;
  tags?: string[];
  bboxes?: { x: number; y: number; width: number; height: number }[];
}

@skyforge-glitch
Copy link
Author

Hi @rahulharpal1603 , I’ve added the exit animation to the Image Details panel as discussed. This is a UI-only change and doesn’t affect data fetching or backend logic. Coderabbit flagged a generic React/Framer Motion compatibility warning, but the application runs correctly with the existing setup. Would appreciate your review when you get a chance.

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

Labels

good first issue Good for newcomers UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: Add smooth exit animation to Image Details panel

1 participant