Skip to content

feat!: semantic colour role layer — ukiyo-homologated module accents - #15

Merged
jals1212 merged 8 commits into
mainfrom
feat/color-roles
Jul 3, 2026
Merged

jals1212 merged 8 commits into
mainfrom
feat/color-roles

Conversation

@jals1212

@jals1212 jals1212 commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

Introduces a semantic colour role layer and remaps module accent defaults onto it, so every theme renders a coherent status line (homologated with tmux-ukiyo's role semantics):

  • New roles @thm_role_{accent,info,notice,muted,alert,error} — defined once as references into the active palette (accent→green, info→sapphire, notice→peach, muted→lavender, alert→yellow, error→red), so they track theme switches automatically and are overridable per user/theme with a single set -g before the plugin loads.
  • BREAKING — module accents now default to roles (19 options across 16 modules): git/gitmux/session → accent; session prefix state red → alert (yellow — red no longer screams error on a mere prefix); clima/weather/pomodoro/git-dirty → notice; battery → muted; kube (incl. the previously red context) /directory/load/host/date_time/time/user/uptime → info; zoom → alert. application and kube_namespace keep their raw defaults (documented). cpu/ram keep their live level-colour escalation — a deliberate divergence; a static role cannot model a live threshold.
  • Overriding one role re-colours every module in that family at once; per-module @themux_<name>_color overrides still win as before.

Changes

File Change
themux.conf Role definitions (after theme load, before modules)
modules/*.conf (16 files) Accent defaults reference roles instead of raw palette slots
tests/color_roles.sh (+expected) Role resolution, module rendering, role override fan-out, metrics untouched, theme-switch re-derivation
tests/{git_module,load_module,naked_style}_expected.txt Regenerated only for the intended remaps
docs/reference/configuration.md, docs/reference/status-line.md "Colour roles" section, breaking enumeration with per-row visible/no-change notes

Test plan

  • Full suite green: run_tests.sh — 17/17 (16 existing + new color_roles)
  • shellcheck -a clean
  • Live-verified: recursive #{E:} role→slot→hex resolution through module render, layout refs and notch seams; role override precedence; mid-session theme switch re-derives roles (mocha → kanagawa_wave)

Notes

  • Pre-existing (unchanged by this PR, reproduced byte-identical on main): kube.conf composes @themux_kube_context_color/_namespace_color inside an #{l:...} literal without _expand, so those two colours never actually apply in rendered output. Worth a follow-up issue.

jals1212 added 8 commits July 2, 2026 14:37
Introduce six @thm_role_{accent,info,notice,muted,alert,error} options,
each a live reference to one @thm_* palette slot. Defined right after
load_theme.sh resolves the active theme and before modules/*.conf are
sourced, so module defaults can build on top of them in a follow-up
change.

Roles stay refs (not flattened hex) rather than pre-resolved values:
verified on an isolated tmux socket that the existing #{E:} render
pipeline fully resolves the module_color -> role -> palette chain in
one pass, and that the harness-style theme-switch reset re-derives
roles exactly like the rest of @thm_*.
Point every module's _color/_active_color/_context_color default at
the new @thm_role_* layer instead of a hardwired palette slot, so all
built-in themes read as one coherent set instead of clashing per
module. kube_namespace_color, application_color and the cpu/ram live
level-colour escalation are deliberately left untouched (no role
counterpart, or a live threshold that a static role can't model).

Regenerates the three existing *_expected.txt fixtures whose captured
output embeds one of the changed defaults (git's resting/dirty accent,
load's icon colour, session's active-prefix colour).

BREAKING CHANGE: module accent defaults changed.
- @themux_git_color / @themux_gitmux_color: teal -> role_accent (green)
- @themux_git_active_color: peach -> role_notice (same hex, ref changed)
- @themux_session_color: green -> role_accent (same hex, ref changed)
- @themux_session_active_color: red -> role_alert (yellow)
- @themux_clima_color / @themux_weather_color: yellow -> role_notice (peach)
- @themux_battery_color: lavender -> role_muted (same hex, ref changed)
- @themux_kube_color: blue -> role_info (sapphire)
- @themux_kube_context_color: red -> role_info (sapphire)
- @themux_directory_color: blue -> role_info (sapphire)
- @themux_load_color: blue -> role_info (sapphire)
- @themux_host_color: mauve -> role_info (sapphire)
- @themux_date_time_color: sapphire -> role_info (same hex, ref changed)
- @themux_time_color: sky -> role_info (sapphire)
- @themux_zoom_color: yellow -> role_alert (same hex, ref changed)
- @themux_pomodoro_plus_color: peach -> role_notice (same hex, ref changed)

Override the affected @themux_<name>_color (or the role itself) before
the plugin loads to keep the previous colour.
Add tests/color_roles.sh (+ expected fixture), registered in
run_tests.sh. Covers: the six roles resolve to the correct default
palette hex through the expanded #{E:} core (not the raw ref); kube's
icon accent renders the role colour through the real module render
path; overriding @thm_role_info before re-sourcing re-colours every
info-family module at once (directory, host, date_time, time, load,
kube); cpu/ram stay wired to tmux-cpu's live level colours, not to any
role; session's active-prefix accent is now role_alert instead of the
old hardwired red; and a harness-style theme switch re-resolves a role
from the new theme's palette.

Also documents (via kube_context_color_is_role_info /
kube_namespace_color_untouched, without asserting on the rendered
core) a pre-existing, unrelated quirk found while writing this test:
kube's context/namespace fg colours are composed inside an #{l:...}
(literal, never-expanded) block in @themux_kube_text, so they were
already not resolving through the render pipeline before this change
-- confirmed unaffected by the accent both being a raw @thm_* ref and
being a @thm_role_* ref.
Add a "Colour roles" section to configuration.md: the six roles, their
default palette slot, override syntax, and a breaking-change callout
enumerating every module accent default that changed (and why the
three exceptions -- kube_namespace_color, application_color, cpu/ram
-- were deliberately left out of the remap).

Update status-line.md's git and kube examples, which showed the old
raw @thm_teal/@thm_red defaults instead of the new role references.
README.md was checked and has no stale per-module accent examples
for the modules in the remap table.
@jals1212
jals1212 merged commit d0cd96d into main Jul 3, 2026
2 checks passed
@jals1212
jals1212 deleted the feat/color-roles branch July 3, 2026 11:43
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