Repository navigation
Treat empty theme colors as missing in gradient resolution - #19467
ThePrimeagen wants to merge 6 commits into
Conversation
resolve_theme_ref() and resolve_gradient_color() used
${THEME_COLORS[key]+_}, which reports a key as present even when
its value is empty. Sparse themes get empty-valued keys (accent,
red, blue) from the alias cascade, so gradient_start accent blue
resolved to an empty string; color_to_shell_hex("") then looked
up ${THEME_COLORS[]}, aborting with 'bad array subscript'.
Check for a non-empty value (${THEME_COLORS[key]:-}) instead, so
an empty color falls back as a missing one does, and return early
from resolve_gradient_color() on an empty input so no empty
subscript lookup occurs. This fixes sparse themes, explicitly
empty values, and gradients naming an empty-valued color.
[Medium impact] The PR appears safe to merge. SummaryGradient helpers now treat empty theme colors as missing and avoid looking up an empty array key.
Reviews (6) · Last reviewed commit: "Cover an empty gradient fallback alias" · Reviewed by Greptile |
|
Codex (GPT-6; reasoning effort not exposed by this session) read the gradient resolver, its template call sites and the existing regression coverage. No code changes or runtime tests were completed: the classification model, deepseek-v4p1-flash, returned no usable answer, so classification remains unsettled. No second opinion reviewed the code; Greptile's request for a regression test remains open. This is waiting on the maintainer to resolve classification before verification continues. |
|
Codex (GPT-6; reasoning effort not exposed by this session) read head Classification remains unsettled: my classification is |
|
Codex (GPT-6; reasoning effort not exposed by this session) read head Classification remains unsettled: my classification is |
The two-colour palette test checked that each built-in template left a file behind, which the renderer does on quattro without this fix, and expected the word "blue" where a colour belongs. A palette with no accent, blue or color4 is incomplete with or without the fix. The explicitly empty key test fails on quattro for both reasons the fix exists: the border rendering as "" and the bad array subscript from gradient_start. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Reviewed at 88eb435. The three-line change to What was run, on disposable workers built from the Omarchy ISO:
What the description gets wrong, for whoever reads it later:
What I pushed: 88eb435 removes the two-colour test. Its loop over the built-in templates only checked that each output file exists, which passes on Reviewed by Claude Fable 5.2, with Opus 5.5 High and muse-wonder (thinking high) as a second opinion over two rounds. They agreed with the findings above, with independence not guaranteed, and Opus added which changed lines the remaining test does and does not pin. One claim of theirs did not hold: that this branch needs a rebase. It merges into #19494 was the same change and is closed as a duplicate of this one. #19445 and #19474 are other open fixes for the same cause. This waits on the maintainer. |
|
Reviewed the merge at On a disposable Omarchy ISO worker, an independent reproduction using Tokyo Night with an explicitly empty
GPT-6 in Codex (reasoning effort not exposed) reviewed the merge and ran the checks. Opus 5.5 High and muse-wonder via pi, thinking high reviewed the same head and the completed evidence, found no actionable code defects, and agreed that the existing regression covers the failure. Their independence is not guaranteed. One earlier reviewer claim, that the error prevents every file from being generated, was rejected against the actual worker results. #19445 and #19474 remain open alternatives. This is waiting on the maintainer's choice, including whether the description needs correcting. The captures show the real theme command's diagnostics and generated configuration on the worker; they do not establish the appearance inside every application. |
The existing empty-colour fixture always resolves through a non-empty blue or a literal fallback. Carry the sparse fallback scenario from omacom#19445 into the focused regression: a missing primary colour and an empty accent alias retain the fallback name without a subscript diagnostic. Reverting only the fallback non-empty check makes this assertion fail; the existing assertions still pass. This preserves the documented single-fallback grammar without claiming a sparse palette produces usable application colours. Co-Authored-By: ThePrimeagen <the.primeagen@gmail.com> Co-Authored-By: muse-wonder via pi, thinking high <noreply@openai.com> Co-Authored-By: GPT-6 (reasoning effort not exposed) <noreply@openai.com>
|
Pushed On a fresh disposable Omarchy ISO worker, the complete-palette reproduction failed with the base renderer, passed on this head, and failed again with the renderer reverted. GPT-6 in Codex (reasoning effort not exposed) reviewed the change and ran these checks. Opus 5.5 High and muse-wonder via pi, thinking high reviewed this exact head and found no actionable defects; their agreement does not guarantee independence. This is waiting on the maintainer's choice between the open fixes and whether to correct the description's claims about aborted switching and sparse themes. |


Switching to a theme with no accent colour breaks
omarchy theme set:omarchy-theme-set-templatesprintsTHEME_COLORS: bad array subscriptand leaves themed files such as slack.json unrendered, so the switch never completes.Screenshots
Reproduce
mkdir -p ~/.config/omarchy/themes/my-sparse && printf 'mode = "light"\nbackground = "#eeeeee"\nforeground = "#111111"\n' > ~/.config/omarchy/themes/my-sparse/colors.tomlomarchy theme set my-sparse/usr/share/omarchy/bin/omarchy-theme-set-templates: line 61: THEME_COLORS: bad array subscriptand the theme switch left incomplete.More cases
Theme with explicitly empty accent
Gradient naming an empty colour