fix(@sanity/cross-dataset-duplicator): address review feedback from #974#1292
Draft
stipsan wants to merge 4 commits into
Draft
fix(@sanity/cross-dataset-duplicator): address review feedback from #974#1292stipsan wants to merge 4 commits into
stipsan wants to merge 4 commits into
Conversation
…view Address review feedback on PR #974 in the Duplicator component: - Index destination docs by _id so status updates are O(n) not O(n²) - Fail fast when an asset download response is not ok (e.g. 401/403/404) instead of uploading the error body as the asset, and surface the error - Create a single merged asset document at the uploaded _id (avoids leaving an orphaned asset document behind when an SVG's _id changes on upload) - Clone documents before remapping SVG references so React state objects held in `payload` are never mutated in place - Fix the duplicate button label: show counts for single-item selections and only insert "and" when both documents and assets are selected - Guard the progress bar against a zero-asset payload (avoids NaN transform)
…copy
The EXISTS document tooltip read awkwardly ("with the same ID with the
same Updated time"); tighten it to "with the same ID and Updated time".
…up README/LICENSE - Correct the invalid config snippet (`export default defineConfig(...)`) - Remove stale standalone-repo sections (plugin-kit dev workflow and semantic-release) and the duplicate License section - Update the LICENSE copyright year to the current year
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Addresses the Copilot review feedback on the merged migration PR #974 for
@sanity/cross-dataset-duplicator. All 10 review comments are resolved.Walkthrough
Demo of the duplicator UI after the fixes — corrected
EXISTStooltip copy, singular/plural button label, and a zero-asset duplication completing cleanly (no broken progress bar):cross_dataset_duplicator_review_fixes_demo.mp4
EXISTStooltip now reads "…with the same ID and Updated time." and statuses render via the index map:EXISTS tooltip and statuses
Button label correctly uses the singular "1 Document" (previously this branch was unreachable):
Singular button label
Changes
src/components/Duplicator.tsx_idso status updates are O(n) instead of O(n²).ok(e.g. 401/403/404) instead of uploading the error body as the asset, and surface the message._id, avoiding an orphaned asset document when an SVG's_idchanges on upload.payload) are never mutated in place.NaN/Infinitytransform).src/components/StatusBadge.tsxEXISTStooltip copy ("with the same ID with the same…" → "with the same ID and Updated time.").README.mdexport default defineConfig(...)).LICENSETesting
pnpm format,pnpm lint,pnpm build,pnpm test runall pass.pnpm dev): ran the duplicator query, confirmed the corrected tooltip, singular/plural button label, status badges (EXISTS/OVERWRITE) computed via the index map, and a zero-asset duplication completing with no broken progress-bar rendering.dsetclone, downloadres.ok) are covered by the type-checked build, lint, and tests.A
patchchangeset is included.To show artifacts inline, enable in settings.