githubnext/chopinPublic

Let's compose rich plans together

Condense the Chat research suggestion card #348

MergedMaggieAppletonmerged 3 commits intomainfromrefs/pull/348/head
  1. MA

    Stacked on #341.

    ## Why

    The research suggestion in Chat was an undesigned slab: three different left edges, a full button per source (the same author twice), a nested "Suggested addition" card with its own button row, a permanent "Brief refinement failed. Retry refinement" row, full-size "Dismissed" tombstones, a "Follow-up to earlier research" label even when no research had run, and a fixed 5-row brief editor that ignored Escape and listed yourself as an editor.

    ## What changed

    - One card aligned with the message text column, same frame as the research status card. - Header: icon, "Research suggestion", other editors as a 16px avatar stack, and the sources as one quiet link ("from @ana, @bo") that steps through the source highlights. Authors are deduplicated. - Brief: two lines with Show more (shared `ResearchBrief` from the document card). - Suggested additions: inline "+ text" rows with check / close icon buttons (tooltips "Add to brief", "Dismiss"). - One action row: Dismiss, Edit brief, Start research. In edit mode: Done (secondary) and Start. Edit brief shows "Opening…" while the shared draft opens instead of freezing every button. - Refinement failure: a quiet warning icon button in the header ("Brief refinement failed. Retry") while the brief is usable; the old row only when no usable brief exists. - Dismissed offers collapse to one quiet line, "Research suggestion dismissed". (No undo action exists, so none is offered.) - Removed the "Follow-up to earlier research" line; the card cannot tell whether earlier research actually ran. - Brief editor: grows with its text from 2 to 8 lines with no resize grip, Escape finishes and returns focus to Edit brief, ⌘↵ / Ctrl↵ starts research, and your own presence is left out (`handle` passed from `room-workspace.tsx`).

    No server changes. `chat/transcript.tsx` untouched.

    ## Screenshots

    Offer in the app, before / after ![offer](https://github.com/user-attachments/assets/f87a01b7-c37b-4ec2-8fb8-df439d965a91)

    Editing, before / after ![editing](https://github.com/user-attachments/assets/2abe0b86-3a1e-4da4-b518-e8f2719b127b)

    Suggested addition, before / after ![addition](https://github.com/user-attachments/assets/cb62457f-336b-4fc2-8e51-aa521e211b87)

    Several sources, before / after ![sources](https://github.com/user-attachments/assets/85d57d66-b476-4758-89d4-716ce6fbe118)

    Refinement failed with a usable brief, before / after ![refine](https://github.com/user-attachments/assets/4dbcb944-a157-4e32-80fb-4fa6d61afeef)

    Dismissed, before / after ![dismissed](https://github.com/user-attachments/assets/68e9eb72-6199-4a90-afdc-d46e32ec06ad)

    Phone width ![phone](https://github.com/user-attachments/assets/21a3b8ab-c0f1-4ced-9b43-6065d0651ee3)

    ## Testing

    - `bun test apps/web/src/chat packages/editor/src/widgets/research` — 192 pass - `bun --bun node_modules/@playwright/test/cli.js test --config e2e/source/playwright.config.ts research-offers.native.ts --timeout 300000` — 5 pass - `bun run ci`, `bun run types` — pass - Checked in a real browser against the fake-GitHub server with the fake Jev classifier: Escape closes the editor and focuses Edit brief, the editor grows with its text - `e2e/research-conversation.e2e.ts` and `e2e/research-offers-ui.e2e.ts` updated for the dismissed line and addition row; relying on CI browser integration (local E2E suspended)

    🤖 Generated with [Claude Code](https://claude.com/claude-code)

  2. anamentionedlast month on GitHub

  3. anasubscribedlast month on GitHub

  4. bomentionedlast month on GitHub

  5. bosubscribedlast month on GitHub

  6. MaggieAppletonreferenced this in Show Chat research status with the document research card #341last month on GitHub

  7. MA
    Author

    **Review:** Looks good

    Checked in the real app: this branch on a fake-GitHub server with the fake Planner and fake Jev, `CONVERSATION_PLAN=on`. Offers came from the real `e2e/research-scenarios.ts` messages. Two users (ana and bo) shared one offer.

    What works: - **Offer card:** one frame aligned with the message text, "from @ana" at the right, and the brief clamped with Show more. Suggested additions show as "+ text" rows with check and × icons, and their tooltips render. Add to brief applies the addition. - **Brief editor:** Escape closes the editor and returns focus to "Edit brief". ⌘↵ starts research from the editor. The editor grows from 58 to 121 px and stops at about 184 px (8 lines), with no resize grip. - **Two users:** each sees only the other's avatar, never their own (`handle` from `room-workspace.tsx`, which is the workspace's own prop, so it is correct). Concurrent edits merged with both sides' text kept. - **Dismissed:** the card collapses to one quiet "Research suggestion dismissed" line and fades in. - **Phone (390):** the offer and the editing state both fit. Done and Start sit on one row. - **`ResearchBrief`** is a clean rename and export. It is used by both cards. - CI is green: container, e2e, and format/lint/types/tests. Locally, `bun run ci`, `bun run types`, and 192 unit tests pass.

    Findings (none blocking): 1. **The source link's name hides its visible text.** `research-offer.tsx`, source button: `aria-label="Show source message(s)"` replaces the visible "from @ana", which fails WCAG 2.5.3 (label in name). Speech users saying "click from ana" won't hit it. Suggest `aria-label={`Show source messages from ${authors.join(", ")}`}`, or drop the label and add a tooltip. 2. **The presence avatar sits right before "from @ana".** In bo's view, ana's 16 px avatar directly precedes "from @ana", so it reads as part of the attribution, not "ana is editing" (see screenshot). There is no tooltip (`titled={false}`). Suggest a `data-tooltip="Editing: @ana"` on the stack, or a little more separation from the source link. 3. **The avatar stack mixes `role="img"` with `aria-live="polite"`.** Live updates on an img are announced unreliably. Suggest moving the announcement into an `sr-only` live span. 4. **⌘↵ with an empty brief is swallowed.** When `canStart` is false, `preventDefault` still runs, so the keystroke does nothing and gives no feedback. That's acceptable, but it could fall through instead. 5. **Minor:** `max-w-[28.125rem]` duplicates the 450 px research-widget width from `packages/editor/src/styles.css`. Consider a shared token or class. `field-sizing: content` has no Firefox support: Firefox gets a fixed two-line editor that scrolls and has no resize grip. That is acceptable, but a regression from `resize-y` there. 6. **Not exercised:** refinement-failure states (icon button, fallback row) were not triggered live; they are covered by the unit test only.

    Bo's view while ana edits, with the avatar next to "from @ana": ![presence](https://github.com/user-attachments/assets/35548bb3-7ed6-405a-b72b-353a33a727ad)

  8. anamentionedlast month on GitHub

  9. anasubscribedlast month on GitHub

  10. MaggieAppletonhead-ref-force-pushed 7c22b7662bb4last month on GitHub

  11. MA
    Author

    Rebased on #341 and addressed in 7c22b766: 1. The source link's accessible name now includes its visible text, e.g. "Show source messages from @ana, @bo". 2. The avatars sit right after the title, away from the attribution, with a "@bo is editing" tooltip. 3. The avatar stack is `aria-hidden`. Announcements go through a separate `sr-only` polite live region. 4. ⌘↵ with an empty brief now shows a quiet "Write a brief to start research." in the action row. 5. The card uses the shared `.plan-research-tracked` width. Where `field-sizing` is unsupported (Firefox), the brief editor grows from its content in JS, and CSS still bounds it at 2 to 8 lines.

  12. anamentionedlast month on GitHub

  13. anasubscribedlast month on GitHub

  14. bomentionedlast month on GitHub

  15. bosubscribedlast month on GitHub

  16. MaggieAppletonhead-ref-force-pushed 93fe41a81d5dlast month on GitHub

  17. MaggieAppletonbase-ref-force-pushedlast month on GitHub

  18. MaggieAppletonautomatic-base-change-succeededlast month on GitHub

  19. MaggieAppletonhead-ref-force-pushed 65c94dc212belast month on GitHub

  20. MaggieAppletonmerged ead1415ae2f5last month on GitHub

  21. MaggieAppletonclosedlast month on GitHub

  22. MaggieAppletonhead-ref-deletedlast month on GitHub