Repository navigation
[Proposal] Centered command palette for searching session titles and message content #13251
Ghost-Sam1222
started this conversation in
Ideas
Replies: 1 comment 1 reply
|
可以补两条中文验收:正文「只能搜索输出」查「搜索输出」( |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
DSH already has the hard part: a full-text index over session events (
session-query-sqlite) and asession/searchRPC. What is missing is a keyboard-first surface for it. TodayCmd+Kexpands the search field inside the sidebar, and the content index ships disabled (openAt: never), so the shortcut only matches session titles by default.I built a small client-only plugin that turns the shortcut into a centered command palette: it searches titles, workspaces, and message content in one overlay, shows the best matching snippet with the query highlighted, and supports
↑/↓/↵/esc. It reuses the existing RPC, so no host code changes are needed; content search needs one profile config line.Problem
Cmd+Kexpands a field inside the sidebar. In a wide window the result list is narrow and the interaction reads as a filter, not a command palette.session-query-sqlitetoopenAt: never. Unless the user edits their profile, the shortcut cannot find anything inside a conversation — the most common thing people search for.Proposal
A centered overlay on the search shortcut:
↑/↓to move,↵to open,esc/click-outside to close;Implementation notes from the working plugin:
shell.overlayslot;sessions.list,workspaces.list, and the existingsessions.searchRPC;before-input-eventand replays them through the native keyboard bridge straight intoregistry.dispatch, so a DOMkeydownlistener never fires. The plugin takes over the built-insession.searchcommand (registry.commands.get('session.search').resolve) instead, which covers both Web and Desktop;openAt: first-searchonsession-query-sqlite; the plugin documents that one-line profile patch.Questions for the maintainers
client-ui-*package, or as an alternate presentation of the existing sidebar search?openAt: never? The cost here was an in-memory SQLite index built on first search — roughly 30 MB of text for ~110 sessions, a few seconds — plus whatever the optional experimental session-search bundle keeps for agent tools when it is enabled.session/searchRPC returns one snippet per session. Would you consider returning the matched event (seq/role) so a palette can show which message matched and jump to it?registry.commands/command.resolve(currently TypeScript-privatebut plain runtime properties)?Limitations (honest list)
shortcuts.registry.commands/command.resolve. If those are renamed, the plugin logs a warning after 10 seconds and leaves the native behavior untouched.0.2.1-rc.3; the APIs used still exist in0.2.2-rc.3source, but I have not run it there yet.Status
Working community plugin, MIT licensed, no host code changes. I can share the plugin source as a gist if useful. Happy to keep it in sync with whatever direction you prefer — or to drop it if a palette is planned natively.
unicode61): CJK runs are a single token, so phrases like搜索输出match only where they stand alone. A trigram or CJK tokenizer insession-query-sqlitewould be needed.All reactions