Affected Apps / Packages
Studio (apps/studio)
Description
When a user is not logged in (e.g., running in local-only builder mode), the useUserStore has a user value of null. However, the sidebar's AccountMenu still renders and lists options that require an active cloud account: "Profile" (which routes to the auth-required /profile page) and "Logout" (which calls auth logout services). Additionally, there is no option in the menu or sidebar for a logged-out user to "Log In" or "Connect Account", forcing them to manually type /login in the URL bar.
- Branch Name: fix/studio-auth-account-menu
- PR Title: [Fix] [Studio]: hide auth-only actions in account menu for anonymous users
Steps to Reproduce
- Open the Studio application without logging in (or log out if logged in).
- Click on the account menu button at the bottom of the sidebar (labeled "Local builder").
- Observe that the menu dropdown displays "Profile", "Light/Dark mode", and "Logout".
- Notice the lack of any "Log In" or "Sign Up" button.
- Click "Profile" and observe it navigates to
/profile but shows empty/unauthenticated fields.
Expected Behavior
If a user is logged out:
- The
AccountMenu button should show a "Connect Account" or "Sign In" option.
- Clicking the menu should show "Sign In" (routing to
/login) and the "Light/Dark mode" toggle.
- "Profile", "Settings", and "Logout" should be hidden.
Environment Information
- App:
@veriworkly/studio
- OS: Windows / macOS / Linux
- Browser: Chrome / Firefox / Safari / Edge
- Node.js: 20.x
Relevant Logs
No response
Proposed Fix / Suggestions
- Update
StudioShell.tsx to retrieve isLoggedIn from useUserStore.
- Pass
isLoggedIn to AccountMenu.
- In
AccountMenu.tsx, conditionally render the menu items:
- If
isLoggedIn is false, hide "Profile", "Settings", and "Logout", and instead display a "Sign In" item with a login icon routing to /login.
- Change the sidebar trigger button to clearly read "Sign in to sync" or similar if collapsed is false.
Affected Apps / Packages
Studio (apps/studio)
Description
When a user is not logged in (e.g., running in local-only builder mode), the
useUserStorehas auservalue ofnull. However, the sidebar'sAccountMenustill renders and lists options that require an active cloud account: "Profile" (which routes to the auth-required/profilepage) and "Logout" (which calls auth logout services). Additionally, there is no option in the menu or sidebar for a logged-out user to "Log In" or "Connect Account", forcing them to manually type/loginin the URL bar.Steps to Reproduce
/profilebut shows empty/unauthenticated fields.Expected Behavior
If a user is logged out:
AccountMenubutton should show a "Connect Account" or "Sign In" option./login) and the "Light/Dark mode" toggle.Environment Information
@veriworkly/studioRelevant Logs
No response
Proposed Fix / Suggestions
StudioShell.tsxto retrieveisLoggedInfromuseUserStore.isLoggedIntoAccountMenu.AccountMenu.tsx, conditionally render the menu items:isLoggedInis false, hide "Profile", "Settings", and "Logout", and instead display a "Sign In" item with a login icon routing to/login.