feat: themeable colors (cga/green/amber)#40
Open
peczenyj wants to merge 1 commit into
Open
Conversation
Route ui's hardcoded ANSI constants through a Theme over semantic roles (Header/Added/Removed/Meta/Padding/Label); the default theme reproduces the historical palette byte-for-byte, so golden output is unchanged. Add built-in retro themes: cga (bright 16-color), green and amber (single-hue phosphor emulations distinguished by intensity + the +/- prefixes). Selection: hidden easter-egg flags -cga/-green/-amber (stripped pre-parse, so invisible in -help) take precedence over the documented STRUCTALIGN_THEME env var, else default. Unknown theme warns and falls back. Theme is orthogonal to -color: it only chooses which colors are used when color is on. Not a full theming system: a fixed set of built-ins and two ways to pick one. Closes #33 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/nolint-respect #40 +/- ##
=========================================================
Coverage ? 86.35%
=========================================================
Files ? 12
Lines ? 843
Branches ? 0
=========================================================
Hits ? 728
Misses ? 74
Partials ? 41 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Adds selectable color themes, built on a small refactor of
ui's hardcoded ANSI constants into aThemeover semantic roles (Header,Added,Removed,Meta,Padding,Label).defaultreproduces today's palette byte-for-byte — all golden fixtures pass unchanged (the refactor is a no-op for existing output).cga(bright 16-color),greenandamber(single-hue phosphor-monitor emulations; add/removed distinguished by intensity + the+/-prefixes, not hue).-cga/-green/-amber(stripped before parsing, so invisible in-helpand never trip "flag not defined") take precedence over the documentedSTRUCTALIGN_THEMEenv var, elsedefault. Unknown name warns and falls back.-color: the theme only chooses which colors are used when color is on.Verified each theme emits distinct ANSI (default
31/32/36, cga91/92/96, green monochrome32+ dim/bold, no red).Not a full theming system — a fixed set of built-ins and two ways to pick one (per-role overrides / custom themes are a deferred v0.8.0 feature).
Tests:
internal/ui(default matches legacy constants,ThemeByName, green-is-monochrome) +internal/app(egg accepted/stripped, unknown env warns, eggs absent from usage).task cigreen (110 tests).Closes #33
🤖 Generated with Claude Code