add quick-open fuzzy file finder (Ctrl/Cmd+P)

A file picker overlay over the whole workspace, distinct from the
command palette. QuickOpenController holds the file list + a
subsequence fuzzy filter; the overlay loads the list via files.walk on
open, shows RecentFilesService entries on an empty query, and opens the
selection through a shared openWorkspaceFile helper (.md → markdown
reader bus, else editor.open) that the files panel now also routes
through, so recents stay in sync from every open site.

Bound to ctrl+p / meta+p with `when: !palette.open` so it never
collides with the palette's ctrl+p navigation; in-overlay arrows/enter/
escape reuse the palette's keymap-driven model via quickOpen.* intents.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 20:19:21 +02:00
co-authored by Claude Opus 4.8
parent d7be5535d5
commit 0c7a6e86d5
16 changed files with 865 additions and 22 deletions
+35
View File
@@ -0,0 +1,35 @@
/// A bounded, most-recent-first list of repo-relative file paths opened
/// this session. Backs the quick-open overlay's empty-query state
/// (T-51). In-memory only — recents reset per app run, matching the
/// session-scoped "recently opened within a workspace" convention.
library;
import 'package:flutter/foundation.dart';
class RecentFilesService extends ChangeNotifier {
RecentFilesService({this.cap = 20});
/// Maximum number of paths retained; the oldest fall off the end.
final int cap;
final List<String> _paths = [];
/// Most-recent-first snapshot of the retained paths.
List<String> get paths => List.unmodifiable(_paths);
/// Record [path] as the most-recently opened file: moves an existing
/// entry to the front (no duplicates) and trims to [cap].
void push(String path) {
if (path.isEmpty) return;
_paths.remove(path);
_paths.insert(0, path);
if (_paths.length > cap) _paths.removeRange(cap, _paths.length);
notifyListeners();
}
void clear() {
if (_paths.isEmpty) return;
_paths.clear();
notifyListeners();
}
}