Skip to content

Add undo for removing an action - #96

Merged
danielchalmers merged 1 commit into
mainfrom
undo-remove-action
Nov 13, 2026
Merged

danielchalmers merged 1 commit into
mainfrom
undo-remove-action

Conversation

@danielchalmers

@danielchalmers danielchalmers commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Remove in Settings deletes an action at once, with no confirmation and no way back. One stray click on the bin loses an action's name, icon, target, arguments, or script. The list also ignored the Delete key, which is the usual way to remove a selected list item on Windows.

Changes

  • Undo bar. After Remove, a bar at the bottom of the Actions card names what went ("Mute removed.") with an Undo button. Undo puts the action back at its old position, selects it, and moves keyboard focus to it.
  • Lifetime. The bar stays until the list changes again (add, remove, reorder, drop, or dragging slices in the menu) or Settings closes. There is no timer. Only the most recent removal can be undone, and there is no Ctrl+Z.
  • Delete key. Delete on the focused list removes the selected action, the same as the button. The Remove tooltip reads "Remove (Delete)" and the list's help text mentions the key.
  • Screen readers. Undo announces "Mute restored." The Undo button's help text carries the bar's message, so focusing the button says what it will bring back.

Design notes

  • ActionsSettingsViewModel keeps the removed action and its index. Any later collection change discards it, which keeps the saved index valid without tracking edits.
  • The editor's per-action state (Editor.Forget) is now dropped when the undo offer ends instead of at removal, so a restored Key action still follows key changes.
  • The bar reuses InfoBarBorderStyle and sits above the drag caption, so nothing in the list moves when it appears.

Before and after

Dark theme, captured from a harness that hosts the real SettingsWindow.

1. After removing Mute

1-undo-bar

2. After removing the last action (long name trims)

2-undo-last-action

Remove now leaves an undo bar under the actions list until the list changes again, and Delete removes the selected action.
@danielchalmers
danielchalmers marked this pull request as ready for review November 13, 2026 02:12
@github-actions github-actions Bot added the enhancement New feature or request label Nov 13, 2026
@danielchalmers
danielchalmers merged commit 1254312 into main Nov 13, 2026
4 checks passed
@danielchalmers
danielchalmers deleted the undo-remove-action branch November 13, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant