diff --git a/frontend/src/routes/(root)/(logged)/scripts/add/+page.svelte b/frontend/src/routes/(root)/(logged)/scripts/add/+page.svelte index a2d25c7e09..da01d90026 100644 --- a/frontend/src/routes/(root)/(logged)/scripts/add/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/scripts/add/+page.svelte @@ -34,6 +34,28 @@ const collabLang = page.url.searchParams.get('lang') as ScriptLang | null const wacParam = page.url.searchParams.get('wac') const importParam = page.url.searchParams.get('import') + + /** Some pages (run/[...run]'s "Fork" action, workspace_settings' + * error/success-handler template buttons) base64-JSON-encode a NewScript + * payload into the URL hash. That value is an explicit "open this script" + * intent and wins over local autosave, templates, hubs, and YAML imports. + * + * We can't use `decodeState` from utils.ts directly — it fires its own + * "Impossible to parse state" toast on failure, which would noise up the + * UI when the hash isn't a script payload at all (e.g. a route anchor). + */ + function decodeUrlScript(): Partial