[fix] Land on the new project after creating one on mobile - #6643
[fix] Land on the new project after creating one on mobile#6643ardaerzin wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe project switcher now uses the shared project URL resolver. After project creation, it closes the sheet, refetches projects, and navigates to the created project. ChangesProject navigation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🔵 Low · up to Creating a mobile project now closes the creation sheet, refreshes projects, and opens the new project. If the refresh fails but navigation continues, the destination may render with an outdated project list; this is a bounded low-risk behavior gap. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Creating a project from the /m drawer switcher closed the sheet and refetched the project list, but never routed. You stayed on the project you started from, and the only way into the new one was reopening the switcher panel. The create mutation now refetches first, then calls the same goTo the project list uses. Refetching before navigating matters: the switcher label, the page title and useCurrentProject all read that one query, so a list without the new project renders the route we just pushed as an unknown project. goTo also moves to projectHomeUrl(), the single spelling of the mobile project home the context resolver forwards to. The hand-rolled template literal it replaces duplicated that route without its encodeURIComponent.
058f92f to
7f69e33
Compare
Website previewPreview URL: https://pr-6643-agenta-website-preview.mahmoud-637.workers.dev Built from |
📘 Docs preview
This comment updates in place on every push. |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Advanced
Run ID: 1d791df4-3b94-4a44-94d5-0c506d576766
📒 Files selected for processing (1)
web/mobile/src/features/nav/DrawerProjectSwitcher.tsx
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Railway Preview Environment
|
Context
Creating a project from the
/mdrawer switcher left you where you started. The sheet closed, the project list refetched, and the new project appeared in the panel, but nothing routed to it. The only way in was to reopen the switcher and pick it by hand.The create mutation's
onSuccessonly didsetCreateOpen(false)andquery.refetch(). Picking an existing project from that same panel callsgoTo, which writes the continuity pair and pushes the project home. Creating one never did.Changes
onSuccessnow refetches, then calls the samegoTothe project list uses, withcreated.workspace_id ?? workspaceIdas the destination workspace.Order matters here. The switcher label, the page title and
useCurrentProjectall read the one["mobile", "projects"]query, so navigating before the refetch lands would render the route we just pushed as an unknown project.Before:
After:
goToalso switches toprojectHomeUrl(), the single spelling of the mobile project home thatContextResolverforwards to. The hand-rolled`/w/${id}/p/${id}/apps`it replaces duplicated that route and dropped itsencodeURIComponent.Tests
pnpm --filter @agenta/mobile types:checkandlintare clean (the five lint warnings are pre-existing and in other files).What to QA
/m, open the drawer, open the project switcher, choose New project, name it, Create. You land on the new project's Apps screen and the switcher header shows its name./mvisit.