Skip to content

fix(chat): support Home and End in the composer - #706

Closed
Zhangs-11 wants to merge 1 commit into
agegr:mainfrom
Zhangs-11:fix/chat-home-end
Closed

fix(chat): support Home and End in the composer#706
Zhangs-11 wants to merge 1 commit into
agegr:mainfrom
Zhangs-11:fix/chat-home-end

Conversation

@Zhangs-11

@Zhangs-11 Zhangs-11 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • implement consistent Home and End behavior in the multiline chat composer
  • use the current logical line for unmodified shortcuts and the whole input for Ctrl/Cmd shortcuts
  • preserve native Shift selection direction and leave IME composition and Alt+Home/Alt+End untouched

Behavior

Shortcut Result
Home / End Move to the start / end of the current logical line
Shift+Home / Shift+End Extend the selection to the current line boundary
Ctrl/Cmd+Home / Ctrl/Cmd+End Move to the start / end of the full message
Ctrl/Cmd+Shift+Home / Ctrl/Cmd+Shift+End Extend the selection to the full-message boundary

Testing

  • npm test — 883 tests passed
  • node_modules/.bin/tsc --noEmit
  • npm run lint
  • Chromium browser verification covering multiline caret movement and Shift selection on the rebased commit

Demo

Home and End navigation in the composer

Recorded from Zhangs-11/pi-web@60d3908fa72e1c4d2bc1e7ba8f324319f9f82c6c on the clean rebased branch, served at http://127.0.0.1:30154 with next dev because repository instructions prohibit next build during development. The run used a fresh isolated Pi agent directory, workspace, and Chrome profile with the normal application transport. A real GPT-6-Astra round created the displayed session; the demonstrated key presses were normal browser keyboard input with no fixtures, mock transport, DOM-event injection, or test-only hooks.

Zhangs-11 added a commit to Zhangs-11/pi-web that referenced this pull request Sep 5, 2026
@agegr

agegr commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Thanks for the contribution. These shortcuts already work through the native textarea on main, so we will keep the native behavior and close this PR. A specific OS/browser reproduction of a failure on main would help justify a targeted fix.

@agegr agegr closed this Sep 5, 2026
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.

2 participants