feat(search): full-history + content commit search#10
Merged
Conversation
The in-graph search highlighted matches over the loaded log client-side — instant, but blind past the loaded window and unable to search file contents (it holds no diffs). Add a backend `Repo::search_log(query, mode, limit)` that shells out to `git log`: `--grep`/`--author` (`--fixed-strings -i`) reach the whole history, and `-G` (the pickaxe) searches commit diffs for an added or removed matching line. Refs + empty-repo handling and the format/parse path are shared with `log`. Wired through `repo_search_log` IPC + `repoSearchLog` wrapper + a `searchLog` store action. The All Commits search pill gains a Content field mode and a "Search all history" button (Mod+Enter, or Enter in Content) that opens a keyboard-navigable results dropdown (combobox + listbox semantics) over matches across all history, marking hits older than the loaded graph. Clicking a result scrolls + focuses it when it is a loaded row and opens the detail panel either way — CommitDetail falls back to the stored search results so an out-of-window commit still renders. The loaded-window highlight + prev/next nav are untouched; the deep search is an explicit action so `git log -G` never fires per-keystroke. Adds a "Search file contents…" palette action. Verified: cargo test -p strand-core (+5 log tests), clippy -D warnings, tsc, vitest (131), vite build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes the last
◐on the 1.0 commit-search line: full-history and content (pickaxe) search, backed by a newgit log-based engine command.The in-graph search highlighted matches over the loaded log client-side — instant, but blind past the loaded window and unable to search file contents (it holds no diffs). This adds the backend reach to close both gaps.
Backend
Repo::search_log(query, mode, limit)(crates/strand-core/src/log.rs) shells out togit logacross all refs (mirrorslog's ref set + empty-repo handling; sharescommit_format+ the parser):Message→--grep,Author→--author— both--fixed-strings -i(case-insensitive substring), reaching beyond the loaded window.Content→-G(the pickaxe) — commits whose diff added/removed a matching line (the one search the client can't do).SearchModeenum, lowercase-serialized for IPC. +5 unit tests.Wiring & UI
repo_search_logIPC →repoSearchLogwrapper →searchLogstore action (results incommitSearchResults).Commits.tsx: a Content field mode + a "Search all history" button (⌘↵, or ↵ in Content) open a keyboard-navigable results dropdown (combobox + listbox /aria-activedescendant). Clicking a hit scrolls+focuses it when loaded, and opens the detail panel either way —CommitDetailfalls back to the stored results so an out-of-window commit still renders.git log -Gnever fires per-keystroke. Adds a "Search file contents…" palette action.Design notes
-Soccurrence-count pickaxe isn't exposed;-Gcovers the intent. Noted as a future refinement.Verification
cargo test -p strand-core(90 pass, +5),clippy -D warningsclean,tscclean,vitest(131),vite build✓.🤖 Generated with Claude Code