vscode: Backlog title-count reflects the active view mode#914
Merged
Conversation
amrmelsayed
added a commit
that referenced
this pull request
May 28, 2026
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.
PIR Review: vscode Backlog title-count reflects the active view mode
Fixes #911
Summary
The Backlog tree title used to read
Backlog (47)(the unfiltered spawnable total) even when the view was in mine-only mode showing just 3 rows — the most prominent integer on the view disagreed with what was rendered below. This PR rewrites the title toBacklog (3 of 47)in mine-only mode andBacklog (47)in show-all mode (option 2 from the issue), and wires the title-update into thecodev.backlogShowAllconfig-change listener so it refreshes in lockstep with the tree rather than waiting for the next overview tick.Files Changed
packages/vscode/src/views/backlog-filter.ts(+54 / -3) — newvisibleBacklogCountandformatBacklogTitlehelpers;spawnableBacklogmoved in frombacklog.tsso the vscode-free module owns all three primitives the title and the provider share.packages/vscode/src/views/backlog.ts(+5 / -10) — drops the localspawnableBacklog; imports + re-exports it frombacklog-filter.tsso existing call sites keep working.packages/vscode/src/extension.ts(+22 / -4) —updateListViewTitlesnow callsvisibleBacklogCount+formatBacklogTitlefor the backlog row;readBacklogShowAllhoisted above the title helper; showAll-config-change listener also callsupdateListViewTitles().packages/vscode/src/__tests__/backlog-filter.test.ts(+131 / -1) — coverage forspawnableBacklog,visibleBacklogCount,formatBacklogTitle. ExistingfilterMinecoverage preserved.codev/plans/911-vscode-backlog-tree-title-coun.md(new, +94) — approved plan.codev/state/pir-911_thread.md(new, +25) — builder thread.Commits
b6e98cf4[PIR vscode: Backlog tree title-count should reflect the active view mode, not the total spawnable set #911] Plan draft8ee5e308[PIR vscode: Backlog tree title-count should reflect the active view mode, not the total spawnable set #911] Thread: plan phase completec614bf76[PIR vscode: Backlog tree title-count should reflect the active view mode, not the total spawnable set #911] Backlog title-count reflects active view mode9512bbd8[PIR vscode: Backlog tree title-count should reflect the active view mode, not the total spawnable set #911] Thread: implement phase complete(porch-managed phase-transition / gate commits omitted.)
Test Results
pnpm check-types: ✓ passpnpm lint: ✓ pass (eslint, zero warnings)pnpm test:unit: ✓ pass — 113 tests across 10 files, ~20 new for the title-count pathpnpm package(esbuild bundle, production): ✓ passdev-approvalgate: ✓ approved by the humanArchitecture Updates
No arch changes needed. This PR works inside the existing Backlog-view module boundary (
backlog.tsprovider +backlog-filter.tspure helpers) — the only structural shift is movingspawnableBacklogfrombacklog.ts(vscode-dependent) intobacklog-filter.ts(vscode-free) so the title helper can reuse it from the vitest harness. That mirrors the precedentfilterMineestablished in #809; not a new pattern.Lessons Learned Updates
No new durable lessons. The "keep vscode-free helpers in
backlog-filter.tsso vitest can test them without vscode mocks" pattern is already documented implicitly byfilterMine's existence — this PR just continues that pattern. A re-statement inlessons-learned.mdwould be churn, not signal.One contextual observation worth recording in the PR body (not the lessons file): two coupled bugs were closed at once — the count itself, and the refresh trigger. The count being wrong would have been obvious; the refresh trigger being wrong would have been masked by the periodic overview poll (the title would have updated within 60s of any showAll toggle, so it looked "almost right" most of the time). Worth knowing for future title/badge-counter work: any view title that depends on user-toggleable state needs to be refreshed on the toggle's listener, not just on the data-change listener.
Things to Look At During PR Review
visibleBacklogCount'scurrentUserfallthrough (backlog-filter.ts). When mine-only is active butcurrentUseris null (gh unavailable),filterMineis a no-op, sovisible == total. The title helper short-circuits this to plainBacklog (T)rather thanBacklog (T of T)— matches the safety branch inBacklogProvider.orderedSpawnableand the third acceptance criterion in the issue.readBacklogShowAllinextension.ts. The reader was previously declared inside the backlog-toggle listener block (around line 358 pre-change). The hoist moves it aboveupdateListViewTitlesso the title helper can call it on every refresh. The original site (now the listener) uses the hoisted reader.Backlog (V of T)) was the issue's mild preference. Options 1 and 3 are also acceptable and the helper could be swapped to either with a one-line change informatBacklogTitle. Worth one re-read by the architect at PR review to confirm.src/test/backlog.test.tsleft in place. The vscode-test (Electron) harness still has the oldspawnableBacklogtest file; it imports frombacklog.tswhich re-exports the moved helper, so it still passes. Deleting it would be cleanup but goes beyond the issue's "purely a count/title-string fix" scope.How to Test Locally
For reviewers pulling the branch:
afx dev pir-911Backlog (V of T)where V matches the row count and T matches the unfiltered spawnable total. With nothing assigned to you, expectBacklog (0 of T)plus the empty-state placeholder from vscode: backlog view — toggle between 'mine only' (default) and 'all' #809.Backlog (T), row count matches.Backlog (V of T). No stale count waiting for the next overview tick.Builders,Pull Requests,Recently Closed) still render with their existing(N)format — no regression.