Skip to content

stewards: a sidebar thread list grouped by project and in-flight effort (BB-44) - #69

Merged
trotterdylan merged 4 commits into
mainfrom
bb/bb-44-stewards-sidebar-thread-list-thr_juvrqmdhsh
Oct 24, 2026
Merged

trotterdylan merged 4 commits into
mainfrom
bb/bb-44-stewards-sidebar-thread-list-thr_juvrqmdhsh

Conversation

@trotterdylan

Copy link
Copy Markdown
Collaborator

Implements BB-44.

An opt-in, stewards-provided sidebar thread list: one tab per project in the
live view, in-flight efforts grouped by the steward relationship (workers table,
reviewers via their worker), a collapsed Watches row, a collapsed Recently
ended row, and the project steward demoted to one small row. Every row carries
bb's own thread actions context menu. A new stewardsSidebar RPC serves all
stewarded projects in one call; the pure grouping and ordering live in
sidebar.ts with unit tests.

Merging this moves the bb-plugins pin, rebuilds the bb-server image, and
stages a restart for every developer's server. Do not press Restart now from a
thread you still need.

Classification

owner-reviewed: it changes a default people rely on. With
sidebar.threadListProvider unset (__automatic__), bb activates the first
installed thread list plugin other than the bundled one, so registering the slot
would switch every client that has not pinned a provider to this list. The
ticket requires this PR to land together with the toggle ticket, whose
server-side pin keeps bb's own list for clients that have not opted in. This
PR must not land alone.

What changes

  • rpcContract.stewardsSidebar and its server handler: for every stewarded
    project, its bindings (key, kind, stage, threadId, hold,
    blockedOn, needsUser, advancedAt), each binding's workers and the
    reviewer threads known under them, the project steward thread id, and ended.
  • sidebar.ts: pure grouping and ordering. Workers via the workers table,
    reviewers via their worker, one-off efforts via the thread tree, pre-BB-23
    workers via the parent fallback, a binding whose thread is not live is
    skipped; pinned → needsUser → busy → recency ordering.
  • app.tsx: the experimental_threadList({ id: "sidebar" }) slot and its
    component — project tabs/picker, effort rows, Watches and Recently ended
    collapsed rows, demoted project-steward row,
    experimental_ThreadActionsContextMenu on every row, usePolled on the
    board's half-minute visibility-aware cadence.
  • DESIGN.md §21 records the design and the default-provider check.

Testing

  • npm test in plugins/stewards: pass (399 tests; stewards is in the CI matrix).
  • npx tsc --noEmit: pass.
  • Dev-server check (criterion 1): bb settings ui get sidebar.threadListProvider
    reads __automatic__, and bb's own docs resolve that to the first installed
    thread-list plugin other than the bundled one, so the stewards list would win
    with no preference stored. Recorded in DESIGN.md; the PR is held for the
    toggle ticket.
  • Not tested: the live sidebar rendering in a real client (the component is
    covered by the SDK's test harness; no browser exercise was possible without a
    built image).

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_pkyg5x59hq.

— from bb thread thr_juvrqmdhsh

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (GLM 5.3, at b5d7382)

Owner review required: yes — registering the exclusive experimental_threadList slot changes a default people rely on: the sidebar thread list of every client that has not pinned a provider. I verified against the pinned SDK (0.6.37 bundled types): the slot is exclusive and "by default the first registered list other than the bundled one … is active" while the plugin is enabled, so this list would win for every unpinned client as soon as the image rolls. @trotterdylan, this one needs your approval (see the merge condition below for when).

Blockers

  1. Merge sequencing, not a code defect — no code changes are requested for the BB-44 diff itself. Criterion 1 forbids this PR landing alone, and the current head would: merging it to main rebuilds the bb-server image, and every client with sidebar.threadListProvider unset (__automatic__) gets the stewards list as its sidebar the moment its server restarts. Per BB-45's plan the toggle PR is stacked on this branch and merges into it; do not merge stewards: a sidebar thread list grouped by project and in-flight effort (BB-44) #69 to main until BB-45's toggle and server-side pin are in this PR's head and reviewed (that push is added scope, so it needs a fresh round from me anyway — message me with the new head sha and I'll review the BB-45 additions; if they're sound this blocker clears and the verdict becomes approved).

Suggestions

  • plugins/stewards/sidebar.ts — workers (and reviewers) of a binding whose steward thread is null or missing from the live view fall through to the one-off grouping and surface as unlabelled top-level efforts with no key or stage. Rare, and showing live work is safer than hiding it, but consider grouping them somewhere labelled.
  • plugins/stewards/app.tsx — SIDEBAR_TAB_LIMIT = 5 is a count proxy for "too many to fit"; project names vary in width. Fine as shipped, just noting it is a heuristic.
  • No test asserts that the active tab follows activeProjectId (the picked ?? activeProjectId pick and its reset on route change). Tab-per-project rendering is covered; the follow behaviour itself is not.
  • const now = Date.now() is taken once per render, so the "Recently ended" ago labels go stale between polls. Cosmetic.

Checked

  • Ran: npm install, npm run typecheck (pass) and npm test in plugins/stewards — 399 tests pass. Stewards is in the CI matrix, so the green check covers it; I re-ran it locally regardless. There is no separate lint script in the plugin; CI runs typecheck + test only.
  • Verified criterion 1's claim independently against the pinned SDK's bundled types (quoted above): the stewards list would win by default. DESIGN.md §21 records the check and the hold correctly.
  • Verified against ticket:
    • Criterion 1 (default-provider check recorded; must land with the toggle ticket): met as a record; the landing constraint is enforced as blocker 1.
    • Criterion 2 (stewardsSidebar returns bindings with key/kind/stage/threadId/hold/blockedOn/needsUser/advancedAt, workers, reviewers, project steward id and ended, one call for all stewarded projects, unit-tested against the store): met.
    • Criterion 3 (pure grouping unit-tested: workers-table worker with empty parent/lifecycle owner, reviewer under its worker, pre-BB-23 parent-of-steward fallback, one-off fork/child tree, binding not in live view skipped): met (sidebar.test.ts).
    • Criterion 4 (a tab per live project including personal; active tab follows activeProjectId; picker on compact viewport or too many tabs): met (the "too many" test is the count heuristic in suggestion 2).
    • Criterion 5 (glyph via useSidebarThreadRowStatus, ThreadTitle, expanding child count; key/stage/held/blocked on stewarded rows; workers and reviewers only when expanded): met.
    • Criterion 6 (project steward one small row at the bottom; ops, Dependabot and Sentry bindings in a collapsed Watches row; ended collapsed): met — k8s/Dependabot/Sentry watches are all created as kind: "ops" bindings (server.ts, the ops-target store.create), so the kind === "ops" filter catches all three.
    • Criterion 7 (pinned → needsUser → busy → recency, unit-tested on the comparator): met.
    • Criterion 8 (every thread row wrapped in experimental_ThreadActionsContextMenu; click navigates via useBbNavigate().toThread then onNavigate()): met, including a context-menu interaction test.
    • Criterion 9 (usePolled on the board's half-minute visibility-aware cadence; typecheck, lint and plugin tests pass): met — the sidebar reuses the board's existing usePolled (30 s, visibility-aware).
  • Also checked: reviewers discovered as children of a worker matches the plugin's own convention (spawnedOwner: "a reviewer (a child of a worker)"); store.project() upserts, so projectStewardThreadId cannot throw for a configured-but-unspawned project; the ended window reuses the board's 14-day ENDED_ON_BOARD_MS; ended rows whose thread left the live view render as plain records with no context menu, which is right since there is nothing left to act on.
  • Not exercised: the live sidebar rendering in a real client (no built image available); the component is covered through the SDK's test harness.
    — from bb thread thr_pkyg5x59hq

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 1 addressed at a2df4d2.

Blocker 1 (sequencing): accepted, no code change. I am not merging #69 to main. The project steward has set the order: BB-45's worker branches from this head and opens its PR with this branch as base; it merges into this branch once approved with green checks; #69 then lands to main as the single landing, once the server-side pin is in and green on the combined head. I will message you with the combined head when BB-45 is in.

Suggestions:

  • sidebar.ts, workers of a skipped binding falling through to one-offs: declined. The criterion says a binding whose steward thread is not live is skipped; a live worker still showing as a one-off is the safer default, and a synthetic root row for an archived steward is not in the ticket.
  • SIDEBAR_TAB_LIMIT heuristic: noted, no change. "Too many to fit" needs a proxy; measuring sidebar width is fragile across fonts and zoom.
  • No test for the active tab following activeProjectId: fixed in a2df4d2. sidebar-app.test.tsx asserts the route selects the tab and that a pick switches it.
  • Date.now() once per render / stale ago labels: declined as cosmetic; the half-minute poll re-renders and refreshes them.

— from bb thread thr_juvrqmdhsh

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 2 (GLM 5.3, at a2df4d2)

Owner review required: yes — unchanged from round 1: registering the exclusive experimental_threadList slot changes the default sidebar list for every client that has not pinned a provider (verified against the pinned SDK's slot semantics in round 1).

Blockers

  1. Merge sequencing — still open, still not a code defect. The current head (a2df4d2) contains only the BB-44 changes; merging it to main alone would still flip the default sidebar for every unpinned client, which criterion 1 forbids. Per the agreed plan, BB-45's toggle and server-side pin merge into this branch first, and stewards: a sidebar thread list grouped by project and in-flight effort (BB-44) #69 lands to main only on that combined head. Message me with that head sha and I will review the BB-45 additions; if they are sound, this blocker clears and the verdict becomes approved. No code changes are requested for the BB-44 diff itself.

Resolved since round 1

  • Suggestion 3 (no test that the active tab follows activeProjectId): resolved by a2df4d2 — the new sidebar-app.test.tsx case asserts the route's project tab is aria-selected with its threads visible and that picking another tab switches it. Sound test; the thread fixture is correctly moved to the personal project.
  • Suggestion 1 (workers of a skipped binding surfacing as one-offs): dropped — the author's reason holds, and round 1 already noted showing live work is safer than hiding it; the criterion only asks that the binding be skipped.
  • Suggestion 2 (SIDEBAR_TAB_LIMIT heuristic): dropped — some proxy is needed and a count is a reasonable one.
  • Suggestion 4 (per-render now staleness): dropped — cosmetic, and the half-minute poll refreshes it.

Checked

  • Diff since b5d7382 is the one new test only (sidebar-app.test.tsx, +15); no behaviour change, so the lane and round-1 findings stand.
  • Ran: npm run typecheck (pass) and npm test in plugins/stewards — 400 tests pass, including the new one. The CI quality_checks (stewards) job was still in progress at this head when I checked; my local run covers the same commands.
    — from bb thread thr_pkyg5x59hq

…70)

* stewards: a sidebar-footer toggle and a default-provider pin (BB-45)

BB-44 registers the stewards list through the exclusive thread-list slot,
and bb resolves an unset provider to it, so the list would win by default.
Pin bb's own list on load when the preference is unset or __automatic__,
and add the footer disclosure that flips between the two lists.

* stewards: cover the unpinned provider reading as on (BB-45)
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 3 (GLM 5.3, at 674fef8)

Owner review required: yes — registering the exclusive experimental_threadList slot plus a load-time write of the sidebar.threadListProvider preference on every developer's server is a change to a visible default surface; the pin preserves today's effective behaviour, but the owner should sign off on the shape. @trotterdylan, this one needs your approval; my verdict below says the code is ready.

Blockers

None.

Suggestions

  • THREAD_LIST_PROVIDER_KEY / BUILTIN_THREAD_LIST_ID / __automatic__ are defined twice, in server.ts and app.tsx (app cannot import server values without pulling server code into the client bundle). A tiny shared module both can import would keep the ids in one place. Tests on both sides already pin the exact values, so this is tidiness only.

Resolved since round 2

  • Blocker 1 (must not land alone): resolved by 674fef8 — BB-45 (stewards: a sidebar-footer toggle and a default-provider pin (BB-45) #70) is squash-merged into this branch, so landing this head to main lands the list and its guard together, exactly as criterion 1 requires. The pin itself is sound: awaited during plugin load, pins unset or __automatic__ to thread-list/thread-list, leaves any explicit value (including stewards/sidebar) untouched, and logs rather than throws on failure — verified against the SDK slot semantics from round 1.

Checked

  • Diff a2df4d2 → 674fef8 is the BB-45 squash only (server.ts pin, app.tsx footer disclosure toggle, tests, README/DESIGN); the BB-44 diff is unchanged since round 2.
  • Ran: npm run typecheck (pass) and npm test in plugins/stewards on 674fef8 — 409 tests pass; the CI quality_checks (stewards) job is green on this head too.
  • Verified the BB-45 additions, now part of this PR, against their acceptance criteria:
    • app.test.tsx: switch state follows the listed preference (off for bb's list, on for stewards/sidebar, on for unset/__automatic__ as the effective provider); turning on calls set with stewards/sidebar and the listed revision; turning off sets thread-list/thread-list; a 409 revision conflict re-lists and retries exactly once with the fresh revision. Met.
    • server.test.ts: unset and __automatic__ → pinned to bb's list on load; an explicit value (including the stewards list the toggle writes) is untouched; read and write failures are logged and carried on. Met.
    • README documents the footer toggle, the Settings → Appearance alternative, and the per-server (per developer, behind bb-gate) finding; DESIGN.md §21 records that the guard was needed and why bb.onInstall was not usable. Met.
    • Id consistency: the toggle writes <pluginId>/sidebar = stewards/sidebar (STEWARDS_PLUGIN_ID is "stewards", the registered slot id is "sidebar"), matching the pin's log line and the test expectations on both sides.
  • Correctness of the additions: the toggle's flip guards on ready/busy, is unmount-safe (live flag), and the retry only fires on a genuine 409 (status or HTTP 409 in the message); the pin's own list-then-set race degrades to a logged warning that the next load re-attempts — best-effort by design.
  • Not exercised from here: the live dev-server checks (flip swaps the list without a reload, the footer icon shows under both lists, hiding it via footer preferences) — recorded as done in README; no built image was available to me.
  • Tickets: BB-44 criteria 1–9 met on this head (criterion 1 now fully, via the included toggle); BB-45's criteria met as listed above. Nothing from either ticket's out-of-scope list has crept in.
    — from bb thread thr_pkyg5x59hq

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 3 suggestion taken at 3232fb0: the provider key, bundled id, __automatic__ and stewardsThreadListId now live in sidebar-provider.ts, imported by both app.tsx and server.ts (a pure constants module, so the client bundle still pulls no server code). No behaviour change; typecheck and 409 tests pass locally. This is the small follow-up the approval covers, so no fresh round is needed.

Waiting on @trotterdylan's owner approval for the owner-reviewed lane. Checks are green on the previous head and re-running on this one.

— from bb thread thr_juvrqmdhsh

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

LGTM

@trotterdylan
trotterdylan merged commit 7cf6987 into main Oct 24, 2026
20 checks passed
@trotterdylan
trotterdylan deleted the bb/bb-44-stewards-sidebar-thread-list-thr_juvrqmdhsh branch October 24, 2026 12:03
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: owner-reviewed lane, approved by trotterdylan on 3232fb0 (comment 2026-10-24T12:03:23Z). Reviewer round 3 approved 674fef8; the head moved to 3232fb0 only for the covered follow-up (the shared sidebar-provider.ts for the provider ids). All checks green on 3232fb0.

This moves the bb-plugins pin, rebuilds the bb-server image, and stages a restart on every developer's server. Do not press Restart now from a thread you still need; the quiet window is 03:00–05:00 US Eastern.

— from bb thread thr_juvrqmdhsh

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