Skip to content

Cap the text toolbar at eight colours - #219

Open
grunion-ai wants to merge 1 commit into
mainfrom
fix/swatch-cap
Open

grunion-ai wants to merge 1 commit into
mainfrom
fix/swatch-cap

Conversation

@grunion-ai

Copy link
Copy Markdown
Owner

What changed

The text toolbar shows at most eight colour swatches: the role colours first, then the text colours rows use most. Colours already on rows keep rendering.

Why

The swatch row listed every colour on any row in the deck, so library.html offered 44. Bar fills and run backgrounds counted as text colours too: deckColors did not check that a row held text, and its run pattern matched background-color.

Limit

The cap is fixed at eight, with no per-deck setting. A colour past the cap still renders but cannot be reapplied from the toolbar. If a brand needs more, the upgrade path is a palette key in style.json.

Verified

  • New live test in test/editor.test.mjs. It fails on the old template with 36 swatches and passes on this branch.
  • node --test test/**/*.test.mjs: 729 of 729 pass, none skipped, rebased on 0ecc47d.
  • library.html, slide 27, Stat row selected: 44 swatches before, 8 after, measured in Chromium. No screenshot is attached because gh cannot upload images; Kyle has the before and after images.
  • deck.html and library.html are rebuilt from the changed template.

Existing decks keep the old toolbar until they are rebuilt with create --from.

🤖 Generated with Claude Code

The swatch row listed every colour on any row in the deck, so
library.html offered 44. Bar fills and run backgrounds counted too: the
row test ignored whether a row held text, and the run pattern matched
background-color.

The row now holds the role colours first, then the text colours rows use
most, up to eight. Colours already on rows keep rendering.

ponytail:
- template.html deckColors: SWATCH_MAX is a fixed 8 with no per-deck
  setting, and a colour past the cap cannot be reapplied from the
  toolbar. Upgrade path: a palette key in style.json if a brand needs
  more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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