Skip to content

Preview legacy themes that only have alacritty.toml - #19481

Open
ThePrimeagen wants to merge 4 commits into
omacom:quattrofrom
ThePrimeagen:fix/d9a63c76-1566-47e2-98b4-cb3d46847a1e
Open

ThePrimeagen wants to merge 4 commits into
omacom:quattrofrom
ThePrimeagen:fix/d9a63c76-1566-47e2-98b4-cb3d46847a1e

Conversation

@ThePrimeagen

Copy link
Copy Markdown
Contributor

omarchy dev theme-preview says Theme not found for a legacy theme that has only alacritty.toml, even though omarchy theme list shows it and omarchy theme set applies it. The preview in bin/omarchy-dev-theme-preview only looks for colors.toml and never recovers a palette from alacritty.toml like omarchy-theme-set does.

Screenshots

Before After
before after

Reproduce

  1. Press Meta+Enter to open a terminal.
  2. mkdir -p ~/.config/omarchy/themes/OldAlacritty/backgrounds && printf '%s\n' '[colors.primary]' 'background = "#1a1b26"' 'foreground = "#a9b1d6"' '' '[colors.normal]' 'black = "#1a1b26"' 'red = "#f7768e"' 'green = "#9ece6a"' 'yellow = "#e0af68"' 'blue = "#7aa2f7"' 'magenta = "#ad8ee6"' 'cyan = "#449dab"' 'white = "#a9b1d6"' '' '[colors.bright]' 'black = "#414868"' 'red = "#ff7a93"' 'green = "#b9f27c"' 'yellow = "#ff9e64"' 'blue = "#7da6ff"' 'magenta = "#bb9af7"' 'cyan = "#0db9d7"' 'white = "#c0caf5"' > ~/.config/omarchy/themes/OldAlacritty/alacritty.toml
  3. omarchy dev theme-preview OldAlacritty
  4. You see Theme not found: OldAlacritty, even though the theme folder and its alacritty.toml are present.

More cases

Preview by theme directory path

Before After
before after

Preview by name for a legacy stock theme

Before After
before after

Related

resolve_colors_file only looked for colors.toml, so a theme with
only alacritty.toml - listed by theme list and applied by theme
set - was reported as not found. Add the same fallback theme set
uses: recover a palette from alacritty.toml via
omarchy-theme-colors-from-alacritty, generated in a scratch
directory so the theme itself is not written to. This covers
preview by user-theme name, by theme directory path, and by
stock-theme name, while existing colors.toml files keep
precedence.
@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; the stock legacy-theme lookup is restored.

Summary

Adds previews for legacy themes that have only alacritty.toml.

  • Theme preview can read legacy palettes from Alacritty files.

The previous stock-theme lookup finding is fixed. No new actionable issues were found.

Reviews (4) · Last reviewed commit: "Preview a stock theme that has only alac..." · Reviewed by Greptile

Comment thread bin/omarchy-dev-theme-preview Resolved
Comment thread bin/omarchy-dev-theme-preview Resolved
Comment thread bin/omarchy-dev-theme-preview Resolved
@omarchybot

Copy link
Copy Markdown
Collaborator

I read the preview resolver, palette converter, theme-set integration, existing CLI tests, and review comments at 418b44d9cc3fc5e722b3ec261bbd4e5d3cab543d. My classification is a bug fix, but the configured classifier, deepseek-v4p1-flash, returned no valid class, leaving the required classification unsettled. No code was changed or executed, and no verification labels were added. This waits on the maintainer to resolve the classification.

Reviewed by GPT-6 High in Codex. No second opinion on the code was requested because classification stopped the review.

@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6 High in Codex read the updated resolver, palette converter, regression-test diff, and review discussion at 8952da6e630236a52a296d6aa4b3f7ab120dc322. My classification remains a bug fix, but the configured classification model, deepseek-v4p1-flash, again returned no valid class for this head. The required classification remains unsettled, so worker verification cannot proceed. No code was changed or executed, no verification labels were added, and no second opinion on the code was requested. This waits on the maintainer to resolve the classification.

The conversion needs somewhere private to write, and making that inside resolve_colors_file meant the function could no longer print its answer: it had to set a global so the main shell knew what to clean up, which rewrote every branch of it. Making the directory once, before the lookup, lets the function stay as it was with three branches added, and the lookup keeps quattro's single loop, which already tries the exact name first.

A theme whose alacritty.toml cannot be converted is now reported as not found rather than falling through to a bundled theme spelled alike, which is what omarchy-theme-set does with that folder. The File line says the palette was generated instead of naming a temporary file that is gone when the command returns. No bundled theme ships an alacritty.toml, so that branch is dropped.

The tests keep the two ways in, by directory and by name, and check once that the theme folder and the temp directory are left as they were.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>
Co-Authored-By: Muse Wonder High <noreply@meta.com>
Comment thread bin/omarchy-dev-theme-preview Resolved
omarchy-theme-set generates a palette for a theme under $OMARCHY_PATH/themes the same way it does for one under ~/.config/omarchy/themes, and the preview is there to show what it would apply. No theme Omarchy ships is in that state today, so this keeps the two in step rather than fixing something seen.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Nov 20, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed by Claude Fable 5.2 at 9700c0107, with the change run on a worker built from the Omarchy ISO.

The gap is real on quattro. A theme with an alacritty.toml and no colors.toml is still supported: omarchy theme set generates its palette (docs/theming.md describes this for a theme predating colors.toml), and on the worker it applied one. omarchy dev theme-preview said Theme not found for the same theme, by name and by directory. On this branch both preview the palette omarchy theme set would generate, the theme folder is left alone, and nothing stays behind in TMPDIR.

The change was right but about three times the size it needed, so I pushed b8e240e78, which keeps what it does and, with the three lines of 9700c0107, takes it from +83/-10 to +51/-1:

  • The conversion needs a private place to write. Making that inside resolve_colors_file is what forced the function to stop printing its answer and set a global instead, which rewrote every branch of it. The directory is now made once before the lookup, so the function is quattro's again with three branches added, and quattro's single loop already tries the exact name first.
  • A theme folder whose alacritty.toml cannot be converted is reported as not found, rather than falling through to a bundled theme spelled alike. That is the folder omarchy theme set would pick too.
  • The File: line says generated from alacritty.toml instead of naming a temporary file that is gone by the time the command returns.
  • A theme under $OMARCHY_PATH/themes with only alacritty.toml is still previewed by name. I had taken that branch out because no theme Omarchy ships is in that state; 9700c0107 puts it back, since omarchy theme set would apply such a theme and the preview should agree with it. Checked on the worker with a stand-in OMARCHY_PATH.
  • The tests keep both ways in, by directory and by name, and check once that the folder and the temp directory are as they were.

On the worker ./test/cli passes, and fails with quattro's script, with the exit trap removed, with the converted name tried before the exact one, and with the conversion run in place in the theme folder.

Second opinion: Opus 5.5 High and muse-wonder (thinking high) each read it three times. The first round found no bug in the original but both described this smaller shape and said it was worth having, and both raised the File: line; the second and third, on the two commits above, found nothing that should hold it. Their independence from this review is not guaranteed. Left as they are, with both agreeing: a symlinked alacritty.toml in a theme installed from a repo is previewed although omarchy theme set would refuse it, since the preview only reads colours; and a TMPDIR that cannot be written to now stops any preview, not only a legacy one. One more, which I found afterwards and have not changed: a legacy theme's light.mode marker is not carried into the temp directory, so its mode is read from the background's brightness instead. That gives the same answer unless a theme marked light has a dark background.

Greptile scores this head 5/5 and its four findings are answered in their threads.

This is unrelated to the pull requests about empty or missing colours in omarchy-theme-set-templates (#19445, #19467, #19474, #19494): no file is shared. #19485 adds tests at the same place in test/cli, so whichever lands second needs a trivial merge.

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

Labels

bug Something isn't working ready Good to merge 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.

2 participants