From 193c9d8fa616e504361f2c17c7551611b0b6f6c2 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 16 Dec 2025 16:00:23 +0200 Subject: [PATCH] feat(breadcrumb): option to hide archived notes --- .../src/translations/en/translation.json | 3 +- apps/client/src/widgets/layout/Breadcrumb.css | 5 ++++ apps/client/src/widgets/layout/Breadcrumb.tsx | 30 ++++++++++++++++++- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index db876bee0..10a3cb8cb 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -2149,7 +2149,8 @@ "hoisted_badge_title": "Unhoist", "workspace_badge": "Workspace", "scroll_to_top_title": "Jump to the beginning of the note", - "create_new_note": "Create new child note" + "create_new_note": "Create new child note", + "empty_hide_archived_notes": "Hide archived notes" }, "breadcrumb_badges": { "read_only_explicit": "Read-only", diff --git a/apps/client/src/widgets/layout/Breadcrumb.css b/apps/client/src/widgets/layout/Breadcrumb.css index 76d5095c0..947f8266e 100644 --- a/apps/client/src/widgets/layout/Breadcrumb.css +++ b/apps/client/src/widgets/layout/Breadcrumb.css @@ -82,4 +82,9 @@ padding: 0 10px; width: 200px; } + + & > .filler { + flex-grow: 1; + height: 23px; + } } diff --git a/apps/client/src/widgets/layout/Breadcrumb.tsx b/apps/client/src/widgets/layout/Breadcrumb.tsx index aeb0d8d23..f51ab8fdc 100644 --- a/apps/client/src/widgets/layout/Breadcrumb.tsx +++ b/apps/client/src/widgets/layout/Breadcrumb.tsx @@ -19,6 +19,7 @@ import froca from "../../services/froca"; import hoisted_note from "../../services/hoisted_note"; import { t } from "../../services/i18n"; import note_create from "../../services/note_create"; +import options from "../../services/options"; import tree from "../../services/tree"; import ActionButton from "../react/ActionButton"; import { Badge } from "../react/Badge"; @@ -67,6 +68,11 @@ export default function Breadcrumb() { )) )} + +
); } @@ -277,7 +283,7 @@ function useNotePaths() { }; } -//#region Context menu +//#region Note Context menu function buildContextMenu(notePath: string, parentComponent: Component | null) { return async (e: MouseEvent) => { e.preventDefault(); @@ -398,3 +404,25 @@ function buildContextMenu(notePath: string, parentComponent: Component | null) { }; } //#endregion + +//#region Empty context menu +function buildEmptyAreaContextMenu() { + return (e: MouseEvent) => { + const hideArchivedNotes = (options.get("hideArchivedNotes_main") === "true"); + + e.preventDefault(); + contextMenu.show({ + items: [ + { + title: t("breadcrumb.empty_hide_archived_notes"), + handler: () => options.save("hideArchivedNotes_main", !hideArchivedNotes ? "true" : "false"), + checked: hideArchivedNotes + } + ], + x: e.pageX, + y: e.pageY, + selectMenuItemHandler: () => {} + }); + }; +} +//#endregion