Skip to content

feat(search): full-history + content commit search#10

Merged
danielss-dev merged 1 commit into
mainfrom
full-history-commit-search
Jun 24, 2026
Merged

feat(search): full-history + content commit search#10
danielss-dev merged 1 commit into
mainfrom
full-history-commit-search

Conversation

@danielss-dev

Copy link
Copy Markdown
Owner

What

Closes the last on the 1.0 commit-search line: full-history and content (pickaxe) search, backed by a new git 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 to git log across all refs (mirrors log's ref set + empty-repo handling; shares commit_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).
  • SearchMode enum, lowercase-serialized for IPC. +5 unit tests.

Wiring & UI

  • repo_search_log IPC → repoSearchLog wrapper → searchLog store action (results in commitSearchResults).
  • 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 — CommitDetail falls back to the stored results so an out-of-window commit still renders.
  • The loaded-window highlight + ‹/› stay untouched; the deep search is explicit so git log -G never fires per-keystroke. Adds a "Search file contents…" palette action.

Design notes

  • Flat dropdown, not graph filtering — dropping rows would break the lane topo invariant.
  • One deliberate cut: -S occurrence-count pickaxe isn't exposed; -G covers the intent. Noted as a future refinement.

Verification

cargo test -p strand-core (90 pass, +5), clippy -D warnings clean, tsc clean, vitest (131), vite build ✓.

⚠️ Not verified: a live pass in the actual Tauri window (the webview can't be driven by the browser harness here).

🤖 Generated with Claude Code

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>
@danielss-dev danielss-dev merged commit 9b5b3e9 into main Jun 24, 2026
2 checks passed
@danielss-dev danielss-dev deleted the full-history-commit-search branch June 24, 2026 11:22
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.

1 participant