Commit 94cfe39
authored
feat(sidebar): open sidebar automatically after onboarding completion (#1961)
## TL;DR
The sidebar now opens automatically when users complete onboarding, improving the post-onboarding experience by showing the sidebar by default alongside the existing behavior of opening it when workspaces exist.
## Problem
After completing onboarding, users would not see the sidebar opened automatically, requiring them to manually open it. This creates a suboptimal user experience for newly onboarded users.
## Changes
- Added `useOnboardingStore` import to access onboarding completion state in `MainSidebar` component
- Updated the sidebar auto-open logic to consider both onboarding completion status and workspace count
- Modified `setOpenAuto` call to open the sidebar when either:
- User has completed onboarding, OR
- User has existing workspaces (existing behavior)
- Added `hasCompletedOnboarding` to the dependency array of the `useEffect` hook to ensure proper reactivity
## How did you test this?
This change integrates with existing onboarding and sidebar state management. The logic ensures backward compatibility by maintaining the original behavior of opening the sidebar when workspaces exist, while adding the new condition for onboarding completion.
## Publish to changelog?
no
---
_Created with_ [_PostHog Code_](https://posthog.com/code?ref=pr)1 parent 8941040 commit 94cfe39
1 file changed
Lines changed: 6 additions & 2 deletions
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | | - | |
| 18 | + | |
15 | 19 | | |
16 | | - | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
0 commit comments