Add soft-delete (tombstone) functionality for particles #149

Merged
talksik merged 1 commits from claude/resolve-issue-146-JZGBg into master 2026-04-12 20:18:10 +00:00
talksik commented 2026-04-12 19:03:31 +00:00 (Migrated from github.com)

Summary

Implements soft-delete functionality for particles, allowing creators to delete their particles while keeping the Firestore document in place. Concurrent viewers see a "This particle was deleted" tombstone message instead of being jumped to the next particle.

Key Changes

  • New Components:

    • DeleteParticleOverlay: Modal dialog for confirming particle deletion with keyboard support (Esc to close)
    • DeletedParticleView: Displays a tombstone view for deleted particles with deleter attribution, auto-advances after 2 seconds when not paused
  • Type System Updates:

    • Added TombstoneFields to particle schema (deleted_at, deleted_by_human_id) for non-container particles
    • Added isParticleDeleted() utility function to check if a particle has been soft-deleted
    • Updated Firestore converter to handle tombstone field serialization/deserialization
  • Backend Integration:

    • Added softDeleteParticle() function to update particle with deletion metadata (idempotent operation)
    • Deletion is restricted to particle creators only, excluding container types (streams/folders)
  • UI Integration:

    • Added "Delete particle" menu item in stream top bar (destructive variant, visible only to creators of non-deleted, non-container particles)
    • Updated stream view to render tombstone for deleted particles and prevent reactions on deleted content
    • Updated particle list view to show trash icon for deleted particles

Implementation Details

  • Soft-delete keeps the Firestore document intact so concurrent viewers see inline deletion rather than content jumping
  • Tombstone auto-advances after 2 seconds (matching short text particle reading cadence) unless playback is paused
  • Deletion is idempotent—re-calling on already-deleted particles just refreshes timestamps
  • Keyboard support (Esc) for dismissing the delete confirmation overlay

https://claude.ai/code/session_01M2ShnZPvWfQzzvuu3Xm8b9

## Summary Implements soft-delete functionality for particles, allowing creators to delete their particles while keeping the Firestore document in place. Concurrent viewers see a "This particle was deleted" tombstone message instead of being jumped to the next particle. ## Key Changes - **New Components**: - `DeleteParticleOverlay`: Modal dialog for confirming particle deletion with keyboard support (Esc to close) - `DeletedParticleView`: Displays a tombstone view for deleted particles with deleter attribution, auto-advances after 2 seconds when not paused - **Type System Updates**: - Added `TombstoneFields` to particle schema (`deleted_at`, `deleted_by_human_id`) for non-container particles - Added `isParticleDeleted()` utility function to check if a particle has been soft-deleted - Updated Firestore converter to handle tombstone field serialization/deserialization - **Backend Integration**: - Added `softDeleteParticle()` function to update particle with deletion metadata (idempotent operation) - Deletion is restricted to particle creators only, excluding container types (streams/folders) - **UI Integration**: - Added "Delete particle" menu item in stream top bar (destructive variant, visible only to creators of non-deleted, non-container particles) - Updated stream view to render tombstone for deleted particles and prevent reactions on deleted content - Updated particle list view to show trash icon for deleted particles ## Implementation Details - Soft-delete keeps the Firestore document intact so concurrent viewers see inline deletion rather than content jumping - Tombstone auto-advances after 2 seconds (matching short text particle reading cadence) unless playback is paused - Deletion is idempotent—re-calling on already-deleted particles just refreshes timestamps - Keyboard support (Esc) for dismissing the delete confirmation overlay https://claude.ai/code/session_01M2ShnZPvWfQzzvuu3Xm8b9
Sign in to join this conversation.