Condense the Chat research suggestion card #348
- 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 
Editing, before / after 
Suggested addition, before / after 
Several sources, before / after 
Refinement failed with a usable brief, before / after 
Dismissed, before / after 
Phone width 
## 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)
anamentionedlast month on GitHub
anasubscribedlast month on GitHub
bomentionedlast month on GitHub
bosubscribedlast month on GitHub
MaggieAppletonreferenced this in Show Chat research status with the document research card #341last month on GitHub
- MA
**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": 
anamentionedlast month on GitHub
anasubscribedlast month on GitHub
MaggieAppletonhead-ref-force-pushed 7c22b7662bb4last month on GitHub
- MA
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.
anamentionedlast month on GitHub
anasubscribedlast month on GitHub
bomentionedlast month on GitHub
bosubscribedlast month on GitHub
MaggieAppletonhead-ref-force-pushed 93fe41a81d5dlast month on GitHub
MaggieAppletonbase-ref-force-pushedlast month on GitHub
MaggieAppletonautomatic-base-change-succeededlast month on GitHub
MaggieAppletonhead-ref-force-pushed 65c94dc212belast month on GitHub
MaggieAppletonmerged ead1415ae2f5last month on GitHub
MaggieAppletonhead-ref-deletedlast month on GitHub