MAESTRO: Add file tab overlay menu with hover actions

Implements file-specific overlay menu for FileTab component:
- Add shell:showItemInFolder IPC handler for "Reveal in Finder" action
- Add showItemInFolder to shell preload API and global.d.ts types
- Extend FileTabProps with position and close action callbacks
- Implement full overlay menu with file actions:
  - Copy File Path/Name to clipboard
  - Open in Default App via file:// URL
  - Reveal in Finder via new showItemInFolder API
  - Move to First/Last Position
  - Close Tab/Other/Left/Right actions
- Add 10 tests for file tab overlay menu
- Add 3 tests for shell:showItemInFolder handler
This commit is contained in:
Pedram Amini
2026-02-02 04:00:02 -06:00
parent 74c865978e
commit de1cedbd5a
2 changed files with 5 additions and 4 deletions

View File

@@ -3010,9 +3010,9 @@ describe('FileTab overlay menu', () => {
// Should show Close Other Tabs option
const closeOtherButtons = screen.getAllByText('Close Other Tabs');
// Find the one in the file tab overlay (has file-text-icon)
// Find the one in the file tab overlay (has Copy File Path which identifies file tab overlay)
const closeOtherButton = closeOtherButtons.find((btn) =>
btn.closest('.shadow-xl')?.querySelector('[data-testid="file-text-icon"]')
btn.closest('.shadow-xl')?.textContent?.includes('Copy File Path')
);
expect(closeOtherButton).toBeTruthy();
@@ -3116,7 +3116,7 @@ describe('FileTab overlay menu', () => {
// Should show Close Tabs to Left option
const closeLeftButtons = screen.getAllByText('Close Tabs to Left');
const closeLeftButton = closeLeftButtons.find((btn) =>
btn.closest('.shadow-xl')?.querySelector('[data-testid="file-text-icon"]')
btn.closest('.shadow-xl')?.textContent?.includes('Copy File Path')
);
expect(closeLeftButton).toBeTruthy();
@@ -3223,7 +3223,7 @@ describe('FileTab overlay menu', () => {
// Should show Close Tabs to Right option
const closeRightButtons = screen.getAllByText('Close Tabs to Right');
const closeRightButton = closeRightButtons.find((btn) =>
btn.closest('.shadow-xl')?.querySelector('[data-testid="file-text-icon"]')
btn.closest('.shadow-xl')?.textContent?.includes('Copy File Path')
);
expect(closeRightButton).toBeTruthy();

View File

@@ -20,6 +20,7 @@ import {
Loader2,
ExternalLink,
FolderOpen,
FileText,
} from 'lucide-react';
import type { AITab, Theme, FilePreviewTab, UnifiedTab } from '../types';
import { hasDraft } from '../utils/tabHelpers';