Skip to content

Add live search to the HEY panel - #30

Open
nille wants to merge 2 commits into
basecamp:masterfrom
nille:feat/live-search
Open

nille wants to merge 2 commits into
basecamp:masterfrom
nille:feat/live-search

Conversation

@nille

@nille nille commented Sep 23, 2026 •

Copy link
Copy Markdown

I realize search may go beyond the intended scope of this widget. For me, it was the missing piece, so I wanted to offer it as a PR. Feel free to use, adapt, or pass on it as you see fit.

What changes

  • Adds a third SEARCH tab after PREVIOUSLY SEEN, with an automatically focused Search… input.
  • Searches after a 300 ms typing pause once the query reaches 3 characters. Enter also submits shorter, non-empty queries.
  • Uses HEY's full-mail search in the selected account. All accounts combines the first page from each linked account, showing up to 50 matching threads with their account names.
  • Supports arrow-key selection, Enter to open a result, and / to enter Search.
  • Opening a result clears the query, returns the selected tab to NEW FOR YOU, and closes the panel.
  • Shows loading, no-match, and retryable error states. Empty input stays quiet.

Search runs per panel and cancels obsolete requests, with a revision check to discard late responses. It reuses the existing themed controls, email rows, CLI output limits, and timeout handling. The demo CLI supports search too.

Verification

  • ./tests/run: 90 Node tests and 100 QtTest checks passed, including the existing coverage gates.
  • Adds 5 Node tests and 13 QML behavior tests covering the CLI contract, numeric account routing, bounded multi-account results, debounce, short-query submission, cancellation races, account changes, and recovery.
  • Native Qt smoke checks covered typing/focus, mouse and keyboard activation, query clearing, tab reset, closing/reopening, and 360/430 px panel widths.
  • Tried in the live Omarchy top bar.

Account routing

All-account search queries each linked account separately and retains its numeric account ID on every result. The TUI receives that numeric ID when opening a result, so an existing instance can switch to the matching account using the released CLI's remote-open protocol. Requests run sequentially through the existing bounded process, and results are published after every account succeeds.

Copilot AI balanced review requested due to automatic review settings September 23, 2026 10:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

All-account search results cannot be opened reliably when the existing HEY TUI remains scoped to another account.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Adds live HEY mail search with debouncing, cancellation, keyboard navigation, retry states, and demo support.

Changes:

  • Adds a searchable third panel tab.
  • Implements search commands, parsing, and result handling.
  • Extends documentation, demo behavior, and automated tests.
File Description
tests/​qml/​tst_search.qml Tests search lifecycle, races, and failures.
tests/​qml/​imports/​Quickshell/​Io/​Process.qml Supports deferred process exits in tests.
tests/​model.test.js Tests search commands and parsing.
tests/​demo.test.js Tests demo search behavior.
Search.qml Implements debounced search and cancellation.
README.md Documents search usage.
Panel.qml Adds search UI, navigation, and result opening.
Model.js Adds CLI routing and parsing; all-account results may open in a stale account-scoped TUI.
demo/​bin/​hey Adds demo search support.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Model.js Resolved
@nille

nille commented Sep 23, 2026

Copy link
Copy Markdown
Author

The account-routing fix is pushed in 3d75122. Could a maintainer request a fresh Copilot review? GitHub denied my re-review request because I do not have permission to request reviews in this repository.

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.

2 participants