Skip to content

fix: open create prompt modal when navigating from onboarding screen#4260

Merged
bekossy merged 5 commits intoAgenta-AI:release/v0.98.1from
Devarsh05:fix/onboarding-modal-not-opening
May 5, 2026
Merged

fix: open create prompt modal when navigating from onboarding screen#4260
bekossy merged 5 commits intoAgenta-AI:release/v0.98.1from
Devarsh05:fix/onboarding-modal-not-opening

Conversation

@Devarsh05
Copy link
Copy Markdown
Contributor

@Devarsh05 Devarsh05 commented May 4, 2026

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=true
as 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_prompt
query 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

  1. Went to /get-started
  2. Clicked "Create and test prompts"
  3. Confirmed modal opens automatically on the home page without
    requiring a second click

Added or updated tests

N/A

QA follow-up

N/A

Demo

Agenta_TheLLMOpsplatform -GoogleChrome2026-05-0412-56-20-ezgif com-video-to-gif-converter

Checklist

  • I have included a video or screen recording for UI changes, or marked Demo as N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

Copilot AI review requested due to automatic review settings May 4, 2026 17:13
@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

Someone is attempting to deploy a commit to the agenta projects Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 4, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 4, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7d956f7f-1b21-4706-b511-41b310721c25

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The app-management page now checks for the URL query create_prompt=true once Next.js routing is ready, opens the "Add app from template" modal, and removes the query using a shallow router.replace. Additionally, onErrorRetry calls archiveWorkflow(statusData.appId!) using a non-null assertion.

Changes

Query Parameter-Driven Modal Opening

Layer / File(s) Summary
Router Setup
web/oss/src/components/pages/app-management/index.tsx
Import useRouter and call const router = useRouter() inside the AppManagement component.
URL-Driven Modal Logic
web/oss/src/components/pages/app-management/index.tsx
Add useEffect that waits for router.isReady, checks router.query.create_prompt === "true", opens the "Add app from template" modal, then calls router.replace to remove create_prompt using shallow routing.
Error Retry Adjustment
web/oss/src/components/pages/app-management/index.tsx
onErrorRetry updated to call archiveWorkflow(statusData.appId!) with a non-null assertion.

Sequence Diagram

sequenceDiagram
    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 })
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: opening the create prompt modal when navigating from the onboarding screen, which directly addresses the core issue.
Description check ✅ Passed The description is well-detailed and directly related to the changeset, explaining the root cause, the fix, testing performed, and includes a demo video.
Linked Issues check ✅ Passed The PR fully addresses issue #4019 by implementing the expected behavior: reading the create_prompt query param and automatically opening the modal on navigation from onboarding.
Out of Scope Changes check ✅ Passed The changes are scoped to the onboarding modal opening requirement. The addition of onErrorRetry with archiveWorkflow is a minor implementation detail that may be incidental to the modal functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/router usage in AppManagement to inspect the create_prompt query 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.

Comment thread web/oss/src/components/pages/app-management/index.tsx Outdated
@dosubot dosubot Bot added the Frontend label May 4, 2026
@Devarsh05 Devarsh05 force-pushed the fix/onboarding-modal-not-opening branch from 3d3c8f0 to ceec9ae Compare May 4, 2026 17:30
Copilot AI review requested due to automatic review settings May 4, 2026 17:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@mmabrouk
Copy link
Copy Markdown
Member

mmabrouk commented May 4, 2026

Thank you @Devarsh05 for the PR!

There are merge conflicts though, can you please resolve them. Thanks!

@Devarsh05
Copy link
Copy Markdown
Contributor Author

Hi @mmabrouk, I've resolved the merge conflicts! PR #4260 should be ready for review now. Thank you for your time!

Copilot AI review requested due to automatic review settings May 5, 2026 09:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 5, 2026
@bekossy
Copy link
Copy Markdown
Member

bekossy commented May 5, 2026

@all-contributors please add @Devarsh05 for bug fix

@allcontributors
Copy link
Copy Markdown
Contributor

@bekossy

I've put up a pull request to add @Devarsh05! 🎉

@bekossy bekossy merged commit 8ddc013 into Agenta-AI:release/v0.98.1 May 5, 2026
10 of 14 checks passed
@bekossy
Copy link
Copy Markdown
Member

bekossy commented May 5, 2026

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 (onboardingWidgetActivationAtom) wired up for exactly this in app-management/index.tsx. The fix ended up being in GetStarted.tsx - setting the atom to "open-create-prompt" before navigating, instead of passing ?create_prompt=true via the URL.
Worth keeping in mind for future PRs: when triggering UI state across navigation in this repo, look for an existing atom pattern first. Appreciate the contribution!

@Devarsh05
Copy link
Copy Markdown
Contributor Author

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!

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

Labels

Frontend lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Onboarding: "Create New Prompt" navigates to home without opening creation modal

5 participants