Skip to content

feat(props): friendly colour words and when/active_when presets - #21

Merged
jals1212 merged 1 commit into
mainfrom
feat/prop-grammar
Jul 3, 2026
Merged

jals1212 merged 1 commit into
mainfrom
feat/prop-grammar

Conversation

@jals1212

@jals1212 jals1212 commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Colour props accept a role word (accent, info, notice, muted, alert, error) or a palette word (peach, mauve, surface_0, ...), resolved through @thm_role_<w> then @thm_<w>; the theme wins over tmux native colour names (red = palette red). Raw tmux values — hex, colour255, #{E:...} refs, draw-time conditionals — pass through untouched.
  • @themux_<name>_when / _active_when gain always / never (alias off) presets; bare format variables (window_zoomed_flag, client_prefix) and raw #{...}/#(...) conditions keep working verbatim.
  • Fix: git/gitmux baked their in-repo when gate with set -gq, clobbering any user value at source time — now -ogq, matching zoom.

Replaces #19 (closed by the base-branch delete when #18 merged; rebased onto main).

Changes

File Change
utils/render_style.sh Shared helpers: themux_colour, themux_when_cond, themux_active_cond
utils/module_render.sh Normalize accents, channel pins, active_when, and the standalone-pill when gate
utils/layout.sh Source render_style.sh; normalize when at the powerline splice and group visibility
utils/window_render.sh, utils/pane_render.sh Route accents/surface through themux_colour
modules/git.conf, modules/gitmux.conf when gate -gq-ogq (user-overridable)
tests/prop_grammar.sh + expected, run_tests.sh 13 assertions: word resolution, theme-wins, raw passthrough, when/active_when presets, window wiring
docs/reference/configuration.md, status-line.md Colour values + condition grammar sections

Test plan

  • ./run_tests.sh — 18/18 green (new prop_grammar suite included)
  • shellcheck on all touched scripts
  • Live-verified on tmux 3.7a (kanagawa theme): words resolve per-theme, live session renders intact

🤖 Generated with Claude Code

Colour props (_color, _active_color, per-slot overrides, raw channel pins,
window/pane accents) now accept a theme role word (accent, notice, ...) or a
palette word (peach, mauve, surface_0, ...) resolved through @thm_role_<w>
then @thm_<w> — the theme wins over tmux native names, so red is the palette
red. Raw tmux values (hex, colour255, formats) pass through untouched.

Visibility and escalation conditions gain two presets: always and never
(alias off), normalized in shared render_style.sh helpers and consumed by
layout.sh (powerline splice + group visibility), module_render.sh (the
standalone-pill gate and chan's active switch). Everything else passes
through raw — a bare unknown word was already false (tmux reads it as a
format variable), the presets make the two useful constants sayable.

git.conf and gitmux.conf set their in-repo when gate with -ogq (was -gq,
which clobbered any user value at source time), matching zoom.conf.
@jals1212
jals1212 merged commit f023a8a into main Jul 3, 2026
2 checks passed
@jals1212
jals1212 deleted the feat/prop-grammar branch July 3, 2026 16:12
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