Skip to content

Show project picker before auth/waiting-room gates#535

Merged
jahooma merged 1 commit intomainfrom
jahooma/fix-picker-kickout
Apr 22, 2026
Merged

Show project picker before auth/waiting-room gates#535
jahooma merged 1 commit intomainfrom
jahooma/fix-picker-kickout

Conversation

@jahooma
Copy link
Copy Markdown
Contributor

@jahooma jahooma commented Apr 22, 2026

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 any authQuery failure (more likely since the recent banned-user / abuse-detector work) pre-empted the picker.

This reorders the render in cli/src/app.tsx so the project picker renders first when the user starts at home. Picking a directory flips showProjectPicker off 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

  • Typecheck clean; project-picker.test.ts passes
  • Launched freebuff from $HOME in tmux — picker renders and stays
  • Verify on a banned / revoked-token account that picker now shows first, then the downstream banned / login screen after a directory is selected

@jahooma jahooma merged commit 796d211 into main Apr 22, 2026
11 checks passed
@jahooma jahooma deleted the jahooma/fix-picker-kickout branch April 22, 2026 18:08
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 22, 2026

Greptile Summary

This PR fixes a UX regression where the login modal (or waiting-room/banned screen) would flash on top of the project picker when freebuff was launched from $HOME. The fix is a one-location reorder in cli/src/app.tsx: the showProjectPicker early-return is moved above the auth/login gate so users always see the directory picker first. Once a directory is selected, onProjectChange flips showProjectPicker off and the normal auth → waiting-room → chat flow proceeds as before.

Key points:

  • The ProjectPickerScreen has no auth dependencies, so rendering it before auth checks is safe.
  • After picking a directory, the auth gate fires normally — a banned or unauthenticated user will still see the appropriate screen.
  • No logic was added or removed; this is a pure render-order change.
  • The one outstanding test case in the PR test plan (banned/revoked-token account) is still manual-only, but the code path is straightforward to reason about.

Confidence Score: 5/5

Safe 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. ProjectPickerScreen has no auth dependencies, so hoisting it above the login gate carries no security or correctness risk. The auth flow is fully preserved after a directory is selected. No edge cases are introduced.

No files require special attention.

Important Files Changed

Filename Overview
cli/src/app.tsx Moves the showProjectPicker early-return above the login/auth gate, so the project picker renders first when starting from $HOME, preventing the auth modal from flashing before the picker. Logic-only reorder with no functional change to either path.

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]
Loading

Reviews (1): Last reviewed commit: "Show project picker before login/waiting..." | Re-trigger Greptile

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