Skip to content

chat: fix undo/redo skipping multiple no-edit requests#299330

Merged
connor4312 merged 1 commit intomainfrom
connor4312/275234
Mar 5, 2026
Merged

chat: fix undo/redo skipping multiple no-edit requests#299330
connor4312 merged 1 commit intomainfrom
connor4312/275234

Conversation

@connor4312
Copy link
Member

  • Fixes _willRedoToEpoch to advance one request at a time when there are no edit operations ahead, instead of jumping past all remaining requests
  • When redoing with no operations in the queue, now finds the next request-start checkpoint boundary and advances there, following the same single-step pattern as undo
  • Adds test case verifying undo and redo step through consecutive no-edit requests one at a time

Fixes #275234

(Commit message generated by Copilot)

- Fixes _willRedoToEpoch to advance one request at a time when there are
  no edit operations ahead, instead of jumping past all remaining requests
- When redoing with no operations in the queue, now finds the next
  request-start checkpoint boundary and advances there, following the same
  single-step pattern as undo
- Adds test case verifying undo and redo step through consecutive no-edit
  requests one at a time

Fixes #275234

(Commit message generated by Copilot)
Copilot AI review requested due to automatic review settings March 5, 2026 00:18
@connor4312 connor4312 enabled auto-merge (squash) March 5, 2026 00:18
@vs-code-engineering
Copy link

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@jrieken

Matched files:

  • src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.ts

Copy link
Contributor

Copilot AI left a comment

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 chat editing timeline undo/redo behavior so redo does not skip across multiple consecutive “no-edit” requests, aligning redo’s stepping with undo. It also adds a regression test covering the consecutive no-edit request scenario.

Changes:

  • Update _willRedoToEpoch to advance redo by request boundaries when there are no upcoming edit operations.
  • Ensure redo advances one request at a time even when the operation queue is empty.
  • Add a test verifying undo/redo step through consecutive no-edit requests individually.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.ts Adjusts redo target epoch computation to step through request-start checkpoints when no operations remain.
src/vs/workbench/contrib/chat/test/browser/chatEditing/chatEditingCheckpointTimeline.test.ts Adds coverage for undo/redo behavior across multiple no-edit requests.

You can also share your feedback on Copilot code review. Take the survey.

@connor4312 connor4312 merged commit 9a207cb into main Mar 5, 2026
24 checks passed
@connor4312 connor4312 deleted the connor4312/275234 branch March 5, 2026 00:51
@connor4312 connor4312 restored the connor4312/275234 branch March 5, 2026 01:35
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.

undo/redo redoes all requests

3 participants