Skip to content
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

Improvement: Centralized Default Position for Handle Panel: #42

Closed
Codehagen opened this issue Jan 5, 2024 · 7 comments · Fixed by #86
Closed

Improvement: Centralized Default Position for Handle Panel: #42

Codehagen opened this issue Jan 5, 2024 · 7 comments · Fixed by #86
Assignees
Labels
🐛 bug Something isn't working

Comments

@Codehagen
Copy link
Member

Title

Currently, the right handle panel is locked to the right side. The default position should be centered.

Improvement Description

The panel should be split, something like this picture on default.
image

Proposed Solution

We need to look at the documentation code to see what we can find. I think the picture down should guide is in the right direction.

Additional Context

Under you is screenshot from Shadcn and our project

Shadcn:
image

Our application:
image

Under you can see the diffrence from Shadcn code and our. Im getting a error message for this:
image

@Codehagen
Copy link
Member Author

Was this what we where talking about @JamesSingleton 👀

@JamesSingleton
Copy link
Contributor

@meglerhagen yea, the error you're getting on the onCollapse is because this project is using the 1.x of the react resizable library whereas ShadCN expects you to use 0.55. But someone closed the original issue: #24

But also the direct middle is going to be different for every screen size, so it might be better to just determine how wide you want them. https://github.com/bvaughn/react-resizable-panels/blob/main/packages/react-resizable-panels/README.md#panel

Also, it looks like there is a defaultSizePercentage prop that can be passed to the panel according to the docs.

@Codehagen
Copy link
Member Author

I have tried, and tried @JamesSingleton . Maybe im dumb, but cant get this to work 🍅

@Codehagen Codehagen added 🐛 bug Something isn't working and removed enhancement labels Jan 23, 2024
@miralsuthar
Copy link
Contributor

I would like to work on this

@Codehagen
Copy link
Member Author

Go insane @miralsuthar ✨ 😄

@miralsuthar
Copy link
Contributor

Hey @meglerhagen,

Just a doubt, like on what basis this deafaultLayout are given for the default size of Resizable panels ?

image

I saw the documentation and there it says that value should be between 1 - 100.

@Codehagen
Copy link
Member Author

The values is from a project that was before, i think this is changed. You can just experiment and see if it works. Thats my main concern right now. Thanks for the comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants