Badget icon indicating copy to clipboard operation
Badget copied to clipboard

Improvement: Centralized Default Position for Handle Panel:

Open Codehagen opened this issue 1 year ago • 7 comments

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 avatar Jan 05 '24 05:01 Codehagen

Was this what we where talking about @JamesSingleton 👀

Codehagen avatar Jan 05 '24 05:01 Codehagen

@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: https://github.com/meglerhagen/projectx/issues/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.

JamesSingleton avatar Jan 05 '24 15:01 JamesSingleton

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

Codehagen avatar Jan 23 '24 12:01 Codehagen

I would like to work on this

miralsuthar avatar Jan 23 '24 14:01 miralsuthar

Go insane @miralsuthar ✨ 😄

Codehagen avatar Jan 23 '24 19:01 Codehagen

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.

miralsuthar avatar Jan 24 '24 05:01 miralsuthar

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.

Codehagen avatar Jan 24 '24 05:01 Codehagen