Repository navigation
fix(ui): a host's root font size no longer shrinks the side panel - #242
Merged
Merged
Conversation
A host that sets `html { font-size: 62.5% }` (Twenty Twenty, OceanWP)
rescaled every rem the widget still shipped: the side panel measured
220px instead of 352px, list labels wrapped, and the map camera kept
padding for a 352px panel.
Converts the residue TAILWIND_REM_TO_PX did not cover: the drawer width
fallback (22rem -> 352px) in the Drawer atom and DrawerStack, the content
cap (32rem -> 512px), the cog offsets, ActionRow's max width, the Modal's
margins, the story harness panel, the root fallback's inline style, and
the rem lengths in globals.css and the vendored vaul.css.
The camera half of the pair becomes DRAWER_W_PX = 352, used directly for
the left padding, and the pairing spec now captures the fallback's unit,
so a rem fallback fails it as well as a mismatched number.
Schedule-X's theme CSS stays in rem: it is third-party and loads only
with the calendar.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
assert-css-scoped gains a fourth check. It reads every injected stylesheet back out of dist/, as it already does for scoping, and fails on any declaration carrying a rem length unless the injecting chunk is CalendarView's (Schedule-X's theme). Media-query params are not checked: their rem is the browser's initial font size, which no page can change. The calendar's own rem lengths double as the detector's proof of life: finding none there fails the gate too, so a renamed chunk or a detector that stopped matching the minifier's output cannot pass every sheet blind. The exemption is decided per injecting file, not per unique sheet. Verified both ways: the pre-fix dist fails with the 14 known lengths, and reintroducing `max-w-[6rem]` fails `pnpm build`. src/AGENTS.md and tailwind.config.js now state the px-only rule. Co-Authored-By: Claude Opus 5.5 <[email protected]>
States it in "What the widget does to your page", with the calendar's third-party grid named as the one part still sized in rem, and records the fix under Unreleased -> Fixed in the changelog. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Deploying sahajatlas with
|
| Latest commit: |
c384ac9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://64e90c0d.sahajatlas.pages.dev |
| Branch Preview URL: | https://fix-238-root-font-panel.sahajatlas.pages.dev |
Deploying sahajatlas-design with
|
| Latest commit: |
c384ac9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://42e86dd3.sahajatlas-design.pages.dev |
| Branch Preview URL: | https://fix-238-root-font-panel.sahajatlas-design.pages.dev |
# Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
html { font-size: 62.5% }) no longer shrinks the side panel: it is 352px everywhere.DRAWER_W_PX = 352) now matches the panel's rendered width on every host.pnpm buildfails on anyremlength in the injected CSS outside the calendar's Schedule-X chunk.Changes
src/hooks/use-map-controller-real.tsx—DRAWER_W_REM = 22/× 16becomesDRAWER_W_PX = 352, used directly for the padding. The "one half of a pair" comment names the px pair and drops the root-font caveat it no longer has.Drawer.tsx,DrawerStack.tsx,story-harness.tsx—--sy-drawer-wfallback22rem→352px,--sy-content-max32rem→512px,calc(100%-2rem)→-32px, cog offsets+2rem/+3rem→+32px/+48px.ActionRow.tsxmax-w-[6rem]→[96px];Modal.tsxcalc(…-2rem)→-32px;App.tsxroot fallback inline style → px.globals.css(swiper pagination offset, expanded-dialog control nudge) and the vendoredvaul.css(handle radius, 44px hit area) → px. The vendoring header now says to re-convert on refresh.use-map-controller.test.ts— the pairing spec captures the fallback's unit, so aremfallback fails it, and it pins that the padding readsDRAWER_W_PX.scripts/assert-css-scoped.mjs— check 4: noremin any injected declaration unless the injecting chunk isCalendarView-*.js.src/AGENTS.md,tailwind.config.js— state the px-only rule (the oldmax-w-[6rem]example is nowmax-w-[96px]).Contract impact
Host-observable, so
docs/embedding.md("What the widget does to your page") andCHANGELOG.md(Unreleased → Fixed) both say it: a host's root font size no longer resizes the widget, and the calendar view's text is the one part still inrem. Consumers: SahajAtlasWordpress (its browser lane'stwentytwenty/oceanwp/root-font/fixed-headercells found this) and WeMeditateWeb's/maphost. Neither needs a code change. Nothing changes in the script URL, the CSP, or the sizing rules.Test results
.claude/skills/pr-prep/check.sh, after rebasing on fix(widget): compact card's overlay opens with no interface #234): ✓ lint, ✓ typecheck, ✓ 125 files / 1620 testspnpm build: ✓assert-css-scoped: 1172 rules across 3 injected stylesheet(s) confined to .sy-atlas, with no rem outside the calendar chunk; ✓assert:mapspnpm size: ✓ standalone 301.9 / 308 KiB, loader 2.6 / 3.5 KiB, embed 303.7 / 308 KiBdist/, it listed the 14 known lengthsmax-w-[6rem]put back,pnpm buildexited 1 naming.max-w-\[6rem\] { max-width: 6rem }22remfallback put back inDrawerStackand a literal352in the padding, both assertions went red. Restored, both pass.Manual verification
Measured in Chromium (Playwright, 1280×720, map mode,
clients/mestubbed). The host page's<sahaj-atlas>loadsauto.jsfrompnpm review:embed. All other SahajCloud reads were proxied to production with the published key, so the list shows live countries.[data-vaul-drawer]once it settles:main62.5%(10px)main62.5%(10px)Still to do after deploy (the issue's checklist item, not run here): SahajAtlasWordpress's browser lane on the
twentytwentyandroot-fontcells should report no "side panel keeps its width" finding.Notes for reviewer
CalendarView-*.js). If the chunk is renamed, the build fails and the message namesREM_EXEMPT_CHUNK. Finding noremin the calendar chunk also fails. That second check is the detector's proof of life: a regex that silently stopped matching the minifier's output would otherwise pass every sheet.rem, on purpose. It is third-party and pinned. On a 62.5% host the calendar's text renders smaller. The guide and the changelog both say so.remis the browser's initial font size, which a page cannot change.src/App.tsx,src/styles/,scripts/*css*) are touched. The diff only changes length units and adds a read-only check to the gate. No selector, scope, or injection changes;assert-css-scopedstill confines every rule.word-break/overflow-wrap. At 352px nothing wraps either way.Detail
htmlcan separate them.assert-css-scopedrather than a sibling script: it already extracts every injected sheet with its chunk name and fails when it finds nothing, or fewer sheets than injection sites. A sibling would either duplicate that or import a module whose top level runs the scoping gate.// 224px (14rem)equivalence notes, the Modal comment quoting its old100vw-2remdefence, and a hypothetical media query inresponsive.test.ts.mainbaseline on :5194, built fromgit archive origin/main). The post-rebase measurement usedpnpm review:embedon :5174 itself. Each server was stopped by its own PID.Closes #238
🤖 Generated with Claude Code