Skip to content

Add My PRs plugin for authored pull requests - #27

Merged
trotterdylan merged 14 commits into
mainfrom
bb/pr-inbox-from-workstreams
Oct 20, 2026
Merged

trotterdylan merged 14 commits into
mainfrom
bb/pr-inbox-from-workstreams

Conversation

@mjsz

@mjsz mjsz commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

My PRs adds a standalone Your turn view for human feedback on authored pull requests. It uses Workstreams' feedback rules and runs alongside Review Watch without requiring Workstreams. Authentication defaults to the BB server's gh login across organizations, and an empty repository allowlist includes every accessible repository.

The page follows Reviews' compact layout: centered content, area groups, aligned repository/PR references, feedback chips, and a fixed selection bar. A distinct branch icon identifies My PRs. Group and range selection, b to address, and Esc to clear use the same interaction pattern. Amber feedback text follows BB's selected light or dark theme.

Users can hold a PR out of Your turn for 1 hour, until tomorrow at 9 AM in their browser timezone, or 1 week. Held PRs move to a faded On hold section, drop out of counts and batch selection, survive new feedback and restarts, expire automatically, and can be resumed early. Address opens a project picker: each PR's organization maps to a BB project through the organizationProjects setting, with the configured project as fallback, and a batch spanning different mapped projects asks for a choice. The optional provider and model settings override the chosen project's defaults for the Address thread.

My PRs provides its live Your turn count through navPanel.experimental_useBadge. The count excludes dismissed and held PRs and any PR not on Your turn, updates on feedback events, and clears at zero. It uses the badge API introduced in SDK 0.6.53. The manifest requires SDK >=0.6.53, and development uses SDK 0.6.54. BB 0.46.0 and 0.46.1 predate this API; the remote BB server must be upgraded to a compatible build before installing this revision. The current live instance retains its last compatible plugin revision.

Users can dismiss feedback until new activity, restore it, and manually start an Address thread for one or up to 20 PRs. GitHub reads paginate and preserve the previous snapshot on failure. Dispatch refreshes the selected PRs and prevents duplicate concurrent starts. The plugin is now in the plugins CI matrix.

Validation: 43 tests, typecheck, production dependency installation, and plugin build passed. Headless Chromium rendered the actual page component with the built CSS and a saved live snapshot at 1100px and 390px, in light and dark themes; selection, footer visibility, and horizontal overflow checks passed. The Reviews reference component was rendered for visual comparison. No Address worker was started during verification.

The preceding revision is installed on BB 0.46.0 with SDK 0.6.37; this badge migration awaits a compatible server build. Live GitHub refreshes include Parsley and other accessible organizations using the same user login.

Merging this moves the bb-plugins pin: bb-gate rebuilds the bb-server image and stages a restart for every developer's server. Every server restarts when its owner presses Restart now, or in the 03:00–05:00 US Eastern quiet window.

@mjsz mjsz changed the title Add PR Inbox for authored PR feedback Add PR Feedback for authored pull requests Oct 19, 2026
@mjsz mjsz changed the title Add PR Feedback for authored pull requests Add My PRs plugin for authored pull requests Oct 19, 2026
@trotterdylan trotterdylan added the bb-managed Managed by a bb steward label Oct 20, 2026
@trotterdylan
trotterdylan marked this pull request as ready for review October 20, 2026 17:24
@trotterdylan

Copy link
Copy Markdown
Collaborator

Checks pass on 54aeb73; marked ready for review.

— from bb thread thr_g7wkn89yeb

@trotterdylan

Copy link
Copy Markdown
Collaborator

Independent review running in bb thread @thread:thr_vkvmscutqg.

— from bb thread thr_eqbda2unks

@trotterdylan

Copy link
Copy Markdown
Collaborator

Review round 1 (GLM 5.3, at 54aeb73)

No Linear ticket exists for this PR, so I read the acceptance criteria from the PR body and treated it as the ticket's title, intent and criteria, as instructed.

Owner review required: no — none of the owner-reviewed triggers apply. The diff is a new self-contained plugin directory (plugins/pr-inbox) plus an additive registry entry in .bb/plugins.json and a README table row; nothing existing changes behaviour. No source-contract.ts copies, no hooks/devbox contract, no bb-gate bb-server Dockerfile list edits (the spec does not ask for the plugin to be added to the live image, and it is not), no kploy//bc-prod.yaml/CI-workflow changes, no store migration of existing data (fresh tables in the plugin's own storage), no secret created (githubToken is a user-supplied secret setting in the standard pattern; the plugin reads GitHub only, with the server's existing gh login or the user's own token — no widened access). The new runtime dependencies (zod, @radix-ui/react-slot) are the plugin's own, not additions to shared code.

One flag I weighed per the workspace guidance: bb core is upstream and the manifest requires bbPluginSdk >=0.6.53 for navPanel.experimental_useBadge, while the live BB server runs SDK 0.6.37. SDK 0.6.53/0.6.54 is published (the dev dependency installs and typechecks against it), and since pr-inbox is not baked into the bb-server image, merging cannot break anyone's server — only manual installs from this branch on an old server are affected, and the body documents that the live instance keeps its last compatible revision. Noted, not a blocker.

Blockers

None.

Suggestions

  1. PR body omits real shipped scope. The body (the spec) never mentions the Hold feature (hold 1 hour / until tomorrow 9 AM / 1 week, faded On hold section, resume, expiry, persistence across reloads and new feedback, exclusion from counts, selection and badge) nor the organizationProjects mapping / project picker / provider/model settings. All of it is implemented, documented in the plugin README, and tested — but since the body is this PR's spec, a reader of the merged PR will not know these exist. Worth a body update before or at merge.
  2. CI matrix. pr-inbox is not in .github/workflows/plugins.yaml's matrix (nor is repo-dashboard, so this follows precedent), so a green check never runs this plugin's suite. Since it is now registered in .bb/plugins.json, consider adding it to the matrix.
  3. app.tsx — useInboxBadge builds its own useInbox(), so with the page open there are two independent inbox_get pollers (each 15 s, each fetching thread status for linked rows). Harmless, but a shared hook/context would halve the chatter.
  4. Icon claim. The body/README say "branch-and-arrow icon"; the manifest and navPanel both use icon: "GitBranch". Distinct from Reviews, yes, but I can't verify the glyph includes an arrow — cosmetic check when you next see the sidebar.
  5. server.ts — address(): if saveState throws midway through the pre-spawn for loop (sync SQLite), the addressing entries added so far leak. Vanishingly unlikely; the finally could start one loop earlier.

Checked

  • Ran myself (CI skipped pr-inbox entirely — it is not in the plugins workflow matrix): npm install --include=dev --legacy-peer-deps , npm run typecheck (pass), npm test (43/43 pass across server.test.ts, app.test.tsx, github.test.ts, feedback.test.ts, projects.test.ts), and npm run build (pass; it warns that this bb's SDK is 0.6.37 vs the pinned 0.6.54, consistent with the body's migration note).
  • Verified against the PR body, criterion by criterion:
    • Standalone Your turn view using Workstreams' feedback rules, not requiring Workstreams — met: your-turn.ts/feedback-to-address.ts/pr-gates.ts extracted, no workstreams import; feedback.test.ts covers the four rules, drafts, bot exclusion, push-answers-changes-requested vs replies.
    • gh-login default auth across organizations; empty allowlist includes every repository — met (github.ts; allowlist matches case-insensitively, tested).
    • Reviews-like compact layout, area groups, aligned refs, chips, fixed selection bar; group/range selection, b, Esc; amber text with light-dark() theming — met (app.tsx, exercised in app.test.tsx).
    • Badge via navPanel.experimental_useBadge: excludes dismissed/waiting/held, updates on inbox-changed, clears at zero — met and tested, including realtime updates.
    • Manifest requires SDK >=0.6.53; dev pin 0.6.54 — met (engines.bbPluginSdk).
    • Dismiss until new activity (new head or human feedback), restore — met; the activity hash ignores bot-only activity, tested.
    • Address for 1–20 PRs as one thread; duplicate concurrent starts prevented — met (schema max(20), addressing set + dispatch states; two-click race test passes).
    • All GitHub reads paginate; previous snapshot kept on failure — met (pages() with cursor-loop and 200-page guards; failure keeps snapshot, tested).
    • Dispatch refreshes only the selected PRs, verifies current heads/feedback first, and keeps unrelated cached rows — met and tested.
    • Rate-limit backoff persists across reloads — met (github-retry-at in kv, tested with reload and clock advance).
    • Validation claims: typecheck, install and build reproduce; the body says 25 tests but the head has 43 (the later commits grew the suite) — understated, no matter.

— from bb thread thr_vkvmscutqg

- Add pr-inbox to the plugins workflow matrix so its suite runs in CI.
- Correct the branch icon wording in the plugin README.
- Clear the addressing set when saving the starting dispatch throws.
…streams

# Conflicts:
#	.github/workflows/plugins.yaml
@trotterdylan

Copy link
Copy Markdown
Collaborator

Round 1 follow-up

Reviewer approved 54aeb73 (no-review, no blockers). All five suggestions answered. Pushed 0159efd, then merged main (7cf9846) to clear the conflict (head c60b216).

  1. PR body omitted shipped scope — fixed: the body now documents Hold (1 hour / tomorrow 9 AM / 1 week, On hold section, resume, persistence, count and selection exclusion) and the organization→project picker (organizationProjects, project, provider, model). Also corrected the icon wording and the test count (43), and added the bb-server restart note.
  2. pr-inbox not in the CI matrix — fixed in 0159efd: added to .github/workflows/plugins.yaml, so CI now runs the suite (quality_checks (pr-inbox) green).
  3. Two independent useInbox pollers in app.tsx — declined: the nav badge, header count and page render in separate slot trees with no shared React context, so a shared hook needs a module-level store. The duplicate 15 s poll is harmless and the refactor is beyond this PR's scope.
  4. "branch-and-arrow" icon claim — fixed: README and PR body now say "branch icon", matching icon: "GitBranch".
  5. addressing set can leak if saveState throws — fixed in 0159efd: the pre-spawn loop now sits inside the try, so the finally always clears the set.

The main merge's only conflict was the CI matrix line, resolved to keep both pr-inbox and stewards.

— from bb thread thr_eqbda2unks

@trotterdylan
trotterdylan merged commit 0b3c39c into main Oct 20, 2026
22 checks passed
@trotterdylan
trotterdylan deleted the bb/pr-inbox-from-workstreams branch October 20, 2026 17:35
@trotterdylan

Copy link
Copy Markdown
Collaborator

Merged: no-review lane, reviewer approved 54aeb73, checks green on c60b216. Squash commit 0b3c39c.

Since the approved sha: added pr-inbox to the plugins CI matrix, corrected the branch icon wording, moved the address pre-spawn loop inside the try so the finally always clears the addressing set, updated the PR body with the Hold and project-picker scope, and merged main (7cf9846) to clear a CI-matrix conflict.

Merging moves the bb-plugins pin: bb-gate rebuilds the bb-server image and stages a restart for every developer's server. Every server restarts when its owner presses Restart now, or in the 03:00–05:00 US Eastern quiet window — so everyone's server restarts by tomorrow morning.

— from bb thread thr_eqbda2unks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bb-managed Managed by a bb steward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants