refactor(chat-ui): unify caret placement helper#2657
Open
curtisman wants to merge 8 commits into
Open
Conversation
Consolidate the duplicate moveCursorToEnd helper into the existing placeCaretAtEnd, and place the caret at the end of the input when recalling a command via history navigation so users can continue editing from the end instead of the start.
robgruen
approved these changes
Jul 13, 2026
auto-merge was automatically disabled
July 13, 2026 23:33
Pull request was closed
auto-merge was automatically disabled
July 13, 2026 23:37
Pull request was closed
Collaborator
|
This is a test! |
Collaborator
|
/azp run |
|
No pipelines are associated with this pull request. |
Collaborator
|
/azp run |
|
No pipelines are associated with this pull request. |
Collaborator
|
/azp run TypeAgent Smoke Tests |
|
No pipelines are associated with this pull request. |
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
Small refactor in the chat-ui
ChatPanelinput handling that removes a duplicated caret-placement helper and fixes the caret position when recalling commands from history.Changes
moveCursorToEnd()helper, which was functionally equivalent to the existingplaceCaretAtEnd().acceptCompletion()now callsplaceCaretAtEnd().navigateHistory()now places the caret at the end of the recalled command text. Previously, after pressing ArrowUp/ArrowDown to recall a prior command, the caret was left at the start of the input, forcing the user to manually move to the end before continuing to edit.Rationale
Consolidating the two helpers removes redundancy and keeps a single code path for caret placement. Placing the caret at the end on history recall matches typical shell/terminal behavior and lets users continue typing immediately.