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

feat: Revamping Sidebar #1162

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

JeevaRamanathan
Copy link
Contributor

@JeevaRamanathan JeevaRamanathan commented Oct 20, 2024

{/* Sidebar component, swap this element with another sidebar if you like */}

Hi @mfts,
Since ShadCN introduced the sidebar component two days ago, I thought of revamping the current sidebar using ShadCN's component. I would like to get your input on this.

Here’s a preview of how it looks:
image
Mobile View:
image

Copy link

vercel bot commented Oct 20, 2024

@JeevaRamanathan is attempting to deploy a commit to the mftsio Team on Vercel.

A member of the Team first needs to authorize it.

@mfts
Copy link
Owner

mfts commented Oct 20, 2024

@JeevaRamanathan nice. I was hoping someone would add Shadcn sidebar :)

@JeevaRamanathan
Copy link
Contributor Author

@mfts I would like to get your input on this.
Do you prefer keeping the sidebar icons visible when it’s closed, or would you rather have a full-screen version like this example from ShadCN: https://ui.shadcn.com/blocks/default/sidebar-05 and kindly let me know if you have any other inputs or suggestions.

@mfts
Copy link
Owner

mfts commented Oct 20, 2024

@JeevaRamanathan

Do you prefer keeping the sidebar icons visible when it’s closed

Yes it would be great if the icons would still be visible when closed.

@mfts
Copy link
Owner

mfts commented Oct 22, 2024

@JeevaRamanathan let me know when you want me to start reviewing this PR or have questions :)

@JeevaRamanathan
Copy link
Contributor Author

JeevaRamanathan commented Oct 22, 2024

Hi @mfts,
Sorry for the delay, was in the middle of something :)

I have removed the commented lines of the previous sidebar along with few changes. I also noticed the visitor option was added, and I have included that as well and resolved the henceforth conflict.
I can say it's ready for review now, but there are two things to note:

  1. Currently, the sidebar is not controlled (i.e., when switching pages, it returns to its default open/close state—I will be looking into that).
  2. Adding this sidebar creates multiple scroll bars, including one in the AppLayout (here). While adding overflow-hidden removes the extra scroll bars, it makes the items partially hidden at the bottom. Your input on this would be helpful.

Edit:
For 2, I have moved the trigger within the container with a separator which solved this issue. Please have a look and let know on any changes.

23.10.2024_02.51.14_REC.mp4

Signed-off-by: JeevaRamanathan <[email protected]>
Signed-off-by: JeevaRamanathan <[email protected]>
Signed-off-by: JeevaRamanathan <[email protected]>
Signed-off-by: JeevaRamanathan <[email protected]>
@JeevaRamanathan JeevaRamanathan marked this pull request as ready for review October 23, 2024 05:56
@JeevaRamanathan JeevaRamanathan requested a review from mfts as a code owner October 23, 2024 05:56
@JeevaRamanathan
Copy link
Contributor Author

JeevaRamanathan commented Oct 27, 2024

Hi @mfts,
Finally, the sidebar controlled state issue was resolved with help from this X thread, and it’s now working locally. However, the changes also involve updates in ui/sidebar.tsx. Since a PR might eventually be proposed to ShadCN by the thread author involving changes to ui/sidebar.tsx, I made updates in that file locally as well to get it working based on the thread. So can we address this as a separate issue after this PR merged to avoid any potential clash once the sidebar is updated in ShadCN.

Your thoughts on this please?

Copy link
Owner

@mfts mfts left a comment

Choose a reason for hiding this comment

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

@JeevaRamanathan great progress.

I think the collapsible icon should be on the sidebar itself, not on the main div.

the icons and font of the items are one size too small

On mobile, the navbar should contain the collabsible buttons (which is does) and the user dropdown, which it used to but not longer.

Remove the P icon next to Papermark, because there's no space for the plan name

CleanShot 2024-10-29 at 12 45 31@2x

CleanShot 2024-10-29 at 12 48 21@2x

hooks/use-mobile.tsx Show resolved Hide resolved
tailwind.config.js Show resolved Hide resolved
@mfts mfts added revisit Currently not required but important in the future 🕹️ oss.gg iteration-1 labels Oct 29, 2024
@JeevaRamanathan
Copy link
Contributor Author

JeevaRamanathan commented Oct 29, 2024

Hi @mfts, I have a question on one section

I think the collapsible icon should be on the sidebar itself, not on the main div.

I felt placing the icon separately from the sidebar might provide more clarity, as the sidebar already contains the title, and combining them could make it feel cluttered. Here’s a similar approach used in ShadCN’s sidebar example, where the trigger is in the main div: Sidebar example and documentation.

the icons and font of the items are one size too small

Got it! I’ll check on this

and the user dropdown, which it used to but not longer.

I’m not sure I completely understood this part. Could you clarify? Are you suggesting that the user dropdown should be removed from the sidebar on mobile view, possibly moving it to the highlighted rounded area on the right side like now?

Remove the P icon next to Papermark, because there's no space for the plan name

Understood! I’ll remove the icon when the sidebar is expanded, and I’ll keep it when it’s collapsed to avoid leaving an empty space.

@JeevaRamanathan
Copy link
Contributor Author

JeevaRamanathan commented Oct 29, 2024

Hi @mfts, Can you please review the changes

  1. Removed the P icon when sidebar is open.
  2. Added back the comments in tailwind.config.js
  3. Moved the user dropdown to top in mobile view.
  4. The font size remains the same as before, but the icon size was smaller than specified. This appears to be a bug in the shadcn sidebar: [bug]: Sidebar icon size is not taken in consideration. Implemented a temporary workaround with custom CSS and made a minor change in ui/sidebar.tsx to fix that.

Could you please take a look and let me know if any changes are needed?

Thanks!

@mfts
Copy link
Owner

mfts commented Oct 31, 2024

@JeevaRamanathan

I felt placing the icon separately from the sidebar might provide more clarity, as the sidebar already contains the title, and combining them could make it feel cluttered. Here’s a similar approach used in ShadCN’s sidebar example, where the trigger is in the main div: Sidebar example and documentation.

I agree.
However, I don't love how it's currently solved. We are wasting a lot of space on top.

I think the https://ui.shadcn.com/blocks#sidebar-07 should be our role model
CleanShot 2024-10-31 at 13 27 14@2x

  • Let's keep Papermark at the top.
  • move the plan into the dropdown team picker.
  • maybe we can even use a nicer dropdown or whatever shadcn block uses here

CleanShot 2024-10-31 at 13 28 43@2x
CleanShot 2024-10-31 at 13 32 47@2x
CleanShot 2024-10-31 at 13 33 15@2x

I also like these collapsibles to reveal more settings
CleanShot 2024-10-31 at 13 37 30@2x

@mfts
Copy link
Owner

mfts commented Oct 31, 2024

I'm awarding you now but I'd love for you to continue with this sidebar so we can get it merged :)

/award 750

Copy link

oss-gg bot commented Oct 31, 2024

Awarding JeevaRamanathan: 750 points 🕹️ Well done! Check out your new contribution on oss.gg/JeevaRamanathan

@mfts mfts added the awarded label Oct 31, 2024
Signed-off-by: JeevaRamanathan <[email protected]>
Signed-off-by: JeevaRamanathan <[email protected]>
Signed-off-by: JeevaRamanathan <[email protected]>
Signed-off-by: JeevaRamanathan <[email protected]>
@JeevaRamanathan
Copy link
Contributor Author

Hi @mfts,

  • Let's keep Papermark at the top.
  • move the plan into the dropdown team picker.
  • maybe we can even use a nicer dropdown or whatever shadcn block uses here

I have made these changes similar to sidebar-07.

I also like these collapsibles to reveal more settings

We already have branding as a separate option within the settings screen. Should we move the branding section into the collapsible settings as well to reveal more options?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awarded iteration-2 🕹️ oss.gg revisit Currently not required but important in the future
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants