Repository navigation
Description
Summary
Make the widget read as the host's own events feature rather than as a product called Sahaj
Atlas embedded in their page, and stop the host's CSS reaching into it.
Stage B of the white-label/SEO programme (.claude/reports/whitelabel-seo-program.md §8), and the
one that states the goal literally. Everything before it was infrastructure: the loader made the
embed cheap (#150), query routing made it indexable (#155). This is the part a visitor sees.
Taken now rather than in plan order because Stage C is blocked — SahajCloud #633 and #634 are
still open and C4/C5 consume what they produce. What remains of C on this side is one deletion,
which is also a B item, so it comes along here (see B1).
Proposed changes
B1 · Copy sweep — the visitor-facing strings
| Where | Now | Change |
|---|---|---|
public/locales/*/common.json widget.label ×10 |
"Sahaj Atlas — free meditation classes" | Split into widget.label ("Free meditation classes") and widget.label_named ("%{name} — free meditation classes") |
public/locales/*/events.json on_sahaj_atlas ×10 |
"on Sahaj Atlas" | Key renamed to display.view_full_details |
Fallbacks.tsx app-level alert |
title="Sahaj Atlas" |
Drop the prop entirely |
App.tsx RootFallback |
"Sahaj Atlas could not be loaded…" | Neutral sentence |
src/lib/ics.ts PRODID |
-//Sahaj Atlas//Events//EN |
Neutral, and not tenant-configurable |
src/styles/fonts.ts FONT_FAMILY |
'Sahaj Raleway' |
'Atlas Raleway' |
index.html <title> |
"Sahaj Atlas" | Neutral |
Four of those need their reasoning stated, because each has a trap:
widget.labelsplits into two keys rather than taking an interpolation. An absent name would leave a dangling em-dash, and this string is therole="region"accessible name — WebKit drops the landmark entirely when it resolves empty (i18n-options.test.tsrecords this).on_sahaj_atlasis renamed, not just retranslated. A key named after the brand is itself a brand reference in a file translators read.RootFallbackstays a hardcoded English literal with no i18n and no theme dependency. That constraint is correct and must survive: it renders when the providers themselves have failed. Only the string becomes neutral.- ⚠
UID:event-<id>@atlas.sydevelopers.com(ics.ts:324) stays exactly as it is. It is the calendar dedupe key — changing it makes every previously-exported event re-appear as a new entry in somebody's calendar.PRODIDidentifies the producing software and is a different field with different rules.
Plus the deletion carried over from Stage C: EventSummary renders both the on_sahaj_atlas
label and an outbound link to event.webUrl. That backlink was never correct behaviour, and once
canonicals point at the owning client it becomes a self-link on the very page the widget is
embedded in. With it gone the component is a two-call-site alias over an EventFacts that already
takes variant, title, children and className — so it goes too, along with its
standalone/hasMap read and its barrel exports.
A ratchet spec walks the locale JSON and a named list of source files and fails if anything
matches /sahaj\s*atlas|we ?meditate/i. Same spirit as href.test.ts's anchor inventory: the
enumeration is the enforcement, so the next brand string turns the lane red instead of shipping.
B2 · Tenant identity
- Display name from
client.name, which already exists and is already used as a display string inbuildReportContext— no SahajCloud change needed. Plus thenamescript parameter the loader already parses. - JSON-LD
organizercurrently hardcodes We Meditate (EventMetadata.tsx:50-55). Derive it from the client, and omit the whole block when unknown — an absent optional property is better structured data than a false one. - Typography via a
--sy-font-sanscustom property thattailwind.config.jsreads, so a host can name a font their page already loads. No new request, no CSP change. - Storage keys move under
atlas.. ⚠ The un-namespacedthemekey is a bug fix, not branding —docs/embedding.mdalready admits it reads and overwrites a host's ownthemekey — so it needs a one-time migration read of the old key and should be described in the changelog as a fix.
B3 · Defensive CSS reset
Host CSS reaching into the widget is the one direction the #91 scoping work does not cover, and
it has broken embeds in the field.
:where(.sy-atlas),
:where(.sy-atlas) :where(*) {
all: revert;
}Unlayered, and placed before our sheet. The mechanics matter, because the obvious spelling is
backwards:
- ⚠
@layeralone makes it worse. Unlayered author styles outrank every author layer, so putting our sheet in a layer hands the host's unlayered rules an automatic win. :where()is (0,0,0) specificity, so every rule of ours still outranks it — it only wins where nothing of ours speaks, which is exactly the set a host can leak into.allexcludes custom properties, so the brand palette survives untouched.- It is hand-written against
.sy-atlas, whichpostcss-scope-widget.mjspasses through unmodified — soassert:csskeeps working with no changes. - The second half is mandatory:
all: revertdoes not stop inherited properties crossing the root boundary, so the root needs an explicit baseline forfont-family,color,line-height,letter-spacing,text-transform,word-spacingandtext-align.globals.cssalready does this forline-height; this generalises it. - ⚠ Never add
contain: layoutor a transform to the root. The measured table in.claude/rules/components.mdshows both re-parentposition: fixeddescendants — which would break map mode, every drawer, the peek strips and the cog. - ⚠ Measure the cost.
all: reverton*defeats style-sharing and forces full property recomputation per element; check a long results list before shipping.
B4 · Shadow DOM evaluation ticket
Filed as a real ticket rather than left as a maybe. Must cover: @font-face inside a shadow root
in current engines; retargeting every Radix portal and the document.activeElement /
dismissible-layer machinery; vite-plugin-css-injected-by-js appending to document.head;
Mapbox's document.elementFromPoint; and that it does not fix vaul's window-height arithmetic,
which is the thing map mode actually needs.
Explicitly not doing
- Removing
sahajatlas.comas a runtime dependency. Assets are served from there whichever way the widget loads, so bundling the locale JSON would only move which requests hit that origin, not remove it. Document it honestly instead. (Does not block refactor(i18n): source translations from SahajCloud CMS #28.) - Renaming the DOM identifiers —
sahaj-atlas,sahaj-atlas-style,sahaj-atlas-fonts,sy-atlas.docs/embedding.mdinvites hosts to key off the style ids and promises they are stable; no visitor ever sees any of them; and renaming the scope class means four synchronised sites plus a build gate for zero visitor-facing gain.
Acceptance criteria
- No visitor-facing string, in any of the ten locales, names Sahaj Atlas or We Meditate.
- The
role="region"landmark has a non-empty accessible name with and without a client name. -
EventSummaryis gone; both call sites useEventFactsdirectly and render no outbound backlink. - JSON-LD omits
organizerentirely when the client is unknown, rather than naming We Meditate. - The
themekey is namespaced, with a one-time read of the old key so nobody loses their setting. - ⚠ The ICS
UIDis byte-identical to before;PRODIDis neutral. - Host CSS (
button { … },a { color: … !important }, an aggressive* { box-sizing }) does not visibly alter the widget, verified in a browser against a hostile stylesheet. - The brand-string ratchet spec fails when a brand string is reintroduced.
-
pnpm lint && pnpm typecheck && pnpm test:run && pnpm build && pnpm size && pnpm ladle:buildpass, andpnpm sizeis reported for a credentialed build. -
docs/embedding.mdandCHANGELOG.mdrecord what a host can observe; write an implementation report to.claude/reports/.
References
.claude/reports/whitelabel-seo-program.md§8 — the design and the rejected options- feat(widget): split the embed into a smart loader and an element bundle #150 (loader), feat(widget)!: route through a query parameter and remove hash routing #155 (query routing) — the two stages this builds on
.claude/rules/components.md— thecontain/transformmeasurement, and the scoping rulesassert:cssenforces
Metadata
Metadata
Assignees
Labels
Type
Fields
Hold Until
Activity
refactor(event): namespace the calendar UID to the CMS, not the widge…
refactor(event): namespace the calendar UID to the CMS, not the widge…
feat(ui): de-brand the widget and keep host CSS out of it (#158)
Merge origin/main into claude/fix-236-shadow-dom