fix(plex): the player's ⋯ and tracks lists are real menus, and every close returns the focus

They were hand-built divs: no menu roles, no arrow keys, and Escape left the
focus on <body>. Both run on the popover engine now (media-tone rows), and the
tuning panel is a labelled dialog that takes the focus and hands it back to ⋯.
This commit is contained in:
2026-09-27 14:22:37 +02:00
parent 9bedd96774
commit a975ab627a
8 changed files with 224 additions and 90 deletions
@@ -261,9 +261,9 @@ describe("the subtitle poll and notice", () => {
await screen.findByText("Title A");
fireEvent.click(screen.getByLabelText("plex.player.tracks"));
const off = await screen.findByText("plex.player.subOff");
expect(off.closest("button")?.getAttribute("aria-pressed")).toBe("false");
const pressed = document.querySelectorAll('[aria-pressed="true"]');
expect([...pressed].map((b) => b.textContent)).toEqual(["English"]); // the saved subtitle
expect(off.closest('[role="menuitemradio"]')?.getAttribute("aria-checked")).toBe("false");
const checked = document.querySelectorAll('[role="menuitemradio"][aria-checked="true"]');
expect([...checked].map((b) => b.textContent)).toEqual(["English"]); // the saved subtitle
});
});