Skip to content

[codex] Sync sidebar cursor with active target - #39

Merged
samleeney merged 1 commit into
mainfrom
codex/sync-sidebar-selection
Jun 24, 2026
Merged

[codex] Sync sidebar cursor with active target#39
samleeney merged 1 commit into
mainfrom
codex/sync-sidebar-selection

Conversation

@samleeney

Copy link
Copy Markdown
Owner

Summary

Fix the sidebar cursor so it follows the active tmux target on startup and whenever the active client session/window/pane changes.

Root cause

The sidebar kept its keyboard cursor at the first selectable session row unless the user moved it. The active tmux target was rendered separately with the current-row styling, so the UI could show an unrelated row with the grey cursor and arrow while the real active row was also highlighted.

Changes

  • Add a small sidebar selection helper that finds the best selectable row for the active target.
  • Prefer exact pane matches, then active window rows, then the active session/worktree row.
  • Sync the sidebar cursor after collecting a changed active client target.
  • Add regression coverage for session, pane, window fallback, inbox duplicate, and worktree selection cases.

Validation

  • bash -n scripts/sidebar.sh scripts/lib/sidebar-selection.sh tests/sidebar-active-selection.sh
  • for t in tests/*.sh; do bash "$t"; done

@samleeney
samleeney marked this pull request as ready for review June 24, 2026 08:01
@samleeney
samleeney merged commit 037af05 into main Jun 24, 2026
0 of 2 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.

1 participant