From 4c4e216267f8a5283422ea129f9f552d96247622 Mon Sep 17 00:00:00 2001 From: Chris Arderne Date: Wed, 19 Aug 2026 11:23:01 +0100 Subject: [PATCH] refactor(webapp): remove redundant React fragments --- .oxlintrc.json | 1 + apps/webapp/app/components/ErrorDisplay.tsx | 26 +- .../dashboard-agent/AskAgentButton.tsx | 2 +- .../dashboard-agent/WhenAgentUnavailable.tsx | 2 +- .../app/components/primitives/Buttons.tsx | 2 +- .../primitives/SegmentedControl.tsx | 34 +- .../app/components/primitives/Select.tsx | 20 +- .../app/components/primitives/Table.tsx | 2 +- .../webapp/app/components/primitives/Tabs.tsx | 62 ++-- .../app/components/runs/v3/TaskRunsTable.tsx | 6 +- apps/webapp/app/root.tsx | 106 +++--- .../route.tsx | 2 +- .../route.tsx | 16 +- .../route.tsx | 4 +- .../route.tsx | 338 +++++++++--------- .../route.tsx | 168 +++++---- .../route.tsx | 182 +++++----- .../route.tsx | 2 +- apps/webapp/app/routes/_app/route.tsx | 12 +- .../webapp/app/routes/admin.notifications.tsx | 2 +- .../app/routes/confirm-basic-details.tsx | 4 +- .../route.tsx | 16 +- .../route.tsx | 106 +++--- .../app/routes/storybook.filter/route.tsx | 2 +- 24 files changed, 538 insertions(+), 579 deletions(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index 8d8de0274f2..ee5c80fb16f 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -115,6 +115,7 @@ { "files": ["apps/webapp/app/**/*.ts", "apps/webapp/app/**/*.tsx"], "rules": { + "react/jsx-no-useless-fragment": "error", "react/no-unstable-nested-components": "error", "react/rules-of-hooks": "error", "trigger-runops/no-control-plane-run-graph-access": "error", diff --git a/apps/webapp/app/components/ErrorDisplay.tsx b/apps/webapp/app/components/ErrorDisplay.tsx index d40fce0957b..d0f60840f35 100644 --- a/apps/webapp/app/components/ErrorDisplay.tsx +++ b/apps/webapp/app/components/ErrorDisplay.tsx @@ -34,22 +34,16 @@ export function RouteErrorDisplay(options?: ErrorDisplayOptions) { ); } - return ( - <> - {isRouteErrorResponse(error) ? ( - - ) : error instanceof Error ? ( - - ) : ( - - )} - + return isRouteErrorResponse(error) ? ( + + ) : error instanceof Error ? ( + + ) : ( + ); } diff --git a/apps/webapp/app/components/dashboard-agent/AskAgentButton.tsx b/apps/webapp/app/components/dashboard-agent/AskAgentButton.tsx index f5acc37bb38..602a96e123b 100644 --- a/apps/webapp/app/components/dashboard-agent/AskAgentButton.tsx +++ b/apps/webapp/app/components/dashboard-agent/AskAgentButton.tsx @@ -21,7 +21,7 @@ export function AskAgentButton({ fallback?: React.ReactNode; }) { const available = useDashboardAgentAvailable(); - if (!available) return <>{fallback}; + if (!available) return fallback; const button = ( ); } diff --git a/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx b/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx index ddb7220213c..4f134a14b68 100644 --- a/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx +++ b/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx @@ -253,11 +253,7 @@ export function TaskRunsTable({ > Duration - {showCompute && ( - <> - Compute - - )} + {showCompute && Compute} }> Machine diff --git a/apps/webapp/app/root.tsx b/apps/webapp/app/root.tsx index 1e550155fde..43812d5653d 100644 --- a/apps/webapp/app/root.tsx +++ b/apps/webapp/app/root.tsx @@ -146,27 +146,25 @@ export const shouldRevalidate: ShouldRevalidateFunction = (options) => { export function ErrorBoundary() { return ( - <> - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + ); } @@ -180,39 +178,37 @@ export default function App() { const resolvedTheme = themePreference === "system" ? "dark" : themePreference; return ( - <> - - -