Show project picker before auth/waiting-room gates#535
Conversation
…don't replace it mid-flash
Greptile SummaryThis PR fixes a UX regression where the login modal (or waiting-room/banned screen) would flash on top of the project picker when Key points:
Confidence Score: 5/5Safe to merge — pure render-order change with no auth logic altered and no new dependencies introduced. The change is a single, well-reasoned reorder of two early-return blocks. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[App renders] --> B{showProjectPicker?}
B -- Yes --> C[ProjectPickerScreen]
C --> D[User selects directory]
D --> E[onProjectChange called\nflips showProjectPicker off]
E --> A
B -- No --> F{isAuthenticated?}
F -- No --> G[LoginModal]
F -- Yes --> H{freebuff session\nwaiting/banned?}
H -- Waiting --> I[WaitingRoomScreen]
H -- Banned/Superseded --> J[FreebuffSupersededScreen]
H -- Active --> K[AuthedSurface / Chat]
Reviews (1): Last reviewed commit: "Show project picker before login/waiting..." | Re-trigger Greptile |
Summary
When freebuff is launched from the home directory, the project picker briefly showed and was then replaced by the login modal (or, downstream, the waiting room / banned screen) — users read this as being "kicked out of the app." The login-modal gate sat in front of the picker check in
app.tsx, so anyauthQueryfailure (more likely since the recent banned-user / abuse-detector work) pre-empted the picker.This reorders the render in
cli/src/app.tsxso the project picker renders first when the user starts at home. Picking a directory flipsshowProjectPickeroff and the normal auth → waiting-room → chat flow runs as before. The picker is pure UI with no auth dependencies, so rendering it before auth is safe.Test plan
project-picker.test.tspasses$HOMEin tmux — picker renders and stays