feat(config-toggle): adaptive width, centering, and resize handling

Panel now selects from four width tiers based on $COLUMNS (with a 6-col
buffer per side before stepping up): 52-wide (default), 70, 74, or 78.
Each tier carries richer category descriptions sized to fit the layout.
The box is horizontally centered on every draw via a left-padding prefix.

Key reader switches from stty min 1 to min 0 / time 3, giving a 0.3 s
poll interval so COLUMNS changes are detected without a keypress. The
erase formula is now wrap-aware: prev_max_line_width / COLUMNS gives the
wrap factor, ensuring old wider panels are fully cleared after narrowing.
Idle timeout ticks that detect no resize are skipped entirely.
This commit is contained in:
2026-06-12 19:17:49 -04:00
parent 1253f67c9c
commit 93fc5e0517
5 changed files with 134 additions and 56 deletions
+14 -4
View File
@@ -1246,10 +1246,10 @@ Add -i (interactive confirmation) to destructive commands:
Synopsis: config-toggle [-h]
Opens an interactive full-screen TUI for toggling the six opinionated
component categories (C1C6) and the master disable variable without
having to type or remember variable names. Two scope tabs allow
independent per-scope configuration:
Opens an interactive TUI for toggling the six opinionated component
categories (C1C6) and the master disable variable without having to
type or remember variable names. Two scope tabs allow independent
per-scope configuration:
Universal — persists across all sessions (set -U)
Session — current shell only (set -g)
@@ -1257,6 +1257,16 @@ Add -i (interactive confirmation) to destructive commands:
Changes apply immediately on each value keypress. Always available
regardless of the __fish_config_opinionated master state.
The panel adapts to the terminal width automatically, selecting from
four layout tiers (with a 6-column buffer on each side before stepping
up to the next tier) and horizontally centering the box. The panel
redraws within ~0.3 s of a terminal resize with no keypress required.
COLUMNS >= 90 → 78-wide panel (most detail)
COLUMNS >= 86 → 74-wide panel
COLUMNS >= 82 → 70-wide panel
COLUMNS < 82 → 52-wide panel (default)
Navigation:
↑ ↓ / k j Move cursor
← → / h l Set value: OFF ← DEFAULT → ON (clamped)