Skip to content

Desktop: Resolves #10763: Permanent notebook deletion implemented #12508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

outrodani
Copy link

This pull request partially fixes #10763 by adding a "permanently delete notebook" option on the desktop app.

Changes:

Added a permanentlyDeleteFolder command to ‎packages/app-desktop/gui/WindowCommandsAndDialogs/commands.
Added a permanentlyDeleteFolder function to ‎packages/lib/models/Folder.ts which deletes all notes inside a selected folder, then recursively calls itself again for every subfolder inside the selected folder, and finally deletes the folder itself.

Steps to test the feature:

  1. Create a notebook;
  2. Add a note to the notebook added in 1) (optional);
  3. Add a notebook to the notebook added in 1) (optional);
  4. Add a note to the notebook added in 3) (optional);
  5. Delete the notebook added in 1);
  6. Permanently delete the notebook;

Expected behavior:

The permanently deleted notebook, along with everything inside it, should be gone from the trash.

0605.1.2.mp4

outrodani and others added 3 commits June 6, 2025 00:31
A new command was added to the gui when right clicking a folder in the
trash, enabling the user to permanently delete it, along with other
folders and notes inside it. The command calls a function that deletes
the folder as well as anything that it contains.

Co-autored-by: Pedro Dias <pedro.miguel.ramalho.dias@tecnico.ulisboa.pt>
@@ -163,6 +163,28 @@ export default class Folder extends BaseItem {
});
}

public static async permanentlyDeleteFolder(folderId: string, sourceDescription: string) {
Copy link
Owner

@laurent22 laurent22 Jun 28, 2025

Choose a reason for hiding this comment

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

I'll need to review this more in details but just now I'm not sure what's the difference between this and calling Folder.delete() along with deleteChildren and toTrash=false? And if Folder.delete doesn't already do this then maybe that's the function that needs to be fixed?

Also it should not be called "permanentlyDelete". Permanent deletion is a user-facing concept that should not appear in code.

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.

Missing options to individually remove deleted notebooks (and notes on Android) from trash
2 participants