Skip to content

Conversation

@mattcosta7
Copy link
Contributor

@mattcosta7 mattcosta7 commented Dec 12, 2025

related to https://github.com/github/pull-requests/issues/21237
Closes #

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
Copy link

changeset-bot bot commented Dec 12, 2025

⚠️ No Changeset found

Latest commit: 6914dd2

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

@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 Dec 12, 2025
@github-actions
Copy link
Contributor

👋 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. Or, apply the integration-tests: skipped manually label to skip these checks.

@mattcosta7 mattcosta7 self-assigned this Dec 12, 2025
@mattcosta7 mattcosta7 requested a review from Copilot December 12, 2025 19:14
@github-actions github-actions bot requested a deployment to storybook-preview-7310 December 12, 2025 19:16 Abandoned
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes the PageLayout pane resize handling by implementing a two-stage approach: throttled CSS variable updates (16ms) for immediate visual feedback during resize, and debounced synchronization (150ms) of refs, ARIA attributes, and React state when resizing stops. The changes improve performance by reducing expensive operations (getComputedStyle calls, React re-renders) while maintaining visual responsiveness.

Key Changes

  • Separated CSS updates from state synchronization for better resize performance
  • Added requestAnimationFrame-based throttling for smooth 60fps CSS updates
  • Used React 18's startTransition for non-urgent state updates (maxPaneWidth)
  • Added comprehensive test coverage for the new throttle/debounce logic

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/react/src/PageLayout/usePaneWidth.ts Refactored resize handler to use separate updateCSSOnly (throttled) and syncAll (debounced) functions; added startTransition for maxPaneWidth updates; improved performance by limiting getComputedStyle calls to breakpoint crossings
packages/react/src/PageLayout/usePaneWidth.test.ts Added comprehensive tests for throttled CSS updates, debounced ARIA/state sync, viewport clamping, and cleanup behavior; reorganized existing resize listener tests for clarity
packages/react/src/PageLayout/PageLayout.tsx Added safety clamp to handle edge case where user starts dragging before debounced resize completes
packages/react/src/PageLayout/PageLayout.module.css Added documentation comment explaining that --pane-max-width CSS variable is managed by JavaScript

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions github-actions bot temporarily deployed to storybook-preview-7310 December 12, 2025 19:26 Inactive
@primer-integration
Copy link

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

@primer-integration
Copy link

🔬 github-ui Integration Test Results

Check Status Details
CI ✅ Passed View run
Projects (Memex) ⏳ Pending Waiting for workflow to complete
VRT ✅ Passed View run

@mattcosta7 mattcosta7 marked this pull request as ready for review December 12, 2025 21:07
@mattcosta7 mattcosta7 requested a review from a team as a code owner December 12, 2025 21:07
@mattcosta7 mattcosta7 requested a review from TylerJDev December 12, 2025 21:07
@mattcosta7 mattcosta7 merged commit 09eda58 into revert-7305-revert-7275-revert-7274-revert-7251-mc/copilot/sub-pr-7248 Dec 12, 2025
48 of 50 checks passed
@mattcosta7 mattcosta7 deleted the test-resize-improvement branch December 12, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This 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