Skip to content

test(ui): prove nested overlays through the production shadow seam - #381

Draft
cameronapak wants to merge 3 commits into
journey-to-the-shadow-domfrom
cursor/cp/ype-5355-production-overlay-seam-4bb8
Draft

test(ui): prove nested overlays through the production shadow seam#381
cameronapak wants to merge 3 commits into
journey-to-the-shadow-domfrom
cursor/cp/ype-5355-production-overlay-seam-4bb8

Conversation

@cameronapak

@cameronapak cameronapak commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Validates YPE-5355 through the production integration seam (ShadowRootHost with portalStrategy="local-top-layer" + real VerseActionPopover, HighlightPermissionDialog, Dialog, and Popover). This is proof and contract only. YPE-5356 owns any runtime ship to main.

This work is possible because of PR #375 by Austin Harms (abharms). That PR carefully researched and proved a proposed root-owned LIFO overlay-ownership registry, with four independent reviews agreeing the ShadowRoot + React portal architecture is justified. This draft does not replace or correct that research. It asks the open follow-up question: does the current production seam already handle the ticket scenarios without a new ownership registry?

Finding

No ownership registry was added. The production seam already handled the required scenarios. One small adapter-side gap appeared and was fixed in the existing focus helper.

Scenario Result
popover → dialog (VerseActionPopover opening HighlightPermissionDialog) Pass. YPE-1034: the verse-action popover may remain open. Both live in the real [data-yv-shadow-local-overlay] container.
dialog → popover (production Dialog launching production Popover) Pass. Nested popover mounts in the same container, stays clickable, and can hold focus.
two independent overlays Pass. Current Radix dismiss-on-outside is kept; both staying mounted is not required.
rapid close/reopen during unequal exit Pass after a small adapter fix. Reopen during exit had captured the outgoing overlay as the restore target, leaving ShadowRoot.activeElement empty.
cleanup / unmount while a modal is open Pass. Host teardown is idempotent and does not crash.
second isolated ShadowRoot Pass. Each island owns its own top-layer container.

What changed

  • Chromium Storybook proof: packages/ui/src/components/shadow-overlay-production-seam.shadow-isolation.stories.tsx
  • Static visual frames of the same production harness (not tagged integration)
  • Production focus helper: skip portal-container nodes when choosing a restore target; fall back to the last wrapper control
  • ADR 0006 + isolation plan: record that YPE-5355 did not need a new ownership registry; YPE-5356 owns shipping
  • Empty changeset (no package release)

Complexity deliberately avoided

No second mutable ownership class, parentId graph, custom exiting phase, manual revision bookkeeping, duplicated focus trap, or fatal lifecycle throws. Escape, outside dismissal, presence, and focus scope stay with Radix. Focus acceptance stays in the adapter.

Out of scope

Jira

YPE-5355

Open in Web Open in Cursor 

Exercise YPE-5355 nested and concurrent overlay scenarios against the real ShadowRootHost + Radix path, without adding an ownership registry.
@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: da7e47d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

The production seam handled nested and concurrent overlays without a new ownership registry. Rapid reopen during exit captured the outgoing overlay as the restore target; skip portal-container nodes and fall back to the last wrapper control.
Leave the ticket scenarios on screen so the production VerseActionPopover, permission dialog, nested popover, and independent overlays can be inspected without racing the play function.

@cameronapak cameronapak left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

No Jira. Spec is the Conductor off-ticket showcase (related YPE-5355).

Summary

Standards: 0 must-fix. Worst: none.

Spec: 0 must-fix on this SHA. Worst: none.

CI: pass.

I would approve the code. This UI proof still needs Cam's visual review. Stay draft. The PR has no image artifacts, so add before-and-after screenshots with before-and-after.

For Agents: pin and review state
  • Pin HEAD: da7e47df167f464a12b0dc246af3f1e5a0f25da8
  • Base branch: journey-to-the-shadow-dom
  • Draft: yes. Stay draft. No ready, APPROVE, or merge.
  • Event: COMMENT only (UI overlay + Cam-authored PR).
  • Spec source: Conductor off-ticket showcase. Do not rewrite Austin's YPE-5355 ticket. Do not touch PR #375.
  • Greptile: missing (ok).
  • CI: Build, Bundle Size, Integration Tests, Lint, Lint Commit Messages, Lint PR Title, Locale Ownership, Test, Type Check, i18n Check, Require Changeset pass. Publish coverage badges skipped.
  • Finding: no ownership registry; production seam covers required scenarios; rapid-reopen restore gap fixed in use-shadow-dialog-focus.ts via useShadowFocusRestoreTarget.
  • Non-blocking nits: independent-overlays path does not assert Radix outside-dismiss closed the verse popover; portal restore skip is broad (!container.contains) and untested on YPE-1034 close path.

By Code Reviewer bot, sent on behalf of Cam.

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.

2 participants