Skip to content

Conversation

@monu808
Copy link

@monu808 monu808 commented Jan 6, 2026

@rahulharpal1603
Fixes #959

  • Hides the "Open Folder" button in the image viewer since its functionality is not implemented.
  • Commented out the button until the feature is properly implemented. Added a TODO comment explaining what's needed to re-enable it.

To Re-enable Later

  1. Configure @tauri-apps/plugin-opener in Tauri
  2. Uncomment the button in MediaViewControls.tsx and start working on.

Summary by CodeRabbit

  • Chores
    • The "Open Folder" control in the media view has been hidden/disabled and its icon removed from the visible toolbar.
    • All other media view controls (Info, Favorites, Slideshow for images, Close) remain available and unchanged for users.

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

@github-actions github-actions bot added bug Something isn't working frontend labels Jan 6, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

The MediaViewControls component disables the "Open Folder" feature: the onOpenFolder prop and the folder icon import are removed/disabled and the Open Folder button JSX is commented out; other controls and handlers remain unchanged.

Changes

Cohort / File(s) Summary
UI component update
frontend/src/components/Media/MediaViewControls.tsx
Removed/disabled onOpenFolder prop, removed Folder import, and commented out the Open Folder button JSX block; remaining controls (Info, Favourites, Slideshow, Close) left intact.

Sequence Diagram(s)

(omitted — change is a UI element disablement and does not introduce new multi-component control flow)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • AOSSIE-Org/PictoPy#577 — Adds and wires onOpenFolder prop and active Open Folder button in MediaViewControls.tsx, directly related/conflicting with this PR's disabling of that feature.

Suggested reviewers

  • rahulharpal1603
  • Aditya30ag

Poem

🐰 I hid a folder-button away,
Quiet in code where it used to play.
For now it rests in commented light,
Awaiting hands to make it right —
I'll hop and wait till it's awake today. 🥕

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: hiding/disabling the non-functional Open Folder button in the MediaView component.
Linked Issues check ✅ Passed The PR addresses issue #959 by hiding the non-functional Open Folder button and removing its unused prop, aligning with the proposed solution to comment out the button until functionality is implemented.
Out of Scope Changes check ✅ Passed All changes are directly related to the objective of hiding the Open Folder button: removing the onOpenFolder prop, commenting out the button UI, removing the Folder import, and cleaning up unused code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 46e909e and a6a3e7c.

📒 Files selected for processing (1)
  • frontend/src/components/Media/MediaViewControls.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/Media/MediaViewControls.tsx

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.

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: 0

🧹 Nitpick comments (3)
frontend/src/components/Media/MediaViewControls.tsx (3)

2-2: Remove the unused Folder import.

Since the Open Folder button is now commented out, the Folder icon import is no longer used and will likely trigger linter warnings.

🔎 Suggested fix
-import { Info, Folder, Heart, Play, Pause, X } from 'lucide-react';
+import { Info, Heart, Play, Pause, X } from 'lucide-react';

4-14: Consider commenting out or removing the unused onOpenFolder prop.

Since the Open Folder button is now hidden, the onOpenFolder prop declaration is unused. For consistency, consider either:

  1. Commenting it out in the interface alongside the button (preferred if re-enabling soon)
  2. Removing it entirely if the parent component can also be cleaned up

This helps avoid confusion and potential linter warnings.

🔎 Option 1: Comment out the prop (if re-enabling soon)
 interface MediaViewControlsProps {
   showInfo: boolean;
   onToggleInfo: () => void;
   onToggleFavourite: () => void;
-  onOpenFolder: () => Promise<void>;
+  // onOpenFolder: () => Promise<void>; // TODO: Uncomment when Open Folder is re-enabled
   isFavourite: boolean;
   isSlideshowActive: boolean;
   onToggleSlideshow: () => void;
🔎 Option 2: Remove the prop entirely
 interface MediaViewControlsProps {
   showInfo: boolean;
   onToggleInfo: () => void;
   onToggleFavourite: () => void;
-  onOpenFolder: () => Promise<void>;
   isFavourite: boolean;
   isSlideshowActive: boolean;
   onToggleSlideshow: () => void;

16-26: Remove the unused onOpenFolder from destructuring.

Since onOpenFolder is no longer used in the component (the button is commented out), it should be removed from the destructuring to avoid linter warnings and dead code.

🔎 Suggested fix
 export const MediaViewControls: React.FC<MediaViewControlsProps> = ({
   showInfo,
   onToggleInfo,
   onToggleFavourite,
-  onOpenFolder,
   isFavourite,
   isSlideshowActive,
   onToggleSlideshow,
📜 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 46e909e.

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

40-49: LGTM! Non-functional button properly hidden with clear TODO.

The Open Folder button is correctly commented out using proper JSX syntax, and the TODO comment clearly explains the requirements for re-enabling it (implementing revealItemInDir from @tauri-apps/plugin-opener). This effectively addresses issue #959 by hiding the non-functional button until the feature can be properly implemented.

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

Labels

bug Something isn't working frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Open Folder Button in Image Viewer Does Nothing

1 participant