Repository navigation
Description
Summary
On a host page where the slot is too small, the compact card's button opens a full-viewport map with no drawer, search, cog or close button, and a click on the host's header closes it. Seen live on https://shrimataji.org/test/kn/find-a-class/ (WordPress, Mesmerize Pro, routing=path) at 1280×720 and 390×844. Two independent causes, both confirmed in a browser.
Approach
- Theme root never adopted.
src/Widget.tsxhandsBrandThemea ref to its own parent wrapper. React 18 attaches a parent's ref only after its children's layout effects run, soBrandTheme(src/config/theme/BrandTheme.tsx:53-66) readsnulland adopts<html>. It recovers only if the client's colours change afterwards — never in path mode (PathBoothas already cachedclients/me) and never for a record with no colours.widgetOverlayContainer()(src/lib/overlay.ts:101) then returnsdocument.body, so the expanded dialog renders outside.sy-atlaswith none of the scoped stylesheet: nocontain: layout, so the map'sfixed; inset: 0fills the window and the rest renders unstyled below the page. Fix: hold the wrapper in state through a callback ref and renderApponce it exists — the contractsrc/hooks/use-frame.tsalready documents. - Overlay under host chrome. The dialog's scrim and frame are
z-50(src/views/CompactEmbedView/CompactEmbedView.tsx:98-103) in the host's stacking context. Mesmerize's header isz-index: 100, so it paints over the search, cog and ×, and a click there counts as outside and dismisses. Fix: a z-index near the top of the int32 range.
Acceptance criteria
- With a client record carrying no brand colours, in query and path routing, the expanded dialog is a child of
.sy-atlasand renders the full interface. - A host header with
z-index: 100sits under the overlay's scrim, and the overlay's ×, cog and drawer are hit-testable. - A click inside the overlay keeps it open. A click on its margin, or Escape, closes it.
- The light/dark setting never writes a class onto the host's
<html>. -
docs/embedding.mdandCHANGELOG.mddescribe the overlay's stacking.
Verification checklist
-
pnpm test:runpasses, including a jsdom spec that fails against the ref-based wrapper. -
pnpm build && pnpm review:embed, then in Playwright withclients/mestubbed withoutcolor1–color3, on a host page with az-index: 100header and a slot under 420px: press "Find a class near you";document.querySelector('[data-sy-expanded]').parentElementhas classsy-atlas, andelementFromPointat the × lands inside[data-sy-expanded]. - After deploy,
https://shrimataji.org/test/kn/find-a-class/at 900×480 opens the overlay with its drawer visible.
Notes
docs/rules/mapbox.md recorded the theme-root failure as a review-stub trap and believed production recovered. It does not in path mode.
Companion host-side fix: the WordPress plugin stops printing Mesmerize's hero on the Atlas page (sydevs/SahajAtlasWordpress).
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Priority
High
Hold Until
None yet
Projects
- StatusShow more project fieldsDone
Activity