Skip to content

Conversation

JoeyMckenzie
Copy link
Contributor

@JoeyMckenzie JoeyMckenzie commented Mar 10, 2025

Shadcn includes built-in functionality to determine the sidebar state via cookie, so the local component logic utilizing local storage is unnecessary. I've also renamed the cookie name in utils.ts to reflect what's in the documentation.

This change is the Vue version of the same change being made to the React starter kit.

@tnylea
Copy link
Contributor

tnylea commented Mar 19, 2025

Looks great! Thanks @JoeyMckenzie.

@tnylea tnylea added the Approved Approved for merge label Mar 19, 2025
@stephenhowells
Copy link

stephenhowells commented Mar 29, 2025

Small issue on this one. The Laravel starter kit default behavior is for the sidebar to be open the first time the user loads the page. This PR would collapse it by default. In order to keep the existing behavior the HandleInertiaRequests middleware edit should be:

'sidebarOpen' => ! $request->hasCookie('sidebar_state') || $request->cookie('sidebar_state') === 'true',

Otherwise, awesome PR!

@tnylea
Copy link
Contributor

tnylea commented Mar 31, 2025

@stephenhowells Good catch. I've went ahead and made that update so that way the sidebar is open by default 👏

@taylorotwell taylorotwell merged commit 0e9664e into laravel:main Apr 1, 2025
2 checks passed
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.

4 participants