Skip to content

fix: prompts Create & activate has no confirmation, unlike rollback #274

Description

@nazarli-shabnam

Problem

On the admin prompts page, "Create & activate" is a plain button with no confirmation step, while "Rollback to this version" is wrapped in the app's `ConfirmButton` pattern:

  • Create & activate: plain `` (`app/admin/prompts/page.tsx:117-121`)
  • Rollback: wrapped in `ConfirmButton` (`app/admin/prompts/page.tsx:159-168`)

Creating a new prompt version immediately deactivates the current active template and makes the new one live for the AI connection-generation flow — the insert transaction flips `active` atomically (`app/api/admin/prompts/route.ts:60-71`).

Impact

The riskier of the two actions — pushing a brand-new, unreviewed template live to production in one click — has no confirmation, while reverting to a previously working version does. A typo'd or malformed template (e.g. a broken placeholder) goes live immediately with no "are you sure" step, and every subsequent AI connection-generation call uses it until someone notices and manually rolls back. The safety gate is inverted relative to actual risk.

Location

`app/admin/prompts/page.tsx:117-121` (Create & activate) vs. `159-168` (Rollback)

Suggested fix

Wrap "Create & activate" in the same `ConfirmButton` component already used for rollback and other high-impact actions elsewhere in the admin UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    To triage

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions