feat: add Terminal (ANSI) theme preset that follows the terminal palette#338
Merged
Conversation
Adds a theme preset built entirely from Color::Reset and named ANSI colors instead of hardcoded RGB. Terminals remap already-rendered cells when their palette changes, so terminal-theming tools like pywal recolor spotatui live without a restart. No parser changes needed: parse_theme_item and color_to_string already round-trip named ANSI colors, so config persistence and the settings live preview work unchanged. A new test guards that every color in the preset survives the serialize/parse round trip. Closes #336
ffaa570 to
c9ea2ed
Compare
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.
Summary
Adds a Terminal (ANSI) theme preset built entirely from
Color::Resetand named ANSI colors instead of hardcoded RGB. Since terminals remap already-rendered cells when their palette changes, terminal-theming tools like pywal recolor spotatui live, with no restart needed.Closes #336
Details
ThemePreset::Terminalvariant wired into the five preset enumeration points (enum,all(),name(),from_name(),to_theme()). It mirrors the default cyan look using the terminal palette: Cyan accents, Red/LightRed errors, Yellow hints, Magenta hover, DarkGray inactive, andResetfor text/background.parse_theme_itemandcolor_to_stringalready round-trip named ANSI colors, so config persistence, settings-screen cycling, and live preview all work unchanged.terminal_preset_colors_round_trip_through_configasserts every color in the preset survives serialize/parse (guards against a futureColor::Indexed, whichcolor_to_stringsilently collapses toReset).Testing
cargo fmt --all,cargo clippy --no-default-features --features telemetry -- -D warnings, andcargo test --no-default-features --features telemetryall pass (329 tests).Alt-,), then change the terminal palette (e.g.wal -i <image>) and confirm colors update without restarting.