Repository navigation
Description
Overview
The Search view lists nodes that are not roots, and it clears its search term and results whenever the user switches to another tab (including by opening a result) and returns.
Problem Statement
Non-root results
Searching "Graph" in the Search tab returned 20 results: 1 skill, 3 schemas, and 16 text nodes. 15 of the 16 are body paragraphs that are children of skill nodes. The database has 539 nodes of which 117 are roots.
search-pane.sveltecalls thesearch_rootscommand. It does not restrict to roots. It sendssearch_semanticwithinclude_title_matches: trueand scopeeverything(app-lib/src/commands/embeddings.rs).- Semantic matching can only return roots, because only roots have embeddings. The leak is the keyword half:
title_match_nodesincore/src/ops/search_ops.rsqueriestitle_containsandcontent_containsacross every node with no root restriction, so any child paragraph that contains the query text matches. - The returned node carries no parent field, so the frontend cannot filter roots on its own.
State lost on tab switch
Typed "Graph" (25 rows), switched to another tab and back: the box is empty and the view reads "Type to search your nodes."
pane-content.svelte(line ~196) mounts<SearchPane />only while the Search tab is active, so switching tabs destroys the component.query,resultsandhasSearchedare component-local$stateinsearch-pane.svelte, so they are lost with it. A search tab is created with nocontent, so nothing else holds them.
Proposed Solution
Restrict the keyword half of the human-facing search to root nodes, and keep each Search tab's term in state that outlives the component.
Documentation
- ADR-029 - which node types and which nodes (roots) are embedded.
- Frontend State & Persistence - where per-tab UI state lives.
- No prior doc covers the Search view; add a short description to the doc that fits once the behavior is fixed.
Acceptance Criteria
- The Search view returns only root nodes. A test creates a child node whose text matches the query and asserts it is not returned, while its root is.
- The agent and CLI search paths (
include_title_matchesunset) keep their current results. - The
search_rootscommand doc and the pane header describe what is actually searched. - Returning to a Search tab restores the term in the box and re-runs the search, so results are never stale.
- Opening a result and coming back keeps the term.
- Each Search tab keeps its own term.
- A frontend test covers switching away and back.
- Code passes
bun run quality:fix;bun run test:changedpasses.
Technical Specifications
Reference Files
packages/desktop-app/src/lib/components/search/search-pane.svelte- local state,runSearch, thesearch_rootsinvokepackages/desktop-app/src/lib/components/layout/pane-content.svelte- conditional mount ofSearchPanepackages/desktop-app/app-lib/src/commands/embeddings.rs-search_rootspackages/core/src/ops/search_ops.rs-title_match_nodes,merge_keyword_and_semantic, theinclude_title_matchesinput
Implementation Details
Whether NodeQuery already has a roots-only filter, or whether one is added, is for the implementer to establish. If a new flag or wire type is needed it follows the node-type and wire-type rules (generated TypeScript, bun run gen:types).
Related Issues
- None
Activity
mstomar125 commentedon Nov 2, 2026
Picking this up (sweep drain).