feat(studio): publish confirm, hide releases, desk icons, slug uniqueness#419
Open
ignmandagaran wants to merge 2 commits into
Open
feat(studio): publish confirm, hide releases, desk icons, slug uniqueness#419ignmandagaran wants to merge 2 commits into
ignmandagaran wants to merge 2 commits into
Conversation
… uniqueness - Wrap the Publish action in a production-only critical confirm dialog so changes can't go live by accident (sanity/studio/confirm-publish-action.ts). - Disable the Releases navbar tab (releases.enabled: false). - Add Phosphor icons to every desk group/item. - Enforce per-type slug uniqueness on post, project and openPosition via a shared isUnique helper (sanity/schemas/utils/unique-slug.ts).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
releases.enabled: false hides Content Releases but not the separate Scheduled Drafts tool; disable that too with scheduledDrafts.enabled: false.
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
Ports a set of Sanity Studio editor-experience features from the
basement-clipage-builder template, adapted to this project's existing content model
(curated singletons + flat collections — no generic page-builder).
What's included (Phase 1)
criticalconfirm ("This will make these changes live on the production siteimmediately. Continue?"). Production only (
NODE_ENV === "production");dev/preview publishing stays frictionless. Layered on top of the existing
singleton-action filter.
releases: { enabled: false }removes theContent Releases entry from the Studio navbar (unused here).
@phosphor-icons/react) on every desk groupand item for clearer navigation.
post,projectandopenPositionvia a sharedisUniquehelper; Sanity's built-in slugvalidator blocks publish on a duplicate.
New files
sanity/studio/confirm-publish-action.tssanity/schemas/utils/unique-slug.tsDeferred (not in this PR)
hierarchical
page/pageFoldermodel this project doesn't use; for flatcollections Sanity's built-in lists already provide search + draft
indicators, so the marginal value is low. Held pending a decision.
Test Plan
pnpm dev→/studio: editing a singleton publishes with no dialog (dev).NODE_ENV=production): Publish shows thecritical confirm; Cancel aborts, Confirm publishes.
discardChanges/restoreunaffected./studionavbar no longer shows the Releases tab.postdocs with the same slug → second blocks with a uniqueness error.