Skip to content

feat(frontend): create a prompt from the /m Prompts page - #8156

Merged
mmabrouk merged 2 commits into
release/v0.128.9from
feat/m-parity-create-prompt
Nov 6, 2026
Merged

mmabrouk merged 2 commits into
release/v0.128.9from
feat/m-parity-create-prompt

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Nov 6, 2026

Copy link
Copy Markdown
Member

Context

In /m developer mode, a developer cannot start a new prompt. "Create new" on the Prompts page offers only "New folder", and the folder menu in the breadcrumb has no "New prompt" either. In /w, Create new > New prompt > Chat, Completion or Agent creates a draft app, asks for its name, creates it and opens the playground.

Changes

With beta developer mode on, "Create new" and the breadcrumb folder menu now offer New prompt > Chat / Completion / Agent, in the same place as /w. Choosing a type:

  1. makes a local draft app from that type's template (createEphemeralAppFromTemplate, the same factory /w uses; Agent follows the /w path for agents, so it picks the model the same way),
  2. opens the naming step: the shared commit dialog in its create form (App name, slug, message),
  3. on Create, creates the app, its default variant and v1 in one call (createWorkflowFromEphemeralAtom) and opens the new app in the /m playground at that revision.

Cancel drops the local draft. Nothing is sent to the server before Create.

Naming step is a first step. /w names the draft in its editable revision drawer, where the user can also change the prompt before creating it. The /m editable drawer (PR 4.1) is still in progress, so this PR uses the shared commit dialog. CreatePromptDialog is the only piece that the drawer replaces later; the draft, the create call and the landing stay.

Gating. New prompt shows only when the playground developer view is on, which needs beta developer mode (the view is hidden for everyone else). Without it, the menus are exactly as before: Create new has only New folder, the folder menu has Rename, Move, New folder, Delete, and the page does not fetch the templates.

Based on release/v0.128.8 (now in main at 8d75125).

Tests

  • createPrompt.render.test.tsx runs the real create atoms with only HTTP stubbed:
    • Chat: the request bodies for POST /workflows/, /workflows/variants/ and the v1 /workflows/revisions/commit are checked exactly (name, slug, flags, template parameters), then the landing URL /apps/<id>/playground?revisions=<v1>. Before Create, only the template read and the schema inspect are sent.
    • Developer mode off: Create new and the folder menu are unchanged, and no template request is sent.
    • Developer mode on: the folder menu shows New prompt between Move and New folder.
  • promptsScreen.render.test.tsx and promptsRoute.render.test.tsx still pass. /m types pass, lint is clean on the changed files.
  • Live check on the parity stack (local /m dev server, beta developer mode on): created a chat prompt, it opened in the playground at v1, then I archived it again. Completion and Agent were not created live.

What to QA

  • /m with beta developer mode on, Prompts > Create new > New prompt > Chat. Name it and Create. You land in the playground of the new app at v1, and it is in the Prompts list.
  • Same with Completion and Agent.
  • Open a folder, open its caret menu: New prompt sits between Move and New folder.
  • Cancel the naming step: no app is created.
  • Regression: with beta developer mode off (Prompts page turned on in Feature Flags), Create new shows only New folder.

… mode

Create new and the folder menu offer New prompt > Chat, Completion, Agent, as /w does.
Each makes a local draft app from the type's template, names and creates it in the
shared commit dialog, then opens the new app in the /m playground. Without developer
mode the menus stay as they were.

Entire-Checkpoint: 01M6R57JTD9D6TE2VET4VBJCSK
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added prompt creation from the prompts page, with options to create Chat, Completion, or Agent prompts.
    • Name a prompt before creating it, then open the new prompt in its playground.
    • Prompt creation is available when developer mode and prompt editing are enabled.

The Prompts page adds developer-mode prompt creation. Users can select a prompt type, create a template-based draft, submit its name and optional commit message, and navigate to the created revision. Tests cover menu visibility and Chat prompt creation.

Changes: Prompt creation

Layer / File(s) Summary
Select prompt type and prepare a draft
web/mobile/src/features/prompts/NewPromptSubmenu.tsx, web/mobile/src/features/prompts/useCreatePrompt.ts, web/mobile/src/features/prompts/PromptsScreen.tsx
The submenu offers Chat, Completion, and Agent. The hook starts and tracks template-based drafts, discards drafts on close, and provides navigation to a created app. The screen initializes the action and prefetches templates when prompt creation is available.
Expose prompt creation in menus
web/mobile/src/features/prompts/PromptsCreateMenu.tsx, web/mobile/src/features/prompts/PromptsBreadcrumb.tsx, web/mobile/src/features/prompts/PromptsView.tsx, web/mobile/src/features/prompts/PromptsScreen.tsx
The create menu and breadcrumb display the prompt submenu when a prompt action is available. The screen supplies that action only when playground mode and prompt editing are enabled.
Create the prompt and verify the flow
web/mobile/src/features/prompts/CreatePromptDialog.tsx, web/mobile/src/features/prompts/PromptsScreen.tsx, web/mobile/src/features/prompts/promptsCopy.ts, web/mobile/tests/unit/createPrompt.render.test.tsx
The dialog creates a workflow from the draft, invalidates the workflows query on success, and returns the new revision ID. The screen handles dialog callbacks. Copy and tests cover creation, menu visibility, request payloads, and navigation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant NewPromptSubmenu
  participant useCreatePrompt
  participant CreatePromptDialog
  participant WorkflowCreation
  participant Playground
  User->>NewPromptSubmenu: select prompt type
  NewPromptSubmenu->>useCreatePrompt: start(type)
  useCreatePrompt->>useCreatePrompt: create template-based draft
  useCreatePrompt-->>CreatePromptDialog: provide draftId
  User->>CreatePromptDialog: submit name and optional message
  CreatePromptDialog->>WorkflowCreation: create workflow from draft
  WorkflowCreation-->>CreatePromptDialog: return workflow and revision IDs
  CreatePromptDialog->>useCreatePrompt: onCreated(appId, revisionId)
  useCreatePrompt->>Playground: navigate to created revision
Loading

Possibly related PRs

  • Agenta-AI/agenta#8004: Adds the Prompts page and folder menus that this change extends with prompt creation.
  • Agenta-AI/agenta#8075: Changes playground selection to restore revisions from the URL; this change navigates to the created revision through the URL.
Merge Risk: Minimal · previous review 8c5d8

Prompt creation has no established issue requiring a fix before merge; normal checks can proceed.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly describes prompt creation from the /m Prompts page.
Description check Passed The description covers the prompt creation flow, access conditions, and tests.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 9 files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8d75125 and 8c5d88e.

Files selected for processing: 9

  • web/mobile/src/features/prompts/CreatePromptDialog.tsx
  • web/mobile/src/features/prompts/NewPromptSubmenu.tsx
  • web/mobile/src/features/prompts/PromptsBreadcrumb.tsx
  • web/mobile/src/features/prompts/PromptsCreateMenu.tsx
  • web/mobile/src/features/prompts/PromptsScreen.tsx
  • web/mobile/src/features/prompts/PromptsView.tsx
  • web/mobile/src/features/prompts/promptsCopy.ts
  • web/mobile/src/features/prompts/useCreatePrompt.ts
  • web/mobile/tests/unit/createPrompt.render.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Item Value
Status stopped
Commit 8c5d88ef5f9cc64f350dcee0bccc210419c6fb7c
Manual expiry (UTC) Not granted
CI deadline (UTC) Not granted
Workflow https://github.com/Agenta-AI/agenta/actions/runs/42200595117

Preview use finished or expired. Environment absence verified; retained storage requires separate provider accounting.

Post /preview as a new comment to request a one-hour preview. Repeating it while active does not extend the hour.
Preview data is disposable. Expiry is enforced by the next successful cleanup sweep, not an exact timer.
Environment deletion stops its compute. Provider-retained storage and permanent services may still be billed.

…rity-create-prompt

# Conflicts:
#	web/mobile/src/features/prompts/PromptsScreen.tsx
@mmabrouk
mmabrouk merged commit 6dec2c4 into release/v0.128.9 Nov 6, 2026
26 of 28 checks passed
@mmabrouk mmabrouk added the lgtm This PR has been approved by a maintainer label Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant