From b3c51c8b49153a16cd2e73654d8e72ccea6934f1 Mon Sep 17 00:00:00 2001 From: Roland Date: Sat, 26 Sep 2026 12:21:11 -0600 Subject: [PATCH] bookmarks: user bookmarks in the navigation bar, stored in bookmarks.yaml A "Bookmarks" tab between Calculators and Flasher opens on hover or click and lists the user's bookmarks, with directories as flyout submenus (Menu.Sub). The mobile hamburger shows directories as labelled groups instead. The tab always shows, with an "Edit bookmarks" item, so the feature can be found before any bookmark exists. Bookmarks live in a new config-only bookmarks.yaml: a nested tree where a node with `children` is a directory and a node with `url` is a bookmark. Every node carries an integer id so the API can rename, move and delete without relying on names. A URL may be a path on this WROLPi, a port on this host (`:8096/` or `http://:8096/`, resolved against whatever hostname the browser used, so it works over LAN IP, mDNS and the hotspot alike), or an absolute URL. Each bookmark chooses whether to open in a new tab. The editor at /more/bookmarks follows the playlist items table: numbered rows, up/down/edit/delete, and inline "Add a bookmark" / "Add a directory" forms with a Location picker. Deleting a directory asks first, since its contents go with it. The menu and the editor are in the component gallery. Co-Authored-By: Claude Fable 5.1 --- app/src/App.js | 17 +- app/src/api.js | 43 +++ app/src/components/Apps.js | 2 + app/src/components/Bookmarks.js | 430 ++++++++++++++++++++++++++ app/src/components/Bookmarks.test.js | 160 ++++++++++ app/src/components/Nav.js | 55 +++- app/src/components/Nav.test.js | 82 +++++ app/src/components/ThemeSamplePage.js | 49 +++ app/src/contexts/BookmarksContext.js | 65 ++++ wrolpi/bookmarks.py | 191 ++++++++++++ wrolpi/bookmarks_api.py | 86 ++++++ wrolpi/common.py | 14 + wrolpi/contexts.py | 7 + wrolpi/root_api.py | 2 + wrolpi/test/test_bookmarks.py | 146 +++++++++ 15 files changed, 1336 insertions(+), 13 deletions(-) create mode 100644 app/src/components/Bookmarks.js create mode 100644 app/src/components/Bookmarks.test.js create mode 100644 app/src/contexts/BookmarksContext.js create mode 100644 wrolpi/bookmarks.py create mode 100644 wrolpi/bookmarks_api.py create mode 100644 wrolpi/test/test_bookmarks.py diff --git a/app/src/App.js b/app/src/App.js index 1e372a53..25881b13 100644 --- a/app/src/App.js +++ b/app/src/App.js @@ -17,6 +17,7 @@ import {ArchiveRoute} from "./components/Archive"; import {FilesRoute} from "./components/Files"; import {QueryProvider, StatusProvider} from "./hooks/customHooks"; import {FileWorkerStatusProvider} from "./contexts/FileWorkerStatusContext"; +import {BookmarksProvider} from "./contexts/BookmarksContext"; import {ChannelEditPage, ChannelNewPage, ChannelsPage} from "./components/Channels"; import {MapRoute} from "./components/Map"; import {MediaContextProvider, mediaStyles, StatusContext} from "./contexts/contexts"; @@ -69,13 +70,15 @@ function Root() { -
- -
- - - -