From 151dcd26e10ade4059f7a4bece0617291664dd71 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Fri, 20 Mar 2026 17:51:11 +0530 Subject: [PATCH] refactor: enhance UI components for consistency and user experience - Updated various card components across Google Drive, Linear, and Notion tools to include the `select-none` class for improved user interaction by preventing text selection. - Ensured consistent styling and behavior in loading states and error handling across different tool UIs, enhancing overall usability and visual coherence. --- .../tool-ui/google-drive/create-file.tsx | 8 ++++---- .../tool-ui/google-drive/trash-file.tsx | 12 ++++++------ .../tool-ui/linear/create-linear-issue.tsx | 12 ++++++------ .../tool-ui/linear/delete-linear-issue.tsx | 16 ++++++++-------- .../tool-ui/linear/update-linear-issue.tsx | 14 +++++++------- .../tool-ui/notion/create-notion-page.tsx | 8 ++++---- .../tool-ui/notion/delete-notion-page.tsx | 12 ++++++------ .../tool-ui/notion/update-notion-page.tsx | 10 +++++----- 8 files changed, 46 insertions(+), 46 deletions(-) diff --git a/surfsense_web/components/tool-ui/google-drive/create-file.tsx b/surfsense_web/components/tool-ui/google-drive/create-file.tsx index 342344a8f..801223106 100644 --- a/surfsense_web/components/tool-ui/google-drive/create-file.tsx +++ b/surfsense_web/components/tool-ui/google-drive/create-file.tsx @@ -467,7 +467,7 @@ function InsufficientPermissionsCard({ result }: { result: InsufficientPermissio function ErrorCard({ result }: { result: ErrorResult }) { return ( -
Failed to create Google Drive file
Google Drive authentication expired @@ -497,7 +497,7 @@ function AuthErrorCard({ result }: { result: AuthErrorResult }) { function SuccessCard({ result }: { result: SuccessResult }) { return ( -
{result.message || "Google Drive file created successfully"} @@ -534,7 +534,7 @@ export const CreateGoogleDriveFileToolUI = makeAssistantToolUI< render: function CreateGoogleDriveFileUI({ args, result, status }) { if (status.type === "running") { return ( -
Google Drive authentication expired @@ -396,7 +396,7 @@ function AuthErrorCard({ result }: { result: AuthErrorResult }) { function WarningCard({ result }: { result: WarningResult }) { return ( -
Partial success
@@ -411,7 +411,7 @@ function WarningCard({ result }: { result: WarningResult }) { function ErrorCard({ result }: { result: ErrorResult }) { return ( -Failed to delete file
{result.message}
@@ -436,7 +436,7 @@ function NotFoundCard({ result }: { result: NotFoundResult }) { function SuccessCard({ result }: { result: SuccessResult }) { return ( -{result.message || "File moved to trash successfully"} @@ -464,7 +464,7 @@ export const DeleteGoogleDriveFileToolUI = makeAssistantToolUI< render: function DeleteGoogleDriveFileUI({ result, status }) { if (status.type === "running") { return ( -
All Linear accounts expired @@ -531,7 +531,7 @@ function AuthErrorCard({ result }: { result: AuthErrorResult }) { function ErrorCard({ result }: { result: ErrorResult }) { return ( -
Failed to create Linear issue
{result.message || "Linear issue created successfully"} @@ -582,9 +582,9 @@ export const CreateLinearIssueToolUI = makeAssistantToolUI< render: function CreateLinearIssueUI({ args, result, status }) { if (status.type === "running") { return ( -
Linear authentication expired @@ -298,7 +298,7 @@ function AuthErrorCard({ result }: { result: AuthErrorResult }) { function ErrorCard({ result }: { result: ErrorResult }) { return ( -
Failed to delete Linear issue
Issue not found @@ -328,7 +328,7 @@ function NotFoundCard({ result }: { result: NotFoundResult }) { function WarningCard({ result }: { result: WarningResult }) { return ( -
Partial success
@@ -342,7 +342,7 @@ function WarningCard({ result }: { result: WarningResult }) { function SuccessCard({ result }: { result: SuccessResult }) { return ( -{result.message || "Linear issue archived successfully"} @@ -370,9 +370,9 @@ export const DeleteLinearIssueToolUI = makeAssistantToolUI< render: function DeleteLinearIssueUI({ result, status }) { if (status.type === "running") { return ( -
Linear authentication expired @@ -646,7 +646,7 @@ function AuthErrorCard({ result }: { result: AuthErrorResult }) { function ErrorCard({ result }: { result: ErrorResult }) { return ( -
Failed to update Linear issue
Issue not found @@ -676,7 +676,7 @@ function NotFoundCard({ result }: { result: NotFoundResult }) { function SuccessCard({ result }: { result: SuccessResult }) { return ( -
{result.message || "Linear issue updated successfully"} @@ -721,9 +721,9 @@ export const UpdateLinearIssueToolUI = makeAssistantToolUI< render: function UpdateLinearIssueUI({ result, status }) { if (status.type === "running") { return ( -
Notion authentication expired @@ -395,7 +395,7 @@ function AuthErrorCard({ result }: { result: AuthErrorResult }) { function ErrorCard({ result }: { result: ErrorResult }) { return ( -
Failed to create Notion page
{result.message || "Notion page created successfully"} @@ -446,7 +446,7 @@ export const CreateNotionPageToolUI = makeAssistantToolUI< render: function CreateNotionPageUI({ args, result, status }) { if (status.type === "running") { return ( -
All Notion accounts expired @@ -298,7 +298,7 @@ function AuthErrorCard({ result }: { result: AuthErrorResult }) { function ErrorCard({ result }: { result: ErrorResult }) { return ( -
Failed to delete Notion page
Page not found @@ -328,7 +328,7 @@ function InfoCard({ result }: { result: InfoResult }) { function WarningCard({ result }: { result: WarningResult }) { return ( -
Partial success
@@ -348,7 +348,7 @@ function WarningCard({ result }: { result: WarningResult }) { function SuccessCard({ result }: { result: SuccessResult }) { return ( -{result.message || "Notion page deleted successfully"} @@ -386,7 +386,7 @@ export const DeleteNotionPageToolUI = makeAssistantToolUI< render: function DeleteNotionPageUI({ result, status }) { if (status.type === "running") { return ( -
Notion authentication expired @@ -325,7 +325,7 @@ function AuthErrorCard({ result }: { result: AuthErrorResult }) { function ErrorCard({ result }: { result: ErrorResult }) { return ( -
Failed to update Notion page
Page not found @@ -355,7 +355,7 @@ function InfoCard({ result }: { result: InfoResult }) { function SuccessCard({ result }: { result: SuccessResult }) { return ( -
{result.message || "Notion page updated successfully"} @@ -392,7 +392,7 @@ export const UpdateNotionPageToolUI = makeAssistantToolUI< render: function UpdateNotionPageUI({ args, result, status }) { if (status.type === "running") { return ( -