-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add resizable support to the <PageLayout>
component
#2352
Conversation
🦋 Changeset detectedLatest commit: 6edaf11 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
size-limit report 📦
|
a687cc1
to
dacf38d
Compare
This is looking great, @japf! 💖 I was poking around in the storybook and noticed that the pane width seems to "jump" when you start dragging. Any ideas why this might be happening? CleanShot.2022-09-20.at.09.25.36.mp4I see this PR is marked as "work in progress" so feel free to ignore if this is a known issue :) |
👋 @colebemis I pushed a few fixes, feel free to have another look. Please let me know what you think is missing to mark the PR as ready for review. I guess I should update the docs? Edit: there is an issue with the positioning of the divider, I'll look into that. |
f5d2fe9
to
9a7b498
Compare
@colebemis updated again, please have another look 😄 |
@japf this is looking great! @joshblack is going to take the lead on code review. He'll be your point-of-contact for any questions you have :) |
Looking great! 🥳 Thanks so much for taking this on 🙏 Just wanted to leave some notes/questions on behavior since I wasn't sure what was expected
Sorry for the long list here! Just wanted to say thanks again for taking this on and let me know if you have any questions or if I'm missing anything! |
Just a note that our new code view is getting feedback that our file tree is too narrow when searching for files (goto file). This resizing will solve that problem for us! Cant wait for this to get to production! |
👋 @japf FYI I'm going to work on getting this over the finish line today. Planning to polish some of the interactions and styling. |
useEffect(() => { | ||
let hasValue = false | ||
if (storageKey) { | ||
const storedWidth = window.localStorage.getItem(storageKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @mattcosta7 pointed out in https://github.com/github/issues/issues/3652 we might want to use a wrapped around the localStorage
call to avoid throwing an error for folks who disabled 3rd party tracking in their browser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. Updated ✅
* Update stories * Refactor resizable pane implementation * Clamp pane width resizing * Delay drag hover effect * Reset pane width on double click * Handle styles while dragging * Add resizable example to SplitPageLayout docs * Remove comment * Add comment about touch events * Update docs * Update resizable pane story * Update snapshots
Update: I finished addressing @joshblack's comments. Here's a quick video demo: https://share.cleanshot.com/imPRk8 This should be ready for another round of review. cc @joshblack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Noticed a couple odd behaviors when testing in Safari and Firefox, curious if you know what's going on @colebemis 🤔
Safari
Screen.Recording.2022-10-27.at.4.20.04.PM.mov
Firefox
Screen.Recording.2022-10-27.at.4.21.11.PM.mov
@joshblack I think those odd behaviors are related to how we set the max width of the pane. The max width of the pane is relative to the entire viewport size ( |
@joshblack I'm open to new ideas about how to handle min/max pane width if you have any! Here's the spec from @vdepizzol: https://github.com/github/primer/issues/581 |
Describe your changes here.
This PR adds resizable support to the
<PageLayout>
component.Screenshots
Please provide before/after screenshots for any visual changes
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.