Skip to content

fix(flow-chat): add editable capsules for large pastes - #2743

Merged
wgqqqqq merged 2 commits into
GCWing:1.0.0-explorefrom
wgqqqqq:wgq/fix-large-paste-caret
Sep 2, 2026
Merged

fix(flow-chat): add editable capsules for large pastes#2743
wgqqqqq merged 2 commits into
GCWing:1.0.0-explorefrom
wgqqqqq:wgq/fix-large-paste-caret

Conversation

@wgqqqqq

@wgqqqqq wgqqqqq commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Render chat pastes over 1000 characters as interactive capsules instead of exposing the full payload in the editor.
  • Add view, copy, edit, save, cancel, collapse, and remove interactions while preserving complete text through drafts, queues, failed-turn recovery, and transport expansion.
  • Keep the caret visually and logically after consecutive capsules, including after repeated Backspace deletion.

Fixes #2542

Type and Areas

Type: bug fix / UI/UX / test

Areas: web UI, chat composer, desktop E2E

Motivation / Impact

Large pasted prompts remain manageable and editable without losing their original content. The fix uses a sanitized zero-width caret anchor to avoid Chromium/WebView drawing the caret at the start of the line after a non-editable inline capsule.

Remote workspace and remote-control submissions still expand the capsule placeholders before transport. Peer Device Mode keeps mappings scoped by device surface and session, and Detached Dispatch receives the complete prompt without depending on controller-side DOM state or a live connection.

Verification

  • pnpm --dir src/web-ui exec vitest run src/flow_chat/components/RichTextInput.test.tsx src/flow_chat/components/ChatInputDraftRecovery.test.ts src/flow_chat/store/sessionComposerStore.test.ts src/flow_chat/utils/pendingQueueDraft.test.ts src/flow_chat/hooks/useMessageSender.test.tsx --maxWorkers=50% — passed, 43 tests
  • pnpm --dir src/web-ui exec eslint src/flow_chat/components/RichTextInput.tsx src/flow_chat/components/ChatInput.tsx --max-warnings=0 — passed
  • pnpm run check:web:appearance — passed
  • pnpm run i18n:audit — passed with 0 warnings
  • BITFUN_E2E_APP_MODE=debug pnpm --dir tests/e2e exec wdio run ./config/wdio.conf.ts --spec './specs/l1-chat-input.spec.ts' --mochaOpts.grep 'should keep the caret after the previous capsule' — passed, 1 test in the real Desktop WebView
  • git diff --check — passed
  • pnpm --dir tests/e2e exec tsc --noEmit --pretty false — blocked by existing E2E project errors; the changed spec reports no TypeScript error
  • Full Web UI type-check remains blocked by existing generated API export errors in websocket-adapter.ts (SearchSessionContentMessage and SearchSessionContentResponse)

Reviewer Notes

The real-device remote scenarios (SSH workspace, Remote Control, Peer Device Mode, and Detached Dispatch) were reviewed at the serialization/transport boundary but were not exercised end-to-end across separate hosts.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

Generated with BitFun

Co-authored-by: BitFun <318544290+bitfun-ai@users.noreply.github.com>
@wgqqqqq
wgqqqqq marked this pull request as ready for review September 2, 2026 08:07
Co-authored-by: BitFun <318544290+bitfun-ai@users.noreply.github.com>
@wgqqqqq
wgqqqqq merged commit 800e1f7 into GCWing:1.0.0-explore Sep 2, 2026
12 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