Repository navigation
fix(web): place the sent message edit caret at the end - #1340
Conversation
Focus the inline editor without scrolling the transcript and show the end of long drafts on entry. Preserve the selection on updates to the same draft.
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
感谢贡献,已合并到 main! |
Summary
After stopping a Turn, opening the last sent message for editing used to leave the caret at the start. Focus the inline textarea without scrolling the transcript, place the caret at the end, and scroll the textarea so the last line of a long message is visible.
Initialize only on entry into edit mode. Draft text, sending state, and target changes leave the selection alone while the textarea stays mounted. Canceling and reopening initializes a fresh editor.
Related issues
N/A
UI Demo
Windows Chromium, isolated rendering of the real inline editor with sample text:
Test plan
npx vitest run --config tests/vitest.config.js apps/web-ui/packages/client/ui-chat/test— 39 passed. The new regression reproduced(0, 0)instead of(10, 10)on the baseline. Coverage includes multiline Chinese and emoji, editing without resetting the selection, cancel and reopen, rejection recovery, and changes to the editable target.node tools/check-boundaries.mjs— passed.npm run build:web:ui— passed with Node 22.22.0 after building the workspace dependencies.npm run lint— reported 23 errors in unchanged files. No out-of-scope fixes included.🤖 Generated with Claude Code