Search notes
Search lets a user find notes by title or body text, inspect a matching note, and distinguish no matches from an unavailable search.
Sub-features
search-openopens search from each supported browser entry point.search-matchreturns title and body matches without changing note data.search-open-resultopens a result in the note editor.search-emptyshows a complete empty state for a query with no matches.search-clearremoves the query and restores the recent-notes view.search-clireturns the same matching notes from the terminal.
How to get to it (user POV)
- Choose the
Searchbutton in the browser toolbar. - Press
/in the browser while focus is outside an editable field. - Run
notes search <query>in a terminal.
Driving it with control-notes
Preconditions:
Notes is healthy at
http://127.0.0.1:4173.The disposable data directory contains
Quarterly planwith body textDraft budget.control-notes doctorreports the expected URL and data directory.Toolbar entry. Choose the
Searchbutton. Runcontrol-notes browser click --role button --name "Search". A dialog namedSearch notesappears with focus in its searchbox.Keyboard entry. Close the dialog, focus the page, and press
/. Runcontrol-notes browser press --key "/". The same dialog appears and the page does not insert a slash.Title match. Type
quarterly. Runcontrol-notes browser fill --role searchbox --name "Search notes" --value "quarterly". TheSearch resultslist containsQuarterly planand does not containGrocery list.Body match. Replace the query with
budget. Runcontrol-notes browser fill --role searchbox --name "Search notes" --value "budget". The resultQuarterly planremains visible with a body-match excerpt.Open result. Choose
Quarterly plan. Runcontrol-notes browser click --role link --name "Quarterly plan". The dialog closes and the editor heading readsQuarterly plan.Empty state. Reopen search and enter
volcano. Runcontrol-notes browser fill --role searchbox --name "Search notes" --value "volcano". A status namedNo matching notesappears after search completes.Clear query. Choose
Clear search. Runcontrol-notes browser click --role button --name "Clear search". The searchbox is empty and theRecent notesregion replaces the result list.CLI match. Search from the terminal. Run
control-notes cli -- notes search "quarterly" --format json. Exit code0and stdout contain one object whose title isQuarterly plan.CLI miss. Search for an absent value. Run
control-notes cli -- notes search "volcano" --format json. Exit code0and stdout are[].Proof. Capture the populated result state. Run
control-notes browser snapshot --aria --path artifacts/search/results.aria.txtandcontrol-notes browser screenshot --path artifacts/search/results.png. Both artifacts identify Notes, the query, andQuarterly plan.
Gotchas
- Pressing
/while the editor or searchbox has focus inserts text instead of opening search. - Results update after a short debounce. Wait for the results list or empty status, not a fixed sleep.
- Archived notes are excluded unless the user enables
Include archived. - The CLI defaults to human-readable output. Use
--format jsonfor stable assertions. - Opening a result changes browser state. Reopen search before proving another query.