Skip to content

refactor(chat-ui): unify caret placement helper#2657

Open
curtisman wants to merge 8 commits into
microsoft:mainfrom
curtisman:fixcur
Open

refactor(chat-ui): unify caret placement helper#2657
curtisman wants to merge 8 commits into
microsoft:mainfrom
curtisman:fixcur

Conversation

@curtisman

@curtisman curtisman commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

Small refactor in the chat-ui ChatPanel input handling that removes a duplicated caret-placement helper and fixes the caret position when recalling commands from history.

Changes

  • Removed the duplicate moveCursorToEnd() helper, which was functionally equivalent to the existing placeCaretAtEnd(). acceptCompletion() now calls placeCaretAtEnd().
  • 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.

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.
@curtisman curtisman closed this Jul 13, 2026
auto-merge was automatically disabled July 13, 2026 23:33

Pull request was closed

@curtisman curtisman reopened this Jul 13, 2026
@curtisman curtisman enabled auto-merge July 13, 2026 23:33
@curtisman curtisman closed this Jul 13, 2026
auto-merge was automatically disabled July 13, 2026 23:37

Pull request was closed

@curtisman curtisman reopened this Jul 13, 2026
@robgruen

Copy link
Copy Markdown
Collaborator

This is a test!

@robgruen

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@robgruen

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@robgruen

Copy link
Copy Markdown
Collaborator

/azp run TypeAgent Smoke Tests

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@curtisman curtisman enabled auto-merge July 14, 2026 02:11
@curtisman curtisman added this pull request to the merge queue Jul 14, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 14, 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