Skip to content

feat(file-open): add Open Recent picker for recently opened files#2297

Open
sinelaw wants to merge 2 commits into
masterfrom
claude/dazzling-dirac-ut30fl
Open

feat(file-open): add Open Recent picker for recently opened files#2297
sinelaw wants to merge 2 commits into
masterfrom
claude/dazzling-dirac-ut30fl

Conversation

@sinelaw

@sinelaw sinelaw commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Closes #926

What

Adds a recent-files feature: every user-initiated file open is recorded per window (most recent first, capped at 20) and persisted in the workspace file, so the list survives restarts.

The list is exposed through a new Open Recent action, reachable from:

  • the File menu, right under "Open File..." ("Open Recent...")
  • the command palette ("Open Recent")
  • keybindings via the open_recent action string

It opens the standard fuzzy-filterable prompt picker (same pattern as Select Theme), pre-selected on the most recent entry. Selecting an entry opens it through the normal open-file path.

Design notes

  • Recording happens in Editor::open_file — the user-initiated path. Session restore uses open_file_internal, so restoring a workspace doesn't scramble the recency order. Virtual/hidden buffers (panels, plugin UIs) are never recorded.
  • Persistence is a new serde-defaulted recent_files field on the existing per-project Workspace struct, stored relative to the workspace root when possible (same convention as read_only_files). Older session files load unchanged.
  • Edge cases: entries whose file was deleted are skipped when building the picker; an empty list shows a "No recent files" status message instead of an empty picker.
  • A prompt picker was chosen over a dynamic File-menu submenu because generate_dynamic_items has no access to editor state (it only receives themes_dir), and threading window state through the menu expansion path (TUI + native macOS menus) would have been much more invasive. The picker also gives type-to-filter for free, which a commenter on the issue asked for.
  • i18n keys added to all 14 locale files.

Testing

  • 6 new e2e tests in tests/e2e/recent_files.rs: menu entry rendering, empty-list status message, list-and-open via palette, most-recent-first ordering, persistence across sessions, deleted-file skipping. All pass.
  • Existing suites re-run green: workspace (51), command palette (75), menu (123) e2e tests, plus all 2725 fresh-editor lib tests.
  • Manually validated in tmux: opened files, used File menu → Open Recent, picker ordering/filtering, re-open after restart with the same data dir — recent list persisted and reopened files correctly.

https://claude.ai/code/session_01DRkE5mej83XAHjmRMc3LSo


Generated by Claude Code

claude added 2 commits June 10, 2026 04:45
Adds a recent-files list (issue #926): every user-initiated file open
is recorded per window (most recent first, capped at 20) and persisted
in the workspace file, so the list survives restarts.

The list is exposed through a new "Open Recent" action available from
the File menu (right under "Open File...") and the command palette. It
opens a fuzzy-filterable prompt picker, pre-selected on the most
recent entry; entries whose file no longer exists are skipped, and an
empty list shows a status message instead of an empty picker.

Paths are stored relative to the workspace root when possible (like
read_only_files), and the new workspace field is serde-defaulted so
older session files load unchanged.

Closes #926

https://claude.ai/code/session_01DRkE5mej83XAHjmRMc3LSo
…restarts

Three new e2e tests for issue #926's orchestrator-session interactions:
- per-window isolation: files opened in one window never appear in
  another window's Open Recent picker
- multi-window quit (save_all_windows_workspaces) then restart rooted
  at either directory restores only that directory's list
- restarting in a never-opened directory starts with an empty list

https://claude.ai/code/session_01DRkE5mej83XAHjmRMc3LSo
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.

Feature Request: Recent files

2 participants