From b4e08bddeced568a215de67c26ce8d095e9ab336 Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Sat, 14 Feb 2026 21:26:25 +0000 Subject: [PATCH] Fix(webapp): metrics UI improvements (#3063) - Lots of small UI improvements - Toggle full screen charts with "V" shortcut CleanShot 2026-02-14 at 20 06
30@2x CleanShot 2026-02-14 at 20 06 58@2x CleanShot 2026-02-14 at 20 06 53@2x CleanShot 2026-02-14 at 20 06 48@2x CleanShot 2026-02-14 at 20 06 45@2x CleanShot 2026-02-14 at 20 10 29@2x --- apps/webapp/app/components/Shortcuts.tsx | 6 + .../app/components/code/ChartConfigPanel.tsx | 137 +++++++----------- .../app/components/code/QueryResultsChart.tsx | 22 +-- .../app/components/code/TSQLResultsTable.tsx | 84 ++++------- .../app/components/metrics/QueryWidget.tsx | 37 ++++- .../metrics/SaveToDashboardDialog.tsx | 8 +- .../app/components/primitives/ClientTabs.tsx | 11 +- .../primitives/SegmentedControl.tsx | 3 +- .../app/components/primitives/ShortcutKey.tsx | 15 +- .../primitives/charts/BigNumberCard.tsx | 11 +- .../app/components/primitives/charts/Card.tsx | 10 +- .../components/primitives/charts/ChartBar.tsx | 15 +- .../primitives/charts/ChartBlankState.tsx | 23 +++ .../primitives/charts/ChartLegendCompound.tsx | 2 +- .../app/components/query/QueryEditor.tsx | 30 ++-- .../AITabContent.tsx | 2 +- 16 files changed, 201 insertions(+), 215 deletions(-) create mode 100644 apps/webapp/app/components/primitives/charts/ChartBlankState.tsx diff --git a/apps/webapp/app/components/Shortcuts.tsx b/apps/webapp/app/components/Shortcuts.tsx index df76bdc52..2decc82c9 100644 --- a/apps/webapp/app/components/Shortcuts.tsx +++ b/apps/webapp/app/components/Shortcuts.tsx @@ -193,6 +193,12 @@ function ShortcutContent() { +
+ Metrics page + + + +
Schedules page diff --git a/apps/webapp/app/components/code/ChartConfigPanel.tsx b/apps/webapp/app/components/code/ChartConfigPanel.tsx index d4b64682e..3032795c1 100644 --- a/apps/webapp/app/components/code/ChartConfigPanel.tsx +++ b/apps/webapp/app/components/code/ChartConfigPanel.tsx @@ -1,4 +1,5 @@ import type { OutputColumnMetadata } from "@internal/clickhouse"; +import { IconSortAscending, IconSortDescending } from "@tabler/icons-react"; import { BarChart, CheckIcon, LineChart, Plus, XIcon } from "lucide-react"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { cn } from "~/utils/cn"; @@ -6,6 +7,7 @@ import { Paragraph } from "../primitives/Paragraph"; import { Popover, PopoverContent, PopoverTrigger } from "../primitives/Popover"; import { Select, SelectItem } from "../primitives/Select"; import { Switch } from "../primitives/Switch"; +import SegmentedControl from "../primitives/SegmentedControl"; import { Button } from "../primitives/Buttons"; import { type AggregationType, @@ -234,54 +236,38 @@ export function ChartConfigPanel({ columns, config, onChange, className }: Chart } return ( -
+
{/* Chart Type */}
-
- - -
+ + Bar + + ), + value: "bar", + }, + { + label: ( + + Line + + ), + value: "line", + }, + ]} + onChange={(value) => updateConfig({ chartType: value as "bar" | "line" })} + />
-
+
{/* X-Axis */}
- + Sort order
- + Prefix
- + Suffix