Skip to content

Delete extra themes from the theme picker - #14713

Merged
dhh merged 2 commits into
quattrofrom
delete-extra-themes-from-picker
Oct 9, 2026
Merged

dhh merged 2 commits into
quattrofrom
delete-extra-themes-from-picker

Conversation

@dhh

@dhh dhh commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

What

Extra (user-installed) themes can now be deleted without leaving the theme picker:

  • Pressing Delete on an extra theme opens the shared confirmation dialog, centered with its faded backdrop. Confirming runs 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.
  • After deletion the carousel refreshes in place and selection lands on the theme before the deleted one (previous match under a filter; the new first theme when deleting the first), so repeated deletions keep your place.
  • Deletable means a real directory under ~/.config/omarchy/themes with no stock twin — the same listing omarchy-theme-remove offers, 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.
  • Applying a theme or asking again is blocked while a removal runs, and theme row / extra theme refreshes now queue behind a running refresh so a deletion finishing mid-refresh never leaves the list stale.

Deleting the currently active extra theme is allowed, matching omarchy-theme-remove.

Testing

  • test/shell.d/image-picker-test.sh passes (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.
  • qmllint shows only the file's pre-existing unresolved-import warning class.
  • Reviewed with Claude before opening; its actionable findings (stock-override distinction, stale-refresh race, mid-removal apply, dialog state on reopen, default-button reset) are addressed in this change.

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.
@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Adds theme deletion UI and logic to the image picker.

Fix the refresh ordering that leaves Enter and Delete blocked before merging.

Findings

  1. P1 Theme actions stay blocked ▶
  2. P2 Enter applies a deleted theme ▶

Summary

The theme picker now confirms and removes extra themes without closing. It keeps the nearby selection and protects stock customizations.

  • Deletion waits for a successful stock listing.
  • Applying and deleting are blocked while removal and its refresh are pending.
  • One refresh ordering can leave both actions blocked until the picker is reopened.

Diagram

sequenceDiagram
  participant User
  participant Picker
  participant Remove as omarchy-theme-remove
  participant Rows as Theme refresh
  User->>Picker: Delete extra theme
  Picker->>User: Confirm deletion
  User->>Picker: Confirm
  Picker->>Remove: Remove selected theme
  Remove->>Remove: Delete directory and send notification
  Remove-->>Picker: Finished
  Picker->>Rows: Refresh themes
  Rows-->>Picker: Updated rows
  Picker->>Picker: Select nearby theme
Loading

Reviews (2) · Last reviewed commit: "Fail closed on theme deletion until stoc..." · Reviewed by Greptile

}

function applySelected() {
if (themeMode && deleteThemeProc.running) return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Enter applies a deleted theme

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.
@dhh
dhh merged commit 988f44e into quattro Oct 9, 2026
1 check passed
@dhh
dhh deleted the delete-extra-themes-from-picker branch October 9, 2026 11:18
Process {
id: deleteThemeProc
onExited: function(exitCode) {
if (exitCode === 0) root.awaitingDeleteRefresh = true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Theme actions stay blocked

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.

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.

2 participants