Repository navigation
feat(prompts): edit/delete a prompt in place via a dialog - #487
Merged
Merged
Conversation
Replace the pencil link on the All Prompts tab (which jumped to the top of the brand page) with an Edit Prompt dialog pre-filled from the row: text, topic, the grouped plan-filtered Platform & Models picker and an active toggle. Delete lives inside the dialog behind an inline confirm step. The shared form body (text input, topic select, engine picker with badge chips) and the plan/shopping-scoped engine lists are extracted out of the Add Prompt dialog into PromptFormFields + useAllowedEngines so the two dialogs cannot drift apart. The pencil column now renders only for roles with write access, matching the Add button.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the pencil link on the All Prompts tab — which only jumped to the top of the brand's prompts page with no reference to the clicked row — with an Edit Prompt dialog, the sibling of the Add Prompt dialog from #483:
chatgpt-shoppinghidden unless the brand opted in), and an active/paused checkbox.updatePrompt— topic resolution, plan filtering and shopping stripping all happen server-side, so no backend changes. Editing keeps the prompt id, so tracking history stays attached.deletePrompt.Reuse, not a fork: the shared form body (text input, topic select, engine picker with badge chips) is extracted out of the Add Prompt dialog into
PromptFormFields, and the plan/shopping-scoped engine lists intouseAllowedEngines. Both dialogs render the same component, so they can't drift apart.Role gate: the Edit column (header + pencil) now renders only for roles with write access (
canManage), matching the Add button; the card subtitle no longer claims the tab is read-only for managers.Related issue
Closes #484
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)