Skip to content

chore: add portal context with comprehensive tests - #6816

Merged
francinelucca merged 2 commits into
chore/add-portal-contextfrom
copilot/stack-pr-6815
Sep 9, 2025
Merged

chore: add portal context with comprehensive tests#6816
francinelucca merged 2 commits into
chore/add-portal-contextfrom
copilot/stack-pr-6815

Conversation

CopilotAI commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

Closes #

This PR adds PortalContext functionality to the Portal component and includes comprehensive test coverage to ensure proper behavior.

Changes Made

  • PortalContext Integration: Fixed useContext hook call in Portal component to be at component level instead of inside useLayoutEffect (following React hooks rules)
  • Enhanced Portal Logic: Updated Portal logic to ensure default portal is created when using default container name from context
  • Comprehensive Test Coverage: Added tests to verify:
    • Elements render correctly inside custom Portal when PortalContext is supplied with portalContainerName
    • Elements render in default portal when PortalContext doesn't specify portalContainerName
    • Elements render in default portal when PortalContext portalContainerName is undefined
    • Portal containerName prop correctly overrides PortalContext portalContainerName

Changelog

New

  • Added comprehensive test coverage for PortalContext functionality

Changed

  • Fixed Portal component hook usage to follow React rules of hooks
  • Enhanced Portal default container logic for better context integration

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

All Portal tests are now passing (9/9) including the new comprehensive test coverage for PortalContext functionality.

Merge checklist


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

CopilotAI mentioned this pull request Sep 9, 2025
13 tasks
@changeset-bot

changeset-botBot commented Sep 9, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 288b4e3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

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

Click here to learn what changesets are, and how to add one.

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

Co-authored-by: francinelucca <40550942+francinelucca@users.noreply.github.com>
CopilotAI changed the title [WIP] chore: address feedback by adding tests for PortalContext renderingchore: add portal context with comprehensive testsSep 9, 2025
@francinelucca
francinelucca marked this pull request as ready for review September 9, 2025 23:22
@francinelucca
francinelucca requested a review from a team as a code ownerSeptember 9, 2025 23:22
@francinelucca
francinelucca merged commit b221f84 into chore/add-portal-contextSep 9, 2025
18 of 53 checks passed
@francinelucca
francinelucca deleted the copilot/stack-pr-6815 branch September 9, 2025 23:22
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Sep 9, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommendedThis change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@francinelucca