Mandatory Media Deletion Confirmation for All Blocks/Sub-blocks Logseq Database

Issue Description

Accidental deletion of embedded media (images, videos, PDFs) in any block/sub-block – including during active editing – causes permanent, unrecoverable loss. Crucially:

  • Ctrl+Z DOES NOT restore deleted media, even immediately after removal

  • Occurs with both existing and newly pasted/uploaded media

  • Highest risk during cursor navigation near media elements

Proposed Solution

Implement a non-bypassable confirmation dialog for ALL media deletions:

  1. Triggers:

    • Backspace/Delete keys targeting media

    • Right-click → “Delete” on media

    • Applies in ALL editing modes (new blocks, nested blocks, mid-sentence)

  2. Popup Text:

    Permanently delete this media? (Cannot be undone with Ctrl+Z)  
    [ Cancel ]  [ Delete ]  
    
  3. Key Coverage:

    • Media in unsaved/newly created blocks

    • Sub-block media (indented content)

    • Bulk media selection deletions

  4. Setting: Settings > Editor > "Always confirm media deletion" (enabled by default)

Why This Matters

  • No Undo Safety Net: Unlike text, deleted media cannot be recovered via undo history

  • Critical Data Preservation: Prevents irreversible loss of research/assets

  • Reduced Anxiety: Eliminates panic from “point-of-no-return” actions

Technical Notes

  • Detection: Flag deletions targeting ![]() or {{embed }} syntax

  • Undo Stack Bypass: Media deletion operates outside standard undo/redo flow

Sorry if I wrote something wrong, I compiled this post using a neural network. I don’t speak English. :slightly_smiling_face:

Well, imagine you’re studying your old notes, clicking on them, reading them, deciding to edit a bit, and accidentally deleting a block with a media file or deleting a media file while editing a block.

And that’s it! There is no media file that was there, and there is no way to return it! 🤷‍♂

Isn’t this a panic? :grin:

Because of what I perceived as the limitations in file management with Logseq I’ve never really sued it to manage my files but this is a pretty major hurdle to transitioning into that (which I do want to do).

Thank you for flagging it up.