Skip to content

feat!: directional notch — zone-aware auto, per-item direction - #11

Merged
jals1212 merged 8 commits into
mainfrom
feat/directional-notch
Jul 2, 2026
Merged

jals1212 merged 8 commits into
mainfrom
feat/directional-notch

Conversation

@jals1212

@jals1212 jals1212 commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

Extends the notch prop (the seam between an item's leading and text blocks) from a boolean to a directional grammar, consistent with the status-line seam alphabet (> < =):

  • @themux_all_notch off | > | < | auto (cascadable per item/module as before). > keeps today's look (left block penetrates right, right-cap glyph); < is the mirror (left-cap glyph, colours swapped).
  • auto resolves per placement: modules and the window list by status-line zone (left → >, right → <, centre → off); panes by leading_position. The same module in two zones resolves each occurrence independently.
  • BREAKING: on is now an alias of auto — in a right zone it draws <, in the centre nothing (it previously always drew >).
  • Closes two pre-existing gaps required by auto: windows and panes had no seam path at all for leading_position right, and the pane seam used the raw block bg for its fg with no accent fallback (invisible seam on naked leading).

Mechanism

Renderers are zone-agnostic, so under auto the module renderer bakes an RS control-byte marker plus per-direction seam chunks, and layout.sh splices per occurrence — a draw-time #{s///:} for ref-consumed modules, a bash splice through the #{E:}+interp pipeline for _expand modules (a literal %NOTCH%-style marker is unsafe: tmux strftime-expands any text passing through #{E:}). The window list uses a draw-time dispatch on a hidden option set by layout (last occurrence wins, documented). Explicit >/</off bake directly with zero added cost.

Changes

File Change
utils/render_style.sh themux_notch_mode() — shared value normalizer (on→auto, unknown→off)
utils/module_render.sh Directional seam bake; RS marker + @_tmx_module_<name>_seam_{gt,lt} under auto
utils/layout.sh Zone threading (align) into full_pill/powerline_run/mod_core; per-occurrence seam splice; _expand seams routed through the expand pipeline; @_tmx_window_notch_dir wiring
utils/window_render.sh Per-side seam formulas for both leading positions; draw-time auto dispatch; seam gated on name visibility
utils/pane_render.sh Local auto resolution; new position=right seam path; seam fg accent-fallback fix
themux_options.conf, docs/, README.md Grammar docs, zone mapping, breaking on callout, squared colours-only note, direct-consumption caveat
tests/notch_direction.sh (+expected) 15 sections: explicit directions vs zones, auto per zone, alias, cascade override, multi-placement, panes, windows, invalid value, squared colours, _expand liveness, marker-leak regressions

Test plan

  • Full suite green: tests/run_tests.sh — 15/15 (14 existing + new notch_direction), no regressions
  • shellcheck clean on all touched scripts
  • Live-verified on tmux 3.7a: zone-aware directions render correctly; cpu/ram metric seams keep their live level colour; no unresolved marker bytes in expanded status lines

jals1212 added 8 commits July 1, 2026 21:06
_expand modules (cpu/ram) baked a live #{l:...} colour ref into their
notch seam, but the seam was bash-spliced into the core AFTER the
core's own #{E:} expansion + interp pass, so the seam's #{l:} wrapper
was never peeled and its fg stayed a dead literal — the dark notch
triangle on cpu/ram. Route the seam through the same #{E:} expansion
the core gets, splice, then interp both together.

Also fix a related leak: the splice was skipped whenever the
replacement text was empty (e.g. centre zone's default middle
separator), but auto mode always bakes the marker regardless of the
replacement — skip the splice only when no marker was baked at all,
never merely because the replacement is empty, or the raw NOTCH_MARK
control byte leaks into the drawn status line.
position=left already wrapped its name block (and notch seam) inside
the #{?${text},...,} name-visibility conditional, but the newly added
position=right path emitted its seam unconditionally after the name
content. A window whose name resolves empty at draw time then showed
a floating seam taper with nothing to taper into. Wrap the
position=right name content and seam in the same conditional.

window_status_styling_expected.txt is updated for the same reason: it
captured the previously-unconditional position=right output.
Document that the squared shape draws the same full-block glyph for
both notch directions (only the colour placement differs), and that
auto/on only resolve through the layout grammar — a module consumed
directly (a user's own tmux format, or _prepend/_append) never gets
its marker spliced. tmux's status-line renderer silently drops that
byte at draw time, so the seam is simply absent, as if notch were off.

Also update tests/module_variant.sh's stale notch comment: under the
current design its length assertion only measures the RAW core's
marker-vs-empty byte, not a rendered glyph's width; real glyph
coverage lives in tests/notch_direction.sh.
@jals1212
jals1212 merged commit 4e7627e into main Jul 2, 2026
2 checks passed
@jals1212
jals1212 deleted the feat/directional-notch branch July 2, 2026 12:21
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