fix(player): a related video played is tracked, and its list is honest about its state
A related video played in place is the player's item now: its title and its own watched / playlist / download controls, its progress checkpointed and resumed, marked watched at its end — and its end does not step the queue. Back returns to the opened video, where it was left. The related list: - its marks announce through the shared notice (the Notification Center finds them), join the host's player session (the feed refetches on close), and stay per write, so an earlier answer no longer undoes a later mark still on its way; - every host's state write patches the cached related lists, which are never refetched; - kept for the session (gcTime), a retry asks for the page that failed, a list read so far with nothing unseen says so, a refusal a retry cannot answer offers none, and the followed mark names itself on hover. Turned off on the instance (a limit of 0), the tab, the drawer button and the live-search buttons are left out. Keys: the player's keys and its focus reclaim defer to a layer above it (the drawer); going wide moves the drawer's list into the panel's tab; `j` goes on from the slot of a row removed inside the top layer; the help sheet lists the list keys over a layer that holds a list.
This commit is contained in:
@@ -167,4 +167,17 @@ describe("watch state and progress", () => {
|
||||
});
|
||||
expect(opts).toEqual({ quiet: true });
|
||||
});
|
||||
|
||||
it("a related list is quiet too, and sends its region and cursor", () => {
|
||||
void feedApi.related("a/b", "hu", "CUR1");
|
||||
const [url, , opts] = vi.mocked(req).mock.lastCall!;
|
||||
const u = new URL(url as string, "http://x");
|
||||
expect(u.pathname).toBe("/api/search/related/a%2Fb");
|
||||
expect(Object.fromEntries(u.searchParams)).toEqual({ region: "hu", cursor: "CUR1" });
|
||||
expect(opts).toEqual({ quiet: true });
|
||||
|
||||
void feedApi.related("abc", "topical", null);
|
||||
const first = new URL(vi.mocked(req).mock.lastCall![0] as string, "http://x");
|
||||
expect(Object.fromEntries(first.searchParams)).toEqual({ region: "topical" });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user