Skip to content

feat(ui): prove nested and concurrent Shadow DOM overlay behavior (YPE-5355) - #375

Open
abharms wants to merge 24 commits into
journey-to-the-shadow-domfrom
ype-5355-nested-concurrent-shadow-dom-overlays
Open

feat(ui): prove nested and concurrent Shadow DOM overlay behavior (YPE-5355)#375
abharms wants to merge 24 commits into
journey-to-the-shadow-domfrom
ype-5355-nested-concurrent-shadow-dom-overlays

Conversation

@abharms

@abharms abharms commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • define a root-owned LIFO ownership contract for nested and concurrent overlays in one shadow root
  • add a committed internal state model with unit coverage for ordering, modal scope, dismissal, exit ordering, and focus restoration
  • add a Chromium Storybook proof for popover → dialog, dialog → popover, independent overlays, and rapid close/reopen during exit
  • keep production Dialog/Popover integration explicitly unsupported until the registry is wired through ShadowRootHost and revalidated

Requirement evidence

Jira acceptance area Evidence
Four required scenarios shadow-overlay-ownership.test.ts and the Shadow overlay ownership Chromium story
Top-layer and focus ownership ADR 0007, LIFO DOM-order assertions, and direct ShadowRoot.activeElement assertions
Inertness lifetime Model assertions plus Chromium checks through modal exit and rapid reopen
Escape/outside dismissal Unit ownership checks plus browser Escape and outside interactions
Focus restoration Unit fallback tiers plus browser opener-restoration assertions
Supported/unsupported classification ADR 0007 and the rollout plan
Contract and limitations ADR 0007, with production integration explicitly deferred

Validation

  • pnpm --filter @youversion/platform-react-ui exec vitest run --project unit src/lib/shadow-overlay-ownership.test.ts — 8/8 passed
  • pnpm --filter @youversion/platform-react-ui exec vitest run --project storybook src/lib/shadow-overlay-ownership.stories.tsx — Chromium proof passed
  • pnpm --filter @youversion/platform-react-ui typecheck — passed
  • pnpm lint — passed
  • pnpm test — the ticket tests pass; an unchanged BibleReader test intermittently exceeds its 5-second timeout under full parallel load and passes in isolation (46/46)
  • final independent Standards, Spec, and Compatibility audits at 7353201 — 0 findings

Compatibility and limitations

  • no production package entry point imports or exports the proof module
  • existing ShadowRootHost, Dialog, Popover, and direct VerseActionPopover runtime paths are unchanged
  • the empty changeset intentionally requests no package release
  • cross-browser, assistive-technology, and real production-primitive validation remain rollout gates

Jira

YPE-5355

Greptile Summary

The PR defines and proves a proposed root-owned LIFO ownership model for nested and concurrent overlays while leaving production integration explicitly unsupported.

  • Adds an internal state model covering ownership, modal scope, dismissal, exit ordering, rapid reopen, and focus restoration.
  • Adds unit and Chromium Storybook coverage for nested, concurrent, and reopening scenarios.
  • Documents the proposed contract, rollout requirements, and current production limitations.
  • Adds the required intentional empty changeset for this no-release change.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/ui/src/lib/shadow-overlay-ownership.ts Adds the internal deterministic ownership model for overlay registration, eligibility, dismissal, exit sequencing, and focus-restoration planning.
packages/ui/src/lib/shadow-overlay-ownership.test.ts Adds unit coverage for nesting directions, independent overlays, modal scoping, cyclic-parent rejection, teardown ordering, and focus fallback.
packages/ui/src/lib/shadow-overlay-ownership.stories.tsx Adds a Chromium Storybook proof exercising ownership and focus behavior inside a real shadow root and native top-layer container.
docs/adr/0007-shadow-overlay-ownership-stack.md Records the proposed overlay ownership contract and clearly distinguishes executable proof from unsupported production integration.
.changeset/define-shadow-overlay-ownership.md Supplies the intentional empty changeset required for a no-release change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Root[Shadow root] --> Registry[Root-owned overlay registry]
  Registry --> Stack[LIFO overlay stack]
  Stack --> Owner[Topmost eligible owner]
  Owner --> Focus[Focus ownership]
  Owner --> Dismissal[Escape and outside dismissal]
  Owner --> Inertness[Modal inertness]
  Owner --> Exit[Descendant-first exit ordering]
  Exit --> Restore[Ordered focus restoration]
  Registry -. production wiring deferred .-> Host[ShadowRootHost]
Loading

Reviews (18): Last reviewed commit: "fix(ui): defer focus acceptance to overl..." | Re-trigger Greptile

Context used (3)

@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0d6b80f

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

Comment thread docs/adr/0007-shadow-overlay-ownership-stack.md Outdated
…ype-5355-nested-concurrent-shadow-dom-overlays

# Conflicts:
#	docs/shadow-dom-isolation-plan.md
@abharms abharms changed the title YPE-5355 Define nested and concurrent Shadow DOM overlay behavior docs(ui): define nested and concurrent Shadow DOM overlay behavior (YPE-5355) Sep 1, 2026
@abharms

abharms commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T02:31:16.296284Z 0d6b80f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0336397c2f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/adr/0007-shadow-overlay-ownership-stack.md Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c62006e8d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/adr/0007-shadow-overlay-ownership-stack.md Outdated
@abharms
abharms marked this pull request as draft September 1, 2026 17:00
@abharms
abharms marked this pull request as ready for review September 1, 2026 17:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 73532013d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/lib/shadow-overlay-ownership.stories.tsx Outdated
Comment thread packages/ui/src/lib/shadow-overlay-ownership.ts Outdated
Comment thread packages/ui/src/lib/shadow-overlay-ownership.ts Outdated
@abharms abharms changed the title docs(ui): define nested and concurrent Shadow DOM overlay behavior (YPE-5355) feat(ui): prove nested and concurrent Shadow DOM overlay behavior (YPE-5355) Sep 1, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0481b00059

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/lib/shadow-overlay-ownership.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 57fb02fc0d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/lib/shadow-overlay-ownership.stories.tsx
Comment thread packages/ui/src/lib/shadow-overlay-ownership.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0323bce573

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/lib/shadow-overlay-ownership.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4ce1652fa4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/lib/shadow-overlay-ownership.stories.tsx

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48f40d5bdf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/lib/shadow-overlay-ownership.stories.tsx

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5dd0b8923d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/lib/shadow-overlay-ownership.stories.tsx
Comment thread packages/ui/src/lib/shadow-overlay-ownership.stories.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03333e1bf9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/lib/shadow-overlay-ownership.ts Outdated
@abharms
abharms marked this pull request as draft September 1, 2026 20:37
@abharms
abharms marked this pull request as ready for review September 2, 2026 18:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8fd4650e6d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/lib/shadow-overlay-ownership.stories.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ef3dee951

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/lib/shadow-overlay-ownership.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d61a6fa556

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/lib/shadow-overlay-ownership.stories.tsx
@abharms abharms self-assigned this Sep 2, 2026
@abharms
abharms requested a review from cameronapak September 2, 2026 19:50

@cameronapak cameronapak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review

Jira ticket: YPE-5355

Summary

Standards: 0 must-fix. Worst: none.

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

CI: pass.

This PR changes UI. I would approve. Cam must look at the overlay proof first.

There are no before or after screenshots on this PR. Add them with before-and-after.

For Agents: pin SHA

Pin: d61a6fa vs main. Ticket YPE-5355. Author abharms.

UI proof (Storybook/Chromium overlays): COMMENT. Would approve. Do not APPROVE.

Empty changeset. Production Dialog/Popover/ShadowRootHost wiring is deferred. Do not treat that as a missing requirement on this SHA.

Greptile 5/5. Partner bots: Greptile and Codex. Codex P2s on earlier SHAs are resolved. Do not reopen. Last Codex note about tabbable() without getShadowRoot is not a must-fix: YPE-5355 proves nested overlays in one shadow root, not nested custom-element shadows inside the owner.

CI: Build Greptile Review Integration Tests Lint Lint Commit Messages Lint PR Title Locale Ownership Require Changeset Test Type Check i18n Check pass. Coverage skipped.

By Code Reviewer bot, sent on behalf of Cam.

@cameronapak cameronapak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review

Jira ticket: YPE-5355

Summary

Standards: 1 must-fix. Worst: the model still returns an opener that cannot take focus.

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

CI: pass.

This PR changes UI. Do not approve until the restore contract lives in the model.

There are no before or after screenshots on this PR. Add them with before-and-after.

For Agents: pin SHA

Pin: d61a6fa vs main. Follow-up: Standards must-fix on unmount openerTarget. Do not reopen Codex threads. Spec still 0.

UI: COMMENT. Do not APPROVE.

CI unchanged pass. Greptile 5/5. Partner: Greptile + Codex.

By Code Reviewer bot, sent on behalf of Cam.

Comment thread packages/ui/src/lib/shadow-overlay-ownership.ts Outdated
Comment on lines +1 to +4
/** @internal */
export type ShadowOverlayKind = 'modal' | 'nonmodal';
/** @internal */
export type ShadowOverlayPhase = 'active' | 'exiting';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

praise: I like the @internal JSDoc comments!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thoughtful

@cameronapak cameronapak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review

Jira ticket: 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. The PR has no image artifacts, so add before-and-after screenshots with before-and-after.

For Agents: pin and review state
  • Pin HEAD: 0d6b80f9380cc284c3f8456f8d987861fed184b5
  • Base: c7649829d890818fb1b66a4853d33997c27f1b4f
  • Review is COMMENT only because this PR changes Storybook UI proof and Cam must inspect it visually.
  • Prior unfocusable-opener finding is fixed. The model returns ordered focus candidates, and the adapter advances when a candidate does not accept focus.
  • Greptile: 5/5 on this SHA. Codex and Greptile findings on earlier SHAs are resolved or outdated. No new inline comments.
  • CI: Build, Bundle Size, Integration Tests, Lint, Lint Commit Messages, Lint PR Title, Locale Ownership, Test, Type Check, i18n Check, Require Changeset, and Greptile Review pass. Publish coverage badges skipped.
  • PR body validation counts are stale after later commits: it says 8/8 unit tests and cites audit SHA 7353201.

By Code Reviewer bot, sent on behalf of Cam.

@cameronapak cameronapak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review

Jira ticket: 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. The PR has no image artifacts, so add before-and-after screenshots with before-and-after.

For Agents: pin and review state
  • Pin HEAD: 0d6b80f9380cc284c3f8456f8d987861fed184b5
  • Base: c7649829d890818fb1b66a4853d33997c27f1b4f
  • Review is COMMENT only because this PR changes Storybook UI proof and Cam must inspect it visually.
  • Prior unfocusable-opener finding is fixed. The model returns ordered focus candidates, and the adapter advances when a candidate does not accept focus.
  • Greptile: 5/5 on this SHA. Codex and Greptile findings on earlier SHAs are resolved or outdated. No new inline comments.
  • CI: Build, Bundle Size, Integration Tests, Lint, Lint Commit Messages, Lint PR Title, Locale Ownership, Test, Type Check, i18n Check, Require Changeset, and Greptile Review pass. Publish coverage badges skipped.
  • PR body validation counts are stale after later commits: it says 8/8 unit tests and cites audit SHA 7353201.

By Code Reviewer bot, sent on behalf of Cam.

@cameronapak

Copy link
Copy Markdown
Collaborator

Hey Austin, thank you for your hard work on this. I was processing back and forth with my agent to figure out if there's any possible way that this could be simpler because this approach feels a little bit advanced and a little bit it triggered a small warning sign in my head to just validate and double-check if this is the easiest path to solve what we're trying to solve.

At this point, I want to give you the information and then give you the option to make the full decision on whether or not you pursue something different or you continue with this.

See AI slop verdict

Verdict

PR 375 is overboard for style isolation. DO NOT SHIP it as “contract proved.”

Shadow DOM is still justified for absolute isolation. The simpler implementation already exists on the parent branch:

  1. One host element.
  2. One ShadowRoot.
  3. One React portal into that root.
  4. SDK CSS injected once.

PR 375 adds a separate overlay ownership system. That system solves nested overlay coordination, not CSS isolation.

Intent

Protect SDK React components from consumer CSS. Preserve React context and support overlays without coupling SDK behavior to the host page.

YPE-5355 is narrower. It is a spike for nested and concurrent overlays inside one ShadowRoot. Production integration is deferred.

Reviewers

Four independent passes reviewed the live diff. All four reached the same architectural conclusion. I could not verify distinct model labels, so the agreement is independent-pass consensus, not confirmed model-family diversity.

Act on

  1. The proof bypasses production code.

    OwnershipProofStory mounts ShadowRootHost without its overlay strategy. The story then creates another top-layer container and duplicates focus behavior.

    The 601-line story proves its own adapter, not Dialog, Popover, or ShadowRootHost.

  2. The ownership contract can crash during normal React teardown.

    unmount() throws when descendants remain. Real sibling overlays can finish different exit animations in either order.

    The proof hides this risk by giving every layer the same 150ms timer.

  3. The ADR ignores the ownership system already in use.

    Radix already handles layer order, Escape, dismissal, and focus scopes. The ADR should explain exactly what Radix cannot provide.

    The strongest real gap is per-ShadowRoot ownership when several SDK instances share one page. That needs a small per-root registry, not necessarily a parent graph.

The simpler shape

Keep ShadowRootHost. Extend its existing ShadowPortalController with one ordered per-root overlay list.

Reuse Radix for Escape, outside clicks, presence, and focus. Let the registry answer only which overlay is topmost inside that ShadowRoot.

Delete:

  • The separate mutable ownership class.
  • parentId graph traversal and cycle guards.
  • The custom exiting phase.
  • Fatal lifecycle throws.
  • Manual revision refresh bookkeeping.
  • The duplicate top-layer container.
  • The duplicate focus trap.
  • Most of the 601-line synthetic story.

Prove the behavior through real VerseActionPopover, Dialog, and ShadowRootHost stories.

Consider

  • Isolate simple leaf components first. Do not block them on nested-overlay architecture.
  • Keep the existing CSS revert-layer defense as the cheap default. It does not replace Shadow DOM against !important and inherited values.
  • If the team wants a research-only PR, change “contract proved” to “contract drafted.” Record the synthetic proof’s limits.

Noted

  • PR 375 adds no production bytes and exports nothing. Immediate consumer risk is low.
  • CI is green at HEAD 0d6b80f9380cc284c3f8456f8d987861fed184b5.
  • The PR is stacked on journey-to-the-shadow-dom, not main.
  • The PR body says 8 tests, but the file now has 14.

Dismissed

  • CSS Modules alone. They cannot stop hostile global !important rules.
  • One separate React root per component. It would sever provider context and increase lifecycle work.
  • Reopening resolved review comments. None changes this architectural result.

Agreement map

All four passes agreed that the ShadowRoot and React portal are load-bearing. All four rejected the synthetic adapter as production evidence.

The passes differed on the replacement. Some preferred a pure reducer. Others preferred a subscribed registry. I prefer the smaller option: extend the controller already owned by ShadowRootHost and reuse Radix.

Pre-flight

Healthy point: main at 555c094cb8a3c91b32feea011564807545f623d9.

  • Immediate runtime risk: low.
  • Architectural lock-in risk: high.
  • Fit for CSS-isolation goal: poor.

DO NOT SHIP as the chosen production contract. A narrowly labeled research artifact could ship after its claims match its evidence.

Principles that changed the decision

  • Redesign from First Principles. I separated CSS isolation from overlay ownership.
  • Laziness Protocol. I rejected a second ownership stack when Radix and ShadowRootHost already own most behavior.
  • Subtract Before You Add. The recommendation deletes the synthetic adapter before adding registry behavior.
  • Minimize Reader Load. One root-owned controller replaces three overlapping ownership systems.
  • Prove It Works. I weighted real production integration above a parallel Storybook simulation.

Nothing was posted or changed on the PR.

My recommendation:

  1. Pause PR 375. Do not merge the proposed contract yet.
  2. Reframe YPE-5355 around one question: what coordination does ShadowRootHost plus Radix actually lack?
  3. Build one real integration proof using VerseActionPopover and Dialog, not the synthetic harness.
  4. If Radix handles the scenarios, delete the ownership model. If not, add only the smallest per-root registry the failure proves necessary.

Keep the ADR findings, but label the contract “drafted,” not “proved.”

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.

4 participants