Skip to content

feat(drafts): readable annotation thread (markdown + sender distinction) - #225

Merged
prellr merged 1 commit into
mainfrom
feat/drafts-thread-readability
Jun 30, 2026
Merged

prellr merged 1 commit into
mainfrom
feat/drafts-thread-readability

Conversation

@prellr

@prellr prellr commented Jun 30, 2026

Copy link
Copy Markdown
Owner

What & why

The Drafts annotation thread / side conversation (the right "Annotations" rail) rendered every thread message as raw plain text in a cramped ~320px column. A structured multi-point Aye reply — bold, numbered lists, headings, code — collapsed into an unreadable wall. This is a presentation pass on the thread display itself; no behavior, backend, or schema change.

Changes (frontend only — packages/views/drafts/)

1. Markdown rendering. Expanded-thread message bodies now render through the app's shared markdown renderer — Markdown from @multica/views/common/markdown with mode="minimal" (the mode whose docstring is literally "Best for: Chat messages"). Same renderer chat + channel messages use. Bold/lists/headings/inline-code/links render with tasteful, token-driven typography (no new markdown lib, no hardcoded colors).

2. Sender distinction (human vs Aye). Each message in the expanded thread is now a conversation row: an avatar + sender name + relative timestamp + the rendered body.

  • Aye (author_type: "agent") reuses the base ActorAvatar (@multica/ui/components/common/actor-avatar, the Bot robot affordance) and is set apart with a primary-accent avatar/name plus a Bot icon. Labeled from the existing drafts.turn.agent_name ("Aye").
  • Humans resolve their member name via the shared useActorName() hook (falling back to a new annotations.you string).

3. Room to breathe. Rail widened w-80 → w-96 (320 → 384px); the editor column (mx-auto max-w-3xl) is unaffected. When a pin is expanded the full conversation renders (including the opener, which was previously only shown truncated in the collapsed card), with comfortable padding/line-height and message grouping. Collapsed cards keep a compact one-line plain-text preview.

4. Mechanics unchanged. Typed annotation header (comment/question/suggestion/approve/block/highlight), reply box, Resolve/Dismiss/Reopen, open-count badge, orphaned tray, and re-anchoring all behave exactly as before.

Before → after (structure)

  • Before: quote line → messages[0] raw text → replies as raw <p> text in tiny bg-muted boxes, no sender, no avatar, everything plain-text in 320px.
  • After: quote line → expanded thread of conversation rows, each with avatar + sender (Aye/member) + timestamp + markdown body, in a 384px rail.

Reused components

  • Markdown: Markdown (@multica/views/common/markdown, mode="minimal") — wraps @multica/ui/markdown.
  • Agent styling/avatar: ActorAvatar base (@multica/ui/components/common/actor-avatar) — the Bot robot affordance. Accent uses the --primary semantic token (see note below).
  • Name resolution: useActorName (@multica/core/workspace/hooks).

Note on "purple": the brief asked for a purple agent accent, but there is no purple/agent semantic token in the theme and CLAUDE.md forbids hardcoded Tailwind colors (the channels' bg-purple-100 is a pre-existing one-off I did not propagate). I used the --primary accent + the Bot icon as the token-correct distinct agent affordance. Easy to swap to a dedicated --agent token if one is introduced.

Verification

  • pnpm --filter @multica/views typecheck ✅ and full monorepo pnpm typecheck ✅ (6/6)
  • pnpm --filter @multica/views exec vitest run drafts/ ✅ (59) — extended the thread-panel test (markdown renders as <strong>/<li>; Aye + member sender labels show)
  • pnpm --filter @multica/views lint ✅ (0 errors; target file clean)
  • Full pnpm test ✅ (857 views tests, all packages green)

i18n: added annotations.you to en + zh-Hans.

🤖 Generated with Claude Code

The annotation rail rendered every thread message as raw plain text in a
cramped ~320px column, so a structured multi-point Aye reply collapsed into
an unreadable wall. This is a presentation pass on the thread display:

- Render message bodies with the shared Markdown renderer
  (@multica/views/common/markdown, mode="minimal") so bold, numbered/bulleted
  lists, headings, inline code, and links render with token-driven typography —
  the same renderer chat/channel messages use.
- Distinguish senders: each expanded-thread message now shows an avatar
  (ActorAvatar base, Bot affordance for Aye), the sender name (Aye via the
  shared turn.agent_name string, or the resolved member name), and a relative
  timestamp. Aye is set apart with a primary-accent avatar/name + robot icon.
- Room to breathe: widen the rail (w-80 → w-96), render the full conversation
  (including the opener) when expanded, comfortable padding/line-height and
  message grouping.

Thread mechanics (typed header, reply box, Resolve/Dismiss/Reopen, open-count
badge, orphaned tray, re-anchoring) are unchanged. Frontend-only; no backend,
schema, or behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@prellr
prellr merged commit 3b044ae into main Jun 30, 2026
2 checks passed
@prellr
prellr deleted the feat/drafts-thread-readability branch June 30, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant