Skip to content

feat(sidebar): invert proc label colors on focused session card#51

Merged
rtalexk merged 3 commits into
mainfrom
feat/sidebar-focused-proc-label-style
May 24, 2026
Merged

feat(sidebar): invert proc label colors on focused session card#51
rtalexk merged 3 commits into
mainfrom
feat/sidebar-focused-proc-label-style

Conversation

@rtalexk

@rtalexk rtalexk commented May 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Focused session card now inverts text proc labels (e.g. py, node): bg = session-name color (ColorFgPrimary), fg = selection color (ColorSelected). Chip pops against the selection row instead of disappearing into it.
  • Icon proc labels (emoji, Nerd Font glyphs) skip the chip background entirely and adopt the selection bg, so they read as part of the row rather than as a separate chip.
  • Added isIconLabel helper (whitespace-trimmed, all-non-ASCII rune check) so labels like "󰵰 " (glyph + padding space) are recognized as icons.
  • Refactored resolveProcLabelColors into a 3-arm switch so the override paths read top-to-bottom.

Test plan

Automated:

  • go test ./internal/tui/ -count=1 — 336 passed
  • go build ./...
  • New tests cover focused/unfocused, icon vs text, and the trimmed-icon case

Manual:

  • Launch demux against a session list that includes:
    • a text proc label (e.g. py, node) configured with custom fg/bg
    • an icon proc label (e.g. "󰵰 " for claude*, or any emoji)
  • Focus the sidebar and move the selection onto each kind of session card
  • Verify the focused text label renders as a chip (light bg, purple fg)
  • Verify the focused icon renders with no chip — it sits on the purple selection bg cleanly, with no light-gray box behind it
  • Unfocus the sidebar and confirm both label kinds revert to their configured colors

rtalexk added 3 commits May 23, 2026 18:25
When a session card has the sidebar focus, text proc labels (e.g.
"py", "node") now render with the session-name color as background and
the selection color as foreground, so the chip pops against the
selection row instead of blending into it.

Icon labels (emoji, Nerd Font glyphs) skip the chip background entirely
and inherit the selection bg, so they read as part of the row rather
than as a separate chip.
Replace the ad-hoc 'all runes non-ASCII' check inside isIconLabel with
the existing isIconRune helper (display width > 1 or Private Use Area),
so the classifier matches the rest of the TUI and won't misclassify
non-ASCII text like accented Latin as an icon.
Proc labels are either pure text or a single icon glyph, so iterating
every rune was unnecessary. Decode the first rune of the trimmed text
and pass it to isIconRune directly.
@rtalexk rtalexk merged commit b22740b into main May 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant