Skip to content

feat: add French, a Preferences page saved under Colony/Collector, and the Colony themes and accents with high contrast - #13

Merged
MotherSphere merged 9 commits into
mainfrom
feat/language-preferences-themes
Oct 14, 2026
Merged

MotherSphere merged 9 commits into
mainfrom
feat/language-preferences-themes

Conversation

@MotherSphere

@MotherSphere MotherSphere commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Collector now speaks English or French, has a Preferences page, and draws in the Colony themes and accents.

Language

  • Every string goes through t/tf, with French units and decimal commas.
  • The language follows the system, or the Preferences choice, which also applies to --help and error messages.
  • collector --version still prints exactly collector X.Y.Z.

Preferences

  • Clicking Collector in the top-left corner, or pressing p, opens the page in place of the boxes. Close, Esc or p close it.
  • Categories follow colony-ui's order: General, Appearance, Accessibility, then About. Sections are collapsible and arrive closed.
  • Keyboard and mouse send the same messages. The wheel moves through the open category.
  • The file is <config>/Colony/Collector/preferences/preferences.json, saved at once, written atomically. Fields use colony-ui StandardPreferences names, plus language and refresh_interval.
  • Reading is lenient per field. A file that is not JSON is renamed to preferences.json.invalid and never overwritten.
  • src/paths.rs ports the colony-ui path table, including the reserved apps refusal.

Themes

  • config/themes.json is a byte copy of Resources generated/themes.json, refreshed to Resources main c19a39d, which carries the shared Preferences labels and the contrastEnds ink and paper. A new CI job (themes.json) fails with the refresh command when the copy falls behind Resources main.
  • src/theme.rs ports from colony-ui:
    • the resolver with its Gruvbox dark fallback,
    • with_high_contrast, with the same amounts,
    • contrast_on, which takes its ink and paper from the contrastEnds of themes.json rather than hard-coding them. A test holds those ends to colony-ui's INK and PAPER.
  • Colours are 24-bit when the terminal advertises it (COLORTERM, or WT_SESSION), otherwise the nearest of the xterm 256.
  • Every widget draws from the palette. A test fails if a colour literal appears outside theme.rs.
  • Appearance:
    • theme cards per family, using themes.json labels,
    • the eight accent swatches, plus auto accent,
    • a live preview.
  • Accessibility: high contrast and reduce motion. A note explains that the terminal owns the font and text size.
  • A theme change shows colony-ui's theme_applied toast in the footer.

colony-ui itself is not a dependency: it pulls in iced, which would break the Linux crate and binary-size budgets. Its contract is mirrored by hand instead: field names, shared en/fr strings, category order and theme maths. A test holds every copied settings_* and theme_applied string, in both locales, to the labels in themes.json, so a reworded shared label fails CI here.

README: the Privacy table, Preferences, key tables, themes and the truecolor note are updated. Merged with #12: its Status and roadmap are kept, with the 0.3.0 features marked as tested in CI only. The binary size line now says about 1.3 MB.

Verification

  • Checked against the colony-ui 0.1.6 sources:
    • StandardPreferences field names, per-field lenient reading, and selected_accent left out when unset.
    • All 30 shared strings, identical in en and fr.
    • The category order.
    • The high-contrast amounts, and the INK and PAPER colours of contrast_on, now read from contrastEnds.
  • cargo test: 45 unit tests passed, including render tests at 80 columns in en and fr, the labels test and the contrastEnds test, plus 7 CLI tests and 3 pseudo-terminal tests.
  • cargo fmt --check is clean.
  • CI is green on the final commit: tests on all three OS (pty test included), MSRV, clippy, advisories, CodeQL, colony.json and themes.json.
  • Linux budgets: 81 of 82 crates, and a 1,322,320-byte binary (limit 3 MB).

Every string the user reads goes through src/i18n (en.rs, fr.rs), with
French units and decimal commas. The quit hint moves to a full-width
footer so it fits in French. --version stays exactly 'collector X.Y.Z'.
Tests: identical key sets, placeholders and non-empty values in both
locales, every key used in the code exists, and an 80x24 render in both
locales with no label cut off.
…rast and reduced motion

config/themes.json is a byte copy of Resources generated/themes.json, embedded
and read once; a CI job fails with the refresh command when it falls behind.
src/theme.rs resolves a family and variant with the Gruvbox dark fallback,
ports colony-ui's high-contrast derivation and contrast_on, and maps colours
to the nearest xterm 256 when the terminal does not advertise truecolor.
Every widget now draws from the palette; no colour literal is left outside
theme.rs.

Preferences gains Appearance (theme cards per family, the eight accent
swatches, auto accent, a live preview) and Accessibility (high contrast,
reduce motion), with colony-ui's shared strings in English and French. A
theme change shows the theme_applied toast in the footer. The mouse wheel
moves through the open category, and a click on a card or swatch picks it.
@MotherSphere MotherSphere changed the title feat: add French, a Preferences page saved under Colony/Collector, and the Colony themes with high contrast feat: add French, a Preferences page saved under Colony/Collector, and the Colony themes and accents with high contrast Oct 14, 2026
@MotherSphere
MotherSphere merged commit d3be277 into main Oct 14, 2026
12 checks passed
@MotherSphere
MotherSphere deleted the feat/language-preferences-themes branch October 14, 2026 10:28
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.

1 participant