You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Undo/redo in the export file name template editor #3017
In the export dialog's Output file name template section, the edits that LosslessCut makes to the input on your behalf cannot be undone:
clicking a variable (e.g. ${SEG_NUM}) to insert it at the caret
pressing Reset
The input is a controlled React input and both of these set its value from state, so the browser's own undo stack doesn't cover them. Recovering a template you spent time on means retyping it.
Steps to reproduce (verified on 3.69.0, Windows):
Open a file and press Export to bring up the export dialog.
Click the output file name to expand the template editor.
Type a custom template, e.g. ${FILENAME}-${SEG_LABEL}${EXT}.
Press Reset.
With the input focused, press Ctrl+Z — the custom template is not restored.
The same applies to inserting a variable by clicking it: Ctrl+Z won't take it back out.
Proposal
Keep a small undo history scoped to that editor:
Undo/Redo buttons next to Reset, and Ctrl/Cmd+Z, Ctrl/Cmd+Shift+Z and Ctrl+Y while the input is focused.
Typing coalesced by the existing 500 ms debounce, so a burst of keystrokes is a single undo step; variable insertion and Reset recorded immediately so they're undoable even within the debounce window.
Scoped to this one component — it does not touch the global keyboard actions or the segment history.
I've implemented this and opened a PR alongside this issue so you can see the shape of it before deciding. Happy to close both if you'd rather not carry the extra surface.
Activity
Make template editor edits undoable with native undo