← Back to Pull requests

feat(bulma-ui): export Portal #861

Open
unknown opened this pull request with 223 lines diff across 2 files
View on GitHub
unknown unknown commented on Oct 02, 2026 01:29 UTC
Author

Part of #772.

An app building its own overlay had to wire createPortal itself, plus a guard for the server render, which has nothing to put in it. Portal renders its children into document.body, or into an element or selector passed as container, through the resolvePortalContainer that Modal and Toast already use. It renders nothing on the server and during hydration, so the first client render matches. disabled renders in place, for a component that portals only sometimes.

  • The component lives in helpers/portal.tsx beside the resolver, renamed from portal.ts: a Portal.tsx next to portal.ts resolved to the wrong file on a case-insensitive filesystem. Modal's and Toast's imports are unchanged.

  • A selector container is looked up on each render, so content follows a target that changes. Moving to another target remounts the children, and the TSDoc, the props table and the page all say so.

  • The TSDoc and the page also say that context reaches portaled children while CSS inheritance (a scoped Theme) doesn't, and that a focus trap doesn't cover what a Portal inside it renders.
  • Tests cover each kind of target, disabled, unmounting, context and event bubbling, a real server render and hydration without a mismatch warning. There's a story and a helper page. The matrix now credits the Portal row, and the custom-component skill says to reach for Portal rather than createPortal.

    Modal, Dialog, Toast, Notification, Sidebar and the pickers keep their own portal code here and move onto Portal one at a time later.

    This is one of three PRs split out of #851, alongside ClientOnly and useFocusTrap. They share the index.ts export block, PUBLIC_EXPORTS, the comparison data and the generated files.

    pnpm all passes locally.

    Diff: 223 lines (+167 / -56) across 2 files Reviewer: claude[bot] Review duration: 24m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.37) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 223 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.324
    Real PR Conversation Timeline
    1 comments
    "Review active on #861"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.8% (MEDIUM) · Higher = larger blast radius
    36.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21% · Safe to merge
    21%