From 4c19a2330a5b1c317cbd2cc58b8dff53c6993604 Mon Sep 17 00:00:00 2001 From: Shine1i Date: Fri, 20 Feb 2026 14:19:52 +0100 Subject: [PATCH] refactor: simplify execution view by removing unused state and redundant logic --- .../components/executions/executions-view.tsx | 272 ++++++++---------- 1 file changed, 120 insertions(+), 152 deletions(-) diff --git a/studio/frontend/src/features/recipe-studio/components/executions/executions-view.tsx b/studio/frontend/src/features/recipe-studio/components/executions/executions-view.tsx index fbdc0b94b0..c10b1d5f5d 100644 --- a/studio/frontend/src/features/recipe-studio/components/executions/executions-view.tsx +++ b/studio/frontend/src/features/recipe-studio/components/executions/executions-view.tsx @@ -230,7 +230,6 @@ export function ExecutionsView({ onLoadDatasetPage, }: ExecutionsViewProps): ReactElement { const [detailTab, setDetailTab] = useState("overview"); - const [showRaw, setShowRaw] = useState(false); const [hiddenDatasetColumns, setHiddenDatasetColumns] = useState([]); const [expandedDatasetCells, setExpandedDatasetCells] = useState< Record @@ -248,12 +247,6 @@ export function ExecutionsView({ selectedExecution.recipeSignature !== currentSignature, ); - useEffect(() => { - if (!showRaw && detailTab === "raw") { - setDetailTab("overview"); - } - }, [detailTab, showRaw]); - useEffect(() => { setHiddenDatasetColumns([]); setExpandedDatasetCells({}); @@ -530,59 +523,26 @@ export function ExecutionsView({ ) : (
-
-
-
-

- {selectedExecution.kind} execution -

- - {formatStatus(selectedExecution.status)} - - {isStale && ( - Recipe changed since this run - )} -
-
- {canCancel && ( - - )} - -
-
-

- Started {formatTimestamp(selectedExecution.createdAt)} |{" "} - {selectedExecution.rows} rows | Duration{" "} - {formatDuration( - selectedExecution.createdAt, - selectedExecution.finishedAt, - )} -

+
+ {selectedExecution.kind} execution + + {formatStatus(selectedExecution.status)} + + {selectedExecution.rows} rows + Started {formatTimestamp(selectedExecution.createdAt)} + Duration {formatDuration(selectedExecution.createdAt, selectedExecution.finishedAt)} {selectedExecution.stage && ( -

+ Stage: {selectedExecution.stage} {selectedExecution.current_column ? ` | Column: ${selectedExecution.current_column}` : ""} -

+ )} + {isStale && Recipe changed since this run}
{showProgressPanel && ( @@ -674,17 +634,29 @@ export function ExecutionsView({ {(selectedExecution.status === "completed" || isInProgress(selectedExecution.status)) && ( - - Overview - Columns - Data - {showRaw && Raw} - +
+ + Overview + Columns + Data + Raw + + {canCancel && ( + + )} +
{showSummaryCards && ( -
+
-
+

Run summary

-
+

Insights

-
+

Model usage

-
-
-

Dataset sample

-
- {datasetColumnNames.length > 0 && ( - - - - - - Visible columns - {datasetColumnNames.map((columnName) => ( - { - setHiddenDatasetColumns((current) => { - if (checked) { - return current.filter((name) => name !== columnName); - } - return [...current, columnName]; - }); - }} - > - {columnName} - - ))} - - - )} - {canPageDataset && selectedExecution && ( - <> - - Page {datasetPage}/{totalPages} - - - - - )} -
+ + + Visible columns + {datasetColumnNames.map((columnName) => ( + { + setHiddenDatasetColumns((current) => { + if (checked) { + return current.filter((name) => name !== columnName); + } + return [...current, columnName]; + }); + }} + > + {columnName} + + ))} + + + )} + {canPageDataset && selectedExecution && ( + <> + + Page {datasetPage}/{totalPages} + + + + + )}
- {selectedExecution.dataset.length === 0 ? ( -

No rows returned.

- ) : tableColumns.length === 0 ? ( -

- All columns hidden. Use Columns to show at least one. -

- ) : ( -
- -
- )} +
+ {selectedExecution.dataset.length === 0 ? ( +

No rows returned.

+ ) : tableColumns.length === 0 ? ( +

+ All columns hidden. Use Columns to show at least one. +

+ ) : ( +
+ +
+ )} +
+ +
+

Raw execution

+
+                      {JSON.stringify(rawExecution, null, 2)}
+                    
- {showRaw && ( - -
-

Raw execution

-
-                        {JSON.stringify(rawExecution, null, 2)}
-                      
-
-
- )} )}