Skip to content

feat(desktop): recent files in quick open and a recent picker (#1609) - #5864

Merged
Jocs merged 8 commits into
developfrom
feat/1609-recent-files
Oct 23, 2026
Merged

Jocs merged 8 commits into
developfrom
feat/1609-recent-files

Conversation

@Jocs

@Jocs Jocs commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Closes #1609

Summary

Adds recently opened files to the existing command palette and a dedicated recent files/folders picker, following VS Code's quick open behavior.

  • Global recent history: the main process now persists recently-used-documents.json on every platform (previously only Windows/Linux) with no entry cap, dedupe and MRU order. Entries whose file/folder was deleted or moved are pruned on read; entries whose parent folder is unreachable (e.g. an unmounted volume) are retained so they reappear when the volume returns.
  • Ctrl/Cmd+P: the empty list shows recently opened files under a recently opened header. Typing ranks name matches first, then path-only matches, then matching files from the opened folder under file results, with duplicates removed.
  • Quick Open Recent (file.quick-open-recent): new picker listing folders first, then files, filterable by name or full path. Enter opens a folder or file, × removes an entry. macOS gets Control+R; Windows/Linux have no default (Ctrl+R is Replace) and reach it from File → Open Recent → Search Recent… or the command palette.
  • Component reuse: the command palette now supports group headers, a secondary path column, a per-row remove button, and a localized no-results state. The Open Recent menu separates the search action from the list.
  • Consistency: in-app rename/move refreshes the recent path, the Dock "Clear Recent" action also clears the stored list, and the File menu caps its display at 12 entries while the pickers keep the full history searchable.

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

Test plan

  • New tests added: store (MRU/no cap/prune/volume retention/remove/clear), menu model, quick open grouping/dedupe/ranking, recent picker ordering/filter/IPC/remove, default keybindings, locale parity, plus a Playwright e2e covering both flows, filtering, no-results and per-row removal.
  • Manually tested on: macOS (dev app) — Ctrl+P, Control+R, File → Open Recent → Search Recent…, filtering, no-results state, per-row removal, rename/move refresh.
  • vitest run test/unit: 118 files / 1222 tests pass.
  • Playwright: quick-open-recent, multi-folder-sidebar, command-palette pass.
  • CI: lint, unit tests (Ubuntu/Windows), e2e, CodeQL and all platform builds pass.

Notes for reviewers [optional]

  • macOS Open Recent: the recentdocuments role silently drops custom submenu items in the rendered menu (verified on a real Mac: the Electron menu model contains them, the native menu does not). The File → Open Recent submenu is therefore built from the stored list on macOS too. app.addRecentDocument is still called so the Dock/OS recent list keeps working.
  • No cap: the stored history is uncapped as requested; only the File menu display is capped at 12 for usability, and everything is searchable from the pickers.
  • Shortcut: Windows/Linux intentionally have no default binding because Ctrl+R is Replace and Ctrl+Shift+R/Ctrl+Alt+R are already used. file.quick-open-recent can be bound by users.
  • Dev note: the main process prefers static/locales/*.min.json; run pnpm minify-locales after locale edits before restarting dev.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Website preview ready: https://pr-5864-marktext-website.ransixi.workers.dev

Built from e3cc9272ced8d59d0d974251f404a709295192c7 · Worker: marktext-website · Version: bc6413d1-e057-4304-b28f-ce8f6637a551 · Alias: pr-5864

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Build artifacts for PR #5864:

Run: https://github.com/marktext/marktext/actions/runs/39913498036

Artifact Size Link
marktext-macos-arm64 300.7 MB Download
marktext-windows-arm64 291.5 MB Download
marktext-linux-arm64 523.2 MB Download
marktext-windows-x64 299.6 MB Download
marktext-linux-x64 669.1 MB Download
marktext-macos-x64 314.1 MB Download

@Jocs Jocs left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This review found two reproducible issues that should be addressed before merging; see the inline comments.

Validation on PR head 1332fd9f: the build passed, all 118 unit test files / 1,222 tests passed, and the existing quick-open-recent E2E passed. Additional checks in a real Electron instance with Playwright reproduced the directory IPC argument mismatch and the focus issue after removing an entry.

@Jocs
Jocs merged commit 44903ac into develop Oct 23, 2026
14 checks passed
@Jocs
Jocs deleted the feat/1609-recent-files branch October 23, 2026 07:53
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.

Quick open recent opened files and folders

1 participant