MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / writeTabToUrl

Function writeTabToUrl

dashboard/shell/src/main.jsx:96–106  ·  view source on GitHub ↗
(name, { push = true } = {})

Source from the content-addressed store, hash-verified

94}
95
96function writeTabToUrl(name, { push = true } = {}) {
97 try {
98 const url = new URL(window.location);
99 if (url.searchParams.get("tab") === name) return;
100 url.searchParams.set("tab", name);
101 if (push) window.history.pushState({ tab: name }, "", url);
102 else window.history.replaceState({ tab: name }, "", url);
103 } catch {
104 /* URL state is best-effort */
105 }
106}
107
108// ---------------------------------------------------------------------------
109// Error boundary — wraps each plugin tab so one crash can't blank the shell

Callers 1

AppFunction · 0.85

Calls 1

setMethod · 0.45

Tested by

no test coverage detected