diff --git a/apps/client/src/menus/tree_context_menu.ts b/apps/client/src/menus/tree_context_menu.ts index 8e8f2ed16..fdc5c20c6 100644 --- a/apps/client/src/menus/tree_context_menu.ts +++ b/apps/client/src/menus/tree_context_menu.ts @@ -13,6 +13,7 @@ import type NoteTreeWidget from "../widgets/note_tree.js"; import type FAttachment from "../entities/fattachment.js"; import type { SelectMenuItemEventListener } from "../components/events.js"; import utils from "../services/utils.js"; +import attributes from "../services/attributes.js"; // TODO: Deduplicate once client/server is well split. interface ConvertToAttachmentResponse { @@ -55,6 +56,7 @@ export default class TreeContextMenu implements SelectMenuItemEventListener { + if (!note) return; + if (!isArchived) { + attributes.addLabel(note.noteId, "archived"); + } else { + attributes.removeOwnedLabelByName(note, "archived"); + } + }, + enabled: noSelectedNotes + }, { title: `${t("tree-context-menu.delete")} `, command: "deleteNotes", diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index c084cf7ec..6a615ecef 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -1594,6 +1594,8 @@ "open-in-a-new-split": "Open in a new split", "insert-note-after": "Insert note after", "insert-child-note": "Insert child note", + "archive": "Archive", + "unarchive": "Unarchive", "delete": "Delete", "search-in-subtree": "Search in subtree", "hoist-note": "Hoist note",