Repository navigation
Keep several versions of one story in the library, with history #16
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Contexte
Origin: the wish to make a series of versions of the same story and keep the history. A device session (see FORMATS.md §9, PR antoinevalentinHA#59) established what the formats offer, and it is little:
- The story pack version (
u16atnioffset 2,"version"instory.json) travels through every format, the editor edits it, the library names archives<title>-<uuid>-v<version>.zip, the device stores it. Nothing is known to read it. - The device identifies a story by UUID only (
.pientry,.content/<tail of uuid>). Same UUID → the upload replaces. Different UUID → a second, unrelated story. - The pack UUID is the first stage node's UUID. The editor keeps node UUIDs across load/save, so editing and re-exporting keeps the identity. Re-creating the story, or duplicating its first node, gives it a new one.
The card checked had the same STUdio story under two UUIDs with byte-identical ni, plus its current v2 under a third. That is the failure mode: versions made by re-creation pile up on the device as siblings it cannot relate, and only the library file names remember which is which.
Description
Make the library the place where history lives, keyed by UUID, so the device holds one version per story and the user can go back.
Design decision to settle first (the rest follows from it):
- A. Same UUID, incrementing version (recommended). The library keeps all archives of one UUID; the tile shows the versions; the highest (or the selected one) is what goes to the device; uploading replaces the previous one on the device. History is a library concept, the device never sees two copies.
- B. One UUID per version. Versions coexist on the device, but the device cannot relate them, the user has to remove old ones by hand, and the library cannot tell "v2 of X" from "another story" without a side table. This is what happens today by accident.
Fichiers concernes
web-ui/src/main/java/studio/webui/service/LibraryService.java— packs are already grouped by UUID (packs[0]); today the group is "formats of one pack", it would become "versions × formats"web-ui/javascript/src/utils/packs.js(sortPacks,chooseDropAction) andPackLibrary.js— pick which version is sent on drop; show versions on the tileweb-ui/javascript/src/components/diagram/widgets/PackDiagramWidget.js— the version input exists; consider bumping on "save as new version"web-ui/javascript/src/utils/packs.test.js,LibraryServicetests — selection rules
Plan d'implementation
- Decide A vs B (above).
- Library model: a pack group = one UUID → list of (version, format, path); define "current" = highest version.
- UI: versions visible on the library tile; drop-to-device sends the current one; a way to pick an older one.
- Editor: "save as new version" = same UUID, version + 1, new archive; never regenerates node UUIDs.
- Guard: uploading a lower version than the one on the device asks for confirmation.
- Tests for grouping, current-version selection and the guard.
Criteres d'acceptation
- Several archives of the same UUID coexist in the library and are shown as versions of one story
- Dropping the story on the device sends exactly one version, the current one by default
- Re-exporting from the editor never changes the story's UUID
-
yarn testand the Java suite green, CI green on Ubuntu and Windows
Complexite
M
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
lgnap commentedon Sep 11, 2026
Prise en charge par Claude Code (instance
tuxedo:40112:d397e957, branchefeat/issue-16-story-versions). Option A retenue : même UUID, version incrémentée, historique dans la bibliothèque, une seule version à bord.lgnap commentedon Sep 11, 2026
Implemented in antoinevalentinHA#60 (branch
feat/issue-16-story-versions), option A.LibraryService: a UUID's artefacts ordered highest version first, timestamp only breaking ties; metadata refreshed from the highest versionchooseDropActionrestricted to the current version;isDowngrade+ confirmation dialog (en/fr) on every path to the device;vNbadge on the library tileLibraryVersionOrderingTest(3),packs.test.js(+13); CI green on Ubuntu, Windows and Web UIAwaiting review/merge by the upstream owner.