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

Use shadcn/ui built-in check for sidebar state #72

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

Conversation

JoeyMckenzie
Copy link
Contributor

Shadcn includes built-in functionality to determine the sidebar state via cookie, so the local component logic utilizing local storage is unnecessary. This is a very minor change and not necessarily a fix, so I'm okay with this going by the wayside as well if we see no functional value in it.

Just wanted to bring it up. Depending on the user's local environment setup, they could see warnings about hydrated content mismatch in the dev console that can be traceable to the typeof window !== 'undefined' logic in the app-shell.tsx shell.

@tnylea
Copy link
Contributor

tnylea commented Mar 7, 2025

Hey @JoeyMckenzie,

Thanks. I really like this technique. When the sidebar is collapsed on SSR, you'll see a flicker of the sidebar open and then collapse, which is not a very good UX. Let me do a little more testing on my end with this and then I can approve it if everything else looks good 👍

Copy link
Contributor

@tnylea tnylea left a comment

Choose a reason for hiding this comment

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

This is excellent @JoeyMckenzie 👏

Just verified that this fixes that flicker of the sidebar when viewing SSR.

Would you mind re-creating this PR in the Vue Starter kit as well. let me know if that's possible and we'll work on getting this one merged in 😉

@tnylea tnylea added the Approved Approved for Merge label Mar 10, 2025
@JoeyMckenzie
Copy link
Contributor Author

@tnylea Absolutely, no problem. I'll queue up the change a little later today.

Happy to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Approved for Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants