Skip to content

fix(studio): hide AI chat panel before login and center auth loading spinner - #1195

Merged
xuyushun441-sys merged 1 commit into
mainfrom
copilot/remove-chat-button-before-login
Apr 20, 2026
Merged

xuyushun441-sys merged 1 commit into
mainfrom
copilot/remove-chat-button-before-login

Conversation

Copilot AI commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

On Studio's /login (and any unauthenticated state) the AI chat toggle was visible, and the pre-auth loading spinner rendered flush to the left edge instead of centered.

Root causes

  • <AiChatPanel /> was rendered unconditionally in __root.tsx, outside any session gate.
  • SidebarProvider wraps children in a row-flex (flex h-svh w-full). The loading container used flex min-h-screen items-center justify-center with no width, so as a flex item it shrank to content width — justify-center centered the spinner only within that shrink-wrapped box.

Changes (apps/studio/src/routes/__root.tsx)

  • Gate the chat panel on auth: introduce AuthedAiChatPanel that consumes useSession() inside the existing SessionProvider and returns null when user is absent. Replaces the direct <AiChatPanel /> render.
  • Fix spinner centering: add w-full flex-1 to the RequireAuth loading container so it fills SidebarProvider's flex row, making justify-center effective horizontally.
function AuthedAiChatPanel() {
  const { user } = useSession();
  if (!user) return null;
  return <AiChatPanel />;
}

// loading container
<div className="flex min-h-screen w-full flex-1 items-center justify-center bg-background">
  <div className="h-8 w-8 animate-spin rounded-full border-4 border-muted border-t-primary" />
</div>

The RootComponent-level "Connecting to ObjectStack…" spinner renders outside SidebarProvider and was already correctly centered — left untouched.

…nner

Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/5fb6f6a0-3113-43a8-be7f-fe05b9313bad

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
@vercel

vercel Bot commented Apr 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectstack-demo Ready Ready Preview, Comment Apr 20, 2026 0:55am
spec Ready Ready Preview, Comment Apr 20, 2026 0:55am

Request Review

@xuyushun441-sys
xuyushun441-sys marked this pull request as ready for review April 20, 2026 12:55
@xuyushun441-sys
xuyushun441-sys merged commit 8b57fc3 into main Apr 20, 2026
3 checks passed

This branch was successfully deployed

2 active deployments
Preview – spec — 750d70cd Deployed Apr 20, 2026 by vercel[bot]
Preview – objectstack-demo — 750d70cd Deployed Apr 20, 2026 by vercel[bot]
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.

2 participants