commit bd497e5623a7c2632750341e960161e6603de813
parent 8667b5a6fa2f9057109e0afdcffbd0ff8ffd0f83
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 22 Sep 2026 16:31:08 -0400
ask: the hub's /ask needs the whole provider stack, not one layer
Adding SearchSessionProvider uncovered the next throw: the session
itself calls usePlayer (it opens a transcript at a cited timestamp), so
/ask died on "usePlayer must be inside PlayerProvider" in the prerender
and in the browser both. AskHub now mounts what SiteWorkspace mounts for
a single site, in the same order — PlayerProvider, the data source, the
session — with TranscriptModal and PostModal as siblings, so a citation
in the hub's chat has something to open.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat:
1 file changed, 25 insertions(+), 12 deletions(-)
diff --git a/export/app/ask/AskHub.tsx b/export/app/ask/AskHub.tsx
@@ -5,6 +5,9 @@
// across every shelved archive. Mirrors HubHome's MultiSiteDataProvider wiring.
import { useMemo } from "react";
+import { PlayerProvider } from "yt-dlp-transcript-common/components/PlayerProvider";
+import TranscriptModal from "yt-dlp-transcript-common/components/TranscriptModal";
+import PostModal from "yt-dlp-transcript-common/components/PostModal";
import {
MultiSiteDataProvider,
type FederatedSite,
@@ -25,18 +28,28 @@ export default function AskHub() {
[sites],
);
+ // The whole provider stack, in the order SiteWorkspace mounts it for a single
+ // site — PlayerProvider, then the data source, then the session — because
+ // hub mode bypasses that shell entirely and /ask is on its own here.
+ //
+ // None of these are optional: AskChat's retrieval reads the committed query
+ // tree, the filters and runQueryTree out of useSearchSession, and the session
+ // itself calls usePlayer (it opens a transcript at a cited timestamp). A
+ // missing provider THROWS, so the hub build's prerender of /ask failed and
+ // took the whole route with it — which is why e2e:2origin was red. The fix is
+ // the stack, never an opt-out of prerendering.
return (
- <MultiSiteDataProvider sites={federated}>
- {/* AskChat's retrieval runs through the SAME session the results page
- uses (useAskChat calls useSearchSession for the query tree, the
- filters and runQueryTree), so the provider has to be here. In
- single-site mode the workspace shell supplies it; hub mode bypasses
- that shell, and without this the hub build's prerender of /ask threw
- on the missing context — the whole route, not just the chat. This is
- the same nesting HubHome gets through TranscriptSearch. */}
- <SearchSessionProvider>
- <AskChat />
- </SearchSessionProvider>
- </MultiSiteDataProvider>
+ <PlayerProvider>
+ <MultiSiteDataProvider sites={federated}>
+ <SearchSessionProvider>
+ <AskChat />
+ </SearchSessionProvider>
+ </MultiSiteDataProvider>
+ {/* The viewers a citation opens into, siblings of the session exactly as
+ HubHome and SiteWorkspace mount them — a cited link with nothing to
+ open is the failure this avoids. */}
+ <TranscriptModal />
+ <PostModal />
+ </PlayerProvider>
);
}