Skip to content

Allow theme deletion from the generic theme picker - #21143

Open
ThePrimeagen wants to merge 2 commits into
omacom:quattrofrom
ThePrimeagen:fix/72fcc036-6246-4060-a8d1-06ec2982208b
Open

ThePrimeagen wants to merge 2 commits into
omacom:quattrofrom
ThePrimeagen:fix/72fcc036-6246-4060-a8d1-06ec2982208b

Conversation

@ThePrimeagen

Copy link
Copy Markdown
Contributor

Pressing Delete on a user theme in the picker opened by omarchy-theme-switcher from a terminal does nothing: no confirmation dialog appears and the theme stays. The picker opened from the Omarchy menu works, but the terminal script path in bin/omarchy-theme-switcher goes through the generic image selector in shell/plugins/image-picker/ImagePicker.qml, where deletion was silently ignored.

Screenshots

Before After
before after

Reproduce

  1. Press Super+Enter to open a terminal.
  2. Create a user theme: mkdir -p ~/.config/omarchy/themes/Mygruv && cp -r /usr/share/omarchy/themes/gruvbox/. ~/.config/omarchy/themes/Mygruv/
  3. Run omarchy-theme-switcher
  4. Type Mygruv to filter the picker to that theme.
  5. Press Delete.
  6. The picker stays unchanged with the Mygruv label and no confirmation dialog appears.

More cases

First picker open after restarting the shell

Before After
before after

Related

The standalone theme switcher opens the picker through the generic
image-selector path, so themeMode stays false and Delete was silently
ignored. Treat a selection from the theme preview directory as a theme
for deletion, refresh the extra/stock theme lists on generic opens so
they are known on a first open, and reload rows after a deletion in
that picker.
…fresh

Replace the substring check on currentPath() with an explicit
themeDeleteMode flag set from ImagePickerModel.isThemePreviewSource()
against the session's theme-selector previews directory:

- Only refresh extra/stock theme lists when the generic selector opens
  theme previews, not on icon or background pickers.
- Guard applySelected() during deletion and post-delete refresh in
  themeDeleteMode so Enter cannot return a just-deleted theme.
- Reload rows in updateThemeRows() when themeDeleteMode is active even
  if currentPath() is empty under a filter or themeRows already matched
  the post-delete list while imageRows still held the removed theme, and
  clear awaitingDeleteRefresh once no queued refresh remains.
- Add unit tests in test/shell.d/image-picker-test.sh for the generic
  theme picker delete, apply guard, row refresh, and open flows.
@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Allows Delete in the terminal-opened theme picker without changing how it returns a selection.

  • The terminal theme picker can remove eligible user themes.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Terminal theme switcher] --> B[Generic image picker]
  B --> C{Theme preview source?}
  C -->|Yes| D[Enable theme deletion]
  D --> E[Delete and confirm]
  E --> F[Run omarchy-theme-remove]
  F --> G[Refresh theme rows]
  G --> H[Keep picker open]
  H --> I[Enter returns selection to caller]
Loading

Reviews (1) · Last reviewed commit: "Track theme-preview opens cleanly for de..." · Reviewed by Greptile

@chessing234

Copy link
Copy Markdown
Contributor

thanks. an extra theme can still be deleted from the generic theme picker, and apply cannot return a theme that was just deleted, in #21230. Please close this PR as superseded by #21230.

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review labels Dec 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Codex 6.2 Sol High reproduced the missing Delete dialog in the terminal picker on an Omarchy ISO worker, both on quattro and with this fix reverted. At 664747b, confirming Delete removed the test theme and Enter still returned the selected stock theme. Opus 5.5 High traced how the picker returns its selection and found no actionable issues in the diff.

The CLI and image-picker checks passed. Four other shell tests failed on the same assertions on quattro, so this is waiting on a green worker suite. Delete still depends on the terminal and the running shell using the same XDG_CACHE_HOME. #21230 closed without merging.

On quattro At 664747b
Delete leaves the extra theme selected without a dialog Delete opens the confirmation dialog for the extra theme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants