uiform: clear foreground on blurred titles/options too · Entire
uiform: clear foreground on blurred titles/options too
c67d74e→main·
computermode·2w ago·2 files·+39 added/-1 removed
ThemeBase16 copies Focused into Blurred wholesale, so clearing the foreground only on Focused.Title/Group.Title/Focused.UnselectedOption left the Blurred variants pinned to base16 slots (title 8, unselected option 7). Inactive fields in multi-field forms (e.g. review --edit pickers) rendered with those pinned colors and couldn't invert with the terminal background.
Clear Blurred.Title and Blurred.UnselectedOption as well so inactive-field text inherits the terminal default, matching the buttons which already set both Focused and Blurred variants. Adds a regression test over the theme's blurred/focused/group foreground state for both dark and light.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Sessions
0eb7ac1654c1View transcript
[?
Migrate Experts Command to Base16 PaletteClaude Code·Opus 4.8·3 steps](/content/gh/entireio/cli/session/8027fc39-6b44-40d4-9040-981887f4786c#timeline-0eb7ac1654c1/index.html)
Changes
2
cmd/entire/cli/uiform
Muiform.go+5/-1
Auiform_test.go+34
39 unmodified lines
40
41
42
43
43
44
45
46
47
48
49
50
51
52
53
39 unmodified lines
// the terminal's default text color, which already inverts with the
// background. A pinned base16 slot (e.g. black "0") can't invert because
// it always maps to that slot in both themes. Group.Title is copied from
// Focused.Title inside ThemeBase16, so clear both.
// Focused.Title inside ThemeBase16, and ThemeBase16 copies Focused into
// Blurred wholesale, so clear the blurred variants too — otherwise
// inactive fields in multi-field forms keep the pinned base16 color.
t.Focused.Title = t.Focused.Title.UnsetForeground()
t.Group.Title = t.Group.Title.UnsetForeground()
t.Focused.UnselectedOption = t.Focused.UnselectedOption.UnsetForeground()
t.Blurred.Title = t.Blurred.Title.UnsetForeground()
t.Blurred.UnselectedOption = t.Blurred.UnselectedOption.UnsetForeground()
// Magenta selection: the pointer (single + multi select) and the
// chosen option(s), replacing ThemeBase16's yellow/green.
Mcmd/entire/cli/uiform/uiform.go+5/-1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package uiform
import (
testing
"charm.land/lipgloss/v2"
)
// TestTheme_BlurredTitlesInheritTerminalForeground guards against the theme
// pinning base16 foreground colors on blurred (inactive) fields. ThemeBase16
// copies Focused into Blurred wholesale, so clearing only the Focused variants
// leaves inactive fields in multi-field forms with pinned colors that can't
// invert with the terminal background.
func TestTheme_BlurredTitlesInheritTerminalForeground(t *testing.T) {
t.Parallel()
for _, isDark := range []bool{true, false} {
s := Theme().Theme(isDark)
unset := map[string]lipgloss.Style{
"Blurred.Title": s.Blurred.Title,
"Blurred.UnselectedOption": s.Blurred.UnselectedOption,
"Focused.Title": s.Focused.Title,
"Focused.UnselectedOption": s.Focused.UnselectedOption,
"Group.Title": s.Group.Title,
}
for name, style := range unset {
if _, ok := style.GetForeground().(lipgloss.NoColor); !ok {
t.Errorf("isDark=%v: %s pins foreground %v, want unset so it inherits the terminal default",
isDark, name, style.GetForeground())
}
}
}
}
Acmd/entire/cli/uiform/uiform_test.go+34