Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions cli/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,20 @@ export const App = ({
// 4xx client errors (401, 403, etc.) keep 'ok' - network is fine, just auth failed
}

// Render project picker FIRST when at home directory or outside a project.
// This deliberately precedes the login/auth and waiting-room gates so the
// user always gets to pick a working directory before anything else — auth
// failures or a banned/queued freebuff session would otherwise replace the
// picker mid-flash and look like being kicked out of the app.
if (showProjectPicker) {
return (
<ProjectPickerScreen
onSelectProject={onProjectChange}
initialPath={projectRoot}
/>
)
}

// Render login modal when not authenticated AND auth service is reachable
// Don't show login modal during network outages OR while retrying
if (
Expand All @@ -275,16 +289,6 @@ export const App = ({
)
}

// Render project picker when at home directory or outside a project
if (showProjectPicker) {
return (
<ProjectPickerScreen
onSelectProject={onProjectChange}
initialPath={projectRoot}
/>
)
}

// Use key to force remount when resuming a different chat from history
const chatKey = resumeChatId ?? 'current'

Expand Down
Loading