From ff0c89e5a398c693fe8aa3798aa1eb9c577cf7da Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 5 Feb 2026 21:28:50 +0200 Subject: [PATCH] feat(bookmarks): collapse on mobile into single icon (closes #5464) --- .../src/translations/en/translation.json | 3 + .../widgets/launch_bar/BookmarkButtons.tsx | 56 ++++++++++++++----- 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index 7ffe41d16..9f33fd8c3 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -2280,5 +2280,8 @@ "title_one": "{{count}} tab", "title_other": "{{count}} tabs", "more_options": "More options" + }, + "bookmark_buttons": { + "bookmarks": "Bookmarks" } } diff --git a/apps/client/src/widgets/launch_bar/BookmarkButtons.tsx b/apps/client/src/widgets/launch_bar/BookmarkButtons.tsx index f3b88c7aa..f7ead77bd 100644 --- a/apps/client/src/widgets/launch_bar/BookmarkButtons.tsx +++ b/apps/client/src/widgets/launch_bar/BookmarkButtons.tsx @@ -1,11 +1,16 @@ -import { useContext, useMemo } from "preact/hooks"; -import { LaunchBarContext, LaunchBarDropdownButton, useLauncherIconAndTitle } from "./launch_bar_widgets"; -import { CSSProperties } from "preact"; -import type FNote from "../../entities/fnote"; -import { useChildNotes, useNoteLabelBoolean } from "../react/hooks"; import "./BookmarkButtons.css"; + +import { CSSProperties } from "preact"; +import { useContext, useMemo } from "preact/hooks"; + +import type FNote from "../../entities/fnote"; +import froca from "../../services/froca"; +import { t } from "../../services/i18n"; +import { useChildNotes, useNoteLabelBoolean } from "../react/hooks"; import NoteLink from "../react/NoteLink"; +import ResponsiveContainer from "../react/ResponseContainer"; import { CustomNoteLauncher } from "./GenericButtons"; +import { LaunchBarContext, LaunchBarDropdownButton, useLauncherIconAndTitle } from "./launch_bar_widgets"; const PARENT_NOTE_ID = "_lbBookmarks"; @@ -19,17 +24,42 @@ export default function BookmarkButtons() { const childNotes = useChildNotes(PARENT_NOTE_ID); return ( -
- {childNotes?.map(childNote => )} -
- ) + + {childNotes?.map(childNote => )} + + } + mobile={ + +
+
    + {childNotes?.map(childNote => )} +
+
+
+ } + /> + ); } function SingleBookmark({ note }: { note: FNote }) { const [ bookmarkFolder ] = useNoteLabelBoolean(note, "bookmarkFolder"); - return bookmarkFolder - ? - : note.noteId} /> + return + : note.noteId} /> + } + mobile={ +
  • + +
  • + } + />; } function BookmarkFolder({ note }: { note: FNote }) { @@ -55,5 +85,5 @@ function BookmarkFolder({ note }: { note: FNote }) { - ) + ); }