Skip to content

Show themes without a preview image in the theme picker - #18816

Closed
ThePrimeagen wants to merge 3 commits into
omacom:quattrofrom
ThePrimeagen:fix/bb4ee0e5-b8aa-4aab-a2a9-89c6bef218d8
Closed

ThePrimeagen wants to merge 3 commits into
omacom:quattrofrom
ThePrimeagen:fix/bb4ee0e5-b8aa-4aab-a2a9-89c6bef218d8

Conversation

@ThePrimeagen

Copy link
Copy Markdown
Contributor

A theme with only a colors.toml is listed by omarchy theme list and applied by omarchy theme set, but the theme picker never shows it: typing its name gives "No matches". bin/omarchy-theme-switcher only adds a picker row for a theme with a preview.* or a backgrounds/ image.

Screenshots

Before After
before after

Reproduce

  1. Press Super+Enter to open a terminal.
  2. Make a theme with only colours: mkdir -p ~/.config/omarchy/themes/colours-only && cp /usr/share/omarchy/themes/gruvbox/colors.toml ~/.config/omarchy/themes/colours-only/
  3. Run omarchy theme list: it lists Colours Only.
  4. Run omarchy theme set colours-only: the theme applies.
  5. Run omarchy theme switcher and type colours.
  6. The picker shows "No matches" instead of a Colours Only card.

More cases

Opened from the menu while Colours Only is the current theme, the picker selects Catppuccin Latte

Before After
before after

Related

Generate a solid preview from a theme's background colour when it has no preview or backgrounds, so colours-only themes get a picker row. In the shell picker, wait for the behind-open refresh when the held rows do not list the current theme, so the menu-opened picker preselects the current theme instead of the first row.
@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No new blocking issue was found.

Summary

Adds theme-picker cards for themes without preview media.

  • Themes without preview artwork now get a card in the theme picker.
  • The theme picker waits for rows that include the active theme.

No new findings were accepted. Both previous threads were unnumbered, so they have no numbered finding entries.

Reviews (4) · Last reviewed commit: "Keep the picker's fast check cheap and n..." · Reviewed by Greptile

Comment thread bin/omarchy-theme-switcher Resolved
Comment thread bin/omarchy-theme-switcher Resolved
The picker rebuilt its previews only when a theme folder's modification time
changed. Editing colors.toml in place leaves the folder alone, so a
colours-only theme kept the preview of its old background colour. Count each
theme's colors.toml size and modification time in that check too, and test
that a colours-only theme gets a preview of its background and that an
in-place edit redraws it.

Co-authored-by: Cursor <cursoragent@cursor.com>
…view

Drop the per-theme colors.toml stat from the fast signature: it runs on every picker open, the hot path omarchy-dev-benchmark-theme-switcher guards, and every stock theme has a colors.toml, all so an in-place colour edit redraws.

When magick cannot draw a colours-only preview, leave the theme without a row as before, rather than linking the first stock theme's preview.png under its name.

Keep one test case, the one that fails on the base branch: a colours-only theme gets a preview in its background colour. The half asserting the in-place redraw goes with the stat, and the one-use helpers are inlined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Pushed d1612a6 on top of this, so it is ready for the maintainer.

What changed, and why:

  • The colors.toml stat in the fast signature is gone. That loop runs on every picker open, the path omarchy-dev-benchmark-theme-switcher guards, and every stock theme has a colors.toml, so it cost an extra stat process per theme every time just so an in-place colour edit would redraw. A new or renamed theme still redraws, as before.
  • The magick-failure fallback is gone. It linked the first stock theme's preview.png under this theme's name, so the picker showed the wrong theme's artwork. If magick fails now, the half-written file is removed and the theme has no row, as it did before this change.
  • Tests, kept in proportion to the fix. I kept one case in test/shell.d/theme-switcher-test.sh: a theme with only a colors.toml gets a preview in its background colour. It goes through the real switcher, omarchy-theme-color and magick, and fails on quattro. Only the picker UI is stubbed. The in-place-redraw half went with the stat, and the helpers that were each used once are inlined. It is still a new file because no test covered the switcher before.

Proved on a worker built from the Omarchy ISO: the test passes on this head and fails on quattro ("a colours-only theme gets a preview"), and ./test/cli passes. I also ran the switcher with magick forced to fail and a stock theme that has a preview.png. Before this commit, the colours-only theme was linked to the stock theme's preview and the fast signature held 2 colors.toml entries. After it, the theme has no row and the signature holds none. The QML change was not touched and was not re-run.

Codex Medium reviewed the commit and found nothing to change. It agreed that the v3 signature bump and the extension check in add_theme_preview are still needed. Its independence is not guaranteed: my prompt described the brief.

@dhh

dhh commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Don't want this. A theme is not valid without a preview.png.

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.

3 participants