Skip to content

feat(clients): live-preview a service's colours on the Atlas tab - #1129

Merged
sydevs-bot merged 42 commits into
mainfrom
claude/feat-1110-clients-live-preview
Nov 13, 2026
Merged

sydevs-bot merged 42 commits into
mainfrom
claude/feat-1110-clients-live-preview

Conversation

@sydevs-bot

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

Copy link
Copy Markdown
Contributor

Summary

  • The Atlas tab opens a live preview of the service's own atlas, repainting as the colour pickers move. The pickers sit in a Branding Colors group with a quiet Reset colors link beside its title, a Map Preview light/dark toggle, and the sample registration email. Where the atlas adjusts a colour, an info banner lists all three colours as visitors see them, in light and dark, each marked adjusted or safe with its reasons, and one Use adjusted colors button. Every other tab's panel closes, and explains itself when reopened.
  • Registrant emails take black or white text by whichever reads on color1 — the stop Outlook always paints — falling back to the worse stop where one of them is illegible there, and a sample one renders in a collapsible under the colours.
  • CI's wait for a fresh preview certificate goes 3 → 10 minutes, and its failure is retitled infrastructure-failure so the dispatcher re-runs the job rather than dispatching a repair for something no branch can fix. Joined here because it is what was failing this PR's own CI.

Change outline

Contract — what the admin panel gains

  clients.admin
+   livePreview.url    → <SAHAJATLAS_URL>/<region webPath>?locale=<code>&scope=clients
+                        '' for Worldwide · the explanation page with reason=no-atlas-role
+                        for a service without the role — never null, which persists "closed"
+   livePreview.breakpoints  Mobile 390×844, as Events and Regions use

  clients tabs
+   Config, Usage, Diagnostics   previewTargetField({ autoClose, unavailable: 'atlas-tab-only' })
+   Atlas                        previewTargetField({ autoOpen: true })
+                                group "Branding Colors"  (unnamed: color1–color3 stay top-level)
+                                  Label           Reset colors, a text link (helpers/labelWithAction)
+                                  adjustedColors  (ui) the banner, from the atlas's report
+                                  mapPreview      (ui) the light/dark toggle
+                                  emailPreview    (ui) the rendered sample, in a collapsible

  LivePreviewUnavailableReason
+   'atlas-tab-only'   The preview belongs to the Atlas tab
+   'no-atlas-role'    This service has no atlas

One endpoint, admin-panel only:

POST /api/clients/:id/email-preview  ← { color1?, color2?, logo?, name? }   (unsaved form values)
                                     → { html }   the real template, server-rendered

Flow — what crosses the iframe boundary

manager moves a colour picker
└── Payload posts the whole reduced form state to the frame   (Payload's own, unchanged)
    └── the atlas repaints, then posts { type: 'sahaj-atlas:palette-report', roles }
        roles.<role> = { entered, light, dark, suggested, lightAdjustedBy, darkAdjustedBy }
        └── AdjustedColors reads all three, if each `entered` is still its field's value

manager switches Light / Dark
└── MapPreviewField posts { type: 'sahaj-atlas:preview-mode', mode }
    to iframeRef.current.contentWindow, targetOrigin from originOf(iframe.src)
    └── re-posted on every load AND on the atlas's first message after it, since the
        atlas listens only once its token verifies, after `load`

⚠ Whatever the frame says is accepted from that frame alone, checked by usePreviewMessage as each message arrives — both fields read it there, so one guard spells the channel: event.source must be iframeRef.current.contentWindow and event.origin the iframe's own. Nothing about the frame is captured at mount, so a panel that opens after the fields (autoOpen), reloads, or is repointed needs no re-subscribe. A report whose entered no longer matches the field is ignored; between a pick and its report the last answer stays up, its button inert, so nothing flickers. The CMS computes no colours — every adjustment and every suggestion is the atlas's.

Behaviour — the preview target per tab

The panel had one URL per document. It now has one per tab, and holds it through a save.

  PreviewTarget effect, on every change of the provider's `url`
    if (url !== lastComposedUrl) serverResolvedUrl = url
-   if (!serverResolvedUrl) return
+   if (!serverResolvedUrl || isLivePreviewUnavailableUrl(serverResolvedUrl)) return
-   composed = composeTargetUrl(serverResolvedUrl, target)
+   composed = target.unavailable
+     ? new URL(livePreviewUnavailableUrl(target.unavailable), window.location.origin)
+     : composeTargetUrl(serverResolvedUrl, target)
    if (!composed || composed === url) return
    setURL(composed)

⚠ unavailable is the one target that leaves the default's origin. It names a reason code, not a URL — no origin, no credential — and lands on the admin's own origin. composeTargetUrl is untouched and still refuses every cross-origin path.

⚠ A document's own refusal outranks a tab's. A service with no atlas resolves to the explanation page already, so the tab target is skipped rather than telling it its preview belongs to a tab it does not have.

⚠ This collection's livePreview.url reads data, because the preview opens the service's own region, so a save re-resolves it and calls setURL with the real atlas. The effect above runs on that change, which is what keeps a save on Config from putting the atlas back in a panel that should be explaining itself.

Behaviour — text on a brand gradient

  EmailLayout header title, and a filled BrandButton
-   color: '#ffffff'                          (always, whatever the brand)
+   color: brandTextColor(brand.colors)
+     = readableTextOn(colors.primary, colors.light)
+       primary decides while BOTH clear WCAG AA-large across every stop
+       the worse stop decides where one of them does not
  brandGradient(colors)                       unchanged — the colours never move

⚠ primary goes first because it is the only stop that always paints. Both sites set it as backgroundColor beneath the gradient's backgroundImage, and Outlook desktop drops the image. Reading the minimum across both stops therefore let a surface those readers never see choose the text: ATLAS_DEFAULT_COLORS took black at 3.44 where white on #1E6C71 alone scores 6.11, and across the gradient the two are 3.44 to 3.15 — both legible, 0.29 apart. Below that legibility floor the worse stop still decides, so a dark primary with a pale second stop keeps black. The three project brands are unaffected: white clears no stop of any of them.

Files

src/collections/Clients/
  Clients.ts                     livePreview config, four preview targets, the Branding Colors group
+ endpoints/emailPreview.ts      renders the sample from unsaved values
src/components/admin/AtlasPreview/
+ AdjustedColors.tsx             the banner: swatches per mode, reasons, Use adjusted colors
+ BrandingColorsLabel.tsx        the group title with Reset colors
+ MapPreviewField.tsx            Light/Dark, posted to the frame
+ paletteReport.ts               reads one colour out of the atlas's report
+ usePreviewMessage.ts           the frame's latest message, sender- and origin-checked
+ EmailPreviewField.tsx(+scss)   the debounced render, in a sandboxed iframe
+ AtlasPreview.scss
src/components/admin/helpers/
+ labelWithAction.tsx(+css)      a heading with a quiet text action; Regions' Import classes uses it too
  ColorField/ColorField.tsx      mergeFieldStyles; a "Default" marker while unset
  PreviewTarget/PreviewTarget.tsx  the `unavailable` branch
src/fields/previewTargetField.ts the `unavailable` declaration
src/lib/livePreview/unavailable.ts  the two new reasons
src/app/(frontend)/live-preview-unavailable/page.tsx  their copy
src/lib/branding/themeColors.ts  readableTextOn + WCAG luminance
src/lib/clients/appearance.ts    ATLAS_DEFAULT_COLORS, BRAND_COLOR_LABELS, isBrandColor (only #000000 is unset)
                                 Primary · Secondary · Accent — labels only; the columns keep their names
src/app/(payload)/custom.scss    a tabs field keeps its right gutter while live preview is open
scripts/preview-domain.ts        the joined CI fix (bound, and the error title)
docs/rules/{clients,admin-ui}.md the panel per tab, the banner, and the `unavailable` target

Preview

Data: not seeded — this repo sets no previewUrl.seed, and a Railway PR environment boots with only its admin, so the Services list is empty until somebody creates one. The two explanation pages need no data and open as they will in production.

Contract impact

Consumes the sahaj-atlas:palette-report and sahaj-atlas:preview-mode messages from sydevs/SahajAtlasWeb#392 (merged) as reshaped by sydevs/SahajAtlasWeb#399: the report's per-mode lightAdjustedBy / darkAdjustedBy replace its adjustedBy union, which this PR was the only reader of. ⚠ #399 merges first — until it deploys this tab shows no adjustment banner; nothing else breaks. isBrandColor mirrors #399's isBrandSeed: only #000000 reads as unset.

Test results

  • Lean gate: ✓ lint, format, typecheck, typecheck:tests, test:unit (274 files / 3723 tests, run with TZ=UTC). ics-builder.spec.ts (from feat(events): serve a token-addressed calendar feed for a class #1134 on main) fails in a non-UTC local zone and passes in UTC, as CI runs — unrelated to this PR.
  • Targeted: tests/int/clients-preview.int.spec.ts 5 passed; atlas-preview-fields.spec.ts 15 (sender and origin checks, the kept answer, the mode re-send each watched failing without their fix).
  • Build: N/A (Railway builds; CI runs the full suite)

Manual verification

Everything below needs a browser and the SahajAtlasWeb build beside it; none of it ran here.

  1. Open a service with the atlas role as a listed manager: it lands on the Atlas tab with the panel open on that service's region.
  2. Set all three colours near-white (#fffdfa, #fafcff, #fff7f5): the banner lists each with its light and dark swatch and reasons, matching the preview's buttons, pills and pins. Use adjusted colors writes the suggestions; Reset colors repaints the defaults.
  3. Switch Map Preview to Dark and confirm the map follows, then reload the frame and confirm it stays dark.
  4. Switch to Config as an admin: the panel closes. Reopen it — it explains itself. Save, and confirm it stays on the explanation rather than going back to the atlas.
  5. Open Preview registration email and confirm the sample shows the service's logo and colours, and redraws about a second after the last edit. Leaving it closed should issue no request at all.

⚠ One acceptance line is only partly met. The panel explains a service with no atlas and a tab that has no preview. A frame the host blocks, or an atlas that is down, is not something the CMS can observe from here — the iframe simply fails to paint. Worth your call on whether that needs its own work.

Deviations from #1110

Two, both the goal owner's own commits on this branch. Neither is in the ticket's text, so they are recorded here.

  • §3's per-picker note is one banner (3b35380, then eleven commits refining it). Each colour's rendered light and dark swatch, its reasons and one Use adjusted colors button sit together under the pickers, rather than a note and a button under each. The two criteria it answers — the picker showing the rendered colour and its reason, and a panel-text-only role offering no button — hold through the banner, with one gap: a palette whose only adjustment anywhere is panel-text shows nothing at all. That check moves the panel's text step, not the swatch, so there is no colour to show that differs from the one entered. §3 also predates fix(ui): brand colours that read in both modes, ringed pins, a per-mode palette report SahajAtlasWeb#399, which replaced its three check ids with six and split adjustedBy per mode.
  • The colour labels read Primary, Secondary and Accent (3b35380). Labels only — color1–color3 keep their names, so the ticket's note deferring a field rename to its own PR still stands. Accent is a third word for the role the widget calls contrast; ROLE_OF_COLUMN in paletteReport.ts is the one place the two meet.

Notes for reviewer

Merges last, after sydevs/SahajAtlasWeb#399. #1127 (the write-only mailing-list key) and SahajAtlasWeb#392 have both landed; #399 is the report shape this PR now reads.

⚠ The order is load-bearing here, not tidiness. Payload's live preview posts the whole reduced form state to the preview frame, and on this branch alone that state still contains mailingList.apiKey. #1127 is what takes it out. Merging this before #1127 would send a service's provider secret to sahajatlas.com.

Three judgement calls:

  • The clients preview cases are their own int spec (tests/int/clients-preview.int.spec.ts) rather than an extension of clients-access.int.spec.ts. That file is about who may read and write a clients row; where the panel points is a different subject.
  • The sample email draws the logo, the colours and the name, and nothing else is posted. supportEmail is the message's Reply-To rather than anything the template paints, so posting it would have cost a full server-side render on every keystroke in that field for no visible change.
  • readableTextOn lives in src/lib/branding/themeColors.ts, beside tint/shade, rather than in src/emails/. It is a question about a brand colour, and that module already owns the hex parsing.
Detail

This changes existing emails, including unbranded ones. The We Meditate and Sahaj Atlas gradients both run from a mid-toned primary to a paler second stop, so the header title and filled buttons go from white to black on them. That is the rule working, not a side effect — white was unreadable at the light end of those gradients too.

Dismissed review note. relativeLuminance expands #RGB before parsing. colorField's validator accepts the short form, so a service really can store #ff0; read as six digits every channel was NaN, which answered white — white on yellow, the exact defect the rule exists to prevent. tests/unit/atlas-preview.spec.ts pins both forms.

The email sample renders only once it is opened. The collapsible starts collapsed and each render is a full server-side render of the real template, so an effect running on mount billed every Atlas-tab visit for a sample nobody asked to see. useDebouncedEffect from @payloadcms/ui is deliberately not used for the 500 ms settle: it discards the effect's return value, so the AbortController has nowhere to hang and an older render can land after a newer one.

Security review: ran on the original push, no findings. It traced the endpoint's gate (requireActiveManager then overrideAccess: false with the caller's own req, so an unlisted manager gets the 404), confirmed the posted logo id cannot reach an image the caller may not read, confirmed nothing attacker-controlled reaches markup (React escapes the text children, and the sample renders in <iframe sandbox="" srcDoc>), and confirmed composeTargetUrl stays strict for every target but the fixed reason code. Nothing pushed since matches securityReview.triggerPattern.

One thing it raised below its reporting threshold, and the reason the merge order above exists: adding admin.livePreview to clients makes Payload post the reduced form state to SAHAJATLAS_URL once the preview answers its ready handshake — which the atlas child does answer. On main after #1127 that state carries no credential. On this branch alone it still would.

Closes #1110

🤖 Generated with Claude Code

https://claude.ai/code/session_01Mg9rjVjKuC7JyLRa1YRmH3

A service manager picked three atlas colours and a logo with no way to
see the result: to find out what visitors got they had to save and go and
look at their own site.

The Atlas tab now opens a live preview of the standalone atlas on the
service's own region, at `?scope=clients`, and moving a picker repaints
it before anything is saved. The atlas answers with what it rendered, so
each picker can show the colour visitors actually get and why it is not
the one that was entered — and, where a seed can express that colour, a
button writes it into the field. A role adjusted only by `panel-text` has
no such seed, so it shows the note and no button.

On Config, Usage and Diagnostics, which only an administrator sees, the
panel closes and explains itself. `unavailable` is the one preview target
that leaves the default's origin, and it is safe because the declaration
is a reason code rather than a URL: no origin, no credential, and it
lands on the admin's own origin. This collection's `livePreview.url`
reads `data`, so a save re-resolves it — `PreviewTarget` re-applies on
that change rather than letting the atlas back into a panel that should
be explaining itself.

Registrant emails take black or white text by whichever can be read on
BOTH stops of the brand gradient, so a pale brand stops shipping
white-on-pale. The brand colours themselves never change. A sample
registrant email renders beside the logo and support address, through the
real template, from values that have not been saved yet.

`ATLAS_DEFAULT_COLORS` copies the retuned seeds from
sydevs/SahajAtlasWeb#389 — `color2` and `color3` only.

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

`relativeLuminance` read six hex digits off a colour `colorField`'s
validator accepts in its short form, so `#ff0` gave NaN on every channel
and the rule answered white — white on yellow, which is the defect it
exists to prevent.

The palette report was module state with no document key, so opening one
service after another showed the first's rendered colours under the
second's pickers, with a button offering to write them in. The subscriber
supplies its own id now, since the message carries none.

The light/dark control's listener depended only on stable values, so it
never attached: `autoOpen` opens the panel after the field has mounted,
and the control claimed a mode the atlas had never been told. It keys on
the panel's URL now, and asserts the mode as soon as there is a frame.

The email preview had no catch and no stale guard, so a network blip was
an unhandled rejection and an older render could land after a newer one.
It also re-rendered on every keystroke in the support address, which the
template does not draw — that is the message's Reply-To, and it is named
under the frame instead.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVKFZaNEE4JgBvahah
A role whose `adjustedBy` arrived as anything but an array would throw
inside a picker's render and take the field down with it. The shape
crosses a window boundary, so it is narrowed rather than cast.

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

railway-app Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-1129 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Nov 13, 2026 at 4:59 pm UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot

sydevs-bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running
CI fix 2

recent dispatches
  • 16:47Z resolve-conflicts · attempt 1 · session · done
  • 16:47Z resolve-conflicts · attempt 1 · session
  • 02:49Z address-review · attempt 1 · session · done
  • 02:49Z address-review · attempt 1 · session
  • 02:41Z review-pr · 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
#1082 and this branch each re-measured the unit lane, so all four
conflicts are the same drifting fact stated in four places. Neither
side's count survives the merge: the tree now holds both sets of
specs. Measured here instead — 265 files, 3560 tests — and recorded
in PERF.md with its own session row, since perf-figures-pinned.spec
holds every consumer to what is on disk.

No code conflicted. The two sides overlap on documentation alone.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjW39iuJsgv5ZBz7cwe
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1129 November 11, 2026 20:23 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Merged main (#1082). Four conflicts, all documentation, all the same fact: the unit lane's file and test count, which both sides had re-measured.

Neither side's number survives the merge — the tree now holds both sets of specs — so I measured it here and wrote that: 265 files / 3560 tests, recorded in tests/PERF.md with its own session row and propagated to the three consumer docs. perf-figures-pinned.spec.ts holds all four to what is on disk, so the count was not a free choice.

The two sides overlap on documentation alone — no source file conflicted, and none was touched by both.

Lean gate green on the merge: lint, format, typecheck, typecheck:tests, 3560 unit tests, 135 s.

🤖 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
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 11, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 11, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 11, 2026
#1112 landed its own re-measurement of the unit lane while this branch
carried the one from the last merge, so both sides state a different
count for the same fact in three places. Neither survives: the merged
tree holds both sets of specs. Measured here — 266 files, 3565 tests —
and recorded in PERF.md as its own session row, which is what
perf-figures-pinned.spec reads the four consumer docs against. AGENTS.md
stated the old file count without conflicting, so it moved too.

Both sides' session rows are kept and renumbered. A row is a
measurement someone took, not a figure to overwrite.

No code conflicted.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYibqRjk5PCRSxEt1h
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1129 November 11, 2026 21:55 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Resolved three documentation conflicts. All three are the same fact — the unit lane's file and test counts — stated in different places, and neither side's figure survives the merge: the tree now holds both sets of specs.

Re-measured here instead: 266 files, 3565 tests. Written into tests/PERF.md, docs/rules/testing-reqs.md and tests/AGENTS.md, plus AGENTS.md, which carried the stale count without conflicting. perf-figures-pinned.spec.ts holds all four to what is on disk.

Both sides' PERF.md session rows are kept and renumbered, and this run's added. A row is a measurement someone took, not a figure to overwrite.

No code conflicted. Lean gate green: 266 files / 3565 tests, 116 s.

🤖 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
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 11, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 11, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 11, 2026
`Lint, Test & Smoke` went red on this head with every test passing: the
Workers Custom Domain for pr-1129 was attached, but its edge certificate
had not finished provisioning when the 3-minute reachability bound ran
out. The address answers 302 now.

Three minutes was not headroom, it was the measurement. The run before
this one, minutes earlier on another PR's first attach, spent 2m32s in
the same wait and passed with eight seconds to spare. Ten minutes puts
real distance between the bound and what Cloudflare takes, and costs
nothing when the certificate is ready: the loop returns on the first
answer.

The annotation now carries the title the sydevs dispatcher matches, so a
timeout here is re-run rather than handed to a session. Neither cause the
message names — a slow certificate, an undeployed Worker — is something a
PR's branch can change.

Lean gate green: lint, format, typecheck, typecheck:tests, 266 unit files
/ 3565 tests.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZToNgi12cLHSUiWek
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1129 November 11, 2026 22:18 Destroyed
@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
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 11, 2026
Ardnived and others added 8 commits November 12, 2026 19:37
…iew field

- The pickers and the adjustment banner sit in an unnamed "Branding Colors" group, with Reset colors beside its title (the Regions Import classes shape); nothing stored moves
- Each banner row shows the colour's light and dark swatch, and drops the hex
- The light/dark toggle is its own "Map Preview" field below the group
- The surface reason reads for both modes; a near-white check has words ready for the atlas

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…review in the group

- Branding Colors uses Payload's own group title markup, with Reset beside it
- Map Preview and the registration email sample move into the Branding Colors group
- Each swatch is marked by its own mode, from the atlas's `lightAdjustedBy` / `darkAdjustedBy`; an atlas sending only the union marks both
- The dark-map swatch carries a faded black mark; reasons are joined with semicolons
- The adjustment banner keeps ordinary field spacing

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lors and Import classes

- `helpers/labelWithAction` draws a heading with a text-link action beside it; Branding Colors' Reset colors and Regions' Import classes both use it, each keeping its own heading and its own rule for when the action shows
- The Atlas tab reads only the atlas's per-mode `lightAdjustedBy` / `darkAdjustedBy`; the union field is gone from the report

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

- The banner hid itself for the round trip between a colour change and the atlas's report on it, so it flickered on every pick; the last answer now stays up, with Use adjusted colors disabled until the report arrives
- The near-white and near-black reasons go with the atlas checks that sent them

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…as now reads it

`isBrandColor` reads only the old `#000000` sentinel as unset, matching the atlas's `isBrandSeed`; a near-colourless pick no longer snaps to the default in the picker, the banner or the emails.

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

- The button stays enabled while a report is pending; a press in that window applies nothing, where toggling `disabled` flickered it
- The atlas's near-white and near-black checks have words again

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1129 November 13, 2026 02:41 Destroyed
@Ardnived

Copy link
Copy Markdown
Contributor

@sydevs-bot review

@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 moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 13, 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

Third look, over the twenty commits since the second. The contract reads right: lightAdjustedBy/darkAdjustedBy, the six check ids and the retuned seeds match SahajAtlasWeb#399 exactly, and isBrandColor mirrors its isBrandSeed.

What moved since you acknowledged §3 as built is the shape of it. 40f7204 put the per-picker notes back; 3b35380 took them out for one banner, leaving two criteria unmet and no waiver in the body. The colour labels were renamed in the same stretch, which #1110 reserves for another PR. And one tab now carries two bespoke message listeners.

Findings

  • should-fix — §3's per-picker note is a banner, and a panel-text-only role shows nothing (paletteReport.ts:17).
  • should-fix — the colour labels are renamed, which #1110 defers; Accent is a third word for contrast (appearance.ts:38).
  • should-fix — a second message listener beside usePreviewMessage, guarding the same channel differently (MapPreviewField.tsx:62).
  • consider — the banner's answer round-trips through JSON.stringify/parse to be its own dependency (AdjustedColors.tsx:43).

What was checked

  • #1110's seven sections and eleven criteria against all 41 files; §3 and two criteria are the gap.
  • Producer side on origin/fix/dark-near-white-brand: RoleReport's fields and PALETTE_CHECKS' ids line up with readSwatch and SWATCH_REASONS; DEFAULT_SEEDS equals ATLAS_DEFAULT_COLORS. #399 is still open, so the banner stays dark until it merges.
  • Ladder: labelWithAction is generic and ImportClassesLabel joined it; MapPreviewField reuses ToggleGroup and originOf.
  • Previews: previewUrl sets no seed, and neither PREVIEW_ACCESS_* half is here, so all three links are unreachable from this run.

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


Generated by Claude Code

Comment thread src/lib/clients/appearance.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 13, 2026
sydevs-bot and others added 4 commits November 13, 2026 02:52
tests/PERF.md: both sides appended rows to the same table. Kept all 72,
in order, renumbered.
The answer was serialised and parsed back only so it could be its own
effect dependency. A ref holds it with no round trip and no effect, and
is read on the same render that drops the current answer.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXdTVjk731s9nycbh5
MapPreviewField listened for the atlas's first message itself, checking
the sender but not its origin, so the tab guarded one channel two ways.
It now reads `usePreviewMessage`, which checks both, and keeps its own
re-arm on reload. A frame that has navigated elsewhere no longer counts
as proof the atlas is listening.

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

Copy link
Copy Markdown
Contributor Author

Four critic threads, and main merged in.

Adopted

Recorded, not built

  • §3's per-picker note and the colour-label rename are both the goal owner's own commits here, 3b35380 and eleven after. The body carries each under ## Deviations from #1110, with the one real gap named: a palette adjusted only by panel-text shows nothing.

main merged clean but for tests/PERF.md, where both sides appended rows to one table. All 72 kept, in order, renumbered.

Lean gate green: 274 files / 3723 tests.

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


Generated by Claude Code

Ardnived and others added 2 commits November 12, 2026 20:53
- The banner holds the latest palette report instead of re-deriving a kept
  answer through state and an effect. `readSwatch` now marks a report about a
  colour the field no longer holds (`current: false`) rather than refusing it,
  so the last report stays on screen until the next one lands, and the button
  applies nothing while any row is stale.
- The listener lives with its one consumer and keeps only palette reports, so
  the atlas's other messages cannot clear the banner.
- One stylesheet for the folder; the email frame's inline styles move into it.
- `readableTextOn` moves beside `brandTextColor`, its only caller, and
  `themeColors.ts` returns to what main holds. Its cases join the email
  template spec.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The bot's ref-based banner fix is superseded by the latest-report hook.
Its frame-origin guard is kept as `isFromPreviewFrame`, shared by the
banner and the mode toggle, so usePreviewMessage stays removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/PERF.md: the one conflict. Both sides appended rows to the same
table — this branch 7 (#1129), `main` 13 (#1104). Kept all 86, each
side's rows in its own order, `main`'s first where both inserted at the
same point, renumbered end to end.

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

Copy link
Copy Markdown
Contributor Author

Resolved tests/PERF.md, the one conflict. Both sides appended to the same measurement log — this branch 7 rows, main 13. Kept all 86. Where both inserted at the same point, main's rows go first. Renumbered end to end, so the diff is wider than the change.

Two things the auto-merge got right and a reviewer may want named. main retyped InfoBanner's action from a ReactNode to { label, href | onClick }; nothing on this branch passes one, so the Atlas tab is unaffected. The generated importMap.js carries both sides' entries, with none left pointing at the deleted MeditationTranscript.

Gate green on the merge: 277 files / 3825 tests, 74.4 s. tests/int/clients-preview.int.spec.ts 5 passed.

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


Generated by Claude Code

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1129 — 9bebb4b2 Deployed Nov 13, 2026 by railway-app[bot]
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(clients): live-preview a service's colours on the Atlas tab

3 participants