From 25ef78da91b5067929b9db102d81b6d7fb58e235 Mon Sep 17 00:00:00 2001 From: Will Gordon Date: Fri, 16 Oct 2026 23:12:40 -0400 Subject: [PATCH 1/7] feat(notifications): adds validated action links to toast and drawer --- .../components/shared/NotificationDrawer.tsx | 11 ++++ src/app/components/shared/ToastContainer.tsx | 13 +++- src/app/lib/errors.ts | 43 +++++++++--- src/app/lib/sentry.ts | 3 +- .../shared/NotificationDrawer.test.tsx | 18 +++++ .../components/shared/ToastContainer.test.tsx | 24 +++++++ tests/lib/errors.test.ts | 65 +++++++++++++++++++ tests/lib/sentry.test.ts | 6 ++ 8 files changed, 173 insertions(+), 10 deletions(-) diff --git a/src/app/components/shared/NotificationDrawer.tsx b/src/app/components/shared/NotificationDrawer.tsx index 01ee0b48..fcdbed42 100644 --- a/src/app/components/shared/NotificationDrawer.tsx +++ b/src/app/components/shared/NotificationDrawer.tsx @@ -6,6 +6,7 @@ import { clearNotifications, dismissError, addMutedSource, + isSafeInternalHref, } from "../../lib/errors"; import { relativeTime } from "../../lib/format"; import { severityConfig } from "./ToastContainer"; @@ -104,6 +105,16 @@ export default function NotificationDrawer(props: NotificationDrawerProps) { (will retry) )} + + {" "} + props.onClose()} + class="link link-primary font-medium ml-1" + > + {notif.action!.label} + +

{relativeTime(new Date(notif.timestamp).toISOString())} diff --git a/src/app/components/shared/ToastContainer.tsx b/src/app/components/shared/ToastContainer.tsx index 2249ba81..3dbad4ca 100644 --- a/src/app/components/shared/ToastContainer.tsx +++ b/src/app/components/shared/ToastContainer.tsx @@ -1,7 +1,8 @@ -import { createEffect, createSignal, For, onCleanup } from "solid-js"; +import { createEffect, createSignal, For, onCleanup, Show } from "solid-js"; import { getNotifications, isMuted, + isSafeInternalHref, type AppNotification, type NotificationSeverity, } from "../../lib/errors"; @@ -291,6 +292,16 @@ export default function ToastContainer() { {item.notification.retryable && ( (will retry) )} + + {" "} + dismissToast(item.notification.id)} + class="underline font-medium hover:opacity-80 ml-1" + > + {item.notification.action!.label} + + + + + - {jiraAuth()?.siteName ?? ""} + {jiraAuth()?.siteName ?? config.jira?.siteName ?? ""} - {config.jira?.authMethod === "token" ? "API Token" : "OAuth"} +

+ {config.jira?.authMethod === "token" ? "API Token" : "OAuth"} + + + +
+ +
+

+ Generate a new token at{" "} + + Atlassian API tokens + {" "} + (use Create API token, not "with scopes"). +

+
{ e.preventDefault(); void handleReplaceJiraToken(); }}> +
+ setReplaceJiraEmail(e.currentTarget.value)} + /> + setReplaceJiraTokenInput(e.currentTarget.value)} + /> + + + +
+ + +
+
+
+
+
{ setShowFieldPicker((v) => !v); setTimeout(() => { (document.querySelector("[data-picker-search]") as HTMLElement | null)?.focus(); }, 0); @@ -1450,6 +1742,7 @@ export default function SettingsPage() {