Skip to content

feat(sessions): live-only filter, click to open, copy resume cmd, fitted layout - #60

Merged
zanetworker merged 1 commit into
mainfrom
feat/sessions-live-filter
Oct 10, 2026
Merged

zanetworker merged 1 commit into
mainfrom
feat/sessions-live-filter

Conversation

@zanetworker

@zanetworker zanetworker commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Live-only filter: ^l in the picker and --live on aimux sessions (list, query, picker) show only sessions running in a terminal now. SearchOpts.IDs restricts every query path (keyword, semantic, hybrid, browse); an empty live set shows nothing rather than everything.
  • Click to open: a single click on a row opens it (left-click:accept), same as Enter.
  • Copy resume command: ^y copies cd '<cwd>' && claude --resume '<id>' for the highlighted session and confirms on its own header line.
  • Fitted layout: rows size their title/project columns from FZF_COLUMNS to fit the list pane; the header is split into a status line and a key line that both fit.
  • Fix: fzf compares the preview-window threshold to the preview's own width, not the terminal's, so the layout switched at the wrong width. The split is now 50/50 at 140+ terminal columns, stacked below that.

Test plan

  • go test ./... (44 packages ok), golangci-lint 0 issues
  • Unit tests: IDs scoping, live toggle, --live list/query, click and ^y bindings, row/header widths, threshold
  • Real fzf mouse click opens the clicked row; real clipboard holds the resume command
  • Rendered in tmux at 100/130/139/140/200 columns

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a live-only option for session listings and picker searches, with a toggle in the picker.
    • Added picker shortcuts to open a session by clicking and copy a command to resume a session.
  • Improvements
    • Session rows and preview layout now adapt to terminal width.

…ted layout

- ^l in the picker and --live (list, query, picker) show only sessions
  running in a terminal now; SearchOpts.IDs restricts every query path
- a single click opens the session (left-click:accept)
- ^y copies `cd '<cwd>' && claude --resume '<id>'` for the highlighted row
- rows size their title/project columns from FZF_COLUMNS to fit the list
  pane; header split into a status line and a key line that fit
- fix the preview-window threshold: fzf compares it to the preview width,
  so the side-by-side split now switches at 140 terminal columns (50/50)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: zanetworker/aimux/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1c118c23-0d51-434f-a51b-8af6d29f51db

📥 Commits

Reviewing files that changed from the base of the PR and between 62baae2 and 2ef61fa.


📒 Files selected for processing (11)
  • cmd/aimux/cmd/sessions.go
  • cmd/aimux/cmd/sessions_index_test.go
  • cmd/aimux/cmd/sessions_picker_test.go
  • cmd/aimux/cmd/sessions_search.go
  • internal/search/browse.go
  • internal/search/browse_test.go
  • internal/search/embed.go
  • internal/search/index.go
  • internal/search/service.go
  • internal/sessions/searchpicker.go
  • internal/sessions/searchpicker_test.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



Walkthrough

The sessions command now supports live-only filtering across discovery and indexed search. Search queries accept session-ID restrictions. The picker adds a live-only toggle, copy-resume command, and terminal-width-based row layout.

Changes

Session Search and Picker

Layer / File(s) Summary
Session-ID search scope
internal/search/index.go, internal/search/service.go, internal/search/browse.go, internal/search/embed.go, internal/search/browse_test.go
Search options accept optional session IDs. Recent, keyword, semantic, and coverage searches apply the combined directory and ID scope. Tests cover selected IDs and empty ID sets.
Live-only filtering
cmd/aimux/cmd/sessions.go, cmd/aimux/cmd/sessions_search.go, cmd/aimux/cmd/sessions_index_test.go, cmd/aimux/cmd/sessions_picker_test.go, internal/sessions/searchpicker.go, internal/sessions/searchpicker_test.go
The sessions command passes live-session IDs into indexed queries and filters discovered sessions. The picker adds persistent live-only state and applies the live ID set to its search paths. Tests cover enabled and disabled filtering.
Picker commands and responsive layout
cmd/aimux/cmd/sessions_search.go, cmd/aimux/cmd/sessions_picker_test.go, internal/sessions/searchpicker.go, internal/sessions/searchpicker_test.go
The picker adds copy-resume behavior, click-to-open and copy key bindings, and row formatting based on terminal width. Tests cover copy outcomes, header text, bindings, and row sizing.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant SessionsCommand
  participant CurrentLiveIDs
  participant SearchService
  participant SearchIndex
  SessionsCommand->>CurrentLiveIDs: Get live session IDs
  CurrentLiveIDs-->>SessionsCommand: Return IDs
  SessionsCommand->>SearchService: Query with session IDs
  SearchService->>SearchIndex: Search with session ID scope
  SearchIndex-->>SearchService: Return restricted results
Loading

Suggested labels: architecture

Merge Risk | ⚪ Minimal · up to 2ef61

Merge Risk: ⚪ Minimal · up to 2ef61

This change adds a live-only filter, a copy-resume shortcut and width-aware picker rows. No merge-blocking issues were found.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 2ef61

Search restrictions remain combined with directory filtering, and copied commands retain validation and shell quoting. No introduced security issue was established. Remaining uncertainty concerns concurrent picker updates and selection during an unfinished refresh, rather than a demonstrated permission bypass.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The new paths affect sessions available in the configured local index, the current picker invocation, and the system clipboard. Source establishes default per-user storage, not isolation in deployments that share stores or hosts. The existing loopback action listener remains relevant to same-host exposure independently of the new filters.

Trust Boundaries and Controls

  • observed — Session IDs are bound as database parameters. At command export, IDs must match the allowed-character expression and working-directory apostrophes are escaped within shell quoting. Clipboard operations treat the generated command as stdin data, preserving the separation between copying text and executing it.

Resilience and Maintainability Implications

  • inferred — The live toggle uses a check-then-write/remove operation followed by a separate reload. Source does not establish atomic behavior for overlapping helpers or prevent acceptance of previously displayed rows during reload. These remain filter-consistency uncertainties, not demonstrated authorization failures. Deferred cleanup covers normal returns, but abrupt termination and runtime event ordering were not verified.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 41.30% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 46 functions across 11 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately summarizes the primary changes: live-only session filtering, click-to-open support, copy-resume functionality, and fitted picker layout. It is concise and specific.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zanetworker
zanetworker merged commit a259d5f into main Oct 10, 2026
3 checks passed
@zanetworker
zanetworker deleted the feat/sessions-live-filter branch October 10, 2026 18:24
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.

1 participant