Every Plex poster list (library, Discover rails, person, show, season, collection, Home's rails) now opens one menu per list from the right-click, the long-press, Shift+F10 and the card's "…": play/open, watched, add to playlist, media info, copy title, the pin (usePlexCardActions + PlexMenu, replacing the pin-only PlexPinMenu). The card keeps its state at rest and shows watched / add to playlist / "…" on its picture on hover (ui/reveal.ts, shared with the video card); on touch the toggles are gone and a 44px "…" sits beside the title, while the watched pill stays. The hover ⓘ left the card; an episode's add button moved from its caption to the hover row. Seasons get their own short menu (open, watched, add, copy), labelled "Open season" (the card's overlay said "Open show"). Related shows are ordinary poster cards now. A collection's admin "Remove" X moved into its menu, still behind the confirmation. The collection grid is two columns on a phone. The unused .reveal-idle rule is gone.
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { useTranslation } from "react-i18next";
|
|
|
|
import { useComfortPin, type PinTarget } from "./comfortPin";
|
|
import { ContextMenu } from "./ui/ContextMenu";
|
|
import { type ContextMenuController } from "./ui/useContextMenu";
|
|
|
|
// The menu SURFACE for the comfort-shelf pin (E24 S3). Split from `comfortPin.tsx` for the same
|
|
// reason `ContextMenu.tsx` is split from `useContextMenu.ts`: a file that exports components and
|
|
// nothing else keeps react-refresh working for every surface that imports it.
|
|
|
|
/**
|
|
* The whole right-click menu for a surface whose only context action is the pin — the card grids and
|
|
* rails. Render ONE per list, outside the rows (see `ui/ContextMenu`), and spread
|
|
* `menu.triggerProps` on each row.
|
|
*
|
|
* `target` maps the row the user right-clicked to its pin; `title` names it in the confirmation
|
|
* toast. Both come from the call site because only it knows what its rows are.
|
|
*/
|
|
export function ComfortPinMenu<T>({
|
|
menu,
|
|
target,
|
|
title,
|
|
}: {
|
|
menu: ContextMenuController<T>;
|
|
target: (row: T) => PinTarget | null;
|
|
title: (row: T) => string;
|
|
}) {
|
|
const { t } = useTranslation();
|
|
const pin = useComfortPin(menu.open);
|
|
const row = menu.target;
|
|
return (
|
|
<ContextMenu
|
|
menu={menu}
|
|
ariaLabel={t("home.pin.menu")}
|
|
items={row ? pin.item(target(row), title(row)) : []}
|
|
/>
|
|
);
|
|
}
|