Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 7 additions & 24 deletions packages/viewer/src/client/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ const wsid = isShareMode ? "" : (_seg[1] ?? "");
const apiBase = isShareMode ? `/s/${shareToken}` : `/w/${wsid}`;
// Read-only: the built-in /w/demo/ showcase AND every share view. Hides clear/console/share controls.
const READONLY = isShareMode || wsid === "demo";
// Experimental features (agent console / board history) are hidden by default. Reveal with
// `?experimental=1` (sticky via localStorage `tc-experimental`); `?experimental=0` hides them again.
const EXPERIMENTAL = (() => {
try {
const q = new URLSearchParams(location.search).get("experimental");
if (q !== null) localStorage.setItem("tc-experimental", q === "0" || q === "" ? "" : "1");
return !!localStorage.getItem("tc-experimental");
} catch {
return false;
}
})();
// Honor the OS "reduce motion" setting for auto-advancing (`live`) scopes: render one frame then
// freeze, instead of looping. `frozenLive` tracks scopes already shown their first frame.
const REDUCE_MOTION = typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
Expand Down Expand Up @@ -1265,20 +1254,14 @@ if (isShareMode) {
document.getElementById("history-toggle")?.remove();
document.getElementById("templates")?.remove(); // keep the public demo from exposing the library
} else {
const templatesBtn = document.getElementById("templates") as HTMLButtonElement | null; // not experimental
initConsole();
// Targeted feedback: pin a comment to a pane/element via double-click, touch long-press, or
// `c` over the hovered element. Rides the console's inbox POST.
initTargetedFeedback({ send: sendPinnedMessage, isEnabled: isConsoleOn });
const ht = document.getElementById("history-toggle");
if (ht) ht.onclick = () => toggleHistory(!historyEnabled);
const templatesBtn = document.getElementById("templates") as HTMLButtonElement | null;
if (templatesBtn) { templatesBtn.hidden = false; templatesBtn.onclick = () => void openTemplatesPopover(templatesBtn); }
if (EXPERIMENTAL) {
initConsole();
// Targeted feedback: pin a comment to a pane/element via double-click, touch long-press, or
// `c` over the hovered element. Rides the console's inbox POST; gated by the same beta flag.
initTargetedFeedback({ send: sendPinnedMessage, isEnabled: isConsoleOn });
const ht = document.getElementById("history-toggle");
if (ht) ht.onclick = () => toggleHistory(!historyEnabled);
} else {
// Experimental features off by default — hide the chat console + board-history toggles entirely.
document.getElementById("console-toggle")?.remove();
document.getElementById("history-toggle")?.remove();
}
}
const shareBtn = document.getElementById("share") as HTMLButtonElement | null;
if (shareBtn) shareBtn.onclick = () => void openSharePopover(shareBtn);
Expand Down
Loading