Skip to content

Commit 26b1cbf

Browse files
committed
Show project picker before login/waiting-room gates so auth failures don't replace it mid-flash
1 parent 03a4738 commit 26b1cbf

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

cli/src/app.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,20 @@ export const App = ({
260260
// 4xx client errors (401, 403, etc.) keep 'ok' - network is fine, just auth failed
261261
}
262262

263+
// Render project picker FIRST when at home directory or outside a project.
264+
// This deliberately precedes the login/auth and waiting-room gates so the
265+
// user always gets to pick a working directory before anything else — auth
266+
// failures or a banned/queued freebuff session would otherwise replace the
267+
// picker mid-flash and look like being kicked out of the app.
268+
if (showProjectPicker) {
269+
return (
270+
<ProjectPickerScreen
271+
onSelectProject={onProjectChange}
272+
initialPath={projectRoot}
273+
/>
274+
)
275+
}
276+
263277
// Render login modal when not authenticated AND auth service is reachable
264278
// Don't show login modal during network outages OR while retrying
265279
if (
@@ -275,16 +289,6 @@ export const App = ({
275289
)
276290
}
277291

278-
// Render project picker when at home directory or outside a project
279-
if (showProjectPicker) {
280-
return (
281-
<ProjectPickerScreen
282-
onSelectProject={onProjectChange}
283-
initialPath={projectRoot}
284-
/>
285-
)
286-
}
287-
288292
// Use key to force remount when resuming a different chat from history
289293
const chatKey = resumeChatId ?? 'current'
290294

0 commit comments

Comments
 (0)