Skip to content

Open the search pane from the switcher's row, with the cache's hits landing on their message. - #20

Merged
itz4blitz merged 2 commits into
itz4blitz:mainfrom
unRekable:search/switcher-hits
Oct 17, 2026
Merged

itz4blitz merged 2 commits into
itz4blitz:mainfrom
unRekable:search/switcher-hits

Conversation

@unRekable

Copy link
Copy Markdown
Collaborator

What changed and why

The switcher's "Search messages for …" row has been a promise so far: the slot it calls was
never filled, so the row never showed. It now opens the right pane the architecture had set
aside for this (Layer::Search, RightKind::Search), the pane asks the cache
(SearchMessages, merged in #12) and lists the hits: where they are, the text around the
match, how old, each tagged "cached" (the spec's N12). Clicking a hit opens that conversation
on the message.

The networks are still not asked; that stays the next change, as staged in the roadmap claim.

What it took

  • conversation.rs: a pane's landing field. A search hit opening a conversation starts its
    first page around the hit's message, winning over the read-position page; an already-open
    conversation jumps instead (jump_to, now reachable from the shell).
  • conversation/side.rs: the SearchPage state, open_message_search (asks the cache off
    the main thread, answers only into the page whose words they are), open_search_hit, and
    draw_search (the pane: the query, hit rows with age and the "cached" tag, an empty state).
  • state.rs: the slot is filled, so the switcher's row appears.

Test

  • cargo check -p tinyclient --features gui and cargo test -p tinyclient pass; clippy is
    quiet on the touched files.
  • The flow is driven by hand against the seeded demo: the row appears typed, the pane lists
    the hits, and a hit opens its conversation on the message. A screenshot follows; the pane's
    first cut is this list, with highlighting and the "Jump to present" pill left to a polish
    change, as the spec's N12 stages them.

Tested on Windows; the GUI feature builds here (gpui at the pinned revision).

@unRekable
unRekable force-pushed the search/switcher-hits branch from 4777fe1 to 31365e8 Compare October 17, 2026 16:12
@itz4blitz

Copy link
Copy Markdown
Owner

Left this as a draft, so it is not merged.

One thing before it is ready: open_message_search stores an empty hit list and draw_search treats that as "Nothing in the cache yet." The pane shows that line while the cache read is still in flight, including for a query that has hits. A failed read stays on the same line. Keep the empty copy for an answered page with no hits, and use a different line while the read is outstanding or failed.

The action-bar change in #19 just landed on main and also edits conversation.rs. This will want a rebase onto that before it is marked ready.

@unRekable
unRekable marked this pull request as ready for review October 17, 2026 16:28
@unRekable
unRekable requested a review from itz4blitz as a code owner October 17, 2026 16:28

@itz4blitz itz4blitz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Not merged. The pane opens and the cache read is the right shape, and macOS, Linux, and Windows are green, but the first paint is wrong.

open_message_search stores hits: Vec::new() and draw_search treats an empty list as "Nothing in the cache yet." That line shows while the read is still in flight, including for a query that has hits. A failed read stays on the same line. Show that copy only after an answered page comes back with no hits, and use a different line while the read is outstanding or failed.

This also needs a rebase onto current main. #19 landed in conversation.rs after this branch was cut.

@unRekable
unRekable force-pushed the search/switcher-hits branch from 31365e8 to 38acddb Compare October 17, 2026 17:09
@unRekable

unRekable commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Both done, thank you for reading it so closely.

The pane now says what the read is doing: SearchPage holds the hits as Option beside a failed flag, so asking shows "Asking the cache…", an answered page with no hits shows "Nothing in the cache yet.", a failed read says tinyclient isn't answering, and the rows draw only from an answer. The query's letters are drawn heavier in each snippet, as the switcher's rows do.

Rebased onto the action-bar change; the conversation.rs edits merged clean and the pane builds and passes its tests on top.

@itz4blitz itz4blitz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Both notes are addressed on 38acddb. hits stays None until the cache answers, so the pane says "Asking the cache…" while the read is outstanding, "Nothing in the cache yet." only for an empty answer, and "tinyclient isn't answering." when the read fails. The branch is rebased onto the action-bar change in conversation.rs.

I'll merge once macOS, Linux, and Windows finish green.

@itz4blitz
itz4blitz merged commit 81857fc into itz4blitz:main Oct 17, 2026
3 checks passed
@unRekable

unRekable commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

One more on the same line of the spec: a hit's landing now takes the jump path (Purpose::Jump), so the message flashes where it lands and the jump-to-present pill is about the hit, not the unread line. The last-read page for a plain open is untouched.

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