Skip to content

PromptManager: Stages tab Save, Create, and Delete lack success toasts and Create fails to navigate to the new stage #6022

Description

@atomantic

Problem

In client/src/pages/PromptManager.jsx, stage mutation flows lack success notifications, and the stage creation workflow fails to select or reveal the newly created stage:

  1. Save stage lacks success toast (client/src/pages/PromptManager.jsx:202-208):

    const ok = await savePrompt(selectedStage, payload, { silent: true })
      .then(() => true)
      .catch((err) => { toast.error('Failed to save stage: ' + err.message); return false; });
    if (!ok) { setSaving(false); return; }
    setSaving(false);
    await loadData();

    { silent: true } suppresses the default toast from request(). While failures toast via toast.error, successful saves call no toast. The Save button simply re-enables. (In contrast, saveJobSkill in line 370 calls toast.success('Job skill saved'), added in [UX Audit] [PromptManager] Job skill save failures are swallowed silently with no user error toast #3937).

  2. Create stage neither toasts nor selects the new stage (client/src/pages/PromptManager.jsx:270-287):

    const ok = await createPrompt(payload, { silent: true })
      .then(() => true)
      .catch((err) => { setSaving(false); toast.error(err.message || 'Failed to create stage'); return false; });
    if (!ok) return;
    
    setSaving(false);
    setCreatingStage(false);
    setNewStageForm({ ... });
    await loadData();

    When createPrompt succeeds, it returns { success: true, stageName }. On success, no toast is displayed, the modal closes, and setSelectedStage(payload.stageName) is NEVER called. The user remains parked on whatever stage was previously selected (or empty). Because the 120+ stages are partitioned across collapsible accordion groups, the newly created stage is buried out of sight in a collapsed group.

  3. Delete stage lacks success toast (client/src/pages/PromptManager.jsx:308-317):
    deletePrompt resolves, the modal closes, and selection clears if matching, but no confirmation toast confirms the deletion.

Trigger

  1. In /prompts (Stages tab), edit a template or config and click "Save". The button disables and re-enables; no notification appears.
  2. Click "+" ("New Stage"), fill out key my-stage and name Pipeline — My Stage, and click "Create Stage". The modal closes, no notification appears, and the editor continues displaying the old stage or placeholder while the new stage sits unseen inside a collapsed group.
  3. Click "Delete", confirm in the modal. The modal closes with no confirmation feedback.

Impact

  • Invisible mutation state: Users cannot distinguish a completed server save from a dropped or lagged request.
  • Dead end / disorientation: Creating a stage leaves the user searching through 120+ stages and accordions just to locate and begin editing the template of the stage they just created.

Fix

  1. In client/src/pages/PromptManager.jsx:
    • In saveStage: on success, call toast.success(Stage "${stages[selectedStage]?.name || selectedStage}" saved).
    • In createStage: on success, close the modal, reset the form, call setSelectedStage(payload.stageName) to deep-link to the new stage (which automatically triggers selectedGroupKey to expand its parent accordion group), and call toast.success(Stage "${payload.name || payload.stageName}" created).
    • In confirmDeleteStage: on success, call toast.success(Stage "${stageName}" deleted).
  2. Rejected alternative: Leaving stage creation unselected and relying on manual user search. Rejected per client/src/AGENTS.md ("ID-based deep linking for every selectable UI element - any view that opens/selects a specific record MUST encode that selection in the URL").

Dispatch rationale: model:light + effort:low — mechanical addition of success toasts and setting selectedStage on creation, with companion unit test assertions in PromptManager.test.jsx.

Files to touch:

  • client/src/pages/PromptManager.jsx
  • client/src/pages/PromptManager.test.jsx

Acceptance criteria

  • Saving a prompt stage displays a success toast confirming the stage was saved.
  • Creating a new prompt stage displays a success toast with the stage name.
  • Creating a new prompt stage automatically selects it in the URL (?stage=<stageName>) and expands its parent group accordion in the sidebar list so the editor immediately opens the new stage.
  • Deleting a prompt stage displays a success toast confirming deletion.
  • All existing test suites in PromptManager.test.jsx pass.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uiUI components and stylingbugSomething isn't workingeffort:lowEffort: lowmodel:lightModel size: lightplanTracked by /do:replanplanner:gemini-3-7-flash-highPlan authored by the gemini-3-7-flash-high modeluxProposed from a UX/design audit

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions