Skip to content

Build your personal knowledge base with Trilium Notes

client/deleted notes dialog: add command palette integration

Adorian Doran07c82360da9c
diff --git a/apps/client/src/services/command_registry.spec.ts b/apps/client/src/services/command_registry.spec.ts
index 14e769b0a1..dc31b5c6da 100644
--- a/apps/client/src/services/command_registry.spec.ts
+++ b/apps/client/src/services/command_registry.spec.ts
@@ -91,7 +91,8 @@ describe("CommandRegistry default commands", () => {
"search-notes",
"search-in-subtree",
"show-search-history",
- "show-launch-bar"
+ "show-launch-bar",
+ "show-deleted-notes"
])
);
// getAllCommands returns a name-sorted list.
@@ -122,6 +123,9 @@ describe("CommandRegistry default commands", () => {
await registry.executeCommand("show-launch-bar");
expect(triggerCommand).toHaveBeenCalledWith("showLaunchBarSubtree");
+
+ await registry.executeCommand("show-deleted-notes");
+ expect(triggerCommand).toHaveBeenCalledWith("showDeletedNotes");
});
it("export-note and search-in-subtree skip triggering when there is no active note path", async () => {
diff --git a/apps/client/src/services/command_registry.ts b/apps/client/src/services/command_registry.ts
index 5ad87458b2..0dc75b8e46 100644
--- a/apps/client/src/services/command_registry.ts
+++ b/apps/client/src/services/command_registry.ts
@@ -96,6 +96,14 @@ export class CommandRegistry {
handler: () => appContext.triggerCommand("showLaunchBarSubtree")
});
+ this.register({
+ id: "show-deleted-notes",
+ name: t("command_palette.show_deleted_notes_title"),
+ description: t("command_palette.show_deleted_notes_description"),
+ icon: "bx bx-trash-alt",
+ handler: () => appContext.triggerCommand("showDeletedNotes")
+ });
+
this.register({
id: "pin-active-tab",
name: t("command_palette.pin_tab_title"),
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index d8d6f83526..d183abc1a2 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -2659,6 +2659,8 @@
"search_history_description": "View previous searches",
"configure_launch_bar_title": "Configure Launch Bar",
"configure_launch_bar_description": "Open the launch bar configuration, to add or remove items.",
+ "show_deleted_notes_title": "Show Deleted Notes",
+ "show_deleted_notes_description": "View and restore recently deleted notes",
"pin_tab_title": "Pin Tab",
"pin_tab_description": "Always keep this note open in this tab at the start of the tab bar and prevent it from being accidentally closed",
"unpin_tab_title": "Unpin Tab",