Skip to content

feat(chat): selected text Copy / Note / Comment actions - #295

Merged
Yuqing (mydmdm) merged 1 commit into
alphafrom
fix/issue-293
Oct 12, 2026
Merged

Yuqing (mydmdm) merged 1 commit into
alphafrom
fix/issue-293

Conversation

@mydmdm

Copy link
Copy Markdown
Contributor

Summary

Alpha follow-up to merged #294 for #293, implementing the user-approved selected-content actions: Copy / Add as note / Comment as icon buttons with localized tooltips and accessible names.

Copy writes only selected plain text using the existing clipboard helper, with an explicit error and retry on failure. Add as note saves only selected Markdown through the existing canvasStore.addNode path and user-from-chat thread origin. Markdown comes from the canonical Milkdown serializer over a parent-preserving document slice, retaining partial inline marks, links, list structure and fenced code without unselected text.

Comment retains the existing snapshot editor and explicit Add to input flow. The whole-response bottom buttons are unchanged. Successful copy/note actions dismiss the popover without touching the input draft or triggering generation. Only completed, loaded assistant text in the active Chat is eligible; streaming and cross-surface exclusions remain unchanged.

Scope

No default comments, streaming comment support, permanent annotations, main-targeted delivery, API/schema/dependency/subtree changes or release. The follow-up diff is based on Alpha merge ae491db34cb5ab26855c46ff3719102c9813437b; it does not repeat the original MVP changes. Related architecture docs describe the selection actions and Markdown capture.

Validation

  • Repository pnpm typecheck, pnpm format, pnpm lint:fix, pnpm check:i18n, and git diff --check passed. Lint: 0 errors, 350 existing warnings.
  • Targeted Vitest regressions: 12 files / 115 tests passed, including exact selected Markdown (partial marks/links/list/code/cross-paragraph), plain-text copy, clipboard failure/retry, note payload/thread origin, draft isolation and the unchanged comment/composer/history/editor paths.
  • Production Chat fixture build passed.
  • All four existing production activation/windowing/turn-completion/performance tests passed. All five fragment-feedback browser tests passed, including the new icon/tooltip/clipboard/whole-response-action scenario. The initial combined run found only an ambiguous test locator matching CodeMirror Copy buttons; corrected the locator to the selection button's accessible label and reran the entire fragment spec successfully.
  • Browser coverage uses the isolated production fixture, not a real backend/provider; selected Note content and creation payload are verified with the real serializer and component tests, not a live persistent Note demo. No manual cross-browser verification was performed.

This PR targets alpha, not main. No merge is requested automatically.

Add Copy and Add as note alongside Comment in the selected-text popover. Preserve selected Markdown with the canonical Milkdown serializer, retain whole-response actions, and cover clipboard, note payload and browser interactions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mydmdm
Yuqing (mydmdm) merged commit 10d4879 into alpha Oct 12, 2026
4 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