Show the real write-up state on decided conversation decisions #376
- MA
## Why
A saved conversation decision's settled line said "writing up…" whenever it had no prose. The label wasn't tied to the prose job, so after the job failed it stayed for good, across reloads, and there was no way to retry from the card. The owner also showed as `@handle` in the document and as `handle` in Chat.
## What changed
- **Server:** `Question.CardMeta` gains an optional `writeup: { status: "writing" | "failed"; job }`. It covers the current saved generation's prose job, derived in `prose-job.ts#writeup` from the durable job queue and the pending effect outbox. It's `writing` while the job is queued or running, `failed` when it failed (including `interrupted`), and absent once the job is done or skipped. Planner job transitions already republish card metadata, so this adds no new publication path, and nothing new is persisted. - **Card:** the settled line now renders from that field (new `widgets/writeup-status.tsx`): - writing: a small pulsing dot (the existing `plan-research-dot`, still under reduced motion) and "Writing up…" - failed: "Couldn't write this up" plus a ghost "Retry", which uses the existing `conversation-plan:retry-job` request. It's disabled for read-only or offline viewers. - done: no label - orphaned: unchanged ("· prose removed" and Reopen) - The settled line can wrap (`flex-wrap`), so on a phone the status drops to its own line instead of squeezing the decision text. - Chat's collapsed decision line uses `@handle`, like the document.
## Screenshots
Before (main): the document line said "writing up…" forever after a failed job, and Chat dropped the @.
 
After, failed, desktop:

After, failed, phone (390):

After, writing (job running):

After, Chat line:

## Verification
23 focused tests, `bun run types`, `bun run ci`, and `bun run build` pass on the restacked branch. The reviewed design hash was renewed after checking the integrated source. A focused regression test confirms that a linked document relation remains the sole control after a write-up job fails. GitHub's browser suite will run on the final published head.
MaggieAppletonreferenced this in Show each decision's relationship to the document #367last month on GitHub
- MA
**Review:** Looks good
Checked in a worktree against a fake-Planner server (CONVERSATION_PLAN on, fake MCP moved to 8884), with seeded conversation decisions carrying real prose jobs. Ran the new unit tests (19 pass across `prose-job.test.ts`, `questionnaire-collapse-settled.test.tsx`, `decision-entry.test.tsx`) and `bun run types` (clean).
**Verified** - Derivation (`prose-job.ts#writeup`): keyed on the current generation's exact job id, so earlier generations, reopened and Planner-origin cards show nothing. Pending effect before the queue accepts the job maps to `writing`; failed (including interrupted) to `failed`; done and skipped to nothing. Tests cover each case. - Persistence-before-publication: nothing new is persisted and no new publish path. In the browser a failed job showed Retry after reload, Retry flipped to "Writing up…" within about 10 ms, then back to failed about 1.7 s later (the fake Planner never writes prose), so meta is republished on both transitions. - Retry authorization: the existing `conversation-plan:retry-job` handler requires `canEdit`, a non-archived channel and an open room. A read-only viewer sees Retry disabled (checked in the browser). The button is also disabled when disconnected. - Double-click: `dblclick` sent exactly one `retry-job` frame. The button is disabled while the request is in flight, and the server's `retry` is a no-op unless the job is `failed`. - Phone 390: status wraps to its own line below "Decided: Canary · @ana"; desktop is a single quiet line. The line height doesn't jump between writing and failed. Copy is calm and the dot reuses `plan-research-dot`. - Overlap with #367: it replaces this same status slot with `RelationNote`. The PR body says whichever lands second should render `WriteupStatus` for the pending relation. That's the right resolution. - `bun run ci` fails only on the three `questionnaire.tsx` design-contract review hashes (339, 492, 193). That is the expected, listed hash failure and the change is safe: it adds an import, a static class change and a child component.
**Minor, non-blocking** - `packages/editor/src/widgets/writeup-status.tsx` (Retry button): the accessible name is just "Retry", which is ambiguous with Chat/composer Retry buttons. Consider `aria-label="Retry write-up"`. - `writeup-status.tsx` retry(): `queued: false` (job already moved on, for example another writer retried first) shows "Couldn't retry. Try again." although the card is about to flip to "Writing up…". Consider treating `queued: false` as silent and letting the republished meta speak. - Not verified in the browser: the offline state. Playwright `setOffline` did not drop the existing socket in 3 s, so Retry stayed enabled. The `connected` gating is covered only by the unit test. Done and old-generation states were also checked by unit test only, because my seeded sidecars for those were rejected as invalid.
anamentionedlast month on GitHub
anasubscribedlast month on GitHub
- MA
Addressed review nits in f12b1afb: - Retry now has the accessible name "Retry write-up" (e2e and unit tests updated). - A `queued: false` reply is silent; republished card metadata drives the state. Only a request failure shows "Couldn't retry".
CI: e2e and container pass. Validation fails only on the known design-contract hash for `questionnaire.tsx` (hash unchanged by this commit: `86f24c78…410b`).
MaggieAppletonreferenced this in Keep the settled decision icon full size when its text wraps #393last month on GitHub
MaggieAppletonreferenced this in Keep every icon at its declared size beside wrapping text #398last month on GitHub
MaggieAppletonhead-ref-force-pushed 82a1f9bb0eb9last month on GitHub
MaggieAppletonmerged 8681ff26abc2last month on GitHub
MaggieAppletonhead-ref-deletedlast month on GitHub