Skip to content

Fix: anchor-name not being set in Code with agent SelectPanel - #7707

Merged
liuliu-dev merged 33 commits into
mainfrom
liuliu/debug-logs
Apr 1, 2026
Merged

Fix: anchor-name not being set in Code with agent SelectPanel#7707
liuliu-dev merged 33 commits into
mainfrom
liuliu/debug-logs

Conversation

@liuliu-dev

@liuliu-devliuliu-dev commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Fixeshttps://github.com/github/primer/issues/6483

Changelog

New

Changed

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

Merge checklist

@changeset-bot

changeset-botBot commented Mar 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 50a19a9

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

This PR includes changesets to release 1 package
NameType
@primer/reactPatch

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-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Mar 27, 2026
@github-actions
github-actionsBottemporarily deployed to storybook-preview-7707 March 27, 2026 20:29 Inactive
Base automatically changed from tylerjdev/add-popover-support-css-anchor-positioning to mainMarch 30, 2026 16:39
@liuliu-devliuliu-dev removed the skip changeset This change does not need a changelog label Mar 31, 2026
@github-actions
github-actionsBottemporarily deployed to storybook-preview-7707 March 31, 2026 18:36 Inactive
@liuliu-dev
liuliu-dev marked this pull request as ready for review March 31, 2026 20:37
@liuliu-dev
liuliu-dev requested a review from a team as a code ownerMarch 31, 2026 20:37

CopilotAI 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.

Pull request overview

Fixes an issue where CSS Anchor Positioning (anchor-name) was not reliably applied to the anchor element when using SelectPanel (via AnchoredOverlay) in the Copilot code agent scenario, by ensuring the side effect re-runs when the overlay is opened.

Changes:

  • Re-run the anchor-name side effect on open changes to ensure the anchor gets updated when opening.
  • Add a patch changeset entry for @primer/react.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
packages/react/src/AnchoredOverlay/AnchoredOverlay.tsxUpdates effect dependencies so anchor-name is applied reliably when open toggles.
.changeset/bumpy-paws-end.mdAdds patch-level changeset describing the fix.

Comment on lines 268 to +272
if (overlay) {
overlay.style.removeProperty('position-anchor')
}
}
}, [cssAnchorPositioning, anchorRef, overlayRef, id])
}, [cssAnchorPositioning, anchorRef, overlayRef, id, open])

CopilotAIMar 31, 2026

Copy link

Choose a reason for hiding this comment

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

Consider adding a regression unit test for the scenario this fixes: when renderAnchor is null and the external anchorRef.current becomes non-null only after toggling open to true, anchor-name should be applied to the anchor element. AnchoredOverlay already has a dedicated test suite, so this behavior should be asserted to prevent future dependency-array regressions.

Copilot uses AI. Check for mistakes.
@liuliu-devliuliu-dev added the Canary Release Apply this label when you want CI to create a canary release of the current PR label Mar 31, 2026
@primer-integration

Copy link
Copy Markdown

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/17550

@primer-integration

Copy link
Copy Markdown

Integration test results from github/github-ui:

Passed CI  Passed
Passed VRT  Passed
Passed Projects  Passed

All checks passed!

@liuliu-dev
liuliu-dev added this pull request to the merge queueApr 1, 2026
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to failed status checks Apr 1, 2026
@liuliu-dev
liuliu-dev added this pull request to the merge queueApr 1, 2026
Merged via the queue into main with commit 6431bfeApr 1, 2026
83 of 84 checks passed
@liuliu-dev
liuliu-dev deleted the liuliu/debug-logs branch April 1, 2026 15:50
@primerprimerBot mentioned this pull request Apr 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Canary ReleaseApply this label when you want CI to create a canary release of the current PRintegration-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.

4 participants

@liuliu-dev@TylerJDev@francinelucca