viewer: color schemes, twenty families and every variant, with a light/dark filter
check / check (push) Waiting to run

Owner, 2026-10-19: full color-scheme support for the viewer, the top
Neovim-style schemes, about twenty families each with a flyout of all its
variants, a light/dark/all filter, Ayu included, alphabetical, a whole row
to click.

- The sidebar's corner button (the light/dark toggle before) opens the
  menu: the filter, then, alphabetically and all on screen at once (in
  columns in a short window), Ayu, Catppuccin, Cyberdream, Dracula,
  Everforest, GitHub, Gruvbox, Kanagawa, Material, Melange, Monokai Pro,
  Night Owl, Nightfox, Nord, One Dark, Oxocarbon, Rosé Pine, Solarized,
  Sonokai, Tokyo Night and Wanderbooks (the viewer's own Light and Dark):
  80 schemes, each variant a row with a strip of its colors.
- Colors from each scheme's official source, checked value by value
  (docs/color-schemes.md; the table names the sources).
- Every palette, the viewer's own included, keeps every text color
  (figures, gains and losses, warnings, links, secondary and faint text)
  at WCAG AA (4.5:1) on every ground it sits on, soft fills included; a
  color that falls short keeps its hue and only changes lightness. Text,
  secondary and faint text stay apart (each 1.2 times the next), gains,
  losses and text and the charts' series shown together stay plainly
  different (CIE76 ΔE 20).
- The scheme sets both egui styles and pins its mode, so the system
  turning light or dark changes nothing (it made figures unreadable).
- Preferences now live in the platform's place for app settings
  ($XDG_CONFIG_HOME/wanderbooks-viewer on Linux), not eframe's default,
  which was $XDG_DATA_HOME/wanderbooks: the data root's own place. The
  old file is moved once.
- Tests: every page of thirteen painted in all 80 schemes, the same words
  in the same places, each text readable on what was painted under it;
  the menu's order, reach and whole-row clicks in a tall and a short
  window; the system flip; preferences restored. Two review rounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3gXMVt7XJPi6ens1or9Dj
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-10-19 12:51:58 -06:00
1 parent 67648473ba
commit a1198a9c59
13 files changed
+3700 -87

No files matched your search

+84
View File
@@ -0,0 +1,84 @@
# Color schemes in the viewer
The viewer's color-scheme menu (the button in the sidebar's lower corner)
offers its own scheme, Wanderbooks Light and Dark, and twenty families of
popular editor schemes, each with all its variants: 80 schemes in all (78
and the viewer's own two). The menu's filter narrows the list to light or
dark schemes. Families are listed alphabetically, each one's variants too,
in as many columns as the window's height needs, so every family is on
screen at once; a variant's whole row (its colors and its name) chooses
it.
The choice is a viewer preference, kept with eframe's other preferences;
nothing is written to the books, and no figure or word changes with the
scheme (`schemes.rs`, `painted`).
Owner, 2026-10-19: "full blown colorscheme support … all the top neovim
style colorschemes"; "on the order of 20 families, each with a flyout of all
its variants"; a light/dark/all filter; Ayu included.
## Where the colors come from
Each scheme's sixteen colors (`crates/ledger-gui/src/schemes/table.rs`) were
taken from its official source and checked value by value (2026-10-19); the
table names the source above each family:
| Column | What it is |
|---|---|
| bg | the editor background (Normal) |
| dim | a panel or sidebar background (mantle, bg_dark, bg0 …) |
| raised | a raised surface (surface0, bg_highlight, float …); recorded, not used |
| sel | the visual-selection background; recorded, not used |
| border | the split or border color; recorded, not used |
| fg | the text (Normal) |
| muted | secondary text (subtext, fg_dark, subtle …) |
| faint | comments |
| accent | the scheme's signature accent: in most its blue; Ayu's yellow-orange, Dracula's purple, Rosé Pine's iris, Monokai Pro's yellow, Material's teal, Nord's frost cyan (nord8), GitHub's own accent blue |
| red, green, yellow, orange, blue, purple, cyan | its named colors |
Where a scheme has no color for a column, the closest official one stands
in (Dracula has no blue: its ANSI blue, its purple; Sonokai has no cyan: its
blue; Oxocarbon has no yellow: IBM Carbon's, and no orange: its pink). A few
columns repeat another for the same reason: seven schemes have one
background (Gruvbox Dark Hard, Nord, Solarized Dark and Light, Cyberdream
Dark and Light, Melange Dark), dim being their bg. Variant names are the plugins' own (GitHub
Dark Default, not Dark, which is another theme).
## How the viewer paints with them
- The page is the darker of a scheme's bg and dim, the cards the lighter,
so cards stand out in light and dark schemes alike. A scheme with one
background gets a second a shade toward its text: lighter cards in a
dark scheme, a darker page in a light one.
- Secondary text is the scheme's muted color, unless that is no dimmer than
its text (Nord's documented "subtle" tone is brighter): then a tone
between its text and its comments.
- Selection is the cards tinted with the accent; the new-entry highlight is
the cards lightly tinted with the yellow (at 10%: a stronger tint left
too little room for colored amounts on it, and bleached Nord's red to a
pink).
- The charts' series are the scheme's blue, cyan, yellow, purple, orange,
green, red and accent, in that order, each that looks like one already
taken (CIE76 ΔE under 20) passed over: Monokai Pro and Sonokai name their
cyan with their blue, and Kanagawa Dragon's blues, cyans and purples are
near one another. The three the charts show together (net, income,
spending) are always plainly different.
- **Readable, always.** Every color that carries text or a figure (text,
secondary text, the faintest text, which carries chart amounts and entry
numbers, gains, losses, warnings, links) reaches WCAG AA contrast (4.5:1)
on every background it is drawn on: page, cards, sidebar, hover,
selection, the new-entry highlight, and the soft fills of pills and
badges. A scheme's color that falls short keeps its hue and saturation
and only gets lighter (dark schemes) or darker (light ones), just far
enough. Gains, losses and plain text stay plainly different to the eye
(ΔE 20 or more apart). egui's own faint text (placeholders) is the
secondary text; the logo's initial is black or white, whichever reads on
the accent. The viewer's own palettes go through the same rule (it lifted
Wanderbooks Light's green on the sidebar from 4.35:1, its faint text and
warnings too, and Wanderbooks Dark's faint text).
- **Three levels of text, always apart.** Lifted one by one, secondary and
faint text came out alike (identical in some schemes, faint above
secondary in others). So the faintest is lifted first, then secondary
text until it reads at least 1.2 times better than the faint on the
ground it reads worst on, then the text the same over secondary.
- The scheme sets both of egui's styles and pins its light or dark theme,
so the system turning light or dark later changes nothing.
+51
View File
@@ -406,6 +406,57 @@ reachable by a test:
- the group's member check (`!` deleted), which agrees on every account
whose own group lists no members, the usual case.
## Viewer color schemes (2026-10-19)
`ledger-gui/src/schemes.rs` (docs/color-schemes.md). No mutation run (the
viewer's rule); its two musts are tested directly instead:
- `schemes::painted::every_scheme_paints_the_same_words_and_figures_readably`
draws thirteen pages (an entry, the company, assets, documents, overview,
cash, profit, transactions, the P&L, the balance sheet, accounts,
parties, the journal) in all 80 schemes, a thread a page, and reads what
was painted where it can be seen: every run of text, report rows
included, is the same and in the same place in every scheme, and each is
at 4.5:1 or better against what was painted under it by then (the fills
in paint order, cut to their clips, translucent ones laid over what was
below; every section of a text, its own color or the fallback). It found
egui's placeholder text (its weak text, 60% alpha of the text) at 2.8:1.
Not painted by it: hover, selection and new-entry rows, tooltips and
the menu, whose grounds the palette tests check by arithmetic.
- `the_system_turning_light_or_dark_changes_nothing`: starting as eframe
does (following the system), a scheme chosen and the system then
flipped leaves every painted color as it was. It fails on the first
version, which set only the current theme's style.
- The palette tests check every scheme: every text color at 4.5:1 on
every ground (soft fills included), text over secondary over faint each
at least 1.2 times the contrast of the next on its worst ground, chart
series at 3:1 on cards and the hover tint, the charts' three series shown
together and gains, losses and text each ΔE 20 or more apart, the
logo's initial readable on the accent, light or dark as its background
is, and the filter showing exactly its mode; the menu test chooses,
filters and keeps a scheme, and its accessible labels check only the
family in force and select the variant in force; `app::tests` restores
the scheme (and the old light/dark choice) from the preferences.
The first version's review (2026-10-19) found figures turning unreadable
when the system's theme flipped, Ayu and the families after it out of
reach in a short window, Income and Net the same color in twelve schemes,
pills, faint figures and the logo initial below 4.5:1, a new-entry tint
that bleached reds and greens, and a "same figures" test that compared
only accessibility labels (no report rows); all fixed, with the tests
above. Round 2 found secondary and faint text made alike by lifting each
alone (identical in Wanderbooks Light), the painted test picking a text's
ground without paint order or clips, and every family's accessible label
carrying the hidden check; fixed, with the tests above. The owner, trying
it (2026-10-19): Ayu out of reach (the family list scrolled inside the
menu, its scroll bar hidden), the families not alphabetical, and a click on
a variant's colors doing nothing. Now the families are alphabetical, in
columns with no scrolling, and a variant's whole row is its button;
`every_family_is_on_screen_in_order_and_a_whole_row_chooses` checks all
three in a tall window and a short one. Earlier: the viewer's own light palette's green below 4.5:1 on the
sidebar (4.35:1), and a first fix (moving colors toward the text color)
that turned Everforest's red and green into the same grey; colors keep
their hue and change only lightness.
## Benchmarks (baseline 2026-10-13)
No budget, by decision (Stephen, 2026-10-13: the books do little work