Repository navigation
feat(colors): replace palette roles under [colors] - #105
Merged
Merged
Conversation
… spells them - heading = 238 reads like heading = "238" - plannotator-tui config prints light-blue, 238 and #rrggbb instead of ratatui's names - the archive's selected row reverses the accent so its text stays readable
backnotprop
force-pushed
the
feat/colors
branch
from
October 23, 2026 18:31
10f741d to
69b692f
Compare
Contributor
|
Thanks @nxxxsooo, nice work. I rebased it onto [keys] and pushed a small follow-up: a bare index like |
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.
Implements the colors half of #58, building on the
theme.rspalette from #85 as suggested there.[colors]in config.toml: a role replaces that colour in whichever palette is in force (light or dark, afterPLANNOTATOR_TUI_THEME,[ui] themeand detection have picked one). Roles left out keep today's values, so an empty table changes nothing.accent,heading,comment,looks-good,delete,comment-bg,looks-good-bg,block,toolbar,cursor,selection.blockcovers the focused block and the focused tree row, per @alesch's notes.yellow,light-cyan), indexes (238),#rrggbb.unknown color "chartreuse"; expected a name like yellow, an index 0-255, or #rrggbb).plannotator-tui configprints the roles that are set.[colors]block listing every role with its dark default.Shape
Palettegains the foreground roles that were inlineColor::Cyan/Yellow/Green/Redconstants indraw.rs,layout.rs,header.rs,menu.rs,pick.rsandarchive_view.rs. Both palettes share them, since ANSI colours already follow the terminal.Palette::with(&Colors)applies overrides;installstores the result in theOnceLock(an ownedPalettenow, not&'static).run_uiloads the config once for both theme and colours. A config that fails to parse still falls back to defaults, as before.For review
headingsets every level. Today h1/h2 areCyanand h3+LightCyan, so internally they'reheading/subheading; I leftsubheadingout of the config to keep the role list small. Happy to expose it.cursororselectionis a plain background. The dark selection'sREVERSEDand the light cursor's white glyph would otherwise fight a colour picked to match a theme.config.rsandcli.rs, as feat(keys): rebind every key under [keys] #104 does. The overlap is small: one field each, and therun_uiconfig load.Motivation: I maintain an OpenCode plugin that opens plannotator-tui for
/annotate. It already passesPLANNOTATOR_TUI_THEMEfrom OpenCode's light/dark mode. With[colors]andPLANNOTATOR_TUI_CONFIGit can pass the active OpenCode theme's colours too.Testing:
cargo test --workspace(320 pass; new unit tests intheme.rsandconfig.rs, plus an integration test thatconfigprints the set roles),cargo clippy --workspace --all-targetsclean,cargo fmt --all --check. Checked by hand in tmux: headings at every level and the focused block render in the configured truecolor values.