Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

docs(editor): drop the delete route from the reachability comment

EtienneLescot16e6f2d3cc5f
diff --git a/src/lib/ai-edition/store/useTimeline.test.ts b/src/lib/ai-edition/store/useTimeline.test.ts
index 9f62d0a47..78854e817 100644
--- a/src/lib/ai-edition/store/useTimeline.test.ts
+++ b/src/lib/ai-edition/store/useTimeline.test.ts
@@ -1098,8 +1098,9 @@ describe("useTimeline undo history", () => {
// `zoomFocusRollbackRef` / `annotationRollbackRef` hold the document a drag started
// from, kept until the commit that records it. A drag does not always reach a commit,
// and both commits are reachable without one: the inspector's annotation `<textarea>`
-// writes live on every keystroke and commits `onBlur`, so closing the panel or deleting
-// the region removes the focused node without ever firing blur -- and `SliderCell` wires
+// writes live on every keystroke and commits `onBlur`, so closing the panel unmounts the
+// focused node before blur can fire (the region's own delete button is an `onClick`, which
+// runs after blur, so that route does not reach here) -- and `SliderCell` wires
// mouseup/touchend/keyup straight to `onCommit` with no `onChange` in front, so a bare
// click on a stroke-width thumb reaches `commitAnnotationChange()` carrying that
// leftover. `NewEditorShell` builds ONE `useTimeline()` and hands it to the inspector,
diff --git a/src/lib/ai-edition/store/useTimeline.ts b/src/lib/ai-edition/store/useTimeline.ts
index 2ce0b2699..7823459ec 100644
--- a/src/lib/ai-edition/store/useTimeline.ts
+++ b/src/lib/ai-edition/store/useTimeline.ts
@@ -712,8 +712,12 @@ export function useTimeline() {
// See `commitZoomFocus`: the snapshot counts only while the document on screen is
// still the one this hook's live writes produced. This is the reachable half.
// The inspector's annotation `<textarea>` calls `updateAnnotationLive` on every
- // keystroke and commits `onBlur`, and closing the panel or deleting the region
- // removes the focused node without firing blur; `SliderCell` then wires mouseup
+ // keystroke and commits `onBlur`, and closing the panel unmounts the focused node
+ // before blur can fire: `V4Timeline`'s `startScrub` clears the selection from a
+ // pointerdown handler, and React flushes discrete events synchronously, so the
+ // textarea is gone before mousedown moves focus. (Deleting the region does NOT
+ // reach here — its button is an `onClick`, which runs after blur has committed.)
+ // `SliderCell` then wires mouseup
// straight to `onCommit`, so a bare click on a stroke-width thumb lands here
// carrying the typing's base. `NewEditorShell` builds one `useTimeline()` for
// both, so it is one instance's ref.