Skip to content

fix(annotate): show a Done screen, not Feedback Sent, when Done sends nothing - #1730

Merged
backnotprop merged 2 commits into
mainfrom
fix/annotate-done-screen
Oct 6, 2026
Merged

backnotprop merged 2 commits into
mainfrom
fix/annotate-done-screen

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

Problem

In an annotate session with nothing to send, the header Done posts the nothing-to-send body (nothingToSend: true, #1701). Every host treats that as a no-op: Pi logs "Annotation closed (no feedback).", OpenCode starts no turn, and the Claude Code mod logs it. The completion screen still said Feedback Sent / " will address your feedback on the file".

Cause: handleAnnotateFeedback in packages/editor/App.tsx set the same 'denied' ("feedback sent") state for every annotate submission, and the overlay had no state for nothing-to-send.

Fix

  • handleAnnotateFeedback builds the body once and sets a new 'done' completion state when isNothingToSendFeedbackBody(body) is true. That is the same predicate the annotate servers use (packages/shared/annotate-decision.ts), so the screen matches what the host did.
  • The overlay shows Done / "Nothing was sent to ." with a neutral check icon. It drops the footer line "Your response has been sent." for this state (CompletionOverlay accepts 'done'; additive, noted in packages/ui/HANDOFF.md).
  • Unchanged: Close ("Session Closed"), real feedback ("Feedback Sent"), gated Approve and approve-with-note ("Approved"), and the agent-terminal delivery path.
  • WebMCP read_document reports decision: 'done' instead of 'feedback-sent' for this case.

Paths checked: single file, annotate-last (both no-feedback sentences are covered by the sentinel), folder and bundle (same handler and sentinel), raw HTML and live app (same handler), the non-gated discard confirm (posts the zero body, so it also lands on Done), "Send a note…" (it sends a GLOBAL_COMMENT, so it stays "Feedback Sent"), and gated Approve (it posts /api/approve, so it stays "Approved").

Tests

New annotate completion screen block in packages/editor/App.decisionControl.test.tsx, which is already listed in the workflow's DOM_TESTS step. It covers Done at zero, a sent note, discard-all, gated Approve, annotate-last, and raw HTML. Four of the six tests fail without the fix.

  • DOM_TESTS=1 bun test --isolate packages/editor: 311 pass
  • DOM_TESTS=1 bun test --isolate packages/ui/components: pass
  • bun run typecheck: pass
  • bun run --cwd apps/review build && bun run build:hook: pass
  • bun run --cwd apps/guides-show build:viewer && check:manifest: in sync

… nothing

An annotate Done with nothing to send posts the nothing-to-send body, which
every host treats as a no-op (Pi logs "Annotation closed (no feedback).",
OpenCode starts no turn, the Claude Code mod logs it), yet the completion
screen said "Feedback Sent" / "<Agent> will address your feedback".

handleAnnotateFeedback now sets a distinct 'done' completion state when the
posted body is nothing-to-send, using the same isNothingToSendFeedbackBody
predicate the servers use. The overlay shows "Done" / "Nothing was sent to
<Agent>." with a neutral icon and without the "response has been sent" line.
Close, real feedback and gated Approve keep their screens. WebMCP reports the
decision as 'done' instead of 'feedback-sent'.
…ck screen

The completion overlay's footer said "Your response has been sent." after
Close ('exited'), which sends nothing. Suppress it for 'exited' as for 'done'.

Tests: the completion-screen block now uses an immediate auto-close with a
host close (the phase that renders that footer), so the footer assertions are
not vacuous; adds Close, and a folder session whose comment lives on a
document that is not open (still Feedback Sent). HANDOFF notes the widened
'submitted' type.
@backnotprop

Copy link
Copy Markdown
Owner Author

Follow-up commit 040ca10, from review:

  • Close ('exited', "Session Closed") no longer shows the footer line "Your response has been sent." Close sends nothing either. The line only renders in the auto-close closed phase, after an immediate auto-close whose close request went to a host window (Glimpse, or the VS Code panel's parent frame).
  • The completion-screen tests now run in that phase, so the footer assertions actually check something. A sent note still shows the line.
  • New tests:
    • Close shows "Session Closed" without the line.
    • In a folder session, a comment on a document that is not open (merged from its per-document draft) still shows "Feedback Sent".
  • packages/ui/HANDOFF.md notes that ComponentProps<typeof CompletionOverlay>['submitted'] now includes 'done'.
  • DOM_TESTS=1 bun test --isolate packages/editor: 313 pass. packages/ui/components + packages/review-editor: 0 fail. Typecheck, review build and hook build pass.

@backnotprop
backnotprop merged commit 71c968c into main Oct 6, 2026
28 checks passed
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