Skip to content

feat: deletion confirm & undo - #40

Merged
SmilingPixel merged 5 commits into
mainfrom
feat/deletion_confirm_undo_0808
Aug 15, 2026
Merged

feat: deletion confirm & undo#40
SmilingPixel merged 5 commits into
mainfrom
feat/deletion_confirm_undo_0808

Conversation

@SmilingPixel

Copy link
Copy Markdown
Owner

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 into DiaryRepository.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.

Comment thread composeApp/src/commonMain/kotlin/io/github/smiling_pixel/App.kt Outdated
@SmilingPixel
SmilingPixel merged commit 75b662a into main Aug 15, 2026
3 checks passed
@SmilingPixel
SmilingPixel deleted the feat/deletion_confirm_undo_0808 branch August 15, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants