Files: restoring a Version has no Undo action #770

Open
opened 2026-10-02 13:10:12 +00:00 by kayg · 2 comments
Owner

Found during the source review for #427 on origin/dev at c4a61e8cf090170f35b1bed3350d9de20c83ecd5.

Decided behavior

DESIGN §11 (Versions), §34 (8 s Undo toast), and the owner UX completeness rule of 2026-10-02 require Undo for a state-changing action.

Evidence

apps/web/src/lib/files/InfoPanel.svelte:107–113 awaits restoreVersion, posts a plain confirmation and calls onchanged. Lines 257–259 expose the Restore action. The success toast has no action or retained identity for the content that was replaced.

Observed behavior

Restoring a Version replaces the current file. The User has no Undo in the confirmation and must manually find the previous content in Version history.

This is a source finding. No production build or live-server run was made in this review job.

Expected

Return or retain the identity of the content replaced by the restore. Offer Undo through the shared toast and Version route. Check the current revision before Undo so a later edit is not overwritten.

Test idea

Write two distinct file contents, restore the older Version and undo. Assert exact bytes and visible metadata. Add a third-party edit between Restore and Undo and check that it is preserved.

For UI evidence, use a production build at 390, 820 and 1440 px in light and dark, with macOS platform hints. Check pointer, keyboard and touch, plus reduced motion.

Duplicate check

Searched all issue titles and Version results. No specific Version-restore Undo ticket found. #667 covers the common mutation helper. #722 covers repaint after existing delete Undo, not this missing restore action.

Found during the source review for #427 on `origin/dev` at `c4a61e8cf090170f35b1bed3350d9de20c83ecd5`. ## Decided behavior DESIGN §11 (Versions), §34 (8 s Undo toast), and the owner UX completeness rule of 2026-10-02 require Undo for a state-changing action. ## Evidence `apps/web/src/lib/files/InfoPanel.svelte:107–113` awaits restoreVersion, posts a plain confirmation and calls onchanged. Lines 257–259 expose the Restore action. The success toast has no action or retained identity for the content that was replaced. ## Observed behavior Restoring a Version replaces the current file. The User has no Undo in the confirmation and must manually find the previous content in Version history. This is a source finding. No production build or live-server run was made in this review job. ## Expected Return or retain the identity of the content replaced by the restore. Offer Undo through the shared toast and Version route. Check the current revision before Undo so a later edit is not overwritten. ## Test idea Write two distinct file contents, restore the older Version and undo. Assert exact bytes and visible metadata. Add a third-party edit between Restore and Undo and check that it is preserved. For UI evidence, use a production build at 390, 820 and 1440 px in light and dark, with macOS platform hints. Check pointer, keyboard and touch, plus reduced motion. ## Duplicate check Searched all issue titles and Version results. No specific Version-restore Undo ticket found. #667 covers the common mutation helper. #722 covers repaint after existing delete Undo, not this missing restore action.
Author
Owner

Additional source check: the filesystem restore already snapshots the replaced content and returns its Version identity in WriteResult, but the Files route discards it and returns 204. Undo can use that identity and a current-content check to preserve a later edit.

Additional source check: the filesystem restore already snapshots the replaced content and returns its Version identity in `WriteResult`, but the Files route discards it and returns 204. Undo can use that identity and a current-content check to preserve a later edit.
Author
Owner

Starting work on #770 in branch job/undo-a11y-filesphotos, based at 9281e63b01. I am tracing the existing version restore and conditional-write APIs, then will add a regression for exact-byte Undo and stale-change rejection.

Starting work on #770 in branch job/undo-a11y-filesphotos, based at 9281e63b0164fd0297d959f37eb0008bfa0aa4d3. I am tracing the existing version restore and conditional-write APIs, then will add a regression for exact-byte Undo and stale-change rejection.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#770
No description provided.