Skip to content

Conversation

@mattcosta7
Copy link
Contributor

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 Nov 26, 2025

⚠️ No Changeset found

Latest commit: 17c078f

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 Nov 26, 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.

Comment on lines 195 to -201
React.useEffect(() => {
stableOnDrag.current = onDrag
}, [onDrag])
})

React.useEffect(() => {
stableOnDragEnd.current = onDragEnd
}, [onDragEnd])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

assignment is cheaper than comparison for these

}

/**
* Batches numeric updates so that only a single callback runs per animation frame.
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

* Batches numeric updates so that only a single callback runs per animation frame.
* Falls back to synchronous updates when the DOM is not available (SSR/tests).
*/
function useRafAccumulator(applyDelta: (delta: number) => void): RafAccumulatorControls {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this something we could extract from this component and maybe use as a pattern in other cases similar to this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep - leaving here to minimize the files I needed to copy for now!

stableOnDragEnd.current?.()
event.preventDefault()
}
// TODO: Support touch events
Copy link
Contributor

Choose a reason for hiding this comment

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

is this todo still relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah - I think it will need to be moved though!


if (persist) {
try {
localStorage.setItem(widthStorageKey, resolvedWidth.toString())
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: could we look into IndexedDB here? I recall @JasonMore saying that it would be faster :)

@mattcosta7
Copy link
Contributor Author

@copilot can we further improve performance here by using element.SetPoinyerCapture /release pointer on start/stop for dragging by mouse. If we do this we can probably avoid a user-select none override on. Body * and just handle that here since the drag element will own the pointer, right?

Can we also set a transform instead of width updates while dragging and only commit the width at the end of the drag to avoid document reflowing

Copy link
Contributor

Copilot AI commented Nov 27, 2025

@mattcosta7 I've opened a new pull request, #7249, to work on those changes. Once the pull request is ready, I'll request review from you.

@mattcosta7
Copy link
Contributor Author

moving this PR to #7251

@mattcosta7 mattcosta7 closed this Dec 1, 2025
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.

3 participants