Skip to content

fix: web-admin failing due to change in CSS application#9219

Open
royendo wants to merge 7 commits intomainfrom
fix-embed-e2e
Open

fix: web-admin failing due to change in CSS application#9219
royendo wants to merge 7 commits intomainfrom
fix-embed-e2e

Conversation

@royendo
Copy link
Copy Markdown
Contributor

@royendo royendo commented Apr 10, 2026

use closest() for IntersectionObserver root in CanvasComponent

  • CanvasComponent used document.querySelector(".dashboard-theme-boundary") as the IntersectionObserver root. With multiple .dashboard-theme-boundary elements (e.g., a ThemeProvider wrapping the embed header), querySelector returns the first match in DOM order — which is the header, not the canvas scroll container. Canvas components aren't descendants of the header, so they never intersect, component.visible never fires, and data never loads.
  • Switched to container.closest(".dashboard-theme-boundary") to always find the nearest ancestor theme boundary.
  • Re-applies the ThemeProvider wrapper on the embed header (from nit: add themeing to AI Bar #9210) now that the root cause is fixed.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Developed in collaboration with Claude Code

royendo and others added 7 commits April 10, 2026 12:47
… false

The ThemeProvider wrapper always added `flex flex-col overflow-hidden`
regardless of applyLayout. When used around the embed header, this extra
flex container with overflow-hidden changed height calculations for the
canvas content below, preventing KPI data from rendering in time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ThemeProvider was clearing themeManager's CSS variable cache on every
reactive update, including initial mount and redundant no-op updates.
With multiple ThemeProvider instances (embed header + canvas), this
caused duplicate cache clears that disrupted canvas chart rendering.

Now the cache is only cleared when CSS transitions between different
non-initial values, preventing interference between sibling providers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rapper

Use `dashboard-theme-boundary` class directly on the header div so it
inherits theme CSS variables from the dashboard's own ThemeProvider.
This avoids adding a second ThemeProvider instance which caused canvas
embed e2e failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
`CanvasComponent` used `document.querySelector(".dashboard-theme-boundary")`
to find the IntersectionObserver root. With multiple `.dashboard-theme-boundary`
elements (e.g., a ThemeProvider wrapping the embed header), `querySelector`
returns the first match in DOM order, which may not be the canvas's ancestor.
Components then never intersect, so they never become visible and data never
loads.

Switching to `container.closest(".dashboard-theme-boundary")` finds the
nearest ancestor, which is always the correct scroll root regardless of how
many theme boundaries exist in the document.

Also re-applies ThemeProvider to the embed header (reverted in earlier
debugging) now that the root cause is fixed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@royendo royendo requested a review from djbarnwal April 10, 2026 18:58
@royendo
Copy link
Copy Markdown
Contributor Author

royendo commented Apr 10, 2026

Hey this is to fix web-admin e2e but its actually changing code in canvas Svelte, first time in this side of the code so lmk if this is a okay fix!

@royendo royendo changed the title fix: do not apply layout classes in ThemeProvider when applyLayout is… fix: use closest() for IntersectionObserver root in CanvasComponent Apr 10, 2026
@royendo royendo changed the title fix: use closest() for IntersectionObserver root in CanvasComponent fix: web-admin failing due to change in CSS application Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant