Inline project creation in the tabular-review modal, plus auth-gated reload
Three commits landed within ~30 minutes that let a user create a new project without leaving the "Add new tabular review" modal - and then fix the race condition the change introduced.
The first commit (1e7e5a54) rewrites AddNewTRModal.tsx. The project dropdown gets a "New project" entry; choosing it reveals an inline name field instead of the existing project list. handleSubmit turns async: if "under project" is checked and no existing project is selected, it calls createProject(name) before onAdd. A submitting flag prevents double-submission. The parent page (tabular-reviews/page.tsx) accepts the new project as a fifth callback argument and prepends it to local state, so the project appears immediately without a refetch.
The second commit (7562729f) addresses the obvious follow-on: the main projects list goes stale after an inline create. It extracts reloadProjects() in ProjectsOverview.tsx and attaches it to visibilitychange and window.focus, so switching tabs or focusing the window triggers a refresh. It also calls invalidateDirectoryCache() on the inline-create path.
The third commit (c75f9b88) fixes a real bug introduced by the second. The new listeners fired before AuthContext finished restoring the session, calling listProjects() without a valid user and clearing the list. The fix wraps reloadProjects in useCallback, reads authLoading alongside user, and exits early when auth hasn't settled. Effect dependencies are updated to track reloadProjects.
All three commits are pure frontend - no API contract changes, no schema changes.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?