fix(status-line): honor hidden jobs segment for background job count - #3784
Open
pers0n4 wants to merge 1 commit into
Open
fix(status-line): honor hidden jobs segment for background job count#3784pers0n4 wants to merge 1 commit into
pers0n4 wants to merge 1 commit into
Conversation
`#collectStatusSegments()` appended a hardcoded "N jobs running" chip to the right group after rendering the configured segments, without consulting `statusLine.leftSegments` / `statusLine.rightSegments`. Setting the `jobs` segment to hidden in `/settings` removed only the monitor/cron widget, while the async background-job counter kept rendering with the same icon and the same `statusLineSubagents` color, so the setting looked ignored. `async.enabled` does not help either: `isBackgroundJobSupportEnabled()` always returns true, so the manager and the counter exist in every top-level session. Gate the counter on the `jobs` segment placement resolved by `#resolveSettings()`, so preset and `preset: custom` users share one code path. Every bundled preset keeps `jobs` in `rightSegments`, so default output is unchanged. Lore-id: 4b7e2c19 Rejected: new statusLine.showBackgroundJobs setting | duplicates the existing jobs segment placement the user already set Confidence: high Scope-risk: narrow Reversibility: clean Tested: jobs-segment suite (7); status-line-*, jobs-*, interactive-mode-status (130); biome check Not-tested: live TUI overflow trimming when the counter is the last right-group entry
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.
What
Hiding the
jobsstatus-line segment now also hides the background-job counter.StatusLineComponent#collectStatusSegments()appended a hardcodedN jobs runningchip to the right group after rendering the configured segments, without ever consultingstatusLine.leftSegments/statusLine.rightSegments:This PR gates that counter on the
jobssegment placement resolved by#resolveSettings(), so preset users andpreset: customusers share one code path.Why
GJC has two independent job-rendering paths:
jobssegment (status-line/segments.ts)JobsObserversnapshot — monitor/cron countsleft/rightSegmentstool-status-header.ts:809)AsyncJobManagerrunning jobs minus monitors — async bash / task subagentsSetting
jobsto hidden in/settingscalls#setSegmentPlacement(), which only removes"jobs"from the two arrays. The legacy chip never reads those arrays, and it renders with the sametheme.icon.agentsglyph and the samestatusLineSubagentscolor as the segment — so the user sees an identical-looking job indicator survive the setting and concludes it was ignored.Turning off
async.enableddoes not help either:isBackgroundJobSupportEnabled()unconditionally returnstrue, soAsyncJobManagerexists in every top-level session and the chip appears whenever any non-monitor background job runs.Existing coverage missed this because both legacy-chip tests in
test/jobs-segment.test.tsconfigurerightSegments: ["jobs"]; there was no hidden-placement case.Every bundled preset keeps
jobsinrightSegments(asserted by the existingAC4test), so default output is unchanged. Only users who explicitly hid the segment see a difference — which is the point.Testing
The new regression test fails on the parent commit with exactly the reported symptom:
Known unrelated failure on
devRoot
bun run checkcurrently fails atcheck:sdk-closureon unmodifiedorigin/dev(9d0a1c3), before and after this change:Both test files exist on
devbut are absent fromscripts/telegram-daemon-generation-manifest.json, which was last regenerated at45bc057— beforeb8ea855anda10c6deadded those tests. This PR touches neither the manifest nor any notifications code; the drift is pre-existing and out of scope here.GJC verdict
No independent architect/critic/human review has happened — the author of this change is also the only party that has looked at it, and the template treats self-approval as BLOCK.
Head:
4b240ca04fe80369e00d183047124ad4d4741139Hash reproduces with
git diff origin/dev..HEAD | shasum -a 256.devbun checkpasses — package-levelbun --cwd=packages/coding-agent run checkpasses; rootbun run checkfails only at the pre-existingcheck:sdk-closuretelegram manifest drift documented above