From 21bf088bf19ce8463f14fb69854cc41869dbab92 Mon Sep 17 00:00:00 2001 From: Maximilian Kaske <56969857+mxkaske@users.noreply.github.com> Date: Thu, 3 Sep 2026 14:41:41 +0200 Subject: [PATCH] fix: derive status bar radius from --radius (#2616) * fix: status bar radius css var * refactor: radius scale * chore: registry and agents --- apps/dashboard/src/app/globals.css | 8 ------- .../components/chart/chart-tooltip-number.tsx | 2 +- .../tool-renderers/list-response-logs.tsx | 2 +- .../data-table/response-logs/columns.tsx | 6 ++--- .../response-logs/data-table-basics.tsx | 4 ++-- .../status-page-history/table-cell-uptime.tsx | 4 ++-- .../src/components/development-indicator.tsx | 2 +- apps/status-page/AGENTS.md | 11 +++++++++ apps/status-page/src/app/globals.css | 9 ------- .../components/chart/chart-legend-badge.tsx | 2 +- .../components/chart/chart-tooltip-number.tsx | 2 +- apps/web/src/content/image-zoom.tsx | 4 ++-- apps/web/src/content/simple-chart.tsx | 2 +- packages/ui/AGENTS.md | 24 +++++++++++++++++++ packages/ui/REGISTRY.md | 18 ++++++++++++++ .../ui/src/components/blocks/status-bar.tsx | 15 +++++------- .../src/components/blocks/status-events.tsx | 2 +- packages/ui/src/components/ui/chart.tsx | 4 ++-- packages/ui/src/components/ui/checkbox.tsx | 2 +- packages/ui/src/components/ui/input-group.tsx | 7 +++--- packages/ui/src/components/ui/tooltip.tsx | 2 +- packages/ui/src/globals.css | 20 +++++++++++++--- 22 files changed, 99 insertions(+), 53 deletions(-) diff --git a/apps/dashboard/src/app/globals.css b/apps/dashboard/src/app/globals.css index 4130e0bde..3ecbe2c96 100644 --- a/apps/dashboard/src/app/globals.css +++ b/apps/dashboard/src/app/globals.css @@ -52,12 +52,4 @@ [data-status-preview] .rounded-full { border-radius: calc(var(--radius) * 99999999); } - [data-status-preview] .rounded-b-full { - border-bottom-left-radius: calc(var(--radius) * 99999999); - border-bottom-right-radius: calc(var(--radius) * 99999999); - } - [data-status-preview] .rounded-t-full { - border-top-left-radius: calc(var(--radius) * 99999999); - border-top-right-radius: calc(var(--radius) * 99999999); - } } \ No newline at end of file diff --git a/apps/dashboard/src/components/chart/chart-tooltip-number.tsx b/apps/dashboard/src/components/chart/chart-tooltip-number.tsx index 998315d5a..0bda8c610 100644 --- a/apps/dashboard/src/components/chart/chart-tooltip-number.tsx +++ b/apps/dashboard/src/components/chart/chart-tooltip-number.tsx @@ -44,7 +44,7 @@ export function ChartTooltipNumberRaw({ <>
diff --git a/apps/dashboard/src/components/data-table/response-logs/columns.tsx b/apps/dashboard/src/components/data-table/response-logs/columns.tsx index 74f22b204..3173d5711 100644 --- a/apps/dashboard/src/components/data-table/response-logs/columns.tsx +++ b/apps/dashboard/src/components/data-table/response-logs/columns.tsx @@ -33,13 +33,13 @@ export function getColumns( cell: ({ row }) => { const value = row.getValue("requestStatus"); if (value === "error") { - return
; + return
; } if (value === "degraded") { - return
; + return
; } if (value === "success") { - return
; + return
; } return
-
; }, diff --git a/apps/dashboard/src/components/data-table/response-logs/data-table-basics.tsx b/apps/dashboard/src/components/data-table/response-logs/data-table-basics.tsx index 6642dea21..66b498481 100644 --- a/apps/dashboard/src/components/data-table/response-logs/data-table-basics.tsx +++ b/apps/dashboard/src/components/data-table/response-logs/data-table-basics.tsx @@ -96,7 +96,7 @@ export function DataTableBasicsHTTP({
@@ -130,7 +130,7 @@ export function TableCellUptime({
diff --git a/apps/dashboard/src/components/development-indicator.tsx b/apps/dashboard/src/components/development-indicator.tsx index d76af66e3..0d41d0174 100644 --- a/apps/dashboard/src/components/development-indicator.tsx +++ b/apps/dashboard/src/components/development-indicator.tsx @@ -23,7 +23,7 @@ export function DevelopmentIndicator() { -
+
In Beta
diff --git a/apps/status-page/AGENTS.md b/apps/status-page/AGENTS.md index 101768148..e072a5b86 100644 --- a/apps/status-page/AGENTS.md +++ b/apps/status-page/AGENTS.md @@ -32,6 +32,17 @@ the page's access type — a gated page must not inherit a public TTL. Themes come from `@openstatus/theme-store` as OKLCH CSS variables. Add or edit a theme in that package; do not hard-code colours in a component. +`--radius` is themed too, and this app overrides it to `0rem`. The scale in +`packages/ui/src/globals.css` is proportional to it (`xs` 0.2, `rounded` 0.4, +`sm` 0.6, `md` 0.8, `lg` 1.0, `xl` 1.4), so every step collapses with the theme +— use the tokens, never a hard-coded `rounded-[4px]`, and prefer `rounded-lg` +over the equivalent `rounded-(--radius)`. A pill that stays a pill under a +square theme is the bug. `rounded-full` is only for a chip that wraps a glyph +(`StatusIcon`); a coloured status marker takes `rounded-lg`, matching the bar it +describes. The `.rounded-full` override in `globals.css` exists only so +Tailwind's `9999px` doesn't defeat `--radius: 0` — never add more of those, fix +the component (see `packages/ui/AGENTS.md`). + ## Impact labels Status-page impact labels are coloured text only — no dots, no chevrons. The diff --git a/apps/status-page/src/app/globals.css b/apps/status-page/src/app/globals.css index 685715b1e..634c72aa6 100644 --- a/apps/status-page/src/app/globals.css +++ b/apps/status-page/src/app/globals.css @@ -13,7 +13,6 @@ @theme inline { --font-sans: var(--font-geist-sans); --font-mono: var(--font-commit-mono, var(--font-geist-mono)); - --radius-xs: calc(var(--radius) - 8px); } :root { @@ -34,12 +33,4 @@ .rounded-full { border-radius: calc(var(--radius) * 99999999); } - .rounded-b-full { - border-bottom-left-radius: calc(var(--radius) * 99999999); - border-bottom-right-radius: calc(var(--radius) * 99999999); - } - .rounded-t-full { - border-top-left-radius: calc(var(--radius) * 99999999); - border-top-right-radius: calc(var(--radius) * 99999999); - } } diff --git a/apps/status-page/src/components/chart/chart-legend-badge.tsx b/apps/status-page/src/components/chart/chart-legend-badge.tsx index ef0d13f3e..29209c53f 100644 --- a/apps/status-page/src/components/chart/chart-legend-badge.tsx +++ b/apps/status-page/src/components/chart/chart-legend-badge.tsx @@ -113,7 +113,7 @@ export function ChartLegendBadge({ ) : (
( <>
(
handlers.onClick(index)} onFocus={() => handlers.onFocus(index)} onBlur={handlers.onBlur} @@ -528,7 +528,7 @@ const StatusBarItem = forwardRef( aria-expanded={isActive} data-slot="status-bar-item" > -
+
{/* Render bar segments */} {item.bar.map((segment, segmentIndex) => { if (renderBar) { @@ -537,10 +537,7 @@ const StatusBarItem = forwardRef( return (
{labels.clickAgainToUnpin} - + Esc
@@ -737,7 +734,7 @@ function StatusBarContent({
) : (
) { } const inputGroupAddonVariants = cva( - "text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", + "text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded [&>svg:not([class*='size-'])]:size-4", { variants: { align: { @@ -84,10 +84,9 @@ const inputGroupButtonVariants = cva( { variants: { size: { - xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5", + xs: "h-6 gap-1 rounded px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5", sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5", - "icon-xs": - "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0", + "icon-xs": "size-6 rounded p-0 has-[>svg]:p-0", "icon-sm": "size-8 p-0 has-[>svg]:p-0", }, }, diff --git a/packages/ui/src/components/ui/tooltip.tsx b/packages/ui/src/components/ui/tooltip.tsx index 13fb106ff..060f7ce13 100644 --- a/packages/ui/src/components/ui/tooltip.tsx +++ b/packages/ui/src/components/ui/tooltip.tsx @@ -51,7 +51,7 @@ function TooltipContent({ {...props} > {children} - + ); diff --git a/packages/ui/src/globals.css b/packages/ui/src/globals.css index a0a7fc491..ac749f815 100644 --- a/packages/ui/src/globals.css +++ b/packages/ui/src/globals.css @@ -36,10 +36,15 @@ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); --color-sidebar-border: var(--sidebar-border); --color-sidebar-ring: var(--sidebar-ring); - --radius-sm: calc(var(--radius) - 4px); - --radius-md: calc(var(--radius) - 2px); + /* Proportional, not subtractive: `--radius` is theme-controlled on the status + * page (0rem-0.625rem), where a fixed `- 4px` offset collapses whole steps to + * 0. Ratios are anchored on the 0.625rem default, so those values are + * unchanged (2/6/8/10/14px) and every other radius scales with the theme. */ + --radius-xs: calc(var(--radius) * 0.2); + --radius-sm: calc(var(--radius) * 0.6); + --radius-md: calc(var(--radius) * 0.8); --radius-lg: var(--radius); - --radius-xl: calc(var(--radius) + 4px); + --radius-xl: calc(var(--radius) * 1.4); --color-success: var(--success); --color-warning: var(--warning); @@ -176,3 +181,12 @@ @apply bg-background text-foreground; } } + +@layer utilities { + /* Tailwind's bare `rounded` is a hard-coded 0.25rem (its `--radius` lives in + * `@theme default`, which our `:root --radius` cannot override). Re-point it + * at the scale so it collapses with the theme like every other step. */ + .rounded { + border-radius: calc(var(--radius) * 0.4); + } +} -- 2.54.0