Skip to content

feat(file): add file opening workflows — native dialog, Cmd+O/Cmd+P#56

Merged
khang859 merged 2 commits intomainfrom
crew/fleet-crew-881e
Mar 19, 2026
Merged

feat(file): add file opening workflows — native dialog, Cmd+O/Cmd+P#56
khang859 merged 2 commits intomainfrom
crew/fleet-crew-881e

Conversation

@khang859
Copy link
Copy Markdown
Owner

Summary

Mission 4 of the File Editor feature: adds three UI entry points for opening files.

  • Cmd+O: Native file dialog (multi-select, no type filter, starts in current CWD) — opens selected files as editor/image tabs
  • Cmd+P: Quick open overlay with fuzzy file search — shows recent files initially, searches sector directory on type, arrow/enter/escape navigation with highlighted matches
  • Command palette: "Open File..." and "Quick Open" commands listed with their shortcuts
  • Recent files: tracked in workspace store, persisted to localStorage (max 20), shown in quick open when no query entered; stale entries are naturally handled by the OS (non-existent files won't open)

Implementation

New IPC channels

  • file:open-dialog — calls dialog.showOpenDialog() with multi-select, starts in provided defaultPath
  • file:list — lists files recursively; uses git ls-files (respects .gitignore) with fallback manual walker

Files changed

  • src/shared/constants.ts — two new IPC channels
  • src/main/ipc-handlers.ts — handlers for both channels
  • src/preload/index.ts — expose file.openDialog() and file.list()
  • src/renderer/src/lib/shortcuts.tsopen-file (Cmd+O) and quick-open (Cmd+P)
  • src/renderer/src/lib/commands.ts — two new commands
  • src/renderer/src/store/workspace-store.tsrecentFiles state + addRecentFile(), localStorage persistence
  • src/renderer/src/hooks/use-pane-navigation.ts — keyboard handlers for Cmd+O/Cmd+P
  • src/renderer/src/components/QuickOpenOverlay.tsx — new component
  • src/renderer/src/App.tsx — wire event listeners and render overlay

Test plan

  • npm run build passes ✅
  • Cmd+O opens native file dialog; selected files appear as new tabs
  • Cmd+P opens quick open overlay showing recent files
  • Typing in quick open fuzzy-matches files from current directory
  • Arrow keys navigate, Enter opens file, Escape closes
  • Opened files appear in recent list on next Cmd+P open
  • "Open File..." and "Quick Open" appear in command palette (Cmd+Shift+P)

🤖 Generated with Claude Code

khang859 and others added 2 commits March 19, 2026 08:12
- Add FILE_OPEN_DIALOG IPC channel: calls dialog.showOpenDialog() with
  multi-select, no type filter, starts in current CWD
- Add FILE_LIST IPC channel: recursive file listing via git ls-files
  (respects .gitignore) with fallback manual walker
- Add Cmd+O shortcut → native file dialog (opens multiple files as tabs)
- Add Cmd+P shortcut → QuickOpenOverlay with fuzzy file search
- Add "Open File..." and "Quick Open" commands to command palette
- Add recentFiles tracking in workspace store (persisted to localStorage,
  max 20 entries) — shown in quick open when no query
- QuickOpenOverlay: shows recent files initially, fuzzy-matches on typing,
  highlights matched chars, arrow key/enter/escape navigation, 8 results
- Fix pre-existing unused variable warning in StarCommandTab

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nd palette comm…

Signed-off-by: Fleet - Starcommand
@khang859 khang859 merged commit 269e33e into main Mar 19, 2026
1 check passed
@khang859 khang859 deleted the crew/fleet-crew-881e branch March 19, 2026 12:24
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.

1 participant