CPLAT-11162: refs picker state filter (hide merged/closed by default) - #149
Merged
Conversation
…lient's active window
CurrentWindowClaudes asked tmux for the client's active window
("#{session_name}|#{window_index}") and scanned only that window's panes
for Claude processes. A Claude session running in a background window of the
same client (common during a multi-window build) then matched sessions from
the foreground window instead of its own, so `ccx refs` surfaced unrelated
PRs or reported "no PR/Jira references found".
Walk this process's own PPID chain to the tmux pane that hosts it (reusing
the walkToPane/batchPPIDMap helpers MarkLiveSessions already uses) and pin
the window from that pane. The client-active window remains as a fallback
when the pane can't be determined (e.g. a wrapper re-parented the process
beyond tmux's view).
Extracted claudesInWindow/findPaneByPID so the window-selection logic is
testable without a live tmux.
The refs interactive picker listed every PR/Jira ref regardless of state, so merged/closed PRs and done Jira issues cluttered the view. Add state-based filtering scoped to the refs picker: * Default open-only filter: open/draft PRs and not-done Jira issues show; merged/closed/done refs are hidden. Unresolved refs stay visible until their status lands. * `is:merged` / `is:closed` / `is:open` narrow to that state; `is:all` lifts the default hide without narrowing. * `M` toggle flips showAllRefs to reveal every ref. * pickerRefStatusMsg re-filters on resolve so a ref drops out as soon as its status lands as merged/closed. * Search hint footer advertises open/merged/closed scopes; action hint shows M:show all. Tests cover the default filter, the M toggle, is:merged/is:closed/is:all narrowing, and that the urls picker is unaffected.
Kairo-Kim
approved these changes
Jul 30, 2026
The refs picker's refStatusPlain calls session.RefStatusVariants to pick the widest status form that fits the list pane. This function and its tests were missing from the previous commit, so CI failed with 'undefined: session.RefStatusVariants'.
Kairo-Kim
approved these changes
Jul 30, 2026
mitrilmad
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JIRA: https://sendbird.atlassian.net/browse/CPLAT-11162
Problem
The
ccx refsinteractive picker listed every PR/Jira ref regardless of state, so merged/closed PRs and done Jira issues cluttered the view — the active work you care about was buried under completed items.Fix
Add state-based filtering scoped to the refs picker only (the urls picker handles non-PR/Jira links too, where PR state is not the primary axis):
is:merged/is:closed/is:opennarrow to that state.is:alllifts the default hide without narrowing.Mtoggle flipsshowAllRefsto reveal every ref.pickerRefStatusMsgre-filters on resolve so a ref drops out as soon as its status lands as merged/closed.open merged closedscopes; action hint showsM:show all.Tests
TestRefsFilterDefaultsToOpen— merged/closed drop out after resolve; unresolved stayTestRefsFilterShowsAllWithToggle— M toggle reveals allTestRefsFilterIsMergedNarrows/TestRefsFilterIsClosedNarrows— state narrowingTestRefsFilterIsAllShowsEverything—is:alllifts filterTestRefsFilterDoesNotApplyToUrls— urls picker unaffectedTest plan
go build ./...go test ./internal/cli/ ./internal/tmux/ ./internal/session/