Skip to content

fix(ui): brand colours that read in both modes, ringed pins, a per-mode palette report - #399

Merged
Ardnived merged 19 commits into
mainfrom
fix/dark-near-white-brand
Nov 13, 2026
Merged

Ardnived merged 19 commits into
mainfrom
fix/dark-near-white-brand

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #392, from reviewing SahajCloud's Atlas-tab colour preview (sydevs/SahajCloud#1129) against real service palettes.

  • Brand colours with a hue are painted between 40% and 60% saturation. A muted, pale or near-white colour is lifted until it reads as a colour, and is kept far enough from white or black for that to show, in both modes. "How colourful" is read from the seed's chroma, since HSL calls #fffdfa 100% saturated. Reported as saturation.
  • A grey, white or near-white colour is painted as chosen. Only #000000, SahajCloud's old "unconfigured" value, falls back to the default; snapping every achromatic pick to our teal read as the picker ignoring the manager.
  • The solid is held inside a tone band per mode: light 20–80, dark 60–90. A move past the far edge is reported as near-black / near-white, independently of whether the saturation lift was reported — the two are separate moves. The selected class is the one exception: selected-distinct may take its solid outside the band when nothing inside it separates, which is feat(ui): legible brand colours, previewed live from SahajCloud #389's accepted trade and is now written down.
  • Map marks take the light-mode palette in both modes (MARKER_MODE): the dark basemap is mid-toned, so dark-mode solids washed out on it.
  • Bubbles lose their black/white outline; pins gain a ring of the bubble's kind (ring colour, 0.706 opacity, 2.2 outside the head).
  • The palette report sends lightAdjustedBy and darkAdjustedBy in place of the adjustedBy union, which SahajCloud#1129 was its only reader of.
  • A colour cleared in the SahajCloud preview shows the default, not the saved colour (BrandTheme read null with ??).
  • docs/embedding.md's brand-colour section is rewritten to the above: the light-mode palette on the dark map, #000000 as the only unset value, saturation moving alongside lightness, and each mark's own ring in place of a fixed per-basemap outline.

Our three default colours render unchanged; palette.defaults.test.ts holds globals.css to them.

Contract impact

⚠ Merge before sydevs/SahajCloud#1129. That PR reads only lightAdjustedBy / darkAdjustedBy, so until this deploys the Atlas tab shows no adjustment banner. Nothing else reads the report.

Host-visible changes are in CHANGELOG.md and docs/embedding.md: marker art, dark-map marker colours, achromatic seeds, the saturation band, and the band's selected-distinct exception. No origin, attribute or Permissions Policy change, so the CSP table is untouched.

Test results

  • Lean gate (.claude/skills/pr-prep/check.sh): lint, typecheck, 168 files / 2066 tests green.
  • New assertions each watched failing against the unfixed code: the far-edge limits, the dark-mode saturation reach, near-white pins kept apart, a cleared preview role showing the default, and a band crossing reported whether or not the lift was.

Manual verification

Run against a local SahajCloud (#1129) with a near-white palette (#fffdfa, #fafcff, #fff7f5): the preview's pills, buttons and pins match the banner's light and dark swatches; Reset repaints the defaults; dark-map pins are deep, ringed, and distinct.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Mg9rjVNtqqiPXb7PTjfCiT

Ardnived and others added 14 commits November 12, 2026 19:35
- 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]>
…fter 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]>
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]>
- `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]>
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]>
- 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]>
- 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]>
…ch 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]>
- `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]>
- `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]>
`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]>
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]>
This reverts commit e4c99cc91c7565318da4a740cc2f7dd790a7a369.
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]>
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 13, 2026
@sydevs-bot

sydevs-bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 02:51Z address-review · attempt 1 · session · done
  • 02:51Z address-review · attempt 1 · session
  • 02:39Z review-pr · attempt 1 · session · done
  • 02:39Z review-pr · attempt 1 · session

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

@sydevs-bot

Copy link
Copy Markdown
Contributor

Not required, so not blocking: Workers Builds: sahajatlas-design failed. A preview link in the body may not open until it passes.

🤖 sydevs dispatcher

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 13, 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 failed
View logs
sahajatlas-design cac84d1 Nov 13 2026, 03:09 AM

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧐 Adversarial review

Seven changes, every one named in the Summary, answering one problem: a brand colour that renders near-white, or washes out on the dark map. The diff is no bigger than that, and palette.defaults.test.ts holds the three defaults still. The cross-repo half is nearly right — sydevs/SahajCloud#1129 mirrors the new isBrandSeed, reads lightAdjustedBy/darkAdjustedBy, and has copy for all three new checks.

Look again at the reporting rather than the painting. Which check a seed earns turns on NOTICEABLE_LIFT, a constant about lift size, so two near-white seeds get different banners. And the host-facing guide was left behind: CHANGELOG.md moved, docs/embedding.md did not.

Findings

  • blocker — docs/embedding.md 306–321 contradicts this PR four times → CHANGELOG.md:47
  • should-fix — a band crossing is reported or not by NOTICEABLE_LIFT → palette.ts:250
  • should-fix — selected-distinct may leave a solid outside the new band → palette.ts:203
  • consider — ClusterColors now types pins too → markers.ts:156
  • consider — chromaOf duplicates colord's toHsv() → palette.ts:232

What was checked

Read whole on the branch: palette.ts, markers.ts, layers.ts, BrandTheme.tsx, the five specs. Ladder walk on each new piece — TONE_RANGE, MARKER_MODE, PIN_PATH, PIN_SCALE, own() and round() have no equivalent in the repo, the platform or an installed package; chromaOf does. No new dependency. Consumer side followed into SahajCloud#1129: paletteReport.ts, AdjustedColors.tsx, appearance.ts. MARKER_OUTLINE and BASEMAP_SURFACES stay live for the vague ring and dot, so neither went dead. Re-derived reach across the saturation band by hand — where the two seeds above come from. The body links no preview and this repo publishes none. Profile read.

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


Generated by Claude Code

Comment thread CHANGELOG.md Resolved
Comment thread src/config/theme/palette.ts Resolved
Comment thread src/config/theme/palette.ts Resolved
Comment thread src/config/theme/palette.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 13, 2026
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
`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
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
…ints

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
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
@sydevs-bot

Copy link
Copy Markdown
Contributor

Five threads answered: four built, one rebutted. Pushed for relay.

Lean gate green: 168 files, 2066 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 13, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 13, 2026
@sydevs-bot
sydevs-bot enabled auto-merge November 13, 2026 03:11
@Ardnived
Ardnived disabled auto-merge November 13, 2026 16:25
@Ardnived
Ardnived merged commit 08d3b01 into main Nov 13, 2026
10 of 11 checks passed
@Ardnived
Ardnived deleted the fix/dark-near-white-brand branch November 13, 2026 16:25
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 13, 2026
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.

3 participants