Repository navigation
Treat empty theme colours as missing when resolving gradients - #19494
ThePrimeagen wants to merge 3 commits into
Conversation
resolve_theme_ref and resolve_gradient_color used ${THEME_COLORS[key]+_},
so a present-but-empty entry (created by alias_theme_color for missing
aliases, or set explicitly to "") counted as a hit. That yielded an empty
spec, and resolve_gradient_color then subscripted THEME_COLORS with an
empty REPLY, which bash rejects as a bad array subscript and kills theme
switching mid-render. Test the values for non-emptiness instead, so empty
entries fall back like missing ones, and guard the gradient lookup against
an empty word so it can no longer crash.
[Medium impact] This PR appears safe to merge; no new blocking issues were found. SummaryThis PR treats empty theme colors as missing when resolving gradients and prevents empty color lookups from stopping template rendering.
The earlier request for regression coverage is addressed. No new actionable issues were found. Reviews (3) · Last reviewed commit: "Update sparse palette test to not requir..." · Reviewed by Greptile |
|
Codex High read the diff, surrounding theme-resolution code, callers, and existing template tests. I classified this as a bug fix, but the second classification model, deepseek-v4p1-flash, returned no usable classification, leaving classification unsettled. CI has passed, and Greptile requests regression coverage for sparse palettes and explicitly empty colors. No worker tests or second-opinion code review ran, so the fix is not verified. This is waiting for classification to be resolved before verification continues. |
|
Codex High read the updated diff, surrounding theme-resolution code, callers and regression tests at d67098f. The new tests cover sparse palettes and explicitly empty colors; CI passes, and Greptile scores this head 5/5. I classified this as a bug fix, but the second classification model, deepseek-v4p1-flash, again returned no usable classification. Classification remains unsettled. No worker tests or second-opinion code review ran, so this review does not verify the fix. Verification is waiting for classification to be resolved. |
|
This makes the same change as #19467, which was opened first: the same two edits to Reviewed by Claude Fable 5.2, comparing the two diffs line by line. Nothing from this branch was run; #19467 is the one being tested on a worker. Thanks, @ThePrimeagen. Closing this as a duplicate of #19467. It can be reopened if something here is missing there. |
Setting a theme that defines only background and foreground, with no accent, color4 or blue, makes
omarchy theme setfail inomarchy-theme-set-templateswithTHEME_COLORS: bad array subscript, and slack.json is not rendered.Screenshots
Reproduce
Super+Enterto open a terminal.mkdir -p ~/.config/omarchy/themes/sparse-check && printf 'background = "#101010"\nforeground = "#eeeeee"\n' > ~/.config/omarchy/themes/sparse-check/colors.tomlomarchy theme set sparse-check/usr/share/omarchy/bin/omarchy-theme-set-templates: line 61: THEME_COLORS: bad array subscriptand slack.json is not rendered.More cases
Theme explicitly setting accent to an empty string