feat(design): a page's background menu on the five list pages (E28 S3e4c)

A right-click on the EMPTY area of a page opens a menu of that page's own
toolbar: the feed (sort, reshuffle, view, watch state, content, source, clear
filters), the Plex library grid (sort, watch state, clear), the channel manager
(layout, the cards' sort, sync status, edit tags, clear the tag filter, read
subscriptions), a playlist (play all, group by, reset view, save order,
undo/redo, the list's own menu) and the notification center (mark all read).
No destructive row and no backfill.

PageShell listens on the page area; lib/backgroundTarget decides empty (not
text, a control, a link, media, or a row/card with its own menu). Shift+right-
click, a touch long-press and a right-click on selected words keep the
browser's menu. ui/PageMenu registers while mounted, so a loading or error
state keeps the browser's menu too. The rows mirror each control through
ui/pageMenuItems (sortSubmenu via pickSort, choiceSubmenu, multiSubmenu).
pageMenuScope.contract.test.ts pins the five pages.
This commit is contained in:
2026-09-26 20:48:53 +02:00
parent f8ced6d819
commit 97381e65d0
19 changed files with 877 additions and 56 deletions
+11
View File
@@ -0,0 +1,11 @@
import { type ActionMenuItem } from "./ActionMenu";
import { ContextMenu } from "./ContextMenu";
import { usePageMenu } from "./pageMenuSlot";
/** The page's background menu (./pageMenuSlot). Render it in the branch of the page it belongs to — while
* mounted, a right-click on the page's empty area opens it; unmounted (a loading or error state, a
* different mode of the page), the browser's menu stays. `items` mirror the page's toolbar. */
export function PageMenu({ ariaLabel, items }: { ariaLabel: string; items: ActionMenuItem[] }) {
const menu = usePageMenu();
return <ContextMenu menu={menu} ariaLabel={ariaLabel} items={menu.open ? items : []} />;
}