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.
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import { useTranslation } from "react-i18next";
|
|
import { type PlexCard } from "../lib/api";
|
|
import { type ActionMenuItem } from "./ui/ActionMenu";
|
|
import { ContextMenu } from "./ui/ContextMenu";
|
|
import { type ContextMenuController } from "./ui/useContextMenu";
|
|
import { type PlexCardActions } from "./usePlexCardActions";
|
|
|
|
/** A Plex poster list's one menu: every trigger — right-click, long-press, Shift+F10 and each card's
|
|
* "…" — opens it with the title's whole action list (`usePlexCardActions`, held by the list because
|
|
* its cards' hover "add" opens the same dialog). Render ONE per list, outside the cards. */
|
|
export function PlexMenu({
|
|
menu,
|
|
actions,
|
|
pin = true,
|
|
extra,
|
|
}: {
|
|
menu: ContextMenuController<PlexCard>;
|
|
actions: PlexCardActions;
|
|
/** False for a list of episodes: an episode is not a comfort-shelf kind. */
|
|
pin?: boolean;
|
|
/** The host list's own rows for a title, after the shared ones (a collection's "Remove"). */
|
|
extra?: (c: PlexCard) => ActionMenuItem[];
|
|
}) {
|
|
const { t } = useTranslation();
|
|
const c = menu.target;
|
|
return (
|
|
<>
|
|
<ContextMenu
|
|
menu={menu}
|
|
ariaLabel={t("plex.menu")}
|
|
items={c ? [...actions.items(c, { pin }), ...(extra?.(c) ?? [])] : []}
|
|
/>
|
|
{actions.panel}
|
|
</>
|
|
);
|
|
}
|