Skip to content

ref(🥞): restructure DOM order for paint-order stacking#114520

Draft
natemoo-re wants to merge 7 commits into
nm/zindex/layer-primitivefrom
nm/zindex/dom-order
Draft

ref(🥞): restructure DOM order for paint-order stacking#114520
natemoo-re wants to merge 7 commits into
nm/zindex/layer-primitivefrom
nm/zindex/dom-order

Conversation

@natemoo-re
Copy link
Copy Markdown
Member

@natemoo-re natemoo-re commented May 1, 2026

Summary

Move overlay elements (drawer, modal, indicators) after content in DOM order so they paint above content without relying solely on global z-index values. Wrap content area, drawer panel, and modal in Layer components to create isolated stacking contexts.

DOM Reorder

GlobalDrawer now renders its backdrop and panel after {children} instead of before. GlobalModal and Indicators now render after the ErrorBoundary content outlet. This makes DOM order agree with intended paint order — later siblings paint above earlier ones.

Layer Wrappers

Page content is wrapped in <Layer variant="content">, drawer panel content in <Layer variant="overlay">, and modal content in <Layer variant="overlay">. Each creates an isolated stacking context via isolation: isolate.

Existing z-index values and TooltipContext are kept as safety nets — they will be removed in later PRs once portal consumers are wired to Layer outlets.

🥞 Layer Primitive Series

Test plan

  • Drawer paints above content (DOM order, not z-index)
  • Modal paints above drawer
  • Tooltips still functional in all contexts
  • Manual QA: open drawer, open modal, verify tooltip behavior in each context
  • pnpm run typecheck

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.59%

natemoo-re and others added 3 commits May 28, 2026 11:19
Move overlay elements (drawer, modal, indicators) after content in
DOM order so they paint above content without relying solely on
global z-index values. Wrap content area, drawer panel, and modal
in Layer components to create isolated stacking contexts.

Existing z-index values and TooltipContext are kept as safety nets
and will be removed in follow-up PRs once portal consumers are
wired to Layer outlets.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Give navigation components their own Layer so tooltips and
dropdowns render into the nav portal outlet instead of
escaping to document.body.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Apply Layer isolation styles directly to DrawerSlidePanel via the
render child className pattern, avoiding a wrapper div that would
break the flex layout.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
natemoo-re and others added 4 commits May 28, 2026 11:19
TopBar is app chrome, not page content. Use the render child pattern
to apply Layer isolation styles directly to the sticky Flex element,
preserving sticky positioning while giving TopBar tooltips their own
nav portal outlet.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Layer wrapper div broke flex layout in two places:
- Content area: extra div between flex column parent and Layout.Page
  prevented flex:1 from stretching, collapsing page content height
- Navigation: extra block div inside flex row caused sidebars to
  stack vertically instead of side-by-side

Use render-child pattern to apply isolation:isolate directly to
existing elements without introducing intermediate wrapper divs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components WIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant