Skip to content

fix(notebook): restore selection after undo edits - #74

Merged
BartvHelvert merged 4 commits into
masterfrom
fix/notebook-undo-selection
Nov 6, 2026
Merged

BartvHelvert merged 4 commits into
masterfrom
fix/notebook-undo-selection

Conversation

@BartvHelvert

Copy link
Copy Markdown
Owner

What this changes

Restore notebook selection through the ordered edit stream after undo and redo. The separate RPC reply could arrive first, select the old cell views, and then lose that selection when the following splice removed them. Send the selection event only to the editor that requested the operation, keeping the existing guard against taking focus from a cell the user began editing.

The drag UI test now repeats undo and redo of a multi-cell move and checks selection in both directions.

Fixes #67

Stacked on the hierarchy readiness PR (base: test/ui-hierarchy-ready); this PR adds only the notebook ordering fix.

How it was tested

Checklist

  • Nothing is special-cased for one extension.
  • A new feature has a UI test. Existing notebook behavior; the regression UI test was extended and run.
  • No internal, override-only, obsolete or deprecated platform API.
  • docs/ is updated where behaviour changed, docs/status.md especially. This restores the existing notebook undo behavior; no new API or setup.
  • Third-party material keeps its notice and is listed in NOTICE.md. No third-party material added.

The split-mode hierarchy action can still be disabled immediately after
the client moves its caret. Use the driver's bounded action retry while
keeping the hierarchy assertions, and capture probe logs on CI failures.

Refs #69
The undo RPC reply can arrive before its streamed cell edits. Selecting
old views then lets the following splice remove them and lose selection.
Send selection through the same ordered flow, only to the editor that
requested undo or redo, and keep focus in a cell the user began editing.
Exercise repeated undo and redo of a multi-cell move in the UI test.

Refs #67
Base automatically changed from test/ui-hierarchy-ready to master November 5, 2026 22:38
The list fixture's click can leave the popup open without invoking the
chosen action. Focus the popup list, select the item and confirm it with
Enter, then wait for closure. Repeat copy and undo to exercise activation
while keeping the existing notebook and extension-host assertions.

Refs #70
Allow a bounded 60-second connection idle margin in both test IDEs. A controlled 25-second backend pause disconnects the default connection but survives with this margin.

Refs #71
@BartvHelvert
BartvHelvert merged commit 80d747e into master Nov 6, 2026
7 of 8 checks passed
@BartvHelvert
BartvHelvert deleted the fix/notebook-undo-selection branch November 6, 2026 21:03
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.

Notebook undo can lose selection when its reply overtakes edit events

1 participant