Skip to content

Fix/remove share icon#631

Merged
rahulharpal1603 merged 13 commits into
AOSSIE-Org:mainfrom
DecodeX15:fix/remove_share_icon
Dec 7, 2025
Merged

Fix/remove share icon#631
rahulharpal1603 merged 13 commits into
AOSSIE-Org:mainfrom
DecodeX15:fix/remove_share_icon

Conversation

@DecodeX15
Copy link
Copy Markdown
Member

@DecodeX15 DecodeX15 commented Nov 12, 2025

This pr had removed share button from each page as it is not planned yet and resolving #616
image
image

Summary by CodeRabbit

  • Updates
    • Removed Share button from image viewing controls
    • Enhanced backend API schema to support additional metadata properties in media information

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ No issue was linked in the PR description.
Please make sure to link an issue (e.g., 'Fixes #issue_number')

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 12, 2025

Walkthrough

Share button functionality removed from frontend media components and hover controls. OpenAPI schema simplified for face-search input_type parameter by replacing allOf wrapper with direct reference. ImageInCluster metadata schema expanded to permit additional properties.

Changes

Cohort / File(s) Summary
OpenAPI Schema Updates
docs/backend/backend_python/openapi.json
Simplified face-search input_type parameter from allOf wrapper to direct $ref, removed title field; expanded ImageInCluster.Metadata object to allow additionalProperties: true
Frontend Share Button Removal
frontend/src/components/Media/ImageCard.tsx, frontend/src/components/Media/MediaViewControls.tsx
Removed Share2 icon imports and corresponding Share button UI blocks from media hover controls; component signatures and other functionality unchanged

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Schema changes are straightforward reference simplifications with no behavioral impact
  • Share button removal is UI-only with no logic modifications; consistent pattern across two files

Suggested reviewers

  • rahulharpal1603

Poem

🐰 A rabbit's ode to the changes made,
Share buttons fade, the UI's remade,
Schemas simplified, metadata flows free,
Cleaner than ever, efficient and spree!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix/remove share icon' directly corresponds to the main changes: removing Share2 imports and Share button UI components from ImageCard and MediaViewControls components, plus related OpenAPI schema updates.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f39e40 and 9d46e2b.

📒 Files selected for processing (3)
  • docs/backend/backend_python/openapi.json (2 hunks)
  • frontend/src/components/Media/ImageCard.tsx (1 hunks)
  • frontend/src/components/Media/MediaViewControls.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/src/components/Media/ImageCard.tsx
  • docs/backend/backend_python/openapi.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Tauri Build Check (macos-latest, --target aarch64-apple-darwin)
  • GitHub Check: Tauri Build Check (windows-latest)
  • GitHub Check: Tauri Build Check (ubuntu-22.04)
  • GitHub Check: Backend Tests
🔇 Additional comments (1)
frontend/src/components/Media/MediaViewControls.tsx (1)

2-2: LGTM! Clean removal of unused Share functionality.

The removal of Share2 from the import statement is correct and aligns with the PR objective to remove the share button since sharing functionality is not yet planned. The change is minimal, targeted, and maintains consistency with the similar change in ImageCard.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.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ No issue was linked in the PR description.
Please make sure to link an issue (e.g., 'Fixes #issue_number')

Copy link
Copy Markdown
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

🧹 Nitpick comments (1)
docs/backend/backend_python/openapi.json (1)

2155-2166: Note schema consistency: ImageInCluster.Metadata vs MetadataModel.

The ImageInCluster.Metadata now explicitly allows additionalProperties: true, but the similar MetadataModel schema (line 2221) does not. This creates an inconsistency where different metadata objects have different extensibility rules.

Clarify whether this divergence is intentional or if both should align on additionalProperties behavior for consistency.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cec1303 and b1e0fb8.

📒 Files selected for processing (4)
  • docs/backend/backend_python/openapi.json (2 hunks)
  • frontend/src/components/Media/ImageCard.tsx (1 hunks)
  • frontend/src/components/Media/MediaView.tsx (1 hunks)
  • frontend/src/components/Media/MediaViewControls.tsx (1 hunks)
🔇 Additional comments (3)
docs/backend/backend_python/openapi.json (1)

1080-1086: Verify OpenAPI 3.1.0 $ref with siblings compatibility.

This change uses direct $ref with inline description and default properties, which relies on OpenAPI 3.1.0's JSON Schema support for sibling keywords. While spec-compliant, this may break compatibility with:

  • Tools/generators expecting OpenAPI 3.0.x semantics
  • Older OpenAPI validators or SDK code generators
  • Client libraries that haven't updated to 3.1.0 support

Please confirm that your OpenAPI toolchain (validators, SDK generators, API documentation tools) fully supports this pattern. Consider testing with your CI/CD pipeline and any downstream code generation.

frontend/src/components/Media/ImageCard.tsx (1)

4-4: LGTM! Clean removal of unused Share2 import.

The Share2 icon has been properly removed from the imports along with its corresponding UI usage, aligning with the PR objective to remove share functionality.

frontend/src/components/Media/MediaViewControls.tsx (1)

2-2: LGTM! Clean removal of unused Share2 import.

The Share2 icon has been properly removed from the imports along with its corresponding UI usage, aligning with the PR objective to remove share functionality.

import { useState, useCallback, useMemo, useRef } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { revealItemInDir } from '@tauri-apps/plugin-opener';
// import { revealItemInDir } from '@tauri-apps/plugin-opener';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: Commented import causes runtime error.

The revealItemInDir import is commented out but handleOpenFolder (lines 77-85) still references it, which will throw a ReferenceError at runtime when the "Open Folder" button is clicked.

Apply this diff to either restore the import or remove the broken functionality:

Option 1: Restore the import (if folder-open is still needed)

-// import { revealItemInDir } from '@tauri-apps/plugin-opener';
+import { revealItemInDir } from '@tauri-apps/plugin-opener';

Option 2: Remove the broken handler (if folder-open should be removed like share)

-  // Folder Open functionality
-  const handleOpenFolder = async () => {
-    if (!currentImage?.path) return;
-    try {
-      await revealItemInDir(currentImage.path);
-    } catch (err) {
-      console.log(err);
-      console.error('Failed to open folder.');
-    }
-  };

And remove onOpenFolder={handleOpenFolder} from <MediaViewControls> at line 146.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// import { revealItemInDir } from '@tauri-apps/plugin-opener';
import { revealItemInDir } from '@tauri-apps/plugin-opener';
🤖 Prompt for AI Agents
In frontend/src/components/Media/MediaView.tsx around line 3 and affecting lines
77-85 and 146, the import for revealItemInDir is commented out but
handleOpenFolder still references it, causing a ReferenceError at runtime;
either restore the import from '@tauri-apps/plugin-opener' at the top of the
file if the folder-open feature is required, or remove the handleOpenFolder
function and delete the onOpenFolder={handleOpenFolder} prop passed to
<MediaViewControls> at line 146 to fully remove the broken functionality; ensure
no other references to revealItemInDir remain after the change.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ No issue was linked in the PR description.
Please make sure to link an issue (e.g., 'Fixes #issue_number')

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ No issue was linked in the PR description.
Please make sure to link an issue (e.g., 'Fixes #issue_number')

@github-actions github-actions Bot added UI good first issue Good for newcomers labels Nov 12, 2025
@rahulharpal1603
Copy link
Copy Markdown
Contributor

@Vaibhaviitian
Resolve the conflicts

@DecodeX15
Copy link
Copy Markdown
Member Author

@Vaibhaviitian Resolve the conflicts

done

Copy link
Copy Markdown
Contributor

@rahulharpal1603 rahulharpal1603 left a comment

Choose a reason for hiding this comment

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

Thanks @DecodeX15!

@rahulharpal1603 rahulharpal1603 merged commit d07d817 into AOSSIE-Org:main Dec 7, 2025
9 checks passed
@DecodeX15
Copy link
Copy Markdown
Member Author

Thanks @DecodeX15!
Pleasure is mine sir

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.

2 participants