Skip to content

Graduate merged forwarded refs - #8548

Open
llastflowers wants to merge 9 commits into
mainfrom
remove/merged-forwarded-refs-flag
Open

llastflowers wants to merge 9 commits into
mainfrom
remove/merged-forwarded-refs-flag

Conversation

@llastflowers

@llastflowers llastflowers commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Part of https://github.com/github/primer/issues/7263

Changelog

New

  • None.

Changed

  • Components now always preserve forwarded refs while maintaining their internal refs.
  • AnchoredOverlay preserves anchor ref identity and refreshes merged overlay refs across rerenders.
  • UnderlinePanels applies the complete ref and keyboard props returned by useTabList.

Removed

  • Removed the primer_react_merged_forwarded_refs feature flag and its fallback paths.

Rollout strategy

  • No changes needed in github/github-ui
  • Needs changes in github/github-ui — after this is released, update @primer/react and remove the client feature flag allowlist entry before deleting the DevPortal flag.
  • Ships with feature flag(s)
  • Not sure
  • None

Testing & Reviewing

  • npm test -- --run
  • npm run type-check
  • npm run lint
  • npm run lint:css
  • npm run format:diff
  • npm run build

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: de5c3c24-5ce5-4887-b09b-888953781bde
@llastflowers
llastflowers requested a review from a team as a code owner October 14, 2026 20:01
@llastflowers
llastflowers requested review from tay1orjones and a balanced review from Copilot and removed request for Copilot October 14, 2026 20:01
@changeset-bot

changeset-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7b3007e

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

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

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

@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions
github-actions Bot temporarily deployed to storybook-preview-8548 October 14, 2026 20:11 Inactive
@llastflowers llastflowers added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Oct 15, 2026
Copilot AI balanced review requested due to automatic review settings October 15, 2026 16:39
@github-actions github-actions Bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Oct 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Cross-component ref lifecycle changes affect focus and positioning and warrant human confirmation without runtime validation.

0 open findings

What changed in this PR

Makes merged forwarded refs unconditional across Primer React, preserving consumer refs alongside internal component refs.

Changes:

  • Removes the merged-ref feature flag and fallback paths.
  • Updates anchor replacement tracking and applies complete tab-list props in UnderlinePanels.
  • Simplifies ref tests and adds a patch changeset.
File Description
packages/​react/​src/​TooltipV2/​Tooltip.tsx Always merges trigger and forwarded refs.
packages/​react/​src/​TooltipV2/​__tests__/​Tooltip.test.tsx Removes flag-dependent test variants.
packages/​react/​src/​TextInput/​TextInput.tsx Uses merged input refs unconditionally.
packages/​react/​src/​TextInput/​TextInput.test.tsx Simplifies forwarded-ref tests.
packages/​react/​src/​PageHeader/​PageHeader.tsx Preserves root and title refs without gating.
packages/​react/​src/​PageHeader/​PageHeader.test.tsx Simplifies forwarded-ref tests.
packages/​react/​src/​FilteredActionList/​FilteredActionList.tsx Always merges input and scroll-container refs.
packages/​react/​src/​FilteredActionList/​FilteredActionList.test.tsx Simplifies ref tests.
packages/​react/​src/​FeatureFlags/​DefaultFeatureFlags.ts Removes the merged-ref flag.
packages/​react/​src/​experimental/​UnderlinePanels/​UnderlinePanels.tsx Applies all returned tab-list props.
packages/​react/​src/​experimental/​Tabs/​useTabList.ts Always merges tab-list refs.
packages/​react/​src/​experimental/​Tabs/​Tabs.test.tsx Simplifies tab-list ref tests.
packages/​react/​src/​Dialog/​Dialog.tsx Uses merged autofocus-button refs unconditionally.
packages/​react/​src/​Dialog/​Dialog.test.tsx Removes flag variants from autofocus testing.
packages/​react/​src/​Checkbox/​Checkbox.tsx Always merges checkbox refs.
packages/​react/​src/​Checkbox/​Checkbox.test.tsx Simplifies forwarded-ref tests.
packages/​react/​src/​ButtonGroup/​ButtonGroup.tsx Always merges group refs.
packages/​react/​src/​ButtonGroup/​ButtonGroup.test.tsx Simplifies forwarded-ref tests.
packages/​react/​src/​AnchoredOverlay/​AnchoredOverlay.tsx Tracks anchor replacements and always merges overlay refs.
packages/​react/​src/​AnchoredOverlay/​AnchoredOverlay.test.tsx Simplifies overlay-ref tests.
packages/​react/​src/​ActionList/​List.tsx Always merges list refs.
packages/​react/​src/​ActionList/​ActionList.test.tsx Simplifies forwarded-ref tests.
.changeset/​merged-forwarded-refs.md Documents the ref-handling patch release.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions
github-actions Bot temporarily deployed to storybook-preview-8548 October 15, 2026 16:52 Inactive
@github-actions github-actions Bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Oct 15, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: de5c3c24-5ce5-4887-b09b-888953781bde

@tay1orjones tay1orjones left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, the CI tests on the integration PR look like flakes to me 🤔

@github-actions
github-actions Bot temporarily deployed to storybook-preview-8548 November 12, 2026 18:20 Inactive
@llastflowers llastflowers added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 12, 2026
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8548 November 12, 2026 21:08 Inactive
@github-actions github-actions Bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 12, 2026
@llastflowers
llastflowers marked this pull request as ready for review November 12, 2026 22:12
@primer-integration

primer-integration Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Integration test results from github/github-ui PR:

Waiting  Changes   Waiting
Passed  CI   Passed
Running  VRT   Running
Waiting  Projects   Waiting

This branch was successfully deployed

2 active deployments
storybook-preview-8548 — 7b3007e7 Deployed Nov 12, 2026 by github-actions[bot]
github-pages — 7b3007e7 Deployed Nov 12, 2026 by primer[bot] via deploy-preview #34247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: failing Changes in this PR cause breaking changes in gh/gh

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants