fix(site): name template versions in promote/archive dialogs and toasts - #27633
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a6720c78a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| description={ | ||
| <> | ||
| Are you sure you want to promote version{" "} | ||
| <strong>{versionToPromote?.name}</strong>? Workspaces will be | ||
| prompted to “Update” to this version once promoted. |
There was a problem hiding this comment.
Add interaction coverage for the version-naming flow
This changes the user-visible promote and archive dialogs and their success/error toasts, but no Storybook story was added or updated to exercise either interaction; the existing VersionsTable stories only render the table and cannot verify that the selected version name reaches the confirmation copy and mutation result toast. Add a page-level story with a play function that opens and submits these dialogs.
AGENTS.md reference: site/AGENTS.md:L9-L10
Useful? React with 👍 / 👎.
aqandrew
left a comment
There was a problem hiding this comment.
lgtm other than a tiny merge conflict in TemplateVersionsPage's imports
| Are you sure you want to archive version{" "} | ||
| <strong>{versionToArchive?.name}</strong>? This is reversible. | ||
| Archived versions cannot be used by workspaces. |
There was a problem hiding this comment.
Explicitly naming the versions in the dialog description is a great change! 🙌🏽
nit: The version name is bolded here and double-quoted in the toast text. We should pick one style and stick with it. I vote for bolding the version name in the toast text (removing double quotes)
Note
These were previously returning as typed values in the
api.ts, however, they were not actually typed in this way and updating them wouldn't have worked for thepromotionas it would fall back to needing to validate against the template.Archive toasts showed
"undefined"because the API does not return aTemplateVersion. Toast/dialog copy now comes from the selected version.TemplateVersionfor promote/archive confirms (global pattern elsewhere)Promise<void>