1// Diagnostics stay hidden until the tilde key reveals them —2// the same key that toggles inspect mode in loop mode, so ` means3// "dev view" everywhere. The M/C shortcuts still work while hidden.4const DEV_IDS = ["stats"];56export function installDevUi(): void {7 const els = DEV_IDS8 .map((id) => document.getElementById(id))9 .filter((el): el is HTMLElement => el !== null);10 let shown = false;11 const apply = () => {12 for (const el of els) el.style.display = shown ? "" : "none";13 };14 apply();15 addEventListener("keydown", (e) => {16 const target = e.target as HTMLElement | null;17 if (18 target?.isContentEditable || target?.closest("input, textarea, select")19 ) return;20 if (e.code === "Backquote") {21 shown = !shown;22 apply();23 }24 });25}