Repository navigation
feat(agent,workbench): add inline quote annotations and unify review/side quotes - #7504
Conversation
…side quotes\n\nExtend QuoteRef with an optional QuoteNote so users can select one or\nmore passages from assistant replies or diffs, attach per-passage\ncomments, and send them directly or alongside composer text.\n\n- Backend & contracts: add QuoteNote newtype and optional QuoteRef.note;\n render plain quotes identically (<quoted_excerpt>) to preserve prompt\n cache while rendering annotated quotes as <annotated_excerpt>; share\n the 28 KiB history projection budget across excerpts and notes; prefer\n quote notes in empty-body queue previews; cover cold-migration and\n live annotated sends in upgrade_compat.rs.\n- NSH selection signal: expose dragging on TextSelectionEvent across\n nsh-core, nsh-base, macOS/Windows selectable views, and headless tests\n so floating UI appears only after drag selection settles.\n- Workbench annotations & unification: add floating SelectionToolbar\n (Quote / Comment / Ask beside) on macOS/Windows plus context-menu\n entry everywhere, collapsible inline note editing in DraftQuotes with\n bounded scroll and live TextViewMark linkage, history/pending note\n rendering, and iOS read-only display. Unify SideQuestion gathered\n passages and Diff/File ReviewNote onto QuoteRef + note (with >16\n batch text fallback).\n\nGenerated-by: Maka
…cted note edits\n\nAddress re-review findings:\n- Collapse floating toolbar visibility in messageSelection into a single\n signal + phase so native live -> justCleared -> pressHeld transitions\n never emit an intermediate null that unmounts the hit-tested button.\n- Return acceptance boolean from ComposerSession.setQuoteNote so\n DraftQuotes reverts the controlled <Input> immediately when a note\n edit is rejected (e.g. restore union cap).\n- Gate DraftQuotes' Ask beside action on canAskSideWithQuotes so empty\n sessions without a fork anchor hide the button instead of exposing a\n no-op.\n\nGenerated-by: Maka
jackwener
left a comment
There was a problem hiding this comment.
[P2] Keep saved drafts readable after rolling back
Saving a draft with an annotated quote writes the new note property into the journal's existing quotes column. If the user rolls back to the previous build and reopens that conversation, its strict QuoteRef decoder rejects the field. The journal propagates the error for the whole draft, so the existing text and attachments never reach the composer and the editor stays disabled. Journal write · Previous draft loader
I exercised the Rust quote types from both commits. Both read plain quotes. The new type round-tripped an annotated quote, and the previous type rejected the serialized list with unknown field note. This verifies the decoding step. A full desktop rollback remains to be tested.
Please keep the draft readable by the rollback build and preserve the annotation for a subsequent upgrade. A regression should save a draft containing text, an attachment, and an annotated quote, then check that the previous build can reopen the draft and that the newer build can recover the annotation.
Automated review notice: This comment was posted by an automated review agent operated by jackwener. It is not an independent human review and does not replace one.
jackwener
left a comment
There was a problem hiding this comment.
Approved at the author's direction. The required GitHub check and 27 local tests passed. The earlier review records the draft decoding behavior when rolling back to the previous build.
Automated review notice: This comment was posted by an automated review agent operated by jackwener. It is not an independent human review and does not replace one.
…side quotes (apache#7504) * feat(agent,workbench): add inline quote annotations and unify review/side quotes\n\nExtend QuoteRef with an optional QuoteNote so users can select one or\nmore passages from assistant replies or diffs, attach per-passage\ncomments, and send them directly or alongside composer text.\n\n- Backend & contracts: add QuoteNote newtype and optional QuoteRef.note;\n render plain quotes identically (<quoted_excerpt>) to preserve prompt\n cache while rendering annotated quotes as <annotated_excerpt>; share\n the 28 KiB history projection budget across excerpts and notes; prefer\n quote notes in empty-body queue previews; cover cold-migration and\n live annotated sends in upgrade_compat.rs.\n- NSH selection signal: expose dragging on TextSelectionEvent across\n nsh-core, nsh-base, macOS/Windows selectable views, and headless tests\n so floating UI appears only after drag selection settles.\n- Workbench annotations & unification: add floating SelectionToolbar\n (Quote / Comment / Ask beside) on macOS/Windows plus context-menu\n entry everywhere, collapsible inline note editing in DraftQuotes with\n bounded scroll and live TextViewMark linkage, history/pending note\n rendering, and iOS read-only display. Unify SideQuestion gathered\n passages and Diff/File ReviewNote onto QuoteRef + note (with >16\n batch text fallback).\n\nGenerated-by: Maka * fix(workbench): make floating selection handover atomic and sync rejected note edits\n\nAddress re-review findings:\n- Collapse floating toolbar visibility in messageSelection into a single\n signal + phase so native live -> justCleared -> pressHeld transitions\n never emit an intermediate null that unmounts the hit-tested button.\n- Return acceptance boolean from ComposerSession.setQuoteNote so\n DraftQuotes reverts the controlled <Input> immediately when a note\n edit is rejected (e.g. restore union cap).\n- Gate DraftQuotes' Ask beside action on canAskSideWithQuotes so empty\n sessions without a fork anchor hide the button instead of exposing a\n no-op.\n\nGenerated-by: Maka
…ations (#7531) Carry forward the CI repairs on Jack's branch and clean up follow-up regressions:\n\n- Fix the missing ACP ModelChoice.provider_id test fixture and format markdown-toc.test.mjs with Biome.\n- Update stale test expectations for NSH drag-lift selection events, desktop Google Gemini -> Antigravity connection flow, folded Bot turn layout settlement, archived Read page newlines, iOS Room recovery New Chat locator, and Agent replay/stack sizing.\n- Retain plaintext reasoning normalization policy on reused Responses wire prefixes via a shared wire::install helper.\n- Restore light-theme iOS pressed glass action contrast (#D9E8F2, 4.57:1) and narrow HostListNotices offline state from a single snapshot.\n- Keep macOS popup autofocus pending until first-frame show and resolve AppKit field editor ownership in keymap::editing.\n- Isolate Markdown TOC native list scroll state per turn inside TocHeadingList (covering docked, compact-pinned, and section lists) and drop the obsolete syncedTurn reuse branch.\n- Decode saved eval batch CellRecord outcomes via serde_json::Value so arbitrary_precision feature unification preserves numeric fields inside tagged enums.\n- Restore the resident-pressure model.has_wire_prefix() assertion in Agent driver wire prefix reuse tests.\n\nRefs #7443, #7488, #7395, #7499, #7503, #7504, #7505, #7456, #7515.\n\nCo-authored-by: jackwener <jakevingoo@gmail.com>\nCo-authored-by: M4n5ter <m4n5terrr@gmail.com>\nGenerated-by: Claude Code (Claude Opus 5.5)\nGenerated-by: Maka (OpenAI)\nGenerated-by: OpenAI Codex\nGenerated-by: Maka (Gemini 4 Neon)
Summary
Adds inline annotation support to Maka by extending
QuoteRefwith an optionalQuoteNoteinstead of introducing a parallel annotation track, and unifies the two existing parallel "excerpt + comment" flows (Side Question gathered passages and Diff/FileReviewNote) onto the same model.Key changes
maka-agent-facts,maka-agent-ports,maka-agent-native,plugin-sdk)QuoteNotenewtype (rejects blank strings while preserving non-blank content verbatim) and optionalQuoteRef.note(skip_serializing_if = "Option::is_none").<quoted_excerpt>(preserving prompt cache); annotated quotes render as<annotated_excerpt>with escaped<excerpt>and<user_comment>.quote.noteover excerpt text; journal draft persistence, retract, steer aggregation, and send snapshots carry notes automatically.agent.sendcoverage inproducts/maka/cli/tests/upgrade_compat.rs.third-party/nsh)dragging: boolonTextSelectionEvent/TextViewSelectionEventacrossnsh-core,nsh-base,nsh-platform-macos,nsh-platform-windows, andnsh-testing, firing a settled update when drag selection ends.maka-workbench,agent-composer,agent-conversations,workspace-files)SelectionToolbar(Quote/Comment/Ask beside) anchored to settled selectionpageBoundson macOS/Windows (with mouse-down handoff protection and scroll dismissal), plusComment on selection…in the context menu on all platforms.DraftQuoteswith collapsible per-quote multiline note editors (plain quotes stay compact;Enterreturns focus to composer,Shift+Enterinserts newline,Cmd/Ctrl+Entersends directly even with empty composer body), bounded scroll (maxHeight: 220), and liveTextViewMarkhighlight/underline linkage on the source message.ChatQuotes.tsx/ChatScreen.tsx).gatheredPassages/SideQuoteTray; copies from draft quotes without clearing main draft and enforces the 16-quote cap) and Diff/FileReviewNote(delivers structuredQuoteRef + notewith dedented excerpts, falling back to formatted markdown text only when a batch exceeds 16 notes).Scope notes
nsh-platform-linuxdoes not yet emit selectionbounds/pageBounds; Linux users annotate via the context menu (Comment on selection…) until Linux selection bounds are implemented.Verification
Automated checks
node --test products/maka/workbench/tests/send-receipt.test.mjs products/maka/workbench/tests/conversation-resources.test.mjs— 27/27 passed (upsert/restore union cap, distinct multi-note dedup, floating selection mouse-down hold & scroll dismissal, review note dedent &>16batch fallback).cargo test --locked -p maka-workbench --lib -- fullscreen_composer_— 2/2 passed (including headless inline annotation typing and quote-only send without composer body).cargo test --locked -p maka-agent-facts -p maka-app-client -p maka-agent-native --lib -- quote— all passed (XML rendering, blank note rejection, restart persistence, shared projection budget).cargo test --locked -p maka-cli --test upgrade_compat— passed (upgrade_compat_capsule_roundtrip).node scripts/ci.mjs run contracts,check i18n,check licenses,check migrations— all passed.rustfmt --edition 2024 --checkon all modified.rsfiles andbiome checkon all 51 modified JS/TS/JSON files — clean.Live macOS desktop verification
Verified on an isolated desktop build against a local mock model server:
Settled drag selection floating toolbar (

引用/批注/旁问)Multi-passage inline annotations in composer draft tray with live

TextViewMarkhighlight/underline on source messageSent annotated turn rendered in history (with

<annotated_excerpt>XML verified at mock model endpoint)Diff

ReviewNoteunified into structuredQuoteRef + notein composer trayAI use
Select exactly one:
Tool(s) and scope: Maka (design research, implementation, automated & live macOS verification, and code review). Commits carry the
Generated-by: Makatrailer.Checklist
Does this PR entail a breaking change or persisted-data migration?
upgrade_compat.rscoverage under Summary abovenotefield with#[serde(default, skip_serializing_if = "Option::is_none")]; cold-migration readback & live send verified inupgrade_compat.rs)Does this PR entail a change in behavior?