Files
siftlode/frontend/src/watchMain.tsx
T
peter ae775b383c fix(boot): a stylesheet lost on the way is asked for again
A lost stylesheet left the page unstyled until a reload, and every e2e step that finds elements by
testid still passed on it. Only axe noticed: the one-off target-size failure on eight scattered
controls. Losing the main stylesheet on purpose gives those same eight.
2026-11-03 23:32:40 +01:00

30 lines
1.3 KiB
TypeScript

import React from "react";
import { createRoot } from "react-dom/client";
import { CrashBoundary } from "./components/ui/CrashBoundary";
import WatchPage from "./watch/WatchPage";
import { T } from "./watch/watchStrings";
import "./index.css";
import { installStaleBuildReload } from "./lib/staleBuild";
import { retryLostStylesheets } from "./lib/stylesheetRetry";
// The entry of a public /watch/<token> link (watch.html). Whoever opens it got the link from a
// friend: signed out, often on a phone, often on mobile data — so it imports the player page and
// what that page renders, and none of main.tsx's app (no providers, no app i18n, no client-log
// wiring: an anonymous viewer has no diagnostics consent to send it under). A contract test walks
// this file's imports and fails on any of those (`watchEntry.contract.test.ts`).
// A tab left open across a release reloads onto the new build instead of failing on a chunk.
installStaleBuildReload();
// A stylesheet lost on the way is asked for again rather than leaving the page unstyled.
retryLostStylesheets();
const crashCopy = () => ({ title: T.crashTitle, subtitle: T.crashHint, reload: T.reload });
createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<CrashBoundary copy={crashCopy}>
<WatchPage />
</CrashBoundary>
</React.StrictMode>,
);