Skip to content

fix(app): preserve composer caret after requests#36503

Open
Hona wants to merge 1 commit into
anomalyco:devfrom
Hona:caret-request-dock
Open

fix(app): preserve composer caret after requests#36503
Hona wants to merge 1 commit into
anomalyco:devfrom
Hona:caret-request-dock

Conversation

@Hona

@Hona Hona commented Jul 12, 2026

Copy link
Copy Markdown
Member

Summary

  • persist the live contenteditable cursor before request docks unmount the composer
  • restore the saved cursor synchronously before the browser inserts the first printable key
  • cover a moved draft caret across question-dock removal

Verification

  • focused request-dock regression: 5/5 repeated runs
  • full request-dock regression suite: 3 passed
  • app typecheck
  • E2E typecheck
  • repository pre-push typecheck: 30 tasks passed

@Hona Hona requested a review from Brendonovich as a code owner July 12, 2026 10:09
Copilot AI review requested due to automatic review settings July 12, 2026 10:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a session composer UX regression where the contenteditable caret position could be lost when request docks temporarily unmount the composer, ensuring the caret is restored before the next printable key is inserted.

Changes:

  • Persist the latest contenteditable caret position into prompt state on editor blur.
  • When auto-focusing the composer on the first printable keypress, also restore the caret to the saved position (or prompt end).
  • Add an E2E regression test that exercises caret preservation across question-dock mount/unmount.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/app/src/pages/session.tsx Restores the prompt editor caret when auto-focusing the composer in the document keydown handler.
packages/app/src/components/prompt-input.tsx Persists the current caret position to the prompt store on blur so it can be restored after unmount/remount.
packages/app/e2e/regression/session-request-docks.spec.ts Adds a regression test verifying the caret is restored before typing after a request dock closes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants