Show the BB project in the GitHub PR table, ordered by project name - #1962
Show the BB project in the GitHub PR table, ordered by project name#1962abdoutelb wants to merge 1 commit into
Conversation
The Pull requests tab lists every tracked repo's PRs in one table, but no column said which BB project a row belonged to, so a list spanning several projects read as a flat pile. The panel already had the mapping — `status` returns the tracked repos, each with the project id it was discovered from — it just never carried the project's name. Repo discovery now keeps `projectName` alongside `projectId`, and a shared `project-order` module resolves repo → project name and applies the ordering so the panel and the CLI group identically. The PR table gains a Project column and sorts by project name (case-insensitive, repos with no project last), keeping the cache's newest-updated order inside each project. The issue table is unchanged. `bb github prs` prints the project column in the same order, and `bb github repos` prints the project name next to its id. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ScreenshotsPull requests — the new Project columnSix PRs across four tracked repos. The cache handed them over flat, newest-updated first —
Projects in name order, newest-updated first inside each project, and Same table, light modeIssues — deliberately unchangedNo Project column, still newest-first. Adding the column here would have been easy, but ordering issues by project would have replaced their newest-first default, which nothing asked for. How these were capturedNot a screenshot of a running bb app — the environment I ran in has no authenticated bb instance. These are the real components: The images are served from the
|



What was wrong
The GitHub panel's Pull requests tab lists every tracked repo's PRs in one table, but nothing on a row said which BB project it belonged to. On a workspace with more than one project the tab reads as a flat pile of unrelated PRs, and the only way to tell them apart is recognising the PR title.
The data was already almost there:
discoverRepos()walks BB project sources to find each repo'soriginremote, so it knows exactly which project a repo came from — it just kept the project id and dropped the name, and nothing downstream grouped by it.What changed
plugins/github/server.ts— repo discovery keepsprojectNamealongsideprojectId;repoInfoSchema(and so thestatusRPC output) carries it.BbProjectSummarypicks upname, whichprojects.list()already returns.plugins/github/project-order.ts(new) —projectNamesByRepo()resolvesowner/repo→ project name (skipping blank/absent names so a lookup miss means "no project"), andsortByProjectName()applies the ordering. Shared by the server and the app bundle so the panel and the CLI cannot drift apart.plugins/github/app.tsx— the PR table gains a Project column between ID and Title, andListVieworders pull requests by project name: case-insensitive, repos with no BB project last, and the sort is stable so the cache's newest-updated-first order survives inside each project. A row with no project renders an em dash. The issue table is deliberately unchanged — sorting issues by project would have replaced their newest-first default, which nothing asked for.bb github prsprints the project column in the same order (-where a repo has no project);bb github reposprints the project name next to its id. BothUSAGEand the registered command summary say so, which is what the plugin-commands skill surfaces to agents.plugins/github/README.mddocuments the column, the ordering, and the new CLI output.plugins/github/package.json— version 0.2.1 → 0.3.0, perdocs/official-plugin-release-process.md("bump when the change is user-visible").No wire change:
HOST_DAEMON_PROTOCOL_VERSIONis untouched. The plugin's server and app bundles ship together, so the RPC contract addition needs no compatibility step. Nothing outsideplugins/githubreadsrepoInfoSchemaor the CLI output.How you verified
23 tests pass; typecheck and the plugin build are clean.
New tests, both of which I confirmed fail before this change and pass after:
project-order.test.ts— grouping, stability inside a project (two repos of one project stay interleaved as the cache ordered them), project-less repos last, blank names treated as absent, case-folded ordering that still keeps one project together, a repo missing from the tracked list, and no mutation of the caller's array.app.test.tsx— three jsdom cases rendering the realGithubPanelthrough the plugin SDK's test harness: the column is present and rows come out in project order on the PR tab, each row is labelled with its repo's project (em dash where there is none), and the Issues tab has no Project column. Reverting just the sort fails the first case; forcing the column off fails the first two.app.test.tsxneeded two bits of test plumbing:@testing-library/react+jsdomdevDependencies (matching the other plugins that have anapp.test.tsx), and aresolve.aliasfor@/invitest.config.ts— esbuild reads that path fromtsconfig.jsonwhen bundling the plugin, but vitest does not, so importingapp.tsxfailed to resolve without it.I also rendered the panel in headless Chrome with the compiled
dist/app.cssand the app's theme tokens to check the column visually in light and dark, at the@[48rem]container breakpoint and below it.Filed from Multica issue POLL-3; there is no GitHub issue for it.