Various bug fixes found while testing SaaS build (#6459)

# Description of Changes
Various fixes and improvements I made while testing the SaaS code:
- Changes the new `.env.saas` file to live in `app/` and match the
semantics of the other `.env` files
- Adds top-level `task dev:saas` command to spawn SaaS frontend &
backend
- Deletes dead SaaS code and improves some overriding logic
- Fixes refreshing issue when coming back to the tab
- Fix the Compare tool's selection logic
- Make Compare handle error cases properly
- Fixes the location of the "Dismiss All Errors" button (was rendering
on top of the top-bar with a transparent background previously so it
looked rubbish)
- Fixes file selection in PDF Editor
This commit is contained in:
James Brunton
2026-05-28 11:05:30 +00:00
committed by GitHub
parent 76840d8a57
commit 44fbf8c587
22 changed files with 313 additions and 798 deletions
+8 -2
View File
@@ -550,7 +550,14 @@ export function AuthProvider({ children }: { children: ReactNode }) {
} else if (event === "SIGNED_IN") {
console.debug("[Auth Debug] User signed in successfully");
if (newSession?.user) {
setLoading(true);
// Note: we deliberately do NOT toggle `loading` here. Supabase
// also fires SIGNED_IN on tab visibility / token-refresh wakeups
// (per its docs: "SIGNED_IN is fired when a user signs in OR
// when the access token is refreshed"), and gating the UI on
// `loading` would unmount Landing -> HomePage every time the
// user switches tabs back. Initial-mount loading is handled by
// `initializeAuth` above; downstream fetches expose their own
// null/loading states.
// Sync OAuth avatar in background (don't block other fetches)
syncOAuthAvatar(newSession.user).catch((err) => {
@@ -568,7 +575,6 @@ export function AuthProvider({ children }: { children: ReactNode }) {
// Use a small delay to allow avatar sync to finish if it's quick
setTimeout(() => {
fetchProfilePicture(newSession).finally(() => {
setLoading(false);
console.debug(
"[Auth Debug] User data fully loaded after sign in",
);