feat(plex): a title opens its page, the picture plays; an episode links up
A card title lit like a link but played the item. Now the picture plays and the title opens the page of what it names: a movie's or an episode's info page, a show's page, and for an episode standing as its show (Recently watched) the show. Every poster and episode card carries it (grid, rails, person, collection, season, related, Home), a card with no page keeps a plain title, and the season page gains the menu's Details row too. The episode page had no way up: the detail now serves the show's and the season's rating keys, and on the page the show title opens the show and "S1·E25" the season (Back returns to where the page was).
This commit is contained in:
@@ -173,6 +173,55 @@ describe("PlexInfo enriched detail (page)", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("an episode page links up to its show and season", () => {
|
||||
const episode: PlexItemDetail = {
|
||||
...detail,
|
||||
id: "e1",
|
||||
kind: "episode",
|
||||
title: "Pilot",
|
||||
show_title: "A Show",
|
||||
show_id: "s1",
|
||||
season_id: "se1",
|
||||
season_number: 1,
|
||||
episode_number: 25,
|
||||
tmdb: null,
|
||||
};
|
||||
|
||||
it("the show title opens the show, the episode number its season", () => {
|
||||
const onOpenShow = vi.fn();
|
||||
const onOpenSeason = vi.fn();
|
||||
wrap(
|
||||
<PlexInfo
|
||||
onPlayItem={noop}
|
||||
detail={episode}
|
||||
variant="page"
|
||||
onOpenShow={onOpenShow}
|
||||
onOpenSeason={onOpenSeason}
|
||||
/>,
|
||||
);
|
||||
fireEvent.click(screen.getByRole("button", { name: "A Show" }));
|
||||
expect(onOpenShow).toHaveBeenCalledWith("s1");
|
||||
fireEvent.click(screen.getByRole("button", { name: "S1·E25" }));
|
||||
expect(onOpenSeason).toHaveBeenCalledWith("s1", "se1");
|
||||
expect(screen.getByText(/— Pilot/)).toBeTruthy();
|
||||
});
|
||||
|
||||
it("over the running player the header stays plain text", () => {
|
||||
wrap(
|
||||
<PlexInfo
|
||||
onPlayItem={noop}
|
||||
detail={episode}
|
||||
variant="overlay"
|
||||
onOpenShow={noop}
|
||||
onOpenSeason={noop}
|
||||
/>,
|
||||
);
|
||||
expect(screen.queryByRole("button", { name: "A Show" })).toBeNull();
|
||||
expect(screen.queryByRole("button", { name: "S1·E25" })).toBeNull();
|
||||
expect(screen.getByText("S1·E25 — Pilot")).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
// The owner's layout: a main column (collection strips → crew → cast) beside a sidebar of
|
||||
// facts (details, keywords); a column with nothing in it is not rendered and the other takes the width.
|
||||
// The owner's pick: the hero's text stopped at ~55% of the panel. The facts and the key crew are
|
||||
|
||||
Reference in New Issue
Block a user