feat(context-selector): default topLayer to true for portal-safe rendering - #3314
Draft
chdefrene wants to merge 4 commits into
Draft
feat(context-selector): default topLayer to true for portal-safe rendering#3314chdefrene wants to merge 4 commits into
chdefrene wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: 9929fd3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
chdefrene
marked this pull request as draft
July 27, 2026 07:44
…ering Context selector results are portal-owned UI that must render above whatever stacking context a hosting Fusion app happens to create, without app teams managing z-index. This is the React/shared-component half of the low-level topLayer property added to fwc-searchable-dropdown in equinor/fusion-web-components#2368 (tracked by equinor/fusion-core-tasks#1428). - ContextSelector (and, transitively, ContextSearch) now default the underlying topLayer prop to true, so results render in the browser's top layer via the Popover API. Callers can still pass topLayer={false} to opt back out - the existing prop surface already supports overriding it. - @equinor/fusion-react-searchable-dropdown's generic Dropdown/ SearchableDropdown keep their default (topLayer=false), only gaining typed pass-through support for the new prop. - Adds a temporary, clearly-documented ambient type augmentation (wc-searchable-dropdown.d.ts in both packages) so topLayer type-checks today. @equinor/fusion-wc-searchable-dropdown@4.2.0 (the expected minor release carrying this feature) is not yet published, so the dependency range is intentionally left at the existing ^4.1.1 (which already permits 4.2.0 once released - bumping it now would break bun install entirely). Setting topLayer against the currently installed 4.1.3 build is a harmless no-op; no further code changes are needed once the dependency updates - only delete the augmentation files. - Updates READMEs and Storybook (context-selector.stories.tsx/.mdx) to document the new default and the override. - Adds changesets (minor) for @equinor/fusion-react-context-selector and @equinor/fusion-react-searchable-dropdown. Refs equinor/fusion-web-components#2368 Refs equinor/fusion-core-tasks#1428 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
chdefrene
force-pushed
the
chdefrene-context-selector-top-layer-default
branch
from
July 27, 2026 07:45
0cc9482 to
0be5805
Compare
Mirror the searchable-dropdown stacking-context demo so the context selector story clearly shows the result list either behind the z-index overlay with topLayer disabled or above it when enabled from Storybook controls. Refs equinor/fusion-web-components#2368 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Undo unrelated quote changes from the repository's standalone Prettier defaults so the overlay story remains a focused diff. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mirror the web-component stacking-context demo with a z-index overlay directly below the generic searchable dropdown. Keep topLayer disabled by default and allow Storybook controls to compare both rendering modes. Refs equinor/fusion-web-components#2368 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Component Development
Type
Reference to assignment
Refs equinor/fusion-core-tasks#1428
Refs equinor/fusion-web-components#2368 (coordinated PR adding the underlying
topLayerproperty to@equinor/fusion-wc-searchable-dropdown)Description of assignment
Context selector results are portal-owned UI that must render above whatever stacking context a hosting Fusion app happens to create, without app teams having to manage z-index themselves.
equinor/fusion-web-components#2368adds an opt-in, booleantopLayerproperty (defaultfalse, reflected astop-layer) to@equinor/fusion-wc-searchable-dropdownthat renders the dropdown popover via the native Popover API / browser top layer, falling back to current behavior when unsupported. This PR is the React/shared-component half: it makes@equinor/fusion-react-context-selectorenable that behavior by default, while leaving the generic@equinor/fusion-react-searchable-dropdownpackage's default unchanged.Description of Proposed Changes
@equinor/fusion-react-context-selector:ContextSelector(and, transitively,ContextSearch, which forwards unrecognized props) now defaultstopLayertotrue. Consumers can still explicitly passtopLayer={false}to opt back out — the existing prop surface already supports overriding it, no new API was introduced for this.@equinor/fusion-react-searchable-dropdown: no behavioral change.Dropdown/SearchableDropdownkeep their generic default (topLayerunset/false), only gaining typed pass-through support for the new prop.wc-searchable-dropdown.d.tsin bothpackages/searchable-dropdown/srcandpackages/context-selector/src— duplicated because this monorepo's TS project references don't propagate ambient augmentations across referenced projects): typestopLayeronSearchableDropdownProps/SearchableDropdownElementtoday, ahead of the real upstream release. Heavily documented as temporary and safe to delete once the real dependency ships.@equinor/fusion-wc-searchable-dropdown's changeset in fusion-web-components#2368 isminorfrom the current published4.1.3, so the expected next release is4.2.0— not yet published (verified vianpm view @equinor/fusion-wc-searchable-dropdown versions). The dependency range in bothpackage.jsonfiles is intentionally left at^4.1.1, which already permits4.2.0once published; explicitly bumping to^4.2.0today breaksbun installfor the whole workspace since that version doesn't exist yet (verified). Nobun.lockchanges were needed as a result.@equinor/fusion-wc-searchable-dropdownprop-forwarding (extractElementPropsinpackages/utils) inspects the actual runtime prototype of the installed custom element class, not TypeScript types. Against the currently-installed4.1.3(which lackstopLayer), settingtopLayeris a harmless no-op — it's treated as an unrecognized attribute. Once4.2.0+ is installed, the exact same code starts rendering via the top layer with no further code changes required — only delete the two temporary.d.tsfiles.packages/context-selector/README.mdandpackages/searchable-dropdown/README.mdwith new sections explaining the default/opt-in behavior, override syntax, and the no-op caveat.ContextHeaderTopLayerDisabledstory and docs section. The story mirrors fusion-web-components#2368 with a transformed stacking-context container and az-index: 999overlay directly below the input, so togglingtopLayerin Controls visibly demonstrates the result list moving above the overlay.@equinor/fusion-react-context-selectorand@equinor/fusion-react-searchable-dropdown.Validation
bun run build— full monorepo (21 packages) builds cleanly, including both touched packages.bun run storybook:build— Storybook production bundle builds successfully with the overlay story.bunx biome check— clean on all new/changed.ts/.tsxfiles covered by the repository Biome configuration.bunx changeset status— correctly reports minor bumps for both packages.tsc -bhas pre-existing, unrelated TS errors across several packages; confirmed viagit stashcomparison that the exact same error set exists with and without this change (zero new errors introduced).bun run lint(biome, whole repo) — the ~40 warnings surfaced are all in pre-existing, unrelated files (e.g.scripts/publish.js); zero warnings in files touched by this change.Known blocker / follow-up
@equinor/fusion-wc-searchable-dropdown@4.2.0, so the temporary ambient augmentations can be removed, the real dependency explicitly installed, and top-layer behavior validated against the published package.Checklist
Development
Create Pull Request
Publish Code
Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com