Registry Mirror
Skip to content

Conversation

@backnotprop

@backnotprop backnotprop commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Approval: .product/approved/inbox-message-comments/approval.md (2026-10-19, "Build it now, the file-comment way, and send screenshots before it merges"). Do not merge until the owner has seen the screenshots.

What it does

  • Select words in an agent's message in a thread: the same selection toolbar as on attached files, comment-only (Comment and the one-click 👍 Looks good; no Delete, no label picker). Comment opens the file-comment composer; ⌘↵ / Save stores it.
  • The passage keeps a light highlight, drawn again from the store by its words on every mount (tagged Unanchored in the chip's list if the words are not found).
  • The comment waits in the reply box's N annotations chip with file and guide comments ("Claude Code's message, 2:58 PM", the quote, the comment; Edit / Remove until sent; clicking the name rings the passage), rides the next Send and is marked sent with the reply.
  • The agent receives it first in the feedback text, before file and guide comments:
# Feedback on your messages

The following feedback is on the text of your messages in this thread, one section per message. Each quote is the words I selected (as shown on screen) in your message.

## Feedback on your message from 2:58 PM (msg_…)

I've reviewed this message and have 1 piece of feedback:

### 1. Feedback on: "two, four and eight seconds"
> Cap the total wait too, say 30 seconds.

### 2. Feedback on:

Run this once after you pull:

Feedback on the attached files

echo ```hi
Nothing needs you

> Why a manual step? Put it in the setup script.
```

Words on one line stay inline; words spanning lines go in a fence sized with `codeFenceFor`. Each comment goes to the session that wrote its message: a comment on another session's message rides a reply to that message (`routeSendAnnotations` in `packages/inbox/sendTargets.ts`).

- Not offered on the person's own messages, folded messages, a message an archive closed, or inside a `:::question` card (its words are excluded from selection).
- While the toolbar shows it owns the keys as on a file: **Esc** closes the toolbar (never the thread); the thread's E / Z / j / k / n stand down. Paste-follows-the-field is unchanged: a dictated ⌘V with words selected in a message still lands in the reply box. No new keyboard shortcut.

## How

- **Store / server:** `InboxStore.saveMessageAnnotation`; `POST /api/inbox/messages/:id/annotations` (same-origin + `serverSession` guards). Records go to `annotations.jsonl` with an additive `message: { at }` target, `attachment_id: ""`, `path` = the message id, `version: "current"` (older readers see a record whose file they cannot find and export it under the message id). Refusals: the person's message `422 annotation_not_allowed`, not a comment / bad quote / id used elsewhere `422`, `404 message_not_found`, `409 thread_resolved` (closed by an archive), `409 annotation_closed`. Removal uses the existing remove route.
- **Phone:** door allowlist row + contract 7.59 in `adr/implementation/inbox-mobile.md`. The surface's `export_feedback` uses the same `attachmentFeedback`, so a phone's Send carries them.
- **ui seam (additive):** `Viewer` `textComments` (with `answerOnly`): selection toolbar (comment-only), composer and highlights come back; question cards are wrapped `annotation-exclude`; nothing else of authoring. Plannotator's own surfaces pass neither. guides.show manifest is unchanged (checked).
- **Window:** `MessageBody` `comments`, `messageFeedback` in `attachments.ts`, chip rows for message comments, `selectionToolbarShowing`, a `messageSelectionPending` exception in `pasteTarget.ts`, and the search landing highlight is repainted after comment marks are drawn.
- Docs: AGENTS.md (Inbox section + server table), the marketing reference page, `plannotator inbox --help` (what a reply contains), ui README/HANDOFF.

## Tests

- `packages/server/inbox-message-comments.test.ts` (save / edit / restart / remove, every refusal, archive and the after-archive message, Send → `wait_for_reply` returns quote + comment)
- `packages/server/inbox-devices.test.ts` 7.59 (door, idempotent replay, refusals pass through)
- DOM: `packages/inbox/messageComments.test.tsx` (whole window over a real Inbox: toolbar, Esc, composer, highlight, chip, Send, the agent's `wait_for_reply` through the Inbox's MCP; 👍; reload redraw; Remove; own message and question card; refused save), `packages/ui/components/Viewer.textComments.test.tsx`, a `pasteTarget.test.ts` case
- e2e (compiled binary): `tests/e2e/inbox-message-comments.spec.ts` (desktop 1440 and a 390 px window, real mouse drags, including a drag across a paragraph, a code block and a paragraph); `inbox-dictation-paste.spec.ts` updated for the double-clicked word now showing the toolbar

## Screenshots

Taken headless from a temp Inbox (light and dark, desktop 1440 and phone 390): selecting with the toolbar, the composer, the highlighted passage, the chip listing it, and the reply as the agent receives it. Sent to the owner separately.

Select words in an agent's message: the comment-only toolbar (Comment, 👍)
and the file-comment composer. The comment is stored like file comments
(POST /api/inbox/messages/:id/annotations, an additive message target on
the annotation record), waits in the reply box's annotations chip, and
rides the next Send under "Feedback on your message from <time> (<id>)".
Phone door 7.59. Approval: .product/approved/inbox-message-comments.
- Words that span lines are quoted in a fence sized with codeFenceFor under
  'Feedback on:' (one-line words stay inline), so a quote never cuts or
  injects a heading or leaves a fence open; the intro says the words are as
  shown on screen. The export is the Inbox's own (the parser seam is gone).
- A comment on another session's message rides a reply to that message
  (routeSendAnnotations, with sendTargetsOf in sendTargets.ts), never the
  last session's reply; a test where sessions A and B both wrote.
- A paste that moves to the reply box closes the message's pending mark and
  toolbar.
- saveMessageAnnotation: text required, at most 10,000 characters; no
  images, elementContext, pageUrl or inReplyTo.
- Unanchored marks go once a comment is sent or removed.
- e2e: a real mouse drag on the 390 px window too (the misses were the pane
  still sliding in; measure once finite animations finish).
@backnotprop
backnotprop merged commit cb5aa48 into main Oct 19, 2026
32 checks passed
DuongCoder04 pushed a commit to DuongCoder04/plannotator that referenced this pull request Nov 7, 2026
Selecting words in an agent's message opened a comment-only toolbar (Copy,
Comment, 👍, close): it was built in backnotprop#1997 as "the same toolbar as on attached
files (Comment, 👍)", so Delete was never offered there, and the store refused
a DELETION on a message. The owner asked for it back (approval
.product/approved/inbox-toolbar-delete).

- ui (additive): Viewer `textDeletions` (with `textComments`) and
  AnnotationToolbar `showDelete` bring Delete back on a comment-only toolbar,
  before Comment as in plan review; the label picker and Alt+digit keys stay
  off. Hosts that pass neither see no change.
- Inbox: agent messages pass `textDeletions`. The store takes a DELETION on a
  message's words (no text needed); the phone door passes it through.
- The Send's feedback reads it as plan review's export: `Remove this:
  "<words>"` then `> I don't want this in your message.`
- Tests: ui Viewer, an Inbox MessageBody DOM test (toolbar order, the DELETION
  saved, the feedback text), the export, the store route and the phone door.
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