From 2d8d42bd9cee790c8884a75cbc1ea5f9aa113126 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Thu, 28 May 2026 15:40:18 +0200 Subject: [PATCH] refactor(web): polish automations detail view --- .../automation-detail-content.tsx | 24 ++++---- .../automation-definition-section.tsx | 2 +- .../components/automation-detail-loading.tsx | 60 ++++++++++++------- .../components/automation-runs-section.tsx | 2 +- .../automation-triggers-section.tsx | 2 +- .../components/plan-step-card.tsx | 2 +- .../components/run-details-panel.tsx | 2 +- .../[automation_id]/components/run-row.tsx | 2 +- .../components/runs-loading.tsx | 2 +- .../components/trigger-card.tsx | 2 +- .../new/components/automation-json-form.tsx | 2 +- .../layout/providers/LayoutDataProvider.tsx | 8 ++- 12 files changed, 65 insertions(+), 45 deletions(-) diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/automation-detail-content.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/automation-detail-content.tsx index 49df3633e..4085d47a8 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/automation-detail-content.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/automation-detail-content.tsx @@ -72,16 +72,20 @@ export function AutomationDetailContent({ canDelete={perms.canDelete} /> - - - - - +
+
+ + +
+
+ +
+
); } diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-definition-section.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-definition-section.tsx index 9545f363b..e8721d9b0 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-definition-section.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-definition-section.tsx @@ -24,7 +24,7 @@ export function AutomationDefinitionSection({ definition }: AutomationDefinition const hasInputs = !!definition.inputs; return ( - + Definition diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-detail-loading.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-detail-loading.tsx index 1d01305ee..0d6ba3110 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-detail-loading.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-detail-loading.tsx @@ -3,12 +3,13 @@ import { Card, CardContent, CardHeader } from "@/components/ui/card"; import { Skeleton } from "@/components/ui/skeleton"; /** - * Skeleton for the detail page. Same shell as the loaded view (header + - * two stacked cards) so the layout doesn't jump on data arrival. + * Skeleton for the detail page. Mirrors the loaded view's main/sidebar + * grid (Definition + Runs on the left, Triggers on the right) so layout + * doesn't reflow when data arrives. */ export function AutomationDetailLoading() { return ( -
+ <>
@@ -18,25 +19,38 @@ export function AutomationDetailLoading() {
- - - - - - - - - - - - - - - - - - - -
+
+
+ + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+
+ ); } diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-runs-section.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-runs-section.tsx index b6158cab2..d31bd696d 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-runs-section.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-runs-section.tsx @@ -23,7 +23,7 @@ export function AutomationRunsSection({ automationId }: AutomationRunsSectionPro const runs = data?.items ?? []; return ( - +
diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-triggers-section.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-triggers-section.tsx index 33c8373a1..558a089ac 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-triggers-section.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/automation-triggers-section.tsx @@ -23,7 +23,7 @@ export function AutomationTriggersSection({ canDelete, }: AutomationTriggersSectionProps) { return ( - + Triggers

diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/plan-step-card.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/plan-step-card.tsx index 3feb77712..b9fda00db 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/plan-step-card.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/plan-step-card.tsx @@ -15,7 +15,7 @@ interface PlanStepCardProps { */ export function PlanStepCard({ step, index }: PlanStepCardProps) { return ( -

+
{index + 1} diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/run-details-panel.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/run-details-panel.tsx index d1d46900a..94a96b199 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/run-details-panel.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/run-details-panel.tsx @@ -109,7 +109,7 @@ function Section({ function JsonBlock({ value }: { value: unknown }) { return ( -
+		
 			{JSON.stringify(value, null, 2)}
 		
); diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/run-row.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/run-row.tsx index b8d2bcc8b..02ca0569c 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/run-row.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/run-row.tsx @@ -24,7 +24,7 @@ export function RunRow({ run, automationId }: RunRowProps) { : formatRelativeDate(run.created_at); return ( -
+