fix: reliably hide frontend overlay when collapsed in shadow DOM - #110
Conversation
CSS `translate-x-full` (Tailwind v4 `translate` property) is unreliable
inside a Shadow DOM when `--tw-translate-y` is undefined — the entire
`translate` declaration becomes invalid and the panel stays visible at
right:0 while still being inert/pointer-events-none.
- Add `style:visibility={isOpen ? undefined : 'hidden'}` to the panel div
so it is unconditionally hidden when closed, regardless of CSS transform
support in the shadow root.
- Add `host.style.pointerEvents = 'auto'` in syncHostBounds to guard
against WP themes that inherit pointer-events:none to the host element.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018kx6JF9Cq9DTPpm4xdTx97
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoFix Shadow DOM overlay so it actually hides when collapsed
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Merged origin/main (PR #110) into the branch. The only conflict was the generated app.js bundle; resolved by rebuilding from the merged source. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MhTeTwHB6FWbkRuGmSc1yU
Problem
Panel frontendowy był zawsze widoczny gdy
isOpen=false(np. po zwinięciu lub z wartości z localStorage). Mimo że byłinertipointer-events-none(interakcja poprawnie zablokowana), nie chował się wizualnie.Przyczyna
Aplikacja montuje się w Shadow DOM (
attachShadow). Tailwind v4 używa własności CSStranslatezamiasttransform:Jeśli
--tw-translate-ynie jest zdefiniowane w shadow root (warunek@supportsw@layer propertiesnie pasuje do przeglądarki), cała deklaracjatranslatejest invalid i spada donone— panel pozostaje przyright: 0, widoczny.Poprawki
style:visibility={isOpen ? undefined : 'hidden'}na głównym divie panelu — ukrywa go bezwarunkowo przez inline style (wyższy priorytet niż jakikolwiek CSS). Trigger tab ({#if !isOpen}) jest osobnym elementem i nie jest dotknięty.host.style.pointerEvents = 'auto'wsyncHostBounds— ochrona przed dziedziczeniempointer-events: nonez motywu WP na element hosta shadow DOM.Animacja otwierania (translate slide-in) nadal działa. Zamknięcie jest teraz natychmiastowe wizualnie — akceptowalny trade-off za pewne ukrywanie panelu.
Generated by Claude Code