Skip to content

Undo/redo in the export file name template editor #3017

Closed

Description

@smuhlaci

The fewer issues I have to read, the more new features I will have time to implement, so I ask that you please try these things first

Description

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):

  1. Open a file and press Export to bring up the export dialog.
  2. Click the output file name to expand the template editor.
  3. Type a custom template, e.g. ${FILENAME}-${SEG_LABEL}${EXT}.
  4. Press Reset.
  5. 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

  1. added a commit that references this issue on Oct 18, 2026
    3c1b6a4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions