Skip to content

FEAT: filter Sessions by status and prioritise statusline telemetry - #85

Merged
merefield merged 12 commits into
mainfrom
feat/session-status-filters
Oct 19, 2026
Merged

merefield merged 12 commits into
mainfrom
feat/session-status-filters

Conversation

@merefield

@merefield merefield commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Why

Make Sessions easier to triage, prioritise the telemetry users actually want, and let slash-command options drill down from the command line without replacing the conversation.

Changes

Sessions status filters

  • Keep app-server-confirmed loaded idle/ready sessions ACTIVE even without recent rollout writes. Fix the reproduced 4 sessions / 3 CHECK / 0 ACTIVE case to report 1 ACTIVE. Retire that confirmation on disconnect or missing status; do not promote unknown/unloaded historical sessions or relabel idle as WORKING. This correction is in the shared reader used by both TUI and web.
  • Add ACTIVE between SESSIONS and WORKING: sessions identified as active by the latest observation, excluding inferred CHECK SESSION entries and retained inactive rows. Active overlaps Working and waiting states; non-zero Active and Working counts use green.
  • Click Sessions (all), Active, Working, Approval, Input or Check in the summary strip to filter rows. Up beyond the first row or top of full detail focuses visible attention pills first, then the summary strip. Left/Right changes pill highlight or filter category according to focus; Down retraces the path. Escape clears the filter.
  • Share responsive rendering and hit geometry, including wrapped summaries and summaries retained on tall detail pages.
  • Keep summary totals and attention pills global. Opening an excluded pill clears the filter to reveal its session.
  • Handle live status changes, empty lists, paging, drafts and confirmation targets safely. Keep full-detail reviews open when their state changes.
  • Scope Close All and its confirmation inventory to matching sessions, including matching rows off screen. Filtering is process-local and does not dismiss sessions or change measurement baselines.

Keyboard focus through attention pills

  • Enter the first visible pill when moving up from the Sessions overview, independently of the selected row's own pill. Full detail targets its current review's visible pill; Down from the summary restores the last highlighted pill before returning to the original row/detail. Missing reviews and pagers are skipped without selecting an unrelated pill.
  • Traverse session rows/full-detail text → visible attention pills → summary filters with Up; Down retraces the path and skips header levels that are not displayed.
  • Keep the current detail visible while merely moving focus. Left/Right highlights pills without opening them; Enter opens the exact pill's session/review. Choosing a filter returns to the filtered list.
  • Use a distinct reverse/underlined keyboard focus style without altering pill width, selected-session markers, compression, or mouse hit targets.
  • Track focus by action identity rather than list position. Reordering preserves the target; disappearance or resizing cannot redirect Enter to a different/hidden pill. Include keyboard access to the overflow pager.
  • Keep sibling quota-threshold and native-approval reviews distinct even for the same session. Navigation never approves either request.
  • Disarm pending confirmations when entering the header. Preserve drafts and existing composer, command-menu, schedule and queue editing controls; keep footer globals available. Mouse summary arrows mirror the keyboard path.
  • Document controls and cover full/overview navigation, hidden headers, disappearing/reordered pills, paging/resize, review scoping, styling and rendered click targets across themes/languages.

Configurable telemetry priority

  • Reuse /statusline field selection and ordering for each session's left-hand telemetry box, in bold and using that row's own values.
  • Retain essential state/identity; omit missing or duplicated values; use spare rows for lower-priority metrics. Pagination never replaces configured fields.
  • Preserve the existing preference store and detail footer. Explicitly selecting no fields restores fallback telemetry priorities and hides the footer.
  • Configured token values retain their existing definition: cumulative observed session tokens, not tokens since Zero.

Composer-driven slash-command expansion

  • Fit root suggestions and nested menus to their contents in both session-list and full-screen detail, capped by the surrounding detail pane. Include previews, notices, review text, titles and controls in width measurement; shorten excess text only at the parent boundary and recalculate on resize.
  • Retain the original expanding IntelliSense list above the composer at every command level, including wide session rows. Keep the conversation, composer position and typing focus intact.
  • Type to filter options locally; Up/Down selects, Tab completes, Enter drills in or reviews. Option help stays subdued and single-line with ellipsis.
  • Keep checkbox menus unfiltered in the same expansion: Up/Down selects, Space toggles, Left/Right reorders, Enter applies local statusline preferences.
  • Back/Alt+Left restores the previous level and query; Left/Backspace also goes back with an empty filter. Escape dismisses while preserving the draft.
  • Edit rename/directory arguments directly in the composer. Editing reviewed arguments invalidates their capability and obtains fresh options.
  • Retain explicit C confirmation for session-setting writes, exact session/revision/choice scoping, expiry checks and stale-result rejection. Filtering, browsing and Enter never implicitly confirm those writes; hidden confirmation controls cannot fire after a resize.
  • Ctrl+R refreshes command availability without interpreting typed letters as dashboard shortcuts. Clicking the composer keeps the expansion open.
  • Successful changes clear old catalogues and return focus to a clean composer. Preserve ordinary unsent drafts, including when the unfocused slash shortcut is used.
  • Keep a compact picker for read-only sessions without a composer. Add /commands as a root-list alias.
  • Update README navigation guidance.

Filters, configurable telemetry presentation and command-menu changes are terminal-only. The ready-session activity correction is shared by TUI and web. No new API/write capabilities, dependencies or background polling.

Validation

  • Reproduce 4 sessions / 3 CHECK / 0 ACTIVE before the fix and verify 1 ACTIVE afterwards. Cover quiet zero-token sessions, all exact states, missing/unknown status and reader-level daemon disconnection, plus summary/filter consistency.
  • Full core suite with race detection: go test -race -timeout 10m -skip '^TestLocalisedScreens$' ./...
  • All 17 language options pass the full race-enabled screen/click-surface matrix; the final inline command and checkbox click tests also pass across every language.
  • Native Windows command, suggestion, checkbox, statusline and navigation regressions pass.
  • Regressions cover nested filtering/completion, keyboard and rendered mouse surfaces, draft/history retention, invalidated reviews, hidden-confirmation safety and fresh catalogue revisions.
  • go vet ./..., formatting and git diff --check.
  • Local Linux and Windows amd64 binaries rebuilt.

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.

🟡 Changes recommended

Unresolved moderate issues remain in telemetry deduplication, command picker behavior, filter hit testing, and focus restoration.

3 open issues
What changed in this PR

Adds terminal session filtering, prioritized telemetry, keyboard focus navigation, composer-driven command menus, and improved ready-session activity detection.

Changes:

  • Adds Active/Working and attention filters with keyboard and mouse navigation.
  • Reuses /statusline preferences for session telemetry.
  • Adds inline command browsing, filtering, confirmations, and responsive popups.
  • Preserves drafts and improves quiet ready-session activity handling.
File Summary
README.md Documents filters, telemetry, and command navigation.
internal/​ui/​view.go Adjusts hints during header focus.
internal/​ui/​monitor.go Renders filtered rows and prioritized telemetry.
internal/​ui/​monitor_test.go Updates telemetry fallback coverage.
internal/​ui/​monitor_summary.go Adds filter summaries and focus styling.
internal/​ui/​monitor_summary_test.go Tests summary counts and responsive layout.
internal/​ui/​monitor_suggestions.go Shares popup rendering and sizing.
internal/​ui/​monitor_statusline.go Supplies per-session telemetry values.
internal/​ui/​monitor_statusline_test.go Tests telemetry prioritization.
internal/​ui/​monitor_schedule.go Clears header focus for scheduling.
internal/​ui/​monitor_queue.go Clears header focus for queue editing.
internal/​ui/​monitor_prompt.go Clears header focus when focusing the composer.
internal/​ui/​monitor_navigation.go Extends navigation through filters and headers.
internal/​ui/​monitor_navigation_test.go Updates navigation boundary coverage.
internal/​ui/​monitor_name_test.go Updates compact telemetry expectations.
internal/​ui/​monitor_model_test.go Tests telemetry fallback behavior.
internal/​ui/​monitor_header_focus.go Implements keyboard header traversal.
internal/​ui/​monitor_header_focus_test.go Tests focus navigation and hit surfaces.
internal/​ui/​monitor_filter.go Implements session filters and filter focus.
internal/​ui/​monitor_filter_test.go Tests filtering, paging, and focus behavior.
internal/​ui/​monitor_context.go Integrates filter and focus handling.
internal/​ui/​monitor_context_modes.go Preserves filtered context visibility.
internal/​ui/​monitor_commands.go Adds inline command menus and filtering.
internal/​ui/​monitor_commands_test.go Updates command-menu coverage.
internal/​ui/​monitor_commands_inline.go Implements composer-driven command interaction.
internal/​ui/​monitor_commands_inline_test.go Tests nested menus, drafts, and confirmations.
internal/​ui/​monitor_command_popup.go Defines responsive popup geometry.
internal/​ui/​monitor_command_popup_test.go Tests popup rendering and controls.
internal/​ui/​monitor_close_all.go Scopes bulk dismissal to filtered sessions.
internal/​ui/​model.go Stores filter and focus state.
internal/​ui/​localisation_test.go Adds localized surface coverage.
internal/​ui/​english_snapshot_test.go Updates presentation snapshots.
internal/​codex/​session_ready_activity_test.go Tests quiet ready-session activity.
internal/​codex/​live_usage.go Preserves activity for confirmed idle sessions.

Review effort: Lite

Comment thread internal/ui/monitor_command_popup.go
Comment thread internal/ui/monitor_header_focus.go
Comment thread internal/ui/monitor_statusline.go
@merefield
merefield merged commit 4a89352 into main Oct 19, 2026
6 checks passed
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