Repository navigation
Delete extra themes from the theme picker - #14713
Conversation
Delete on an extra (user-installed) theme opens the shared faded confirmation dialog; confirming runs omarchy-theme-remove and selection lands on the theme before the deleted one. Stock themes and user overrides of them are not offered for deletion, apply/re-ask are blocked while a removal runs, and row refreshes queue so a deletion never leaves the list stale.
|
| } | ||
|
|
||
| function applySelected() { | ||
| if (themeMode && deleteThemeProc.running) return |
There was a problem hiding this comment.
The apply guard ends when deleteThemeProc exits, but the deleted theme stays selected until the row refresh finishes. Pressing Enter in that gap—including holding Enter after confirming—closes the picker and calls omarchy-theme-set with the deleted name. The command rejects the missing theme, so nothing is applied. Keep the guard active until the refreshed rows have been loaded.
Keep Delete disabled until the stock listing finishes successfully, so a stock override cannot look deletable in the startup window. Also hold theme apply (and further delete asks) from removal exit until the refreshed rows load, so Enter cannot apply the just-deleted theme in the gap.
| Process { | ||
| id: deleteThemeProc | ||
| onExited: function(exitCode) { | ||
| if (exitCode === 0) root.awaitingDeleteRefresh = true |
There was a problem hiding this comment.
If an open-time refresh loads the post-deletion rows before deleteThemeProc exits, this line sets awaitingDeleteRefresh back to true. The next refresh returns unchanged rows, so updateThemeRows skips the branch that clears the flag. Enter and Delete then stop working on every remaining theme until the picker is reopened.
This ordering is possible because omarchy-theme-remove waits for its notification after deleting the directory. Clear the flag when the post-deletion refresh finishes, even when its rows are unchanged.
What
Extra (user-installed) themes can now be deleted without leaving the theme picker:
omarchy-theme-remove(its guards and notification included); Escape or clicking the backdrop cancels, and all other input is routed to the dialog while it is open.~/.config/omarchy/themeswith no stock twin — the same listingomarchy-theme-removeoffers, minus user overrides of stock themes, whose directories hold customizations rather than an extra theme (those remain removable from the CLI). Delete does nothing on stock themes or in the background picker.Deleting the currently active extra theme is allowed, matching
omarchy-theme-remove.Testing
test/shell.d/image-picker-test.shpasses (161 checks), including behavioral runs of the confirm/cancel flow, stock/override/background no-ops, the mid-removal guards, the refresh queue, and the post-deletion landing selection.qmllintshows only the file's pre-existing unresolved-import warning class.