// Standalone fixture for the search-results-virtualization spec. Lives in // its own channel so it can co-exist with the standard `data.ts` fixture // without changing the route surface other specs depend on. export const CHANNEL = "Bulk Channel"; export const CHANNEL_SLUG = "bulk-channel"; export const VIDEO_COUNT = 120; // One video carries a large number of hits so we can verify the inner-list // (hits within a single card) is also virtualized — it lives at the // front of the result list so its rows are guaranteed to be on-screen. // 350 + 119 = 469 hits total, well under the DEFAULT_MAX_HITS=500 cap so // the pipeline doesn't mark the result `capped`. export const DENSE_VIDEO_INDEX = 0; export const DENSE_HIT_COUNT = 350; type Cue = { start: number; end: number; text: string }; function videoId(i: number): string { return `bulk-vid-${String(i).padStart(4, "0")}`; } export function slug(i: number): string { return `${CHANNEL_SLUG}/${videoId(i)}`; } function makeSummary(i: number) { return { slug: slug(i), id: videoId(i), channelSlug: CHANNEL_SLUG, title: `Bulk video #${i}`, uploadDate: "20260101", date: "2026-01-01", duration: "5:00", channel: CHANNEL, isLivestream: false, ageRestricted: false, isDeleted: false, isUnlisted: false, platform: "rumble" as const, webpageUrl: `https://example.com/${videoId(i)}`, }; } function cuesFor(i: number): Cue[] { if (i === DENSE_VIDEO_INDEX) { const out: Cue[] = []; for (let k = 0; k < DENSE_HIT_COUNT; k++) { const t = 1 + k * 2; out.push({ start: t, end: t + 2, text: `alpha hit ${k} in dense video` }); } return out; } // Other videos: a single matching line so each shows up as one hit. return [{ start: 5, end: 9, text: `alpha line for video ${i}` }]; } export function summaries() { const out = []; for (let i = 0; i < VIDEO_COUNT; i++) out.push(makeSummary(i)); return out; } export function summariesManifest() { return { version: 2, totalCount: VIDEO_COUNT, pageSize: VIDEO_COUNT, pageCount: 1, generatedAt: new Date().toISOString(), channels: [{ name: CHANNEL, count: VIDEO_COUNT }], }; } export function transcriptPage() { return summaries().map((s, i) => ({ ...s, duration: 300, description: "", cues: cuesFor(i), })); } export function channelTranscriptsManifest() { const slugToPage: Record = {}; for (let i = 0; i < VIDEO_COUNT; i++) slugToPage[videoId(i)] = 0; return { version: 1, channelSlug: CHANNEL_SLUG, pageCount: 1, maxPageBytes: 8388608, generatedAt: new Date().toISOString(), slugToPage, }; } export function subsManifest() { return { version: 3, channels: [], totalCount: 0, liveChatTotalCount: 0, generatedAt: new Date().toISOString(), }; }