feat: deletion confirm & undo - #40
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds safer deletion UX (confirmation + undo) and tightens cloud-sync deletion semantics by clearing local deletion tombstones when an entry is restored, preventing accidental deletions from being propagated after an undo.
Changes:
- Add delete confirmation dialog and “Undo” snackbar flow for multi-select deletion in the main app UI.
- Introduce
clearLocalDeletionTombstone()and wire it intoDiaryRepository.restore()to remove sync tombstones on restore. - Add sync-focused tests covering restore/tombstone clearing and ensuring restored entries sync without stale tombstones.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| composeApp/src/commonTest/kotlin/io/github/smiling_pixel/sync/SyncManagerTest.kt | Adds tests validating restore clears tombstones and prevents stale deletion propagation in sync. |
| composeApp/src/commonMain/kotlin/io/github/smiling_pixel/sync/SyncManager.kt | Introduces helper to clear a local deletion tombstone after restore. |
| composeApp/src/commonMain/kotlin/io/github/smiling_pixel/database/DiaryRepository.kt | Adds restore() API and integrates tombstone clearing into the repository layer. |
| composeApp/src/commonMain/kotlin/io/github/smiling_pixel/App.kt | Adds confirmation dialog + undo snackbar flow for deleting selected entries. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
This pull request introduces an undo feature for diary entry deletion, including a confirmation dialog and integration with cloud sync tombstones. The main changes add user feedback and error recovery for accidental deletions, ensure proper sync state, and provide comprehensive tests for the new behavior.