Skip to content

feat(ui): legible brand colours, previewed live from SahajCloud - #392

Merged
sydevs-bot merged 8 commits into
mainfrom
claude/feat-389-legible-brand-colours
Nov 12, 2026
Merged

sydevs-bot merged 8 commits into
mainfrom
claude/feat-389-legible-brand-colours

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Every pin, bubble, ring and dot carries a fixed outline for the basemap it is drawn on, so a service's colour reaches the map without ever being measured against it.
  • The ladder corrects each role until it passes three legibility checks, for every embed, and the standalone page can take unsaved colours from a SahajCloud preview and report back what it rendered.

Change outline

Behaviour — the ladder, and what moves in it

buildScale kept its signature; a role is now corrected until it passes, and a third check compares two roles, so it cannot live in there.

  buildRole(seed, mode)                       ← was buildScale's whole body
    saturation = min(s, 60)
    l9 = mode === 'dark' ? max(l, 60) : min(l, 70)
+   l9 = correct(l9) until contrast(l9, --background) >= 3        'surface'
+   l11 = correct(ladder[11]) until contrast(l11, steps 1..3) >= 4.5   'panel-text'
    l10 = l9 ± 6
    on  = black or white, by WCAG, computed AFTER the correction
+   → { scale, adjustedBy }

+ buildPalette(palette, mode)                 ← the only caller that sees two roles
+   each role → buildRole
+   contrast step 9 vs primary step 9
+     ΔE2000 < 20 → separateSolid: nearest lightness in the mode's whole range
+                   that clears 20 AND still passes `surface`           'selected-distinct'
+     none → the furthest apart the range reaches THAT STILL PASSES `surface`
+            (the dark-mode trade #388 accepted)

+ paletteReport(palette)                      ← both modes, through buildPalette
+   per role { entered, light, dark, suggested, adjustedBy }
+   suggested = a seed that RENDERS ITSELF, or null where only `panel-text` moved

applyPalette, markerColors and paletteReport all come through buildPalette, so the paint, the map and the report cannot disagree.

- applyPalette: per role → isBrandSeed → buildScale → write 13 variables
+ applyPalette: buildPalette → write 13 variables per role it answered for
- markerColors: stepHex(palette.primary, mode, 9), stepHex(palette.contrast, …)
+ markerColors: buildPalette(…) → scaleHex(role.scale, 9)

Contract — the map art

No brand colour is measured against the basemap any more.

  markers.ts
+   MARKER_OUTLINE      { light: '#000000', dark: '#ffffff' }
+   BASEMAP_SURFACES    the land and water each was measured against
-   pin(fill)                    → <path fill>
+   pin(fill, outline)           → <path fill stroke stroke-width stroke-linejoin>
-   cluster(fill, ring)          → <circle r=19 fill>
+   cluster(fill, ring, outline) → <circle r=18.4 fill fill-opacity stroke>
+                                  (inset by half the stroke. ⚠ `fill-opacity`, never
+                                   `opacity`, which composites the edge away too)
-   markerImages(colors)
+   markerImages(colors, mode)   ⚠ the mode belongs here: `markerColors` answers with
+                                  one shared object for an unbranded embed and carries none
-   registerMarkerImages(map, colors)
+   registerMarkerImages(map, colors, mode)

  layers.ts
-   vagueRingLayer / vagueDotLayer: 'circle-stroke-color': the fill's own colour
+                                   'circle-stroke-color': MARKER_OUTLINE[mode]

⚠ Dark edge on the light map, pale edge on the dark one. The dark style is mid-toned and its land is lighter than its water, so black reaches only 2.74:1 on that water while white reaches 1.20:1 on the light style's land.

Flow — the clients preview session

Standalone only. Nothing of it enters Widget.tsx's import graph, which Widget.standalone.test.ts walks.

main.tsx
├── root = createRoot(#syatlas)          ← kept, so a message can re-render through it
├── render()                              no brand: the client record's colours, as today
└── startClientsPreview(render)
    └── livePreview.active && scope === 'clients'   (else a no-op, which is every page view)
        ├── ready({ serverURL: SERVER_ORIGIN })     Payload posts the current form state
        └── on message, from SERVER_ORIGIN and no other origin:
            ├── payload-live-preview  collectionSlug 'clients'
            │     └── data.color1/2/3 → primary/secondary/contrast → render(brand)
            │        (every other field Payload posts is ignored, and nothing is stored)
            ├── sahaj-atlas:preview-mode → applyTheme
            └── after every repaint → window.parent.postMessage(
                  { type: 'sahaj-atlas:palette-report', roles }, SERVER_ORIGIN)

Contract — what a host can observe

Paraphrasing docs/embedding.md § "Your brand colours reach the map", one rule per line:

  Your colours paint the pins, the bubbles and the numbers on them.
+ A colour that would leave panel text, a chip or the selected class too faint is
+ shifted in lightness until it can be read, keeping its hue. The pins are painted
+ from that same adjusted colour, so the map and the panels agree.
+ What is stored on your record never changes — only what the widget paints does.
+ Every pin, bubble and ring carries a fixed outline for the basemap it is drawn on,
+ so nothing about your colour depends on what the map is showing underneath it.
  No new origin, no CSP change, no Permissions-Policy change, no new parameter.

Files

src/config/theme/palette.ts        buildRole · buildPalette · separateSolid · paletteReport · settledSeed
src/config/live-preview/
+ clients.ts                       the session: the listener, the handshake, the report
  protocol.ts, boot.ts             'clients' added to the scope union, in both its homes
src/main.tsx                       the kept root, and the re-render
src/styles/globals.css             regenerated from the corrected ladder
scripts/check-bundle-size.mjs      budget 330 → 334 KiB

Preview

Cloudflare has not aliased this branch yet — preview pending. Both the app and the Ladle playground are worth opening on a UI change this wide.

Contract impact

  • docs/embedding.md and CHANGELOG.md both change here. A host sees adjusted colours and outlined pins; nothing about the snippet, the CSP, the Permissions Policy or the URL shape moves.
  • SahajCloud consumes two things from this PR, and its own PR carries them: the retuned DEFAULT_SEEDS (ATLAS_DEFAULT_COLORS, color2 and color3 only) and the three message shapes. See the merge order below — the ⚠ mirror comment on both files is satisfied by the set, not by this PR alone.

Test results

  • Lean gate --full: ✓ lint, typecheck, test:run (168 files / 2053 tests), build, pnpm size
  • pnpm size: standalone 330.2 KiB, embed 331.2 KiB, against the new 334 KiB budget — 3.8 and 2.8 KiB spare, and about 1.6 KiB above the credentialed build this gate cannot measure
  • Targeted specs: the palette, the two marker specs, the layers, the standalone graph walk, and the new clients.test.ts — all green

Manual verification

Everything about the map needs a browser, and VITE_MAPBOX_ACCESSTOKEN is not in the committed .env, so none of it ran here.

  1. On both basemaps, confirm a pin and a bubble have a visible edge over pale land, over sea, and over a coastline — with #ffff00 as the brand colour as much as with a careful one.
  2. Confirm the selected class reads as a different colour from the ones around it, on both maps.
  3. Open a region on a phone-width screen and read the smallest text in the side panel, in both looks.
  4. With the SahajCloud PR running, move a colour picker and confirm the map repaints without a reload, and that the note under the picker names the colour on screen.

Notes for reviewer

Second of three PRs in one set. Merge order: sydevs/SahajCloud#1127 (the write-only mailing-list key) → this one → sydevs/SahajCloud#1110's PR (the Atlas-tab preview). This one produces the message format and the retuned seeds that the third consumes.

Four judgement calls:

  • The budget moved rather than the design. colord/plugins/lab is the eager cost, and selected-distinct is a colour-versus-colour measure the a11y plugin cannot make. Every embed owes that check, so it cannot be deferred behind the standalone seam. Service managers see their brand colours live, and the atlas keeps them readable #388's notes estimated ~10 KiB of headroom; there was none.
  • @payloadcms/live-preview is now a direct dependency, pinned to 3.90.2 like its -react sibling, which already pulled it in transitively. One import, ready — six lines that spell a protocol message. The alternative was writing that literal out a second time.
  • suggested is a seed that renders itself, not simply the rendered hex. The ladder works in HSL and emits a quantised hex, so feeding the rendered colour back can land a point the other side of a check and be corrected again — the volunteer's colour would change a second time the moment they accepted the first suggestion. Zero of ~37k swept seeds now fail to settle.
  • boundsLayer is in no check, per Service managers see their brand colours live, and the atlas keeps them readable #388: it is debug-only, behind DEBUG_BOUNDARY.
Detail

Dismissed review findings, with reasons.

  • The selected pin can be pure white in dark mode. Service managers see their brand colours live, and the atlas keeps them readable #388 accepted a near-white selected pin as the cost of giving selected-distinct the full step-9 range ("Accepted"); pure white is the extreme of that. The white outline is then invisible against it, which costs nothing: the outline exists to separate the pin from a mid-toned basemap, and a near-white fill already does that on its own.
  • The report describes the posted colours, while BrandTheme paints prop ?? client record. They diverge only for a role the message omits entirely. Payload posts the whole form state, so all three keys are always present — a cleared picker posts '', which both sides read as unset.

Accepted costs, now carried as shortcut: markers beside the code. The stock art is per-basemap, so an unbranded embed holds eight decoded images rather than four and its first theme switch decodes instead of answering from a warm cache. A clients preview session retains four more bitmaps per palette for the life of that tab — about 86 KB a palette, in one manager's own admin iframe. Both have a stated trigger for revisiting.

panel-text cannot be fixed by a seed. Steps 11 and 3 take fixed lightnesses, so a seed supplies only hue and saturation; at the teal hue the pair passes only below about 14% saturation, which no longer reads as teal. #1E6C71 therefore stays the primary seed and the correction moves its text step instead (L40 → L32). secondary and contrast were retunable and were retuned.

The separation fallback moves no colour today. It was swept over 274,799 primary/contrast/mode combinations before and after the surface constraint was added: the built scales are byte-identical, the fallback fires 11,476 times and never once in light mode, and its worst surface ratio is 4.98. The constraint makes the invariant structural rather than a coincidence of the two ranges.

Security review: ran, no findings. It traced the origin check on the listener, what the report can carry, and whether a colour string can escape the marker SVGs (it cannot — every colour is re-emitted by colord(...).toHex() as six hex digits, and the art is loaded as an image, where script is inert).

Closes #389


Generated by Claude Code

A service's brand colours could make the atlas hard to use: a pin that
vanished into the basemap, a selected pin that matched every other pin,
pale text and chips. Our own default secondary and contrast already
failed one check, and the default primary failed another.

The map edge no longer depends on the brand colour at all. Every pin,
bubble, ring and dot carries a fixed outline for the style it is drawn
on, measured once from each Studio style's own JSON — dark on the light
map, pale on the dark one, because the dark style is mid-toned and its
land is lighter than its water. A pin keeps exactly the colour a service
chose.

The ladder then corrects each role until it passes three checks, for
every embed: `panel-text` and `surface` inside `buildScale`, where one
seed decides them, and `selected-distinct` in `buildPalette`, which is
the only entry point that sees two roles at once. The paint, the map and
the report all come through that one call, so they cannot disagree.
`DEFAULT_SEEDS` is retuned where a seed could fix the failure, and
`globals.css` is regenerated from the corrected ladder.

Raises the eager-payload budget to 334 KiB. `colord/plugins/lab` is the
cost: `selected-distinct` is a colour-versus-colour measure the a11y
plugin cannot make, and every embed owes that check. The credentialed
pair is cleared by about 1.6 KiB.

The standalone page can now take unsaved colours from a SahajCloud
`clients` live preview and answer with what it rendered. Nothing of that
enters the embed's import graph.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVKFZaNEE4JgBvahah
A rendered step 9 is a quantisation of the HSL the ladder works in, so
feeding that hex back can land a point the other side of a check and be
corrected again — offering a volunteer a suggestion that would change
their colour a second time the moment they accepted it. `settledSeed`
walks to a seed that renders itself, stepping one point further where two
candidates render each other. Zero of ~37k swept seeds fail to settle.

The stock marker art is per-basemap now, so an unbranded embed holds
eight cache entries rather than four and its first theme switch decodes
instead of answering warm. Three comments and the mapbox rule said the
opposite. The `clients` preview session also retains four bitmaps per
palette for the life of the tab, which is a `shortcut:` with a trigger
rather than an eviction policy nobody has measured a need for.

`docs/embedding.md` and the changelog said a host's colour reaches the
map exactly as stored. The pins are painted from the corrected colour
like everything else; what the fixed outline buys is that nothing about
the colour depends on the basemap.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVKFZaNEE4JgBvahah
@sydevs-bot

sydevs-bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 17:11Z address-review · attempt 1 · session · done
  • 17:11Z address-review · attempt 1 · session
  • 17:04Z review-pr · attempt 1 · session · done
  • 17:04Z review-pr · attempt 1 · session
  • 15:30Z address-review · attempt 1 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 11, 2026
#383 and this branch each added an entry at the head of CHANGELOG's
Unreleased § Changed, so git saw an add/add there. Both entries stay,
#392 above #349, which keeps the section newest-first.

Nothing else overlapped: `docs/embedding.md` and `docs/testing.md` took
both sides' new sections cleanly, and the code main brought touches
`Widget.tsx`, which this branch never opens.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZVTLRdTmG2ijYEpfj
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Merged main in. One conflict: #383 and this branch each added an entry at the head of CHANGELOG's Unreleased § Changed. Both entries stay, #392 above #349, which keeps the section newest-first.

docs/embedding.md and docs/testing.md took both sides' new sections cleanly, and main's code lands in Widget.tsx, which this branch never opens. Lean gate green: 168 files, 2050 tests.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 11, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design 9626bc6 Nov 12 2026, 05:29 PM

@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 11, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

This draft has had no CI activity for hours and no session holds it. A mention (@sydevs-bot) or a push from you starts me again.

🤖 sydevs dispatcher

@Ardnived

Copy link
Copy Markdown
Contributor

@sydevs-bot continue work on this PR

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 12, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 12, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Nothing to build here: no review, no open thread, and the branch meets #389 as written.

Checked. Merged current main (ae2eb56) — clean. Lean gate --full green on that merge: 168 files, 2050 tests, build, pnpm size 330.1 / 331.2 KiB against 334. The merge stays local; a clean one is pushed only with work.

Why this PR has not moved. CI run 43095574552 is completed / failure, but all three jobs — Lint/Typecheck & Build, Smoke, Dependency Review — are still queued and never started. Nothing has ever run against 8e30eca. The dispatcher reads those queued jobs as "still running" and so will not re-run them: it classifies infrastructure from a check's conclusion, and these have none. Journalled.

Your call:

  • A — re-run that CI run yourself (recommended): one click, and the dispatcher takes it from there.
  • B — say the word and I push the base merge: a new head sha starts a fresh run, against the rule above.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 12, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 12, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 12, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 12, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🧐 Adversarial review

The diff traces to #389 section by section, and nothing is built the ticket did not ask for. The one structural claim it made — that the paint, the map and the report all come through buildPalette, so they cannot disagree — holds in the code. Contracts are handled: embedding.md and CHANGELOG.md both move, no origin, CSP or parameter changes, and SahajCloud's mirrored ATLAS_DEFAULT_COLORS feeds only a picker fallback and the Install tab, so the window before the third PR lands is a stale swatch, not a drift in what visitors see. The three findings are all in the map art and the one correction path no spec reaches.

Findings

  • should-fix — the bubble's outline renders at 71% alpha and misses the 3:1 bar it was measured for. markers.ts:126
  • consider — separateSolid's fallback can leave step 9 failing surface. palette.ts:311
  • consider — the pin's stroke is clipped where the bubble's was inset. markers.ts:113

What was checked

Read whole on the branch: palette.ts, markers.ts, layers.ts, clients.ts, main.tsx, markers.test.ts, markers.outline.test.ts, palette.test.ts, clients.test.ts. Ladder walk on each new piece — scaleHex is stepHex for an already-built scale, @payloadcms/live-preview is the platform's own ready and was already transitive, and clients.ts's hand-rolled listener is §5 of the ticket verbatim, so none is a finding. Consumer side read: SahajCloud src/lib/clients/appearance.ts, Clients.ts:665, InstallGuide.tsx:153. Recomputed the retuned defaults against white — secondary 3.14:1, contrast 3.22:1 — and the outline composites above. No preview link is published yet and this repo seeds none, so nothing was opened.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread src/config/theme/palette.ts Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 12, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 12, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 12, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 12, 2026
`opacity` composites the whole element, so the ring's translucency took its
own outline with it: white at 0.706 over the dark style's land reaches about
2.6:1, under the 3:1 the outline was measured for. `fill-opacity` leaves the
stroke opaque and the ring as translucent as before.

`markers.outline.test.ts` held the constant, not the art, so the gap was
invisible to it. It now reads the rendered art back and refuses an element
carrying both a stroke and an element-wide opacity.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVzCc9EAx2R6ULZgA1
`separateSolid`'s fallback maximised ΔE alone, so where no candidate cleared
both bars it could leave `contrast` step 9 under 3:1 against the app surface —
a check every role owes in both modes. It now searches only the lightnesses
that pass, and gives up the separation alone.

No colour moves today: over 274,799 primary/contrast/mode combinations the
built scales are byte-identical, the fallback fires 11,476 times and never
once in light mode, and its worst surface ratio is 4.98. So there is no
reachable defect for a new spec to fail against, and `legibility` already
holds the property the fallback can now only satisfy.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVzCc9EAx2R6ULZgA1
The note read 0.6 user units — the stroke's half-width, which is how far it
reaches past the path, not past the canvas — beside a device-pixel figure
derived from a different number. The canvas clips 0.1 user units at the head's
left edge and 0.2 at the rounded tip.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVzCc9EAx2R6ULZgA1
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Three adversarial findings, all built. Merged current main (e4d9487) — clean, pushed with the work.

Lean gate --full green: 168 files, 2053 tests, build, pnpm size 330.2 and 331.2 KiB against 334.

The queued CI run I asked you about is moot. This push is a new head, so a fresh run starts on it.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 12, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review November 12, 2026 17:31
@sydevs-bot
sydevs-bot requested a review from Ardnived November 12, 2026 17:31
@sydevs-bot
sydevs-bot enabled auto-merge November 12, 2026 17:31
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 12, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Nov 12, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 12, 2026
Merged via the queue into main with commit e04e801 Nov 12, 2026
62 of 65 checks passed
@sydevs-bot
sydevs-bot deleted the claude/feat-389-legible-brand-colours branch November 12, 2026 20:50
@sydevs-bot sydevs-bot moved this from Pending to Done in SYDevelopers Technical Roadmap Nov 12, 2026
Ardnived added a commit that referenced this pull request Nov 13, 2026
…de palette report (#399)

* fix(ui): tone down a near-white brand colour on the dark map

- Dark mode caps the brand solid at lightness 80, as light mode caps it at 70: white passes `surface` on the dark page, so a near-white seed rendered near-white, and three pale seeds gave pins nobody could tell apart
- The cap is reported to SahajCloud as a new `near-white` check, so the Atlas tab can say why a colour moved
- `selected-distinct` keeps its full dark range, past the cap: same-hue seeds need the room to separate

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ui): stronger near-white cap on the dark map, per-mode report, softer pin outline

- Dark mode's near-white cap drops from lightness 80 to 65: at 80 the pins still read as tints
- The palette report adds `lightAdjustedBy` and `darkAdjustedBy` beside the `adjustedBy` union, so SahajCloud can say which mode moved a colour
- Pin and cluster outlines draw at half strength (`stroke-opacity`, never element `opacity`); the pale edge then reaches about 2:1 on the dark style's land, accepted for a softer edge

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(ui): report each mode's checks alone, without the union

SahajCloud's Atlas tab is the report's one reader, and it now reads lightAdjustedBy and darkAdjustedBy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ui): one tone band per mode for the brand solid

- `TONE_RANGE` holds step 9 per mode: light 20–70, dark 60. The edge facing the canvas is today's (70 on white, 60 on dark), so our own defaults render unchanged
- The far edge is new: a near-black seed is floored at 20 on the light map (`near-black`), and a near-white one capped at 60 on the dark map (`near-white`); only these are reported
- `selected-distinct` keeps its room past the far edge

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ui): a colour cleared in the SahajCloud preview shows the default

The preview sends `null` for a colour the manager reset, and `BrandTheme` read it with `??`, so the map fell back to the saved colour — Reset left the map on exactly the colours it was meant to undo. Only `undefined` falls through to the client record now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(map): ringed pins, outline-free bubbles, light-mode marker colours

- A cluster bubble loses its black or white outline; its translucent ring is the whole edge
- A pin gains a ring of the bubble's kind (ring colour, 0.706 opacity), 2.2 wide outside the head, drawn behind it; the head shrinks to 0.86 about the tip to fit it in the same 34×38 box
- Pins, bubbles, the cluster count and the vague ring and dot take `MARKER_MODE`, the light-mode palette, in both modes: the dark basemap is washed out, and a solid lifted for the dark panel washed out with it
- `markerColors`, `markerImages`, `registerMarkerImages` and `clusterLayer` no longer take a mode; the art is the same in both, so a theme switch answers from a warm cache

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ui): limit the brand solid on the canvas side only

- Light mode caps step 9 at 70 and dark mode floors it at 60, as before this branch; the far-side limits (light 20, dark 60) are gone, and with them the `near-white` and `near-black` checks
- What prompted them, pale brands washing out on the dark map, is the marks' problem, and `MARKER_MODE` already answers it: pins and bubbles take the light-mode shade, which the 70 cap keeps coloured

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ui): paint a near-colourless brand as chosen, with tints that match it

- Only `#000000`, SahajCloud's old "unconfigured" sentinel, falls back to the default; a grey, white or near-white seed is painted as the neutral ramp it is, where it used to snap to our teal
- The ramp's saturation is also held to twice the seed's chroma: HSL calls `#fffdfa` 100% saturated, so its chips and icons came out vivid tan while its solid stayed near-white; mid-toned brands, the three defaults included, are unchanged
- `docs/rules/mapbox.md` now describes the ringed pins, the outline-free bubbles and `MARKER_MODE`

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(ui): paint every brand colour with a hue at 60% saturation

- `MIN_SATURATION` joins `MAX_SATURATION`, both 60: a vivid seed is toned down as before, and a muted, pale or near-white one is lifted until it reads as a colour; a seed with no hue stays neutral
- Whether a seed needs lifting is read from its chroma, since HSL calls `#fffdfa` 100% saturated; a lift past 10 points is reported as `saturation`, so our own teal, two points under, raises no banner
- `globals.css`'s frozen defaults are regenerated: the default teal moves 58% → 60% and the default blue 40% → 60%

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ui): a 40% saturation floor that shows in both modes

- `MIN_SATURATION` drops to 40, so our three defaults sit inside the band and render exactly as before; `globals.css` is back to its frozen values
- A hued solid is also kept far enough from white and black for the floor to show: a near-white seed lifted to the floor still rendered near-white on the dark page, where the canvas-side limit left it alone. That move is reported as `saturation` in the mode it happens in

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(ui): keep the brand solid 20 from the far extreme in each mode

`FAR_MARGIN` floors step 9 at 20 on the light map and caps it at 80 on the dark one, reported as `near-black` and `near-white`; the canvas-side limits (70, 60) are unchanged, and `selected-distinct` keeps its room past the margin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(ui): light-mode solid floor 10, dark-mode floor 50

The tone band is now light 10–70 and dark 50–80. The dark floor moves from 60 to 50, so `globals.css`'s frozen dark defaults are regenerated: the default teal's solid goes 60 → 50 and the blue's 60 → 55.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Revert "feat(ui): light-mode solid floor 10, dark-mode floor 50"

This reverts commit e4c99cc91c7565318da4a740cc2f7dd790a7a369.

* feat(ui): raise the lightest brand solid by 10 in both modes

The tone band is light 20–80 and dark 60–90. Our defaults sit inside both and render unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(theme): report a band crossing independently of the lift

A solid pushed past the mode's far edge earned `near-white` or `near-black`
only when no `saturation` lift had already been reported, so `NOTICEABLE_LIFT`
— a constant about lift size — decided whether a tone move was named at all.
`#fffdfa` and `#ffd6d6` both land at dark lightness 75 from past 90; only the
first said so.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVNtqqiPXb7PTjfCiT

* refactor(theme): read chroma off colord, drop the dead saturation guard

`chromaOf` re-derived from HSL what `toHsv()` already carries: `s * v / 100`
is the same quantity on the same scale. And `Math.max(MIN_SATURATION,
MAX_SATURATION)` is `MAX_SATURATION` for two module constants, so the guard
could not fire and read as if the two could invert.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVNtqqiPXb7PTjfCiT

* refactor(map): name the four marks' colour pair MarkColors

The type covers both pins since they gained rings, and a pin's ring is not a
cluster bubble's.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVNtqqiPXb7PTjfCiT

* docs(embedding): bring the brand-colour section up to what the map paints

Four claims the colour changes broke: the map taking both palettes, an unset
colour meaning any colourless one, lightness as the only axis adjusted, and a
fixed per-basemap outline on every mark. CHANGELOG gains the #399 references
its two new entries were missing, and #392's outline entry says it is
superseded for pins and bubbles.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVNtqqiPXb7PTjfCiT

* docs(theme): say why PALETTE_CHECKS still skips the basemap

Pins and bubbles no longer carry a fixed per-basemap outline, so the reason
given for having no basemap check named something that is gone.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVNtqqiPXb7PTjfCiT

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

feat(ui): legible brand colours, previewed live from SahajCloud

3 participants