Duplicate guides (#100) #123
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MassiveDynamic/kataba!123
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/100-duplicate-guide"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #100
Adds "Duplicate" to a guide's reading view and editor header. Every author and admin who may see a guide can use it.
What the copy gets
Implementation
src/guides/duplicatedContent.ts: a pure function that gives the content new ids for steps, lines, images and attachments, and new file keys. Re-crops still share one original, and annotations are moved onto the new lines.src/guides/duplicateGuide.ts: reads the working copy with the original guide locked (ADR-0013), copies the files and creates the draft.src/guideVersions/freshFileKeys.ts: hands out new file keys. The guide-package import now uses it too.duplicateGuideActionandDuplicateButton, plus the German translation and the CHANGELOG entry.Open question
As the spec says, the copy is made from the working copy. An author who may only see a published guide therefore also gets the owner's unpublished changes in their own draft. If that's not wanted, people who can't edit the guide should get the latest version instead.
Tests
duplicatedContent.e2e/duplicateGuide.spec.ts): another author duplicates a guide, the original is deleted and the copy is still whole; viewers get no button.🤖 Generated with Claude Code