Skip to content

feat: Toolbar v2: Unauth flow inside the EdgeLayout #310

Merged
ryan953 merged 15 commits intomainfrom
ryan953/v2
Jan 5, 2026
Merged

feat: Toolbar v2: Unauth flow inside the EdgeLayout #310
ryan953 merged 15 commits intomainfrom
ryan953/v2

Conversation

@ryan953
Copy link
Copy Markdown
Member

@ryan953 ryan953 commented Jan 2, 2026

Putting the unauth state inside the EdgeLayout system means that it can be drag+dropped, we can use bigger panels to show more information about whats configured and and the current state, it can be collapsed in the same way as a logged-in session, and finally we can include the Feature Flags panel even when the user is not logged-in because it uses local state only.

Unauth Auth
Screenshot 2026-01-02 at 10 25 31 AM Screenshot 2026-01-02 at 10 25 26 AM

@ryan953 ryan953 requested a review from a team as a code owner January 2, 2026 17:45
@ryan953 ryan953 force-pushed the ryan953/v2 branch 2 times, most recently from 600168b to 9efb6d8 Compare January 2, 2026 17:55
Comment thread src/lib/context/ApiProxyContext.tsx
Comment thread src/lib/components/AppRouter.tsx
Putting the unauth state inside the EdgeLayout system means that it can be drag+dropped, we can use bigger panels to show more infomation about whats configured and and the current state, it can be collapsed in the same way as a logged-in session, and finally we can include the Feature Flags panel even when the user is not logged-in because it uses local state only.
Comment thread src/lib/components/panels/settings/CurrentUser.tsx Outdated
className="hidden"
ref={iframeRef}
/>
<ApiProxyStateContext.Provider key={proxyState} value={proxyState}>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Provider key causes children to remount on state change

Adding key={proxyState} to ApiProxyStateContext.Provider causes React to unmount and remount all children whenever the proxy state changes (e.g., from 'connecting' to 'logged-in'). This will reset all component state throughout the application on every auth state transition, potentially causing data loss, re-fetching, and unexpected UI resets. The key on the iframe is intentional to refresh it on state changes, but the key on the Provider appears unintended.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Member Author

@ryan953 ryan953 Jan 2, 2026

Choose a reason for hiding this comment

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

This is fine. We want to blow up all useQuery caches and stuff whenever auth state changes, so that no sensitive data is stashed on the device.
Resetting state is part of that as it'll help guarantee that the user is at a reasonable starting point given that they've just logged-in or -out.

We could test more when problematic login states occur, it would be ideal to render those without the user needing to click through. Something to followup on.

Comment thread src/lib/components/AppRouter.tsx
Comment thread src/lib/components/panels/settings/CurrentOrg.tsx Outdated
Comment thread src/lib/components/AppRouter.tsx
Comment thread src/lib/components/panels/settings/CurrentOrg.tsx Outdated
Comment thread src/lib/components/panels/feedback/FeedbackPanel.tsx Outdated
Comment thread src/lib/components/base/Placeholder.tsx
Comment thread src/lib/components/panels/settings/ConfigPanel.tsx Outdated
Comment thread src/lib/components/panels/settings/ConfigPanel.tsx Outdated
Comment thread src/lib/components/panels/settings/SettingsPanel.tsx
Comment thread src/lib/hooks/useWindowKeyValueSync.ts Outdated
@ryan953 ryan953 merged commit 8ff282e into main Jan 5, 2026
8 checks passed
@ryan953 ryan953 deleted the ryan953/v2 branch January 5, 2026 18:10
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.

1 participant