* I reviewed the dialog and fixed its close handling to align with our other NiceModal dialogs.
What I changed
- Dialog onOpenChange: Use hide, not resolve. Replaced `onOpenChange={modal.resolve}` with `onOpenChange={(open) => !open && modal.hide()}` so the X button actually hides the modal.
- Close/Skip buttons: Hide after resolve. Updated all buttons to call `modal.resolve(...); modal.hide();` so clicking Close/Skip reliably closes.
- Auto-close on success: After device flow success, added `modal.hide()` (and return value for resolve) to ensure the dialog closes immediately when login completes.
Why this fixes it
- `modal.resolve()` alone doesn’t necessarily hide the modal; NiceModal’s `hide()` should be called to close. Other dialogs (e.g., ProvidePatDialog) already follow this pattern.
Files touched
- `frontend/src/components/dialogs/auth/GitHubLoginDialog.tsx`
Quick test suggestions
- Start GitHub login, complete authorization. The dialog should auto-close after success.
- If it shows “Successfully connected!”, both the X and Close buttons should now close it.
- Try “Skip” in both pre-login and device-code steps; it should close.
Want me to run a frontend type check or spin up dev to verify the UI flow?
* Implemented the clean fix while keeping the confirmation view.
What I changed
- Dialog close behavior: `onOpenChange` now both resolves and hides, returning true if authenticated and false otherwise.
- Before: only hid the dialog (or previously only resolved).
- Now: `onOpenChange={(open) => { if (!open) { modal.resolve(isAuthenticated); modal.hide(); }}}`
- Success flow: Removed auto-resolve/hide on device flow success.
- Now it just `await reloadSystem()` and switches to the “Successfully connected!” view. The user closes it via the Close button.
- Buttons: Kept previous button fixes.
- Close (success): `modal.resolve(true); modal.hide();`
- Skip (intro/device): `modal.resolve(false); modal.hide();`
Why this is correct
- Aligns with NiceModal patterns: close actions call resolve + hide, so any awaiting code proceeds and the modal actually closes.
- Keeps the confirmation view: success doesn’t auto-close; the user now sees “Successfully connected!” and closes it explicitly.
Notes
- App flows that await `NiceModal.show('github-login')` will still proceed once the user closes (X/overlay/Close).
- If you want, I can also cancel polling when the dialog closes to avoid background calls; say the word and I’ll add `setPolling(false)` on close.