Skip to content

Service managers see their brand colours live, and the atlas keeps them readable #388

Closed
3 of 3 issues completed
Closed

Description

@Ardnived

The goal

A volunteer who manages their organisation's atlas sees their brand colours on the real map while they choose them, without saving and checking their site afterwards. The atlas itself makes sure that whatever colours they pick, the map's pins, the selected class and the text stay readable for visitors. Registrant emails stay readable with any colours too, and the volunteer can see what an email will look like before anyone receives one.

Why it matters

Today a volunteer picks three colours in SahajCloud with no way to see the result. To find out what visitors see, they have to save and go and look at their own site. Many never customise at all, so most atlases look the same. Those who do customise can make the map hard to use, with pale pins that disappear against the map or a selected class that looks like every other one. Some of our own default colours are already too pale against white. We want customising the branding to take as little effort as possible, so that more volunteers do it.

What success looks like

  • A volunteer who opens their service's Atlas tab sees a live preview of the atlas open beside the form, on their own region, without clicking anything.
  • Moving a colour picker repaints the preview straight away, before saving.
  • The volunteer can switch the preview between the light and dark looks of the atlas.
  • When the atlas has to adjust a colour so it stays readable, the volunteer sees the colour visitors will actually get, with the reason, and can use it with one click.
  • On both the light map and the dark map, a pin and a group bubble carry a ring drawn in their own colour, and both maps paint the same marks. (Reworded 2026-11-18 to the rule fix(ui): brand colours that read in both modes, ringed pins, a per-mode palette report #399 shipped, which replaced the checked black-or-white edge.)
  • A pin keeps the colour the volunteer chose, except that a very muted colour is lifted just enough to stay visible. (Reworded 2026-11-18 to the rule fix(ui): brand colours that read in both modes, ringed pins, a per-mode palette report #399 shipped.)
  • The selected class stands out at a glance from the ones around it, on both maps.
  • Every label and chip the atlas paints in a brand colour can be read on a phone, on both looks, down to the smallest text in the side panel.
  • Registrant emails show readable text on their coloured header and buttons, whatever colours a service chose.
  • Beside the logo and support email, the volunteer can open a sample registrant email with their logo and colours, which redraws within about a second of their last change, with no save and no reload. (Reworded 2026-11-18: the sample sits in a section that starts closed, which stays.)
  • Once a mailing-list password is saved, the field shows only that a key is set and its last four characters. Reloading the page, reading the page source, or opening the preview never shows the rest of it.
  • On the other tabs of a service, which only administrators see, the preview panel closes by itself, and an administrator who opens it again there is told it works on the Atlas tab only.
  • If the preview cannot load — the frame is blocked, the atlas is unreachable, or the service's region has nothing published yet — the panel says what happened instead of showing a blank rectangle. (Moved to feat(clients): explain an Atlas-tab preview that cannot load SahajCloud#1201, 2026-11-18.)

Not included

  • Previewing the atlas on the service's own website. The preview shows the atlas on sahajatlas.com, so it shows the colours accurately but not how the map is sized or placed on their site.
  • Rejecting a colour. Nothing ever stops a volunteer from saving; the atlas adjusts instead.
  • Rewriting a colour a service already saved. The atlas adjusts what it paints; the stored colour changes only when the volunteer accepts a suggestion.
  • Changing the colours used in emails. Emails keep the exact colours chosen; only the text on them changes to black or white so it can be read.
  • Telling a service still using our own colours that those colours have changed. The improvement ships quietly.
  • Colour suggestions taken from the uploaded logo. Considered only if few volunteers customise after this ships.
  • Removing the "Brand Colors" and "Registrant Emails" headings and renaming the colour fields. Handled separately.
  • The colour swatches on the Install tab, which stay as they are and may show a colour the atlas then adjusts.
  • Measuring how many services customise their branding.

Decisions

  • Should the mailing-list password fix be its own, earlier ticket, even though that puts two tickets in one repo? → Yes. Keeping it separate lets the password fix ship before the preview that would otherwise expose it (Ardnived, 2026-11-11)
  • How should the atlas make sure a pin is visible on the map? → Give the pin an outline, and check the outline. The pin keeps the colour the volunteer picked, and the edge is guaranteed against any background (Ardnived, 2026-11-11)
  • What do we do about our own colours? → Fix ours quietly. Less work, but a volunteer may notice their map changed colour and have no idea why (Ardnived, 2026-11-11)
  • Does the sample registrant email stay in this goal? → Yes. The volunteer sees everything their branding touches in one place, which is what the goal promises (Ardnived, 2026-11-11)
  • On the other tabs of a service, which only administrators see, should the preview just close, or also explain itself? → Close and explain. An administrator who opens the panel on the wrong tab is told why it is empty (Ardnived, 2026-11-11)
  • Lines 5 and 6 describe the pin-edge rule that fix(ui): brand colours that read in both modes, ringed pins, a per-mode palette report #399 replaced. Reword them, or ask for the check back? → Reword them to the shipped rule. (Ardnived, 2026-11-18)
  • Should the sample registrant email open by default? → No, it stays in a section that starts closed. (Ardnived, 2026-11-18)
  • What carries on once this goal closes? → The preview's three failure messages, as feat(clients): explain an Atlas-tab preview that cannot load SahajCloud#1201. (Ardnived, 2026-11-18)

Open questions

None. Every decision this goal needs is settled.

Notes

Technical notes

TL;DR

The map edge: what #399 replaced, and what bounds a fill now

MARKER_OUTLINE and BASEMAP_SURFACES survive (atlas markers.ts), but reach only vagueRingLayer and vagueDotLayer. A pin and a bubble carry a translucent ring of their own colour instead — ringOf is +21 L, −16 S, capped at L92, drawn at RING_OPACITY 0.706.

⚠ markers.outline.test.ts asserts the art carries no black or white stroke, and PALETTE_CHECKS's own comment states there is deliberately no basemap check. So nothing measures a mark against land (#f3ead8 / #5a8bbf) or water (#78bced / #33567a).

⚠ MARKER_MODE = 'light': both basemaps take the light palette, so a mark is identical on the two maps.

What bounds a fill instead, all in buildRole:

Bound Value
saturation clamped 40–60, read from chroma × 2, not HSL s
solid lightness light 20–80, dark 60–90, plus a reach margin off each extreme
surface step 9 ≥ 3:1 against #ffffff (light) / #121212 (dark)

Only #000000 reads as unset now (isBrandSeed, mirrored by SahajCloud's isBrandColor). A grey or near-white is painted as chosen.

The six checks, and the report both repos agree on

PALETTE_CHECKS: panel-text · surface · selected-distinct · saturation · near-white · near-black.

Report per role: { entered, light, dark, suggested, lightAdjustedBy, darkAdjustedBy }. The adjustedBy union #389 specified is gone; #1129 was its only reader.

  • suggested is a seed that renders itself (settledSeed), null where only panel-text moved — that check moves a ladder step no seed can express.
  • ⚠ SahajCloud's readSwatch filters panel-text out, so a palette adjusted only by it shows no banner at all. Its swatch is identical to the colour entered, so there is nothing to show — but the volunteer is also not told anything moved.
  • Our three defaults render unchanged. palette.defaults.test.ts holds globals.css to buildScale(DEFAULT_SEEDS).
What the panel cannot explain

LivePreviewUnavailableReason: atlas-tab-only · no-atlas-role · no-key · no-path · no-region · not-reviewable.

None covers a frame the host blocks, an atlas that is down, or a region with nothing published. The CMS cannot observe any of the three from the admin side — the iframe just fails to paint. sydevs/SahajCloud#1129's own body flags this as the one acceptance line it left short.

Email text, the sample, and the key
  • EmailLayout's header title and filled BrandButton take brandTextColor(colors) → readableTextOn(primary, light). primary decides while both candidates clear AA-large across every stop; the worse stop decides otherwise. ⚠ color1 is the only stop Outlook desktop paints, which is why it goes first. Our own two project gradients flipped white → black as a result.
  • Sample: POST /api/clients/:id/email-preview renders the real template server-side, 500 ms after the last keystroke, into <iframe sandbox srcDoc>. ⚠ It sits inside a Collapsible with initCollapsed, so the volunteer opens it once. Each render is a full server-side render, and an ungated effect billed one on every Atlas-tab visit.
  • secretField() (SahajCloud src/fields/secretField/): read: () => false, admin.disabled, payload.encrypt at rest. The key is staged through POST /api/clients/:id/secrets/<path> and applied on the page's own Save; GET answers { last4 }. Two migrations: encrypt the column, then drop mailing_list_enabled — the checkbox is gone, and choosing a provider is what turns the list on.
What each ticket delivered
Ticket PR Landed
sydevs/SahajCloud#1109 #1127 Write-only, encrypted mailing-list key as a reusable secretField()
#389 #392 The ladder's checks, the palette report, the clients preview session
sydevs/SahajCloud#1110 #1129 Atlas-tab live preview, the adjustment banner, the email text rule, the sample
— #399 Saturation and tone bands, per-mark rings, light palette on both maps, per-mode report

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. added this to the Sahaj Atlas launch milestone on Nov 11, 2026
  2. added theissue type on Nov 11, 2026
  3. added
    bot:working
    on Nov 11, 2026
  4. sydevs-bot commented on Nov 11, 2026

    @sydevs-bot
    Contributor

    🤖 no session running
    approved by Ardnived

    recent dispatches
    • 17:30Z revise-roadmap · attempt 1 · session · done
    • 17:30Z revise-roadmap · attempt 1 · session
    • 18:12Z implement · attempt 1 · session · done
    • 18:12Z implement · attempt 1 · session
    • 17:55Z implement-roadmap · attempt 1 · session · done

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

  5. sydevs-bot commented on Nov 11, 2026

    @sydevs-bot
    Contributor

    Reviewed from three angles. Measured the goal's one unknown: the two map backgrounds.

    The pin check does not work as #389 writes it. Today's own defaults fail it in 5 of 6 cases. When two colours share a hue, no correction can satisfy it and still keep the selected class distinct. The numbers are in the technical notes.

    Also changed: nine success lines became twelve a non-developer can check. The three-ticket split is now a recorded decision.

    Needs you: four decisions in ## Open questions — the pin rule, our own colours, whether the sample email stays, and the other tabs. Reply like @sydevs-bot revise 1A 2A 3A 4A.

    Next: once nothing is open, @sydevs-bot implement adjusts the three tickets and starts them.

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


    Generated by Claude Code

  6. removed
    bot:working
    on Nov 11, 2026
  7. moved this from Working to Awaiting in SYDevelopers Technical Roadmapon Nov 11, 2026
  8. Ardnived commented on Nov 11, 2026

    @Ardnived
    ContributorAuthor

    @sydevs-bot revise 1A 2B 3A 4A

    And update the child implementation tickets as needed to by in sync with these changes.

  9. added
    bot:working
    on Nov 11, 2026
  10. 7 remaining items

  11. sydevs-bot commented on Nov 11, 2026

    @sydevs-bot
    Contributor

    Both out-of-sync children are updated. sydevs/SahajCloud#1109 needed no change.

    Build order

    What changed. #389 drops the basemap check for a fixed outline, stroked where the marker art is built so an unbranded embed is edged too. selected-distinct moves out of buildScale, which cannot see two roles at once. At hue 184 panel-text passes only below 14% saturation, so our teal seed stays and the correction carries it. sydevs/SahajCloud#1110 loses its basemap sentence, mirrors color2 and color3 only, and must re-apply its preview target after a save.

    All three are approved and the build starts now. sydevs/SahajCloud#1110 starts when its two blockers close.

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


    Generated by Claude Code

  12. removed
    bot:working
    on Nov 11, 2026
  13. sydevs-bot commented on Nov 11, 2026

    @sydevs-bot
    Contributor

    Approved 3 implementation ticket(s). sydevs/SahajCloud#1109, #389, sydevs/SahajCloud#1110 build together now, and merge in order.

    🤖 sydevs dispatcher

  14. added
    bot:working
    on Nov 11, 2026
  15. sydevs-bot commented on Nov 11, 2026

    @sydevs-bot
    Contributor

    Built all three children. Draft PRs, in merge order:

    1. feat(clients): make the mailing-list API key write-only SahajCloud#1127 — the mailing-list key, write-only and encrypted (#1109)
    2. feat(ui): legible brand colours, previewed live from SahajCloud #392 — the fixed outline, the three checks, the preview session (feat(ui): legible brand colours, previewed live from SahajCloud #389)
    3. feat(clients): live-preview a service's colours on the Atlas tab SahajCloud#1129 — the Atlas-tab preview, the per-picker note, the email text rule (#1110)

    ⚠ The order is load-bearing between 1 and 3: Payload's live preview posts the whole form state, so #1129 before #1127 would send a service's provider secret to sahajatlas.com.

    Two things for you, both in the PR bodies:

    • The eager-payload budget moved 330 → 334 KiB. colord/plugins/lab is the cost, and every embed owes selected-distinct. These notes estimated ~10 KiB of headroom; there was none.
    • Email header and button text flips from white to black on our own two project gradients, not only on a service's.

    Nothing on the map or in a browser was verified — no Mapbox token in the committed .env.

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


    Generated by Claude Code

  16. removed
    bot:working
    on Nov 11, 2026
  17. moved this from Working to Pending in SYDevelopers Technical Roadmapon Nov 11, 2026
  18. added
    bot:working
    on Nov 13, 2026
  19. moved this from Pending to Working in SYDevelopers Technical Roadmapon Nov 13, 2026
  20. sydevs-bot commented on Nov 13, 2026

    @sydevs-bot
    Contributor

    What shipped. Nine of thirteen success lines are met. The Atlas tab opens the preview on the service's own region, pickers repaint it live, a Light/Dark toggle switches it, and a banner names the colour visitors get with a one-click Use adjusted colors. The mailing-list key is write-only and shows only its last four. Emails pick black or white text. Other tabs close the panel and say why.

    Two lines describe a rule you replaced. #399 dropped the checked black-or-white pin edge for a ring of the mark's own colour. Nothing now measures a pin or a bubble against land or water, a muted colour is lifted into a saturation band rather than kept, and both maps paint the same marks. Reword lines 5 and 6, or ask for the check back.

    Two lines are short. The panel explains a service with no atlas and a wrong tab, never a blocked frame, an atlas that is down, or an empty region. The sample email sits behind a collapsible that starts closed.

    Leaving the goal open. @sydevs-bot implement plans whatever you want built.

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


    Generated by Claude Code

  21. removed
    bot:working
    on Nov 13, 2026
  22. moved this from Working to Awaiting in SYDevelopers Technical Roadmapon Nov 13, 2026
  23. Ardnived commented on Nov 18, 2026

    @Ardnived
    ContributorAuthor

    Answered in the terminal by @Ardnived:

    Closing as completed with the Sahaj Atlas launch milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    Priority

    Medium

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions