Skip to content

feat: add per-widget dim styling, whole widget or parens-only#433

Merged
sirmalloc merged 2 commits into
sirmalloc:mainfrom
zachthedev:dim-styling
Jun 15, 2026
Merged

feat: add per-widget dim styling, whole widget or parens-only#433
sirmalloc merged 2 commits into
sirmalloc:mainfrom
zachthedev:dim-styling

Conversation

@zachthedev

@zachthedev zachthedev commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Closes #438.

Adds a per-widget dim toggle alongside bold. Press (d) in the colors menu to cycle: off → whole widget → (...) spans only → off. Parens mode dims just the bracketed part of a widget, e.g. the (42%) in Context Bar output, while the rest keeps full intensity.

Area Change
types/Widget.ts dim: z.union([z.boolean(), z.literal('parens')]) on widget items
utils/colors.ts applyColors gains a dim arg; applyParensDim wraps (...) spans and re-asserts bold after each span (\x1b[22m clears both intensities)
utils/renderer.ts wired into normal and powerline paths; separators inherit dim like bold; intensity resets shared with bold
color-menu/mutations.ts cycleWidgetDim; reset / clear-all strip dim
ColorMenu.tsx (d) keybind, [DIM] / [DIM ()] indicator, dim shown in the widget list preview
renderer-dim.test.ts + mutations tests applyColors dim modes, normal + powerline rendering, visible-width invariant, cycle behavior

Notes:

  • No settings migration needed: the field is optional and absent means off.
  • Visible text and width are unchanged, so truncation and flex math are unaffected (covered by a test).
  • Zero file overlap with my other open PRs; based on current main.

Co-Authored-By: Claude <noreply@anthropic.com>
Preserve parens dim styling when foreground gradients render in both regular and powerline paths.

Emit a combined intensity reset when restoring bold after dim so Ink preserves the dim reset in preview output.

Reset whole-widget dim before powerline separators and end caps, and render ColorMenu style indicators as one suffix to avoid badge wrapping.

Add regression coverage for gradient dim composition, powerline dim boundaries, Ink preview output, and ColorMenu indicator layout.
@sirmalloc sirmalloc merged commit 4f01094 into sirmalloc:main Jun 15, 2026
3 checks passed
@sirmalloc

Copy link
Copy Markdown
Owner

Made a few tweaks, mostly due to interaction of dim and bold widgets next to each other, preview not resetting bold properly after a dim, issues with separators in powerline mode after a dim, and the UI wrapping the dim indicator to the next line in some instances when bold was also applied. I'll publish it in the next release.

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.

Dim styling toggle (whole widget or just the parenthesized part)

2 participants