Skip to content

[fix] Land on the new project after creating one on mobile - #6643

Open
ardaerzin wants to merge 2 commits into
release/v0.115.4from
fix/mobile-project-create-redirect
Open

[fix] Land on the new project after creating one on mobile#6643
ardaerzin wants to merge 2 commits into
release/v0.115.4from
fix/mobile-project-create-redirect

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

Context

Creating a project from the /m drawer 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 onSuccess only did setCreateOpen(false) and query.refetch(). Picking an existing project from that same panel calls goTo, which writes the continuity pair and pushes the project home. Creating one never did.

Changes

onSuccess now refetches, then calls the same goTo the project list uses, with created.workspace_id ?? workspaceId as the destination workspace.

Order matters here. The switcher label, the page title and useCurrentProject all read the one ["mobile", "projects"] query, so navigating before the refetch lands would render the route we just pushed as an unknown project.

Before:

onSuccess: async () => {
    setCreateOpen(false)
    await query.refetch()
},

After:

onSuccess: async (created) => {
    setCreateOpen(false)
    await query.refetch()
    goTo(created.workspace_id ?? workspaceId, created.project_id)
},

goTo also switches to projectHomeUrl(), the single spelling of the mobile project home that ContextResolver forwards to. The hand-rolled `/w/${id}/p/${id}/apps` it replaces duplicated that route and dropped its encodeURIComponent.

Tests

  • pnpm --filter @agenta/mobile types:check and lint are clean (the five lint warnings are pre-existing and in other files).
  • Not verified in a browser yet. The QA steps below are what to run.

What to QA

  • On /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.
  • Regression: pick a different existing project from the same panel. It still navigates and still remembers that pair on the next /m visit.
  • Regression: create a project while in an org with several workspaces. You land in the workspace the project was created under, not the one you came from.

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agenta-documentation Ready Ready Preview Sep 8, 2026 10:36am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 951c942b-c981-4d3d-b36c-976929e1e3f7

📥 Commits

Reviewing files that changed from the base of the PR and between b33a089 and 3524c68.

📒 Files selected for processing (1)
  • web/mobile/src/features/nav/DrawerProjectSwitcher.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/mobile/src/features/nav/DrawerProjectSwitcher.tsx

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved project navigation with consistent URL handling.
    • After creating a project, the app now refreshes the project list and opens the newly created project.

Walkthrough

The project switcher now uses the shared project URL resolver. After project creation, it closes the sheet, refetches projects, and navigates to the created project.

Changes

Project navigation

Layer / File(s) Summary
Project switcher navigation flow
web/mobile/src/features/nav/DrawerProjectSwitcher.tsx
goTo now uses projectHomeUrl for project URLs. Successful project creation now navigates to the created project after the sheet closes and projects refetch.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🔵 Low · up to 3524c

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)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: mobile users land on the newly created project after creation.
Description check ✅ Passed The description directly explains the mobile project creation bug, the navigation fix, route update, test status, and QA steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mobile-project-create-redirect

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.
@ardaerzin
ardaerzin force-pushed the fix/mobile-project-create-redirect branch from 058f92f to 7f69e33 Compare September 8, 2026 10:24
@ardaerzin
ardaerzin changed the base branch from release/v0.115.3 to release/v0.115.4 September 8, 2026 10:24
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Website preview

Preview URL: https://pr-6643-agenta-website-preview.mahmoud-637.workers.dev

Built from 7f69e33f3b1ce05cb4897de0e18e861cbf416e6e. This comment updates in place on every push.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

📘 Docs preview

Status ✅ Ready
Preview https://pr-6643-agenta-docs-preview.mahmoud-637.workers.dev/docs
Inspect Actions run
Commit 7f69e33f3b1ce05cb4897de0e18e861cbf416e6e

This comment updates in place on every push.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 114a19e and 058f92f.

📒 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.

Comment thread web/mobile/src/features/nav/DrawerProjectSwitcher.tsx Outdated
Comment thread web/mobile/src/features/nav/DrawerProjectSwitcher.tsx
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

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.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-pr-6643.up.railway.app/w
Project agenta-oss-clone-spike
Image tag pr-6643-f9ad52e
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-09-08T10:46:02.820Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant