feat(status-bar): import Claude Code status aggregator behind spawnTerm flag#63
Merged
Merged
Conversation
Import the Claude Code session-status aggregator status-bar component from upstream and gate it behind a new spawnTerm feature flag so it is OFF by default and only offered when explicitly enabled. - New: iTermStatusBarClaudeCodeComponent.swift and ClaudeCodeStatusPopoverViewController.swift (sources/StatusBar/Components), registered to the iTerm2SharedARC target; unit tests in ClaudeCodeSummaryBuilderTests.swift (ModernTests synchronized group). - New feature flag spawnterm.claude_statusbar (default OFF), added in the shell KNOWN_FLAGS, the Python KNOWN_FLAGS dict, and iTermSpawnTermCapabilities (capabilityIdentifiers + display name), so it renders as a checkbox in Settings > General > AI > spawnTerm. - Gated registration: iTermStatusBarSetupViewController only offers the component when [iTermSpawnTermCapabilities isEnabledForCapability: @"claude_statusbar"] is YES; stock behavior is unchanged when OFF. - Adapted PTYSession.name handling (nonnull in our tree) to avoid a nil-coalescing warning under warnings-as-errors. - Docs: spawnterm/docs/feature-flags.md and docs/notes-3.7.txt. Adapted from upstream gnachman#648 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
Review by tech-lead — code APPROVED by inspection; build UNVERIFIED (environment). Import do upstream gnachman#648 adaptado à nossa árvore (pbxproj rejeitado → add_file_to_xcodeproj.rb; setup VC re-aplicado à mão; arquivos movidos p/ sources/StatusBar/Components; ajuste nonnull p/ warnings=erros). Higiene limpa (sem vazamento).
|
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.
Closes #58
Summary
Imports the Claude Code session-status aggregator status-bar component from upstream gnachman#648, gated behind a new spawnTerm feature flag so it is OFF by default and only offered when explicitly enabled.
The component aggregates Claude Code session statuses (Waiting / Working… / Idle) across all windows, showing a summary in the status bar and a clickable popover listing each session (click a row to reveal that session).
Feature flag (new):
spawnterm.claude_statusbar— default OFFWired in all three synced places plus docs:
spawnterm/flags/spawnterm-flag— added to the shellKNOWN_FLAGS.spawnterm/flags/spawnterm_flag.py— added to theKNOWN_FLAGSdict with a one-line description.sources/Settings/iTermSpawnTermCapabilities.m— added to bothcapabilityIdentifiersand thedisplayNameForCapability:map ("Claude Code Status Bar"), so it renders as a checkbox in Settings → General → AI → spawnTerm.spawnterm/docs/feature-flags.md— added to the seeded-schema example and the flag-schema table.Shell/Python parity verified:
bash spawnterm/flags/tests/test_flags.sh→ PASS=26 FAIL=0 (includes byte-for-byte config parity, which fails if the twoKNOWN_FLAGSdiverge).Where activation is gated
In
sources/StatusBar/Setup/iTermStatusBarSetupViewController.m-loadElements, the component class is appended to the offered-components list only when[iTermSpawnTermCapabilities isEnabledForCapability:@"claude_statusbar"]returns YES (header imported). When the flag is OFF (default), the component is not offered or registered — stock behavior is unchanged.Files changed
sources/StatusBar/Components/iTermStatusBarClaudeCodeComponent.swift(new)sources/StatusBar/Components/ClaudeCodeStatusPopoverViewController.swift(new)ModernTests/ClaudeCodeSummaryBuilderTests.swift(new; ModernTests is afileSystemSynchronizedGroupstarget, so no pbxproj entry is needed)sources/StatusBar/Setup/iTermStatusBarSetupViewController.m(gated registration + import)sources/Settings/iTermSpawnTermCapabilities.m(flag)iTerm2.xcodeproj/project.pbxproj(two source files registered toiTerm2SharedARCviatools/add_file_to_xcodeproj.rb; 8 lines, both in the Sources phase — no.hin a compile phase)spawnterm/flags/spawnterm-flag,spawnterm/flags/spawnterm_flag.py,spawnterm/docs/feature-flags.md,docs/notes-3.7.txtNo submodule pointers,
ThirdParty/, or version-stamp artifacts were committed.Provenance
Adapted from upstream gnachman#648 ("status-bar: Claude Code session status aggregator component"). The upstream PR's 9 commits were squashed via
gh pr diff 648 --patchand applied withgit apply --reject.sources/StatusBar/Components/layout.iTerm2.xcodeproj/project.pbxprojhunks were rejected (our fork's project differs); the two files were instead registered withtools/add_file_to_xcodeproj.rb … iTerm2SharedARC, matching how upstream added them (build file + file ref + group + Sources phase).iTermStatusBarSetupViewController.mhunk did not apply (our file lives atsources/StatusBar/Setup/); the change was re-applied by hand and gated on the feature flag.Adaptation for our tree
PTYSession.nameis nonnull in this fork (insideNS_ASSUME_NONNULL), so upstream'ssession.name ?? sessionIDwould trigger a "non-optional left side of nil-coalescing" warning under warnings-as-errors. Replaced with an empty-string fallback that preserves the intent. All other APIs used by the imported code (iTermSessionTabStatus,SessionStatusController.instance+ observer signature,NotifyingDictionary.values,revealSession(withGUID:),session(withGUID:),iTermStatusBarTextComponentoverrides, status-bar position prefs) were verified present in this tree.Build status — HONEST
Not a green build. This environment cannot compile iTerm2.
tools/build.sh Developmentfails during the dependency phase, before any iTerm2 source is reached:The
CNoiseC target (a CompanionCore dependency) builds before theiTerm2SharedARCsources, so the newly added Swift files never reach the compiler here. The change is therefore verified correct-by-inspection against the current tree (APIs confirmed, pbxproj/target wiring confirmed, flag parity tests green), not by a successful compile.🤖 Generated with Claude Code