Skip to content

feat(sidebar): open sidebar automatically after onboarding completion#1961

Merged
adboio merged 1 commit intomainfrom
posthog-code/show-sidebar-by-default-after-onboarding
Apr 30, 2026
Merged

feat(sidebar): open sidebar automatically after onboarding completion#1961
adboio merged 1 commit intomainfrom
posthog-code/show-sidebar-by-default-after-onboarding

Conversation

@adboio
Copy link
Copy Markdown
Contributor

@adboio adboio commented Apr 30, 2026

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

Generated-By: PostHog Code
Task-Id: a6ac13a7-5e32-4d39-ac72-1850b59bb9a0
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 30, 2026

Reviews (1): Last reviewed commit: "feat(sidebar): open sidebar automaticall..." | Re-trigger Greptile

Comment on lines +10 to +12
const hasCompletedOnboarding = useOnboardingStore(
(state) => state.hasCompletedOnboarding,
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When is 'hasCompletedOnboarding' set to true ?

@adboio adboio requested a review from a team April 30, 2026 21:13
@adboio adboio merged commit 94cfe39 into main Apr 30, 2026
15 checks passed
@adboio adboio deleted the posthog-code/show-sidebar-by-default-after-onboarding branch April 30, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants