Skip to content

fix(ui): show-in-folder button does nothing on macOS#94

Open
miguelAngelo1999 wants to merge 1 commit into
vanloctech:mainfrom
miguelAngelo1999:fix/show-in-folder
Open

fix(ui): show-in-folder button does nothing on macOS#94
miguelAngelo1999 wants to merge 1 commit into
vanloctech:mainfrom
miguelAngelo1999:fix/show-in-folder

Conversation

@miguelAngelo1999

Copy link
Copy Markdown

Problem

The Show in Folder / Open Folder button on completed download items does nothing on macOS. Clicking it silently fails with no feedback.

Root Cause

All queue item components (QueueItem, UniversalQueueItem, GalleryQueueItem, ChatPanel, HistoryDialog, ProcessingContext) were using revealItemInDir() from @tauri-apps/plugin-opener. On macOS this fails silently because:

  1. dunce::canonicalize() throws if the file doesn't exist on disk
  2. NSWorkspace::activateFileViewerSelectingURLs errors are not surfaced to the JS layer
  3. The catch block only does console.error — no user feedback

Fix

Replace all revealItemInDir() calls with invoke('open_file_location') — the existing Rust command in history.rs that uses platform-native commands:

  • macOS: open -R <path> (reveals in Finder)
  • Windows: explorer /select,<path>
  • Linux: xdg-open <parent dir>

Also improved open_file_location to fall back to the parent directory if the exact file no longer exists (e.g. renamed after download), instead of returning an error.

Files Changed

  • src/components/download/QueueItem.tsx
  • src/components/download/UniversalQueueItem.tsx
  • src/components/download/GalleryQueueItem.tsx
  • src/components/processing/ChatPanel.tsx
  • src/components/processing/HistoryDialog.tsx
  • src/contexts/ProcessingContext.tsx
  • src-tauri/src/commands/history.rs

The revealItemInDir() from @tauri-apps/plugin-opener fails silently on
macOS because dunce::canonicalize() errors if the file doesn't exist,
and NSWorkspace::activateFileViewerSelectingURLs fails without surfacing
errors to the JS side.

Replace all revealItemInDir() calls with invoke('open_file_location')
which uses 'open -R' on macOS, 'explorer /select,' on Windows, and
xdg-open on Linux — all existing implementations in history.rs.

Also improved open_file_location to fall back to the parent directory
if the exact file no longer exists (e.g. renamed after download).

Affected: QueueItem, UniversalQueueItem, GalleryQueueItem, ChatPanel,
HistoryDialog, ProcessingContext
anhtahaylove added a commit to anhtahaylove/youwee that referenced this pull request Jul 3, 2026
The Tauri opener reveal helper is unreliable on macOS in upstream PR vanloctech#94, and the app already has a platform-aware Rust command for opening file locations. Queue and processing UI now reuse a tiny frontend helper that calls that command instead of duplicating opener behavior.

Constraint: Keep the port small and avoid upstream PR vanloctech#94's large ProcessingContext rewrite.
Rejected: Port PR vanloctech#94 wholesale | it pulls more than 1000 lines of unrelated ProcessingContext churn.
Rejected: Keep per-component revealItemInDir calls | the existing Rust command is the shared platform boundary.
Confidence: high
Scope-risk: narrow
Directive: Use openFileLocation for future file reveal buttons instead of importing revealItemInDir directly.
Tested: bun run biome check --write .
Tested: bun run tsc -b
Tested: bun test
Tested: cargo check in src-tauri
Not-tested: macOS Finder reveal behavior on this Windows machine.
@vanloctech

Copy link
Copy Markdown
Owner

Thanks for the fix. I agree the macOS “Show in Folder” issue is worth addressing, but this PR cannot be merged as-is because it includes a lot of unrelated and stale changes.

The PR removes find_duplicate_downloads while it is still registered in Tauri and still used by the frontend, which will break the build/runtime duplicate detection flow. It also changes delete_history and removes the delete-file behavior from Library, plus removes several queue features such as per-item output folder selection, upcoming live scheduling, skipped status UI, and the current ProcessingContext controller structure.

Could you please rebase on the latest main and narrow the PR to only the folder-opening fix? The preferred approach is to replace revealItemInDir(...) with the existing open_file_location command in the affected UI/helper paths, especially the shared processing helper, without changing history commands, queue UI behavior, or ProcessingContext architecture.

vanloctech pushed a commit that referenced this pull request Jul 3, 2026
The frontend still called the opener plugin directly in several queue and processing surfaces even though the backend already exposes an open_file_location command with platform-specific reveal behavior. This keeps the UI on the app command boundary while avoiding the broader ProcessingContext rewrite from the larger upstream PR.

Constraint: Upstream already registers open_file_location in Rust, so the frontend can reuse that command without adding backend surface area.

Rejected: Port PR #94 wholesale | it pulls a larger ProcessingContext diff than needed for the Windows reveal fix.

Confidence: high

Scope-risk: narrow

Directive: Keep file reveal UI actions routed through this helper unless the backend command is removed or renamed.

Tested: biome targeted check for changed files; bun run tsc -b; cargo check in src-tauri after restoring the bundled yt-dlp binary; manual Show in folder on Windows custom build with a real downloaded sample-5s.mp4 file.

Not-tested: macOS Finder reveal behavior; full Biome check in the clean Windows PR worktree because unrelated CRLF diagnostics affect untouched files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants