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.

workflowchat-ui

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.

So what Worth importing as a unit. The three commits compose into a single coherent UX improvement with a real bug fix included. One caveat: the focus-reload fires on every tab refocus. If your fork's `listProjects()` carries more weight than upstream (eager joins, heavy response), add debouncing before merging.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

3 commits from CaliLuke/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
1e7e5a54 Allow creating projects from table modal CaliLuke 2026-05-05 ↗ GitHub
7562729f Refresh project lists after inline create CaliLuke 2026-05-05 ↗ GitHub
c75f9b88 Reload projects after auth restore CaliLuke 2026-05-05 ↗ GitHub

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-69.md from inside the repo you want the changes in.

⬇ Download capture-thread-69.md