githubnext/chopinPublic

Let's compose rich plans together

Show unanswered decision counts on documents and projects in the Projects sidebar

enhancementtriage/human-response
LA

## Problem When someone is working on several documents at once, the only place an unanswered-decision count appears is the Decisions tab of the document that's open. To find out whether any other document is waiting on an answer, they have to open each one.

## Proposal Show unanswered-decision counts in the Projects sidebar:

- **Document rows**, including child documents, show that document's unanswered count, the same number as its Decisions tab. - **Project rows** always show the total for every document in the project, whether the project is expanded or collapsed. That makes it quick to see which project needs attention. - Zero shows nothing.

![Projects sidebar today, proposed counts at rest, and hover states for a document row and a project row, with the existing Decisions tab count for reference](https://github.com/user-attachments/assets/f7546378-de67-4289-b71c-ee4642346e70)

The mockup is rendered from the real `ProjectSidebar`, `Count`, and `DecisionViewControl` markup with the built app CSS. Only the count slot and its hover rule are new.

## Consistent count and button UI - **One count treatment.** Every sidebar count is the existing `Count appearance="quiet"` the Decisions tab already uses (`apps/web/src/decision-view-control.tsx`). No second badge style, no new color. If a count goes up, reuse the tab's existing `motion` feedback instead of changing the color. - **One trailing slot per row.** The count sits in the same 24px trailing slot as the row's hover action. On hover or keyboard focus, the action replaces the count: the `…` menu on document rows, **New document** on project rows. When the pointer leaves, the count comes back. - Today the project row always reserves 24px for its invisible New document button, while document rows collapse their actions to zero width. With counts that would leave project totals out of line with document counts. The project row's action should collapse the way document actions do, so every count lines up at the same trailing edge. - Touch devices (`data-plan-coarse-pointer`) always show actions today. Decide whether the count stays visible beside the action or the action wins there.

## Accessibility - Accessible names follow the tab's wording, for example `Postgres writer lease, 4 unanswered decisions` and `chopin, 10 unanswered decisions`. - The count is `aria-hidden` inside a labeled link or disclosure, as in `DecisionViewControl`. Swapping it out on hover does not change the accessible name.

## Data - The sidebar builds its rows from `Api.channels` (`Channel` in `apps/web/src/api.ts`), and that response has no decision count today. Unanswered counts are only computed from a room that's open. So this needs either a per-channel count in the channel list (from the question sidecar records) or a light subscription. The sidebar should not open a room for each row. - A project total that adds up only the documents loaded so far would be wrong when the list has more pages (`nextCursor`). The total should come from the server, not from summing the rows that happen to be loaded. - Counts come from the authoritative question records, not the document projection (see "Records own decisions" in AGENTS.md).

## Acceptance criteria - [ ] Every document row in the Projects sidebar, including child rows, shows its unanswered-decision count when it's above zero, and the number matches that document's Decisions tab. - [ ] Each project row shows the total for all its documents, expanded or collapsed, including documents that aren't loaded yet. - [ ] Every count uses the shared quiet `Count`. Counts and hover actions share one trailing slot and line up across project, document, and child rows. - [ ] Counts update when a decision is answered or a new one is asked, and showing the sidebar does not open a room for each document. - [ ] Unit coverage for counts and accessible names, and E2E coverage for the hover and focus swap. `bun run ci` passes.

Assistant-workflow: inline Assistant-duration: 5m converged, estimated 15m Assistant-verification: agent-browser screenshot passed: rendered real ProjectSidebar, Count, and DecisionViewControl static markup with the built apps/web CSS at 1160x700 and checked rest and hover states (a mockup, not the running app) Assistant-verification: impeccable detect unavailable: the detector could not read the file:// linked app stylesheets, so its findings on the mockup were incomplete Assistant-verification: code inspection passed: confirmed the Projects sidebar rows (`project-sidebar.tsx`) and `Api.channels` carry no decision count, and that the project row action reserves width while document actions collapse User-preference: show an aggregate decision count on the project row and keep the count and button UI consistent with the Decisions tab Co-authored-by: lavaman131

  1. lavaman131added label enhancementlast month on GitHub

  2. lavaman131assigned lavaman131last month on GitHub

  3. lavaman131renamed Show unanswered decision counts on documents in the Projects sidebar to Show unanswered decision counts on documents and projects in the Projects sidebarlast month on GitHub

  4. lavaman131referenced this in Show unanswered decision counts on Projects sidebar rows #378last month on GitHub

  5. lavaman131referenced 31a061562e56last month on GitHub

  6. lavaman131referenced 96a354f05821last month on GitHub

  7. lavaman131referenced 26c9632acee9last month on GitHub

  8. lavaman131referenced 9ca0477161a1last month on GitHub

  9. lavaman131referenced 20c9029829f8last month on GitHub

  10. lavaman131referenced 95159cd0e445last month on GitHub

  11. lavaman131referenced 3bfa80b45cf9last month on GitHub

  12. lavaman131referenced a541695ddffflast month on GitHub

  13. lavaman131referenced 1a3169638a9alast month on GitHub

  14. lavaman131referenced 53ac11c4c82alast month on GitHub

  15. lavaman131referenced 571ffda7b793last month on GitHub

  16. lavaman131referenced af42cbd729cdlast month on GitHub

  17. lavaman131referenced 16c6ad9b152dlast month on GitHub

  18. lavaman131referenced dad5ac8effd6last month on GitHub

  19. github-actions[bot]botadded label triage/human-responselast month on GitHub

  20. lavaman131referenced f30e01853213last month on GitHub

  21. lavaman131referenced 373eff4ccaf1last month on GitHub

  22. lavaman131referenced e8bc7e4c92aelast month on GitHub

  23. lavaman131referenced c607719afb83last month on GitHub

  24. lavaman131referenced df094d476271last month on GitHub

  25. lavaman131referenced 8a49dda4c9d6last month on GitHub

  26. lavaman131referenced c980963f9a04last month on GitHub

  27. lavaman131referenced 88d14d8d4b15last month on GitHub

  28. lavaman131referenced 4987bb69f349last month on GitHub

  29. lavaman131referenced 252f2f411ac8last month on GitHub

  30. lavaman131referenced abd13f8c1dd6last month on GitHub

  31. lavaman131referenced c6a60d3ff79elast month on GitHub

  32. lavaman131closedlast month on GitHub

  33. lavaman131referenced b95c7a20eaf7last month on GitHub

  34. lavaman131referenced 1d25117ffe41last month on GitHub

  35. lavaman131referenced 4ac8297cbe0alast month on GitHub

  36. lavaman131referenced bb38a669d2aclast month on GitHub

  37. lavaman131referenced 87d6bdcbc565last month on GitHub

  38. mantl-chopin-upstream-sync[bot]botreferenced 98a8bffd9c15last month on GitHub