fix: open create prompt modal when navigating from onboarding screen#4260
Conversation
|
Someone is attempting to deploy a commit to the agenta projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe app-management page now checks for the URL query ChangesQuery Parameter-Driven Modal Opening
Sequence DiagramsequenceDiagram
participant Browser
participant Router
participant AppManagement
participant Modal
Browser->>Router: Navigate to /app-management?create_prompt=true
Router->>AppManagement: Provide router.query (after isReady)
AppManagement->>AppManagement: useEffect sees create_prompt === "true"
AppManagement->>Modal: open "Add app from template" modal
AppManagement->>Router: router.replace(url without create_prompt, { shallow: true })
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
Pull request overview
Fixes the onboarding-to-app-management handoff so the “Create New Prompt” action can open the prompt creation modal after navigation to the apps home page.
Changes:
- Added
next/routerusage inAppManagementto inspect thecreate_promptquery param. - Added a mount-time effect that opens the create-prompt modal when
create_prompt=true. - Cleans the URL after opening the modal and preserves the remaining query params.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3d3c8f0 to
ceec9ae
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thank you @Devarsh05 for the PR! There are merge conflicts though, can you please resolve them. Thanks! |
|
@all-contributors please add @Devarsh05 for bug fix |
|
I've put up a pull request to add @Devarsh05! 🎉 |
|
Thanks for the PR and for tracking down the bug @Devarsh05! Just a heads up - we adjusted the approach slightly after merging. The codebase already had an atom-based pattern ( |
|
Thank you so much @bekossy for the feedback and for merging! Really appreciate the explanation about the atom pattern that's super helpful to know for future PRs. Looking forward to contributing more! |
Summary
Fixes the onboarding flow where clicking "Create New Prompt" on the
get-started screen navigated to the home page but did not open the
prompt creation modal, requiring the user to click again.
Root cause: GetStarted.tsx was already passing
?create_prompt=trueas a query param when navigating to the home page, but AppManagement
(index.tsx) was never reading that param to trigger the modal.
Fix: Added a useEffect in index.tsx that reads the
create_promptquery param on mount, opens the modal automatically, then cleans up
the URL while preserving existing query values (workspace_id, project_id).
Closes #4019
Testing
Verified locally
requiring a second click
Added or updated tests
N/A
QA follow-up
N/A
Demo
Checklist