Version banner, File locations section, final CSP (no unsafe-inline styles, frame-src none, object-src none)

The MTR viewer draws PDFs with pdf.js instead of an iframe the server's frame-ancestors refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-30 17:50:05 -06:00
co-authored by Claude Opus 5.5
parent da31b0a87a
commit 6e820ba0a5
17 changed files with 845 additions and 49 deletions
+19
View File
@@ -0,0 +1,19 @@
import { useBuildChanged, type BuildWatchOptions } from "../lib/buildWatch";
export const UPDATED_TEXT = "Packet Station was updated. Reload to get the new version.";
const reloadPage = () => window.location.reload();
/** A strip across the top when the server build changed since this page loaded. Reload is the user's call. */
export function VersionBanner({ onReload = reloadPage, ...opts }: BuildWatchOptions & { onReload?: () => void }) {
const changed = useBuildChanged(opts);
if (!changed) return null;
return (
<div className="vbanner" role="status" data-testid="version-banner">
<span>{UPDATED_TEXT}</span>
<button className="btn sm pri" type="button" onClick={onReload}>
Reload
</button>
</div>
);
}