Skip to content

feat(tokens): add the content tag palette - #8686

Open
talissoncosta wants to merge 1 commit into
mainfrom
02-tag-palette-tokens
Open

talissoncosta wants to merge 1 commit into
mainfrom
02-tag-palette-tokens

Conversation

@talissoncosta

@talissoncosta talissoncosta commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to #8465

1/4, splitting #8613 into reviewable pieces.

The palette a tag's colour comes from, emitted by the token generator as a typed list so callers look a colour up instead of computing one from a stored hex. Adds a contrast helper, and marks the generated token files in .gitattributes so they collapse in diffs.

Nothing consumes it yet; Tag picks it up in #8689.

How did you test this code?

npm run test:unit covers it: common/theme/__tests__/tagSwatches.test.ts asserts every tint clears contrast in both themes, reporting all failures at once rather than stopping at the first.

Typecheck at main's baseline, 916 errors both sides.

Visual check:

  1. npm run storybook
  2. Open Design System → Tag & Project Colours
  3. Every swatch renders, and its label is legible in light and dark

@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flagsmith-frontend-preview Ready Ready Preview Oct 7, 2026 6:22pm UTC
flagsmith-frontend-staging Ready Ready Preview Oct 7, 2026 6:22pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Oct 7, 2026 6:22pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: dd11011c-7c7f-4bd3-b573-51e934c4c2f6
📥 Commits

Reviewing files that changed from the base of the PR and between a09bf6d and 127a7ed.

📒 Files selected for processing (1)
  • frontend/common/theme/__tests__/tagSwatches.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change adds content-colour tokens and updates token generation to emit TypeScript colour definitions, SCSS variables and tag utility classes. Contrast utilities and tests check the swatch colours against the shared dark ink colour. The palette story displays token-derived swatches and their contrast ratios.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 127a7

The palette outputs and contrast coverage are consistent, with no current merge-blocking risk identified.

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added front-end Issue related to the React Front End Dashboard feature New feature or request labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-8686 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-8686 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-8686 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith:pr-8686 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-private-cloud:pr-8686 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-frontend:pr-8686 Finished ✅ Results ✅

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #21324 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  38 seconds
commit  127a7ed
info  🔄 Run: #21324 (attempt 1)

🗂️ Previous results
✅ private-cloud · depot-ubuntu-latest-16 — run #21324 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  58.7 seconds
commit  127a7ed
info  🔄 Run: #21324 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #21324 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  35.4 seconds
commit  127a7ed
info  🔄 Run: #21324 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #21324 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  30.9 seconds
commit  127a7ed
info  🔄 Run: #21324 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #21309 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  36.7 seconds
commit  a09bf6d
info  🔄 Run: #21309 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-16 — run #21309 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  58.7 seconds
commit  a09bf6d
info  🔄 Run: #21309 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #21309 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  43.9 seconds
commit  a09bf6d
info  🔄 Run: #21309 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #21309 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  20 passed
skipped  2 skipped

Details

stats  22 tests across 14 suites
duration  1 minute, 6 seconds
commit  a09bf6d
info  🔄 Run: #21309 (attempt 1)

Skipped tests

firefox › tests/flag-dependencies-test.pw.ts › Flag Dependencies › A flag can be gated behind another, and says so on both sides @oss
firefox › tests/onboarding-tests.pw.ts › Onboarding › New user connects via the single-page onboarding flow @oss

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #21263 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  36.5 seconds
commit  2f6fb21
info  🔄 Run: #21263 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-16 — run #21263 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  32.9 seconds
commit  2f6fb21
info  🔄 Run: #21263 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #21263 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  36.1 seconds
commit  2f6fb21
info  🔄 Run: #21263 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #21263 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  4.2 seconds
commit  2f6fb21
info  🔄 Run: #21263 (attempt 1)

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Visual Regression

20 screenshots compared. See report for details.
View full report

@talissoncosta

Copy link
Copy Markdown
Contributor Author

@themis-blindfold review

Comment thread frontend/common/theme/__tests__/tagSwatches.test.ts Outdated
@themis-blindfold

Copy link
Copy Markdown
Contributor

⚖️ Themis review: 🧹 Ship it, nits inside

The palette, generated TypeScript, CSS utilities, and Storybook swatches are aligned, and all recorded checks passed. One test filter can skip a future fill that exactly matches the shared ink, allowing the accessibility regression it is intended to prevent.

Area Score
🎯 Correctness 4/5
🧪 Test coverage 4/5
📐 Code quality 5/5
🚀 Product impact 3/5

🧹 Nits

  • frontend/common/theme/__tests__/tagSwatches.test.ts:9 — an ink-valued fill is excluded from the accessibility assertions.
📝 Walkthrough
  • Token source and generator - add the eleven fixed Content hues and expose the typed palette for the later tag migration.
  • CSS and documentation - emit chip utilities and display every swatch with its calculated label contrast.
  • Coverage - validates the palette is present, AA-readable against shared ink, and visually distinct.
🧪 How to verify
  1. Run cd frontend && npm run test:unit -- common/theme/__tests__/tagSwatches.test.ts --runInBand.
  2. Run cd frontend && npm run generate:tokens && git diff --check to confirm generated artifacts remain reproducible.
  3. Run cd frontend && npm run storybook and inspect Design System → Tag & Project Colours in light and dark themes.
  4. Confirm every tag swatch has a distinct fill and a legible dark label.
    Automate: assert that the swatch collection excludes only content-always-dark by name.

Product take: A solid accessibility foundation for the follow-up tag migration. It has no user-facing effect until that consumer lands, but it removes the contrast risk from the eventual palette.

🧭 Assumptions & unverified claims

No unverified assumptions or claims.

The swatches are doing their accessibility stretches before the tags arrive · reviewed at 55fec31

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 2f401894-57db-475c-aea7-d93ea9638ce7
📥 Commits

Reviewing files that changed from the base of the PR and between 801c8a8 and 2f6fb21.

📒 Files selected for processing (3)
  • frontend/common/theme/__tests__/tagSwatches.test.ts
  • frontend/common/theme/tokens.ts
  • frontend/scripts/generate-tokens.mjs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Comment thread frontend/common/theme/__tests__/tagSwatches.test.ts Outdated
The palette a tag's colour is chosen from, emitted as a typed list so a
caller looks a colour up rather than computing one, with a contrast
helper and a test that reports every failing tint at once.

Nothing consumes it yet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

This branch was successfully deployed

2 active deployments
Preview – flagsmith-frontend-staging — 127a7edc Deployed Oct 7, 2026 by vercel[bot]
Preview – flagsmith-frontend-preview — 127a7edc Deployed Oct 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants