Skip to content

Flows: a length being typed or dragged no longer cuts keyframes on the way - #601

Merged
bubulux merged 1 commit into
mainfrom
fix/flow-length-cuts-while-typing
Dec 6, 2026
Merged

bubulux merged 1 commit into
mainfrom
fix/flow-length-cuts-while-typing

Conversation

@bubulux

@bubulux bubulux commented Dec 6, 2026

Copy link
Copy Markdown
Collaborator

The bug

In the Studio's Flows app, changing a flow's length by typing removed keyframes: "20" typed over "30" left the flow at 20 s with every keyframe after 2 s gone.

The Length field handed on every keystroke (NumberInput without commitOnBlur), and a shorter length removes the keyframes and markers past it. Typing passes through an empty field (taken as the minimum, 1 s) and "2" (2 s) before it reads "20".

What changed

  • Studio (FlowsApp.tsx): the length is taken on Enter, on leaving the field or with the arrows; Escape drops what was typed. A change of length is one Undo step of its own. When a shorter length removes keyframes or markers, a toast says how many, with Undo.
  • Phone (ui/Editor.tsx, src/ui/forms.tsx): the Length slider had the same fault while dragging (every step on the way cut). While the thumb is dragged, the length is now cut from the flow as it was when the drag began; Slider gained onDragStart and onDragEnd.
  • docs/features/flows.md says when the length is taken.

Decisions

  • A shorter length still removes what lies past it (the flow rules want every keyframe within the length). Only the accidental cut on the way is fixed, and the deliberate one is now said and undoable from the toast.

Checked

  • make check passes.
  • Clicked through locally (Playwright, a copy of the flow "Fade MC": 30 s, keyframes at 0, 6.5 and 10.5 s):
    • field emptied, then "2" typed and left for a second: still 4 keyframes, nothing saved;
    • "20", Enter: saved as 20 s with all keyframes;
    • "8", Tab: saved as 8 s without the keyframe at 10.5 s, toast "1 keyframe after 8 s removed with the shorter length";
    • Undo in the toast: 20 s and all keyframes again, saved;
    • "1" typed, Escape: nothing changed.

Not checked

  • The phone's slider: typechecked and bundled only, not run on a device. To test: drag Length below a keyframe and back up in one drag (the keyframe must come back), then release below it (it is removed).
  • No unit test: the fix is in how two fields hand their value on.

🤖 Generated with Claude Code

…e way

The Studio's Length field handed on every keystroke, and a shorter length
removes the keyframes and markers past it: "20" typed over "30" passed
through 1 and 2 seconds, so everything after 2 s was gone.

- Studio: the length is taken on Enter, on leaving the field or with the
  arrows (NumberInput's commitOnBlur). A cut is a step of its own for
  Undo, and a toast says what a shorter length removed, with Undo.
- Phone: while the Length slider is dragged, the length is cut from the
  flow as it was when the drag began, so passing a shorter length on the
  way takes nothing for good (Slider: onDragStart, onDragEnd).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@bubulux
bubulux merged commit 0dd5bb5 into main Dec 6, 2026
5 checks passed
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.

1 participant