feat: the selected row is a shade of the terminal's background
CI / Checks (pull_request) Successful in 24s
PR title / Conventional title (pull_request) Successful in 1s

lazysecrets asks the terminal for its background and shades the
selection from it, a little lighter on a dark background and darker on
a light one, where palette 8 was often too bright to read coloured rows
on. Palette 8 stays until the terminal answers, or if it doesn't, and
a theme's selection colours still win.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kebandClaude Opus 5.5 committed 2026-10-11 23:24:56 +02:00
1 parent b95eeb725b
commit 9963615e51
4 files changed
+64 -2

No files matched your search

+4 -1
View File
@@ -489,7 +489,7 @@ func (m *Model) setVersions(items []provider.Object) {
}
func (m Model) Init() tea.Cmd {
cmds := []tea.Cmd{m.sourcesCmd(), m.spin.Tick, m.checkClipboard()}
cmds := []tea.Cmd{m.sourcesCmd(), m.spin.Tick, m.checkClipboard(), tea.RequestBackgroundColor}
if m.cachePath != "" || m.placeDir != "" {
cmds = append(cmds, tea.Tick(persistEvery, func(time.Time) tea.Msg { return persistTickMsg{} }))
}
@@ -514,6 +514,9 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
var cmds []tea.Cmd
switch msg := msg.(type) {
case tea.BackgroundColorMsg:
m.st = m.st.OnBackground(msg.Color, msg.IsDark())
return m, nil
case tea.WindowSizeMsg:
m.w, m.h = msg.Width, msg.Height