Skip to content

CPLAT-11790: show LIVE state in ccx search results and resume from a hit - #162

Merged
gavin-jeong merged 1 commit into
masterfrom
CPLAT-11790-search-resume
Aug 30, 2026
Merged

gavin-jeong merged 1 commit into
masterfrom
CPLAT-11790-search-resume

Conversation

@gavin-jeong

Copy link
Copy Markdown
Collaborator

JIRA: https://sendbird.atlassian.net/browse/CPLAT-11790

Problem

Cross-session search finds the right session and then dead-ends. A result row shows project name and age, Enter jumps to the matching message, and that is it — no way to get back to working in that session, and no way to tell whether it is even still running.

resumeSession already does exactly the right thing (attach to the tmux pane when live, otherwise claude --resume in a tmux window). It was simply unreachable from search — only from the session list.

What this adds

[LIVE] / [HERE] badges on result rows. Resolved from the session store, not from the search result. The result carries a snapshot from when the search ran, and a session can start or exit while the results sit on screen. Since the badge is what you make the jump-or-revive decision from, a stale one is worse than none. Rows are also rebuilt on tick so a session coming up or going down shows while the modal is open — with the cursor preserved, so the refresh doesn't move your selection.

r in the results list resumes the hit. Enter keeps its existing meaning (jump to the message) — the two are different intents and both are worth having.

The flow that was missing: search globally → see which hits are live → r to attach if live, or revive it if not.

Detail worth flagging

The resume case is ordered after the j/k navigation cases. Go's switch takes the first match, so a user who rebinds resume to a navigation key would otherwise lose the ability to scroll their own search results. There's a test pinning this.

Testing

  • Full suite green (go test ./...), go vet ./... clean.
  • Tests cover: live/dead badge rendering, store-wins-over-stale-snapshot in both directions (session came up / session exited), resume reaching resumeSession and closing the modal, badges tracking live changes while the modal is open, cursor preserved across refresh, rebound-resume not swallowing navigation, and the key being discoverable in the help line.
  • Mutation-tested each: took live state from the snapshot instead of the store, moved the resume case before navigation, and removed the tick refresh — all three fail the tests that cover them.

Note

Verified by tests, not interactively — I can't drive the TUI. Worth a make build && ./bin/ccx, Ctrl+S, and checking that the badges look right and r lands you where you expect on both a live and a dead session.

Stacked context: this is independent of #160 (FTS index) and #161 (navigation freeze); all three branch off master.

Cross-session search found the right session and then dead-ended. A
result row showed project name and age, Enter jumped to the matching
message, and that was it — no way to get back to working in that
session, and no way to tell whether it was still running.

Show [LIVE]/[HERE] on result rows and bind the Actions resume key (r)
to resumeSession on the hit. resumeSession already branches the way
this needs: attach to the tmux pane when live, otherwise revive the
transcript with `claude --resume` in a tmux window. It was simply not
reachable from search — only from the session list.

Live state is read from the session store, not from the search result.
The result carries a snapshot from when the search ran, and a session
can start or exit while the results sit on screen; since the badge is
what the user makes the jump-or-revive decision from, a stale one is
worse than none. The rows are also rebuilt on tick so a session coming
up or going down is reflected while the modal is open, preserving the
cursor so the refresh does not move the selection out from under the
user.

The resume case is ordered after the j/k navigation cases. Go's switch
takes the first match, so a user who rebinds resume to a navigation key
would otherwise lose the ability to scroll the results.

Enter keeps its existing meaning (jump to the message); the two are
different intents and both are worth having.
@upwind-code-us

upwind-code-us Bot commented Aug 30, 2026

Copy link
Copy Markdown

Upwind Upwind Code Scan - ✅ Proceed with Deployment

1 newly introduced vulnerabilities · 0 resolved · 2 total in this PR vs master

🔶 1 High | 🟢 1 Low


🟢 Low · 1 finding
CVE Package Version Fix
CVE-2026-39824 golang.org/x/sys v0.42.0 0.44.0

View full analysis in Upwind Console

Scan completed in 19s

Scan history (1 scan)
Commit Scanned at New Resolved Net
ed10b27 < 2026-08-30 12:44 UTC +1 0 +1

Last scanned: ed10b27 · 2026-08-30 12:44 UTC

@upwind-code-us

upwind-code-us Bot commented Aug 30, 2026

Copy link
Copy Markdown

Upwind Upwind IaC Scan - ✅ Proceed with Deployment

0 newly introduced misconfigurations · 0 resolved · 0 total in this PR vs main

View full analysis in Upwind Console →

Scan completed in 4s

Scan history (2 scans)
Commit Scanned at New Resolved Net
ed10b27 2026-08-30 12:44 UTC
ed10b27 < 2026-08-30 12:44 UTC 0 0 0

Last scanned: ed10b27 · 2026-08-30 12:44 UTC

@Kairo-Kim Kairo-Kim added the auto-review/approved Auto-approved by the Slack auto-reviewer bot label Aug 30, 2026
@gavin-jeong
gavin-jeong merged commit a8c00d6 into master Aug 30, 2026
4 of 5 checks passed
gavin-jeong added a commit that referenced this pull request Aug 30, 2026
#160 added a SearchMode argument to updateSearchResults while #162 added
tests that call it. Both were green on their own branches and neither
touched the other's files, so git merged them without conflict — but the
merged tree does not compile:

  vet: search_resume_test.go:17: not enough arguments in call to
       a.updateSearchResults
       have ([]session.SearchResult)
       want ([]session.SearchResult, session.SearchMode)

Production code is unaffected (go build passes); only the test callers
are stale. Pass SearchModeScan, which is what these tests were written
against — they exercise live badges and resume, not index coverage.

Co-authored-by: keyolk <keyolk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-review/approved Auto-approved by the Slack auto-reviewer bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants