Skip to content

fix(frontend): show loading state on home "Create agent" button#5475

Merged
ashrafchowdury merged 3 commits into
release/v0.106.0from
fix/add-loading-indicator-on-the-home-agent-creator
Jul 24, 2026
Merged

fix(frontend): show loading state on home "Create agent" button#5475
ashrafchowdury merged 3 commits into
release/v0.106.0from
fix/add-loading-indicator-on-the-home-agent-creator

Conversation

@ashrafchowdury

Copy link
Copy Markdown
Contributor

Context

On the agent home page, clicking "Create agent" gave no feedback for a moment. Creating an agent is a multi-step async round-trip (mint an ephemeral app, commit it, stash the first-run seed, then navigate to the playground), so the button sat unchanged until navigation kicked in. The silence read as a dead click and left people unsure whether anything was happening.

Changes

The primary button now spins and swaps its label from "Create agent" to "Creating agent" while the create is in flight, then the page navigates to the new agent's playground.

The wiring: useCreateAgent already returned a success boolean, but useAgentHomeActions.onCreate discarded it with void. It now returns that promise. StripHome holds a loading state, sets it before awaiting onCreate, and threads it down through StripComposer to the shared AgentIntentActions button. On success the page navigates away, so the spinner stays up through navigation; it only resets on failure. That avoids flashing the label back to "Create agent" during the navigation gap. A re-entry guard (plus antd disabling the button while loading) blocks a double-submit.

The shared flag prop is named loading (state-describing, matches antd Button's own prop) rather than creating. That rename is why AgentConversation.tsx appears in the diff: it's the other consumer of AgentIntentActions.

Before: click, then nothing visible until the playground opens.
After: click, the button shows a spinner and "Creating agent" until the playground opens.

AgentIntentActions is also used by the playground onboarding composer, which already passed the in-flight flag, so it gets the same "Creating agent" label swap for free.

Tests / notes

  • eslint clean on all touched files.
  • The flag-off classic home (AgentComposer, "Continue in IDE") is a separate composer and was left untouched.

What to QA

  • Home page: type a prompt and click Create agent. The button immediately shows a spinner, reads "Creating agent", and stays that way until the agent's playground opens.
  • Submit with the Enter key instead. Same loading behavior, and no second agent is created if you also click.
  • Regression: force a create failure (e.g. go offline). The button resets to "Create agent" and an error toast shows, rather than spinning forever.
  • Regression: the "Create agent" button inside a new agent's onboarding chat still creates and shows the spinner.

mmabrouk and others added 3 commits July 23, 2026 18:02
The Framer site carried GA4 (G-368ZWZSH5D, recovered from the archive and
matching .env.example); the rebuild shipped only PostHog, so GA flatlined
at cutover. Same gates as PostHog: real domain, indexable production
build, DNT honored. The production workflow sets the public ID.

Claude-Session: https://claude.ai/code/session_013Qe1Vf2yvj33BVd5W1q7HB
fix(website): restore GA4 alongside PostHog (analytics continuity)
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 24, 2026
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 24, 2026 7:48am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The create-agent flow now propagates a loading state through the TemplateStrip, manages asynchronous creation in StripHome, updates button copy and spinner behavior, and aligns the chat onboarding integration with the renamed prop.

Changes

Agent creation loading flow

Layer / File(s) Summary
Loading UI contract
web/oss/src/components/TemplateStrip/assets/constants.ts, web/oss/src/components/TemplateStrip/components/AgentIntentActions.tsx
Adds creating-agent copy and changes the action component from creating to loading, including button state, label, and terminal icon sizing.
Loading prop wiring
web/oss/src/components/TemplateStrip/components/StripComposer.tsx
Adds the optional loading prop and forwards it to AgentIntentActions.
Creation lifecycle
web/oss/src/components/pages/agent-home/StripHome.tsx, web/oss/src/components/pages/agent-home/hooks/useAgentHomeActions.ts, web/oss/src/components/AgentChatSlice/AgentConversation.tsx
Tracks loading during asynchronous creation, prevents concurrent submissions, resets loading on failure, returns the creation result, and updates onboarding to pass loading.

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

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant AgentIntentActions
  participant StripHome
  participant useAgentHomeActions
  User->>AgentIntentActions: Submit create-agent action
  AgentIntentActions->>StripHome: Invoke handleCreate
  StripHome->>AgentIntentActions: Set loading state
  StripHome->>useAgentHomeActions: Await onCreate
  useAgentHomeActions-->>StripHome: Return createAgent result
  StripHome->>AgentIntentActions: Reset loading on failure
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 60.00%.
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.
Title check ✅ Passed The title clearly matches the main change: showing a loading state on the home Create agent button.
Description check ✅ Passed The description is directly related to the changeset and accurately describes the loading-state wiring and behavior.
✨ 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/add-loading-indicator-on-the-home-agent-creator

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.

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-07-24T15:06:13.505Z

@ardaerzin
ardaerzin self-requested a review July 24, 2026 09:46
@ashrafchowdury
ashrafchowdury changed the base branch from main to release/v0.106.0 July 24, 2026 10:17
@ashrafchowdury
ashrafchowdury merged commit 7cfa283 into release/v0.106.0 Jul 24, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend size:M This PR changes 30-99 lines, ignoring generated files. UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants