✨ feat(status-bar): add Claude Code session status aggregator component#648
✨ feat(status-bar): add Claude Code session status aggregator component#648kud wants to merge 9 commits into
Conversation
Add iTermStatusBarClaudeCodeComponent that displays aggregated session statuses (Waiting/Working/Idle) across all windows with a clickable popover showing session details. Includes ClaudeCodeStatusPopoverViewController for navigation, ClaudeCodeSummaryBuilder for testable logic, and 21 unit tests.
- Widen status column to 96pt and increase pill right margin to 16pt to prevent clipping - Disable selection highlight (selectionHighlightStyle = .none) to avoid blue row flash - Replace resetCursorRects with NSTrackingArea + cursorUpdate for consistent pointing hand cursor across entire table view
…ll views for improved layout and hover UX
Register new Swift files iTermStatusBarClaudeCodeComponent.swift and ClaudeCodeStatusPopoverViewController.swift in Xcode project and status bar setup, integrating them into build phases and UI registration. This change updates iTerm2.xcodeproj/project.pbxproj and sources/iTermStatusBarSetupViewController.m to support new components.
Progress update✅ Done
🔲 Not yet done / known gaps
|
|
Thanks for taking this on — a status bar version of the Session Status tool is a good idea and I'd like to see it happen. However, this PR needs a different approach. Let me explain why and how to get there. The core issueThe Session Status system in iTerm2 is generic. Any program can set status text, indicator dots, and colors on any session via OSC 21337 or triggers. The toolbelt's "Session Status" tool ( What to study before starting overRead these files carefully and understand how they fit together:
Suggested approach
General adviceWhen contributing to an unfamiliar codebase, spend time reading the existing code before writing new code. The patterns are already there — your job is to extend them, not reinvent them. The toolbelt tool is your reference implementation; your status bar component should be a compact version of it, not a parallel system. Give it another shot with this framing and I think it'll come together well. |
|
@gnachman Okay, I see! I based this PR on the new Claude Integration actually. Maybe it was too Claude-centric, and you're right—we can make it more generic. I will have another round then. Thanks for the explanation. |
Ticket
Description
Adds a new status bar component,
iTermStatusBarClaudeCodeComponent, that aggregates Claude Code agent statuses across all open iTerm2 windows and surfaces them as a compact label in the status bar (e.g. "2 waiting, 1 working", "1 idle", "No sessions").The component reads session statuses that were written by Claude Code triggers — specifically the three sentinel values "Waiting", "Working…", and "Idle" — via the existing
SessionStatusControllerobservable dictionary. It subscribes to changes and updates the label reactively.Interaction model:
ClaudeCodeStatusPopoverViewController) listing each session name, a coloured status dot derived from the trigger's configured colour, and the status text. Selecting a row navigates to that session and closes the popover.Implementation notes:
ClaudeCodeSummaryBuilderis a pure-logic enum holding the three sentinel strings and thebuildSummary(from:)/isClaudeCodeStatus(_:)helpers, deliberately separated from the heavyweight status-bar component hierarchy so the logic can be unit-tested without a running app.ModernTests/ClaudeCodeSummaryBuilderTests.swiftcover empty sessions, single/multiple counts, all three statuses, mixed combinations, and the sentinel filter.iTermStatusBarSetupViewController.mso it appears in the "Add Status Bar Component" sheet.brainis used as the component icon (available on macOS 12+, matching the deployment target).TODOcomment in the popover notes a planned Allow/Deny button row, deferred until a safe mechanism exists for targeting the correct Claude TUI session.Screencast
No visual changes to existing UI — this is an additive component. To see it in action, add "Claude Code" from the status bar component picker, then start a session whose status bar is being driven by Claude Code triggers.
How to Validate
make run.SessionStatusControllerupdates from the debugger.tools/run_tests.expect ModernTests/ClaudeCodeSummaryBuilderTests.Developer Checklist
ModernTests/ClaudeCodeSummaryBuilderTests.swift)it_fatalErrorinstead offatalErrortools/add_file_to_xcodeproj.rb