Selectable tile colour (#160) #161

Merged
miko merged 2 commits from feature/160-tile-colour into development 2026-11-10 12:37:51 +01:00
Owner

Summary

Categories and guides get a Tile Colour (#160): automatic (derived from the id, as before), one of the eight tile colours, or any colour. Stacked on !159 (#158); its two commits drop out of this diff once !159 is merged.

 Category / Guide
+  tileColor  VARCHAR(7) NULL   -- #rrggbb, null = automatic (ADR-0027)

 <Tile> (src/components/Tile.tsx)
-  className={tileColourClass(tileColour(id))}
+  style={tileStyle(id, tileColor)}        // background + letters: white, dark below 3:1

 <CategoryForm> / <GuidePropertiesForm> (Media tab)
+  <TileColourPicker>                      // Automatic | 8 swatches | custom
+    <HexColourInput>                      // shared with <AccentPicker>, # optional
carries the tile colour
guide versions no, applies at once (ADR-0027)
backups yes; older backups → automatic
duplicating yes
guide packages no; imports start automatic

Evidence

  • Before: the tile colour was always derived from the id.
    After:
    • tile.test.ts: chosen colour wins, #ffd700 → dark letters, presets → white, form field "" → automatic, "teal" → error.
    • CategoryListing/GuideListing tests: background-color:#ffd700;color:#1c1917.
    • backup.test.ts: round trip; a backup without tileColor → null.
    • e2e/duplicateGuide.spec.ts: the copy keeps "Plum".
    • npm test: 644 passed. E2E settings, duplicateGuide, categories, guideEditor, backup, locale and menu pass. pages.spec.ts:127 and :333 (page search) already fail on the base branch.

Merge Danger

Door: one-way (small)

Migration adds two nullable columns, so rolling back the code alone is harmless. Dropping them loses chosen colours.

Blast Radius: tiles

Every category and guide grid now colours tiles by inline style instead of bg-tile-* classes (removed from globals.css). Automatic colours are unchanged. The accent picker now uses the shared hex input.

🤖 Generated with Claude Code

## Summary Categories and guides get a **Tile Colour** (#160): automatic (derived from the id, as before), one of the eight tile colours, or any colour. Stacked on !159 (#158); its two commits drop out of this diff once !159 is merged. ```diff Category / Guide + tileColor VARCHAR(7) NULL -- #rrggbb, null = automatic (ADR-0027) <Tile> (src/components/Tile.tsx) - className={tileColourClass(tileColour(id))} + style={tileStyle(id, tileColor)} // background + letters: white, dark below 3:1 <CategoryForm> / <GuidePropertiesForm> (Media tab) + <TileColourPicker> // Automatic | 8 swatches | custom + <HexColourInput> // shared with <AccentPicker>, # optional ``` | | carries the tile colour | |---|---| | guide versions | no, applies at once (ADR-0027) | | backups | yes; older backups → automatic | | duplicating | yes | | guide packages | no; imports start automatic | ## Evidence - **Before:** the tile colour was always derived from the id. **After:** - `tile.test.ts`: chosen colour wins, `#ffd700` → dark letters, presets → white, form field `""` → automatic, `"teal"` → error. - `CategoryListing`/`GuideListing` tests: `background-color:#ffd700;color:#1c1917`. - `backup.test.ts`: round trip; a backup without `tileColor` → null. - `e2e/duplicateGuide.spec.ts`: the copy keeps "Plum". - `npm test`: 644 passed. E2E settings, duplicateGuide, categories, guideEditor, backup, locale and menu pass. `pages.spec.ts:127` and `:333` (page search) already fail on the base branch. ## Merge Danger **Door:** one-way (small) Migration adds two nullable columns, so rolling back the code alone is harmless. Dropping them loses chosen colours. **Blast Radius:** tiles Every category and guide grid now colours tiles by inline style instead of `bg-tile-*` classes (removed from `globals.css`). Automatic colours are unchanged. The accent picker now uses the shared hex input. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Categories and guides get a tile colour: automatic (derived from the id,
as before), one of the eight tile colours, or any colour. The letters turn
dark where white falls below 3:1. A guide's tile colour applies at once and
is not versioned (ADR-0027); backups and duplicating keep it, guide
packages do not carry it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The accent and tile colour pickers share HexColourInput, which takes a
typed hex value with or without its #. tileStyle and tileTextColour name
what the tile's colours are for, the custom colour's start lives in the
theme, and tileColourFrom returns {tileColor} or {error} like the other
form parsers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit 0173ddaf66 into development 2026-11-10 12:37:51 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba!161
No description provided.