Repository navigation
2026.08.24 - Custom Colours - Phase 1: Catalogue and Config - #89
Merged
lanhhoang merged 3 commits intoAug 24, 2026
Merged
Conversation
…t and lowercase persistence.
Adds the 8 fixed preset palettes plus the live Pi default and the Custom user override, defines the 14-role semantic palette contract shared with SidebarSegmentRole, and threads ColorSettings through the load/save path so all renderers consume one normalized object. - src/core/colors.ts: ATELIER_COLORS, FIXED_COLOR_PALETTES, COLOR_PRESET_IDS, DEFAULT_COLOR_SETTINGS, plus validation helpers (isHexColor, normalizeHexColor) and canonicalization (getFixedColorPalette, normalizeColorSettings). - src/shared/types.ts: PALETTE_ROLES, PaletteRole, ColorPreset, FixedColorPreset, HexColor, ColorPalette, ColorSettings; aliases SidebarSegmentRole = PaletteRole; requires colors on PiStatusConfig. - src/core/config.ts: default/clone/normalize/save now round-trip colors via normalizeColorSettings so JavaScript callers cannot persist uppercase, mixed-case, partial, or unknown colour data. - Test fixtures: every typed PiStatusConfig literal now includes colors: structuredClone(DEFAULT_COLOR_SETTINGS) so the required field is satisfied. - tests/core/config.test.ts: focused failing-test-first describe block pins preset/role order, default fallback, malformed-input repair, case-insensitive hex acceptance, round-trip, frozen catalogue, and save-side canonicalization.
Updates four exact-default expectations and the published-keys list in tests/core/config.test.ts so they accept the new required colors field on PiStatusConfig and include "colors" in the persisted schema key set. This is a fixture-only follow-up to the previous commit that introduced ColorSettings.
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.
ColorSettingscontract, and the config load/save wiring that all later renderers consume.