Skip to content

Remove dead sidebar leftovers and low-value app tests - #4372

Merged
SawyerHood merged 1 commit into
mainfrom
bb/test-audit-app-thr_s3kmw74uzx
Sep 25, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
bb/test-audit-app-thr_s3kmw74uzx

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

When the sidebar moved into the thread-list and navigation plugins (#4036, #4041, #4117, #4140), the old app and client-core copies stayed behind. Nothing in the shipped app renders or calls them, but their tests kept them compiling and passing. The shipped plugin copies have their own tests. A few other app tests could not fail: they restated constants or asserted a flag inside a block that only runs when the flag has that value. Others were near-duplicates of a stronger test.

What changed

Found by a read-only test audit using the repo test-audit skill (#4361).

  • Deletes dead code that nothing in the shipped app calls, and the tests that only exercised it:
    • ThreadArchiveQuickAction and ThreadActionsContextMenu (the plugin copies ship)
    • SidebarRenameProvider, the app's sidebar row state classes, the drop-animation constant and the sidebar lifecycle atom
    • useSystemProviderUsageLimits and its query key (unused since Discover plugin RPC contracts and move usage displays into Provider Usage #3449), and getAppCommandMetadata
    • client-core's environment grouping, sort policy and pinned-root ordering. The only live callers read effectivePinnedThreadIds or pass their own comparator.
    • the unused hasRunningPluginStatus parameter, and the plugin copy of arrangeByStoredOrder
  • The theme-preview anatomy anchor now points at plugins/thread-list/app/rows/sidebarRowClasses.ts, the file that actually renders the rows.
  • Folds duplicate suites into table tests at their owners: bundle budget, command ordering, isRowExpandable, steer rendering and child activity.
  • Deletes tests that restate constants or cannot fail.
  • Adds two tests after coverage verification:
    • an unpinned parent stays out of effectivePinnedThreadIds;
    • the terminal enables xterm's proposed API, which the Unicode 11 addon requires. This builds a real Terminal.

Production +59/−706, tests +476/−1618.

How you verified

  • pnpm exec turbo run test lint typecheck passes for @bb/app, @bb/client-core, @bb/thread-view, bb-plugin-thread-list and bb-plugin-theme-preview, plus typecheck of every client-core and thread-view dependent.
  • An independent verifier used before and after worktrees on 175d5ac and 55 mutations. For each of the 75 removed or merged tests, it wrote the bug that test catches as a production change and checked that the old test fails and a remaining test also fails.
    • Result: 64 OK, 10 with no unique failure mode, 1 lost. The lost assertion is restored above.
    • The live callers RootComposeMobileRecents and useSidebarThreadReveal still fail on sort or pin mutations.
  • Known gap, not caused by this change: the rename-cancel effect in useSidebarRename was untested before and after.

AGENT GENERATED

🤖 Generated with Claude Code

Removes dead app copies of sidebar/thread-list code left after the
thread-list plugin fork (ThreadArchiveQuickAction, ThreadActionsContextMenu,
SidebarRenameProvider, sidebar row state classes, the drop-animation
constant, the sidebar lifecycle atom), the unused
useSystemProviderUsageLimits hook and query key, getAppCommandMetadata,
client-core environment grouping/sort policy/pinned-root ordering, the
unused hasThreadListWorkingActivity plugin-status parameter, and the
plugin copy of arrangeByStoredOrder, together with the tests that only
kept them alive. Constant-restating and tautological tests are deleted;
duplicate suites are folded into tables at their owners (bundle budget,
command ordering, isRowExpandable, steer rendering, child activity).
The theme-preview anatomy anchor now watches the plugin's
sidebarRowClasses.ts, which renders the rows.

Coverage verification found one lost assertion
(a pinned child's unpinned parent must stay out of
effectivePinnedThreadIds), restored as a pinnedSidebarThreads keeper,
and one retained dependency contract: the terminal must allow xterm's
proposed API because the Unicode 11 addon requires it. That guard now
constructs a real Terminal with TERMINAL_ALLOW_PROPOSED_API and loads
the addon.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@SawyerHood
SawyerHood merged commit 4843e34 into main Sep 25, 2026
40 of 42 checks passed
@SawyerHood
SawyerHood deleted the bb/test-audit-app-thr_s3kmw74uzx branch September 25, 2026 22:33
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