fix(flow-chat): add editable capsules for large pastes - #2743
Merged
Conversation
Co-authored-by: BitFun <318544290+bitfun-ai@users.noreply.github.com>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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 testspnpm --dir src/web-ui exec eslint src/flow_chat/components/RichTextInput.tsx src/flow_chat/components/ChatInput.tsx --max-warnings=0— passedpnpm run check:web:appearance— passedpnpm run i18n:audit— passed with 0 warningsBITFUN_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 WebViewgit diff --check— passedpnpm --dir tests/e2e exec tsc --noEmit --pretty false— blocked by existing E2E project errors; the changed spec reports no TypeScript errorwebsocket-adapter.ts(SearchSessionContentMessageandSearchSessionContentResponse)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
Generated with BitFun