Skip to content

feat(chat): fragment comments to input demo MVP - #294

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

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

Conversation

@mydmdm

Copy link
Copy Markdown
Contributor

Summary

Implements the user-approved demo MVP for #293, independently of #172. Select inline, multiline, cross-paragraph or code text within one completed, loaded assistant Markdown segment, open Comment, and explicitly Add to input. Additions append to the latest owning-thread draft without overwriting existing text; several comments and free-form instructions can be reviewed and edited before ordinary Send.

Reuses Milkdown selection capture, Common UI primitives, thread-scoped drafts and the existing submission path. Each template contains the capture-time quotation, short neighboring context and comment. Han characters in the comment choose Chinese labels, ASCII letters otherwise choose English, and remaining input falls back to UI language. Original text is never translated.

Selection reporting has a separate lifecycle from the editor: completing a response or changing active tabs does not remount Milkdown. Tool/thinking/permission and active streaming surfaces do not enable comments; selections spanning distinct text surfaces are rejected. Architecture documentation is updated.

Scope and limitations

  • Input is the only editing authority after insertion; source changes never rewrite inserted text or block Send.
  • No separate Save action, comment list/emitted markers, default presets, persistent highlights, two-way synchronization or durable annotation store. Unsent content uses existing runtime draft lifetime.
  • No new API, wire schema, storage, dependency or subtree changes; no automatic revision, memory/preferences, telemetry or Canvas branching.
  • Browser coverage uses the isolated production Chat fixture rather than a live model/backend. Existing submission-controller tests cover the unchanged real send path. Demo workability does not establish user frequency or quantified product value.
  • Explicit delivery target: alpha; development base origin/alpha at 191a79c8434d4f1374fdd29160fec656f1780c5f. No merge, release or Issue closure is requested.

Validation

  • Repository pnpm typecheck, pnpm format, pnpm lint:fix, pnpm check:i18n and git diff --check passed. Lint reports 0 errors and 350 existing warnings.
  • Targeted Vitest regression suite: 12 files, 107 tests passed, including fragment templates/comments, actual Milkdown selections, preview lifecycle/accessibility/chrome/drag/roundtrip, composer, message list, history and submission controller.
  • VITE_CHAT_PERFORMANCE_FIXTURE=true pnpm --filter @huabu/web build passed.
  • pnpm --filter @huabu/web exec playwright test --config e2e/chat-activation.config.ts: 8 tests passed, including all four fragment-feedback scenarios and existing activation, turn-completion, eviction and performance regressions.
  • Existing test environment warnings and production bundle size warnings remain; no live-provider demo or manual cross-browser verification was performed.

Capture selected completed response text, collect localized quote/comment templates in the owning thread draft, and preserve explicit Send as the only generation action. Cover selection, draft lifecycle and production chat regressions; document the demo MVP boundary.

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