From c5582554507810aa2e02773aa0a36879b44df4ee Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 20 Dec 2025 22:51:04 +0200 Subject: [PATCH] feat(client/bundle): add button to open script note --- apps/client/src/services/toast.ts | 10 +++++++++- apps/client/src/translations/en/translation.json | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/client/src/services/toast.ts b/apps/client/src/services/toast.ts index 4ab4f1efb..09aa8454b 100644 --- a/apps/client/src/services/toast.ts +++ b/apps/client/src/services/toast.ts @@ -1,6 +1,8 @@ import { signal } from "@preact/signals"; +import appContext from "../components/app_context.js"; import froca from "./froca.js"; +import { t } from "./i18n.js"; import utils from "./utils.js"; export interface ToastOptions { @@ -69,7 +71,13 @@ export async function showErrorForScriptNote(noteId: string, message: string) { title: note?.title ?? "", icon: note?.getIcon() ?? "bx bx-error-circle", message, - timeout: 15_000 + timeout: 15_000, + buttons: [ + { + text: t("toast.open-script-note"), + onClick: () => appContext.tabManager.openInNewTab(noteId, null, true) + } + ] }); } diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index 648fe747a..261f4e018 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -29,7 +29,8 @@ "widget-render-error": { "title": "Failed to render a custom React widget" }, - "widget-missing-parent": "Custom widget does not have mandatory 'parentWidget' property defined." + "widget-missing-parent": "Custom widget does not have mandatory 'parentWidget' property defined.", + "open-script-note": "Open script note" }, "add_link": { "add_link": "Add link",