feat!: semantic colour role layer — ukiyo-homologated module accents - #15
Merged
Merged
Conversation
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.
4 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
@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 singleset -gbefore the plugin loads.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.applicationandkube_namespacekeep their raw defaults (documented). cpu/ram keep their live level-colour escalation — a deliberate divergence; a static role cannot model a live threshold.@themux_<name>_coloroverrides still win as before.Changes
themux.confmodules/*.conf(16 files)tests/color_roles.sh(+expected)tests/{git_module,load_module,naked_style}_expected.txtdocs/reference/configuration.md,docs/reference/status-line.mdTest plan
run_tests.sh— 17/17 (16 existing + newcolor_roles)shellcheck -aclean#{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
main):kube.confcomposes@themux_kube_context_color/_namespace_colorinside an#{l:...}literal without_expand, so those two colours never actually apply in rendered output. Worth a follow-up issue.