Skip to content
TypeScript

refactor(web): add radius="none" to ScrollArea (#13026)

Julius Marmingeb4f1f18b7356
diff --git a/apps/web/src/components/ChatMarkdown.tsx b/apps/web/src/components/ChatMarkdown.tsx
index 3b398dd5100..90fca535680 100644
--- a/apps/web/src/components/ChatMarkdown.tsx
+++ b/apps/web/src/components/ChatMarkdown.tsx
@@ -772,7 +772,7 @@ function MarkdownTable({ children, ...props }: React.ComponentProps<"table">) {
className="chat-markdown-table-container"
data-expanded={expanded ? "true" : "false"}
>
- <ScrollArea chainVerticalScroll scrollFade className="w-full max-w-full rounded-none">
+ <ScrollArea radius="none" chainVerticalScroll scrollFade className="w-full max-w-full">
<table ref={tableRef} {...props}>
{children}
</table>
diff --git a/apps/web/src/components/RightPanelTabs.tsx b/apps/web/src/components/RightPanelTabs.tsx
index 23cea9c2883..e66909c0f9f 100644
--- a/apps/web/src/components/RightPanelTabs.tsx
+++ b/apps/web/src/components/RightPanelTabs.tsx
@@ -1127,10 +1127,11 @@ export function RightPanelTabs(props: RightPanelTabsProps) {
data-right-panel-tabbar
>
<ScrollArea
+ radius="none"
ref={tabListRef}
hideScrollbars
scrollFade
- className="min-w-0 flex-1 rounded-none"
+ className="min-w-0 flex-1"
data-right-panel-tab-list
>
<div className="flex h-full w-max min-w-full items-center gap-1">
diff --git a/apps/web/src/components/chat/ComposerBanner.tsx b/apps/web/src/components/chat/ComposerBanner.tsx
index cd1d4bd6be4..bdd28ce555a 100644
--- a/apps/web/src/components/chat/ComposerBanner.tsx
+++ b/apps/web/src/components/chat/ComposerBanner.tsx
@@ -282,9 +282,10 @@ function Children({ className, render, ...props }: useRender.ComponentProps<"div
function Scroll({ className, ...props }: ComponentProps<typeof ScrollArea>) {
return (
<ScrollArea
+ radius="none"
scrollFade
className={cn(
- "h-auto max-h-[min(24rem,40dvh)] rounded-none [&>[data-slot=scroll-area-viewport][data-has-overflow-y]]:pe-2",
+ "h-auto max-h-[min(24rem,40dvh)] [&>[data-slot=scroll-area-viewport][data-has-overflow-y]]:pe-2",
className,
)}
{...props}
diff --git a/apps/web/src/components/files/FilePreviewPanel.tsx b/apps/web/src/components/files/FilePreviewPanel.tsx
index 9e9464ca451..d51141d7896 100644
--- a/apps/web/src/components/files/FilePreviewPanel.tsx
+++ b/apps/web/src/components/files/FilePreviewPanel.tsx
@@ -1090,10 +1090,11 @@ export default function FilePreviewPanel({
{relativePath && attachment === undefined ? (
<div className={FILE_SURFACE_SUBHEADER_CLASS} data-surface-subheader>
<ScrollArea
+ radius="none"
ref={breadcrumbRef}
hideScrollbars
scrollFade
- className="min-w-0 flex-1 rounded-none"
+ className="min-w-0 flex-1"
data-file-breadcrumbs
>
<div className="flex h-full w-max min-w-full items-center text-xs">
diff --git a/apps/web/src/components/onboarding/WelcomeWizard.tsx b/apps/web/src/components/onboarding/WelcomeWizard.tsx
index 7e8dea7f2de..99e0e8513e8 100644
--- a/apps/web/src/components/onboarding/WelcomeWizard.tsx
+++ b/apps/web/src/components/onboarding/WelcomeWizard.tsx
@@ -636,10 +636,7 @@ function AgentsStep({
const { environments } = useEnvironments();
return (
<StepShell title="Your agents" description="Agents available on your selected computers.">
- <ScrollArea
- scrollFade
- className="mt-5 h-auto max-h-96 [&_[data-slot=scroll-area-scrollbar]]:opacity-100"
- >
+ <ScrollArea scrollFade className="mt-5 h-auto max-h-96">
<div className="space-y-5 pr-3">
{environmentIds.map((environmentId) => (
<ConnectedAgentsStep
@@ -1206,10 +1203,7 @@ function ImportStep({
</div>
</div>
) : null}
- <ScrollArea
- scrollFade
- className="mt-2 h-auto max-h-80 [&_[data-slot=scroll-area-scrollbar]]:opacity-100"
- >
+ <ScrollArea scrollFade className="mt-2 h-auto max-h-80">
<div className="space-y-5 pr-3">
{scans.map((scan) => {
const scanCandidates = candidates.filter(
diff --git a/apps/web/src/components/settings/DiagnosticsSettings.tsx b/apps/web/src/components/settings/DiagnosticsSettings.tsx
index 0a987eca8c1..0fe1ae2f624 100644
--- a/apps/web/src/components/settings/DiagnosticsSettings.tsx
+++ b/apps/web/src/components/settings/DiagnosticsSettings.tsx
@@ -172,10 +172,11 @@ function DiagnosticsTable({
}) {
return (
<ScrollArea
+ radius="none"
chainVerticalScroll
scrollFade
hideScrollbars
- className="w-full max-w-full rounded-none"
+ className="w-full max-w-full"
>
<table
className={cn("w-full text-left text-xs", minTableWidth, columnWidths && "table-fixed")}
@@ -355,10 +356,11 @@ function ProcessDiagnosticsTable({
return (
<ScrollArea
+ radius="none"
chainVerticalScroll
scrollFade
hideScrollbars
- className="max-h-[min(64vh,44rem)] w-full max-w-full rounded-none border-t border-border/60"
+ className="max-h-[min(64vh,44rem)] w-full max-w-full border-t border-border/60"
>
<table className="w-full min-w-[1040px] table-fixed text-left text-xs">
<colgroup>
@@ -1224,10 +1226,11 @@ export function DiagnosticsSettingsPanel() {
<SettingsSection title="Span Logs">
{data && data.latestWarningAndErrorLogs.length > 0 ? (
<ScrollArea
+ radius="none"
chainVerticalScroll
scrollFade
hideScrollbars
- className="w-full max-w-full rounded-none"
+ className="w-full max-w-full"
>
<table className="w-full min-w-[920px] table-fixed text-left text-xs">
<colgroup>
diff --git a/apps/web/src/components/settings/ProviderSettingsPanel.tsx b/apps/web/src/components/settings/ProviderSettingsPanel.tsx
index 7f09e89c53d..509a758f3cc 100644
--- a/apps/web/src/components/settings/ProviderSettingsPanel.tsx
+++ b/apps/web/src/components/settings/ProviderSettingsPanel.tsx
@@ -334,7 +334,7 @@ function ProviderSettingsPanelContent(target: ProviderSettingsTarget) {
options.length === 1 && options[0]?.entry.target._tag === "PrimaryConnectionTarget";
const deviceTabs =
!target.scoped && !onlyPrimaryDevice && options.length > 0 ? (
- <ScrollArea hideScrollbars scrollFade className="h-11 min-w-0 flex-1 rounded-none">
+ <ScrollArea radius="none" hideScrollbars scrollFade className="h-11 min-w-0 flex-1">
<ToggleGroup
aria-label="Devices"
variant="segmented"
diff --git a/apps/web/src/components/ui/scroll-area.tsx b/apps/web/src/components/ui/scroll-area.tsx
index 852a3ed1005..47076d99f25 100644
--- a/apps/web/src/components/ui/scroll-area.tsx
+++ b/apps/web/src/components/ui/scroll-area.tsx
@@ -29,6 +29,7 @@ function ScrollArea({
scrollbarGutter = false,
hideScrollbars = false,
chainVerticalScroll = false,
+ radius = "inherit",
...props
}: ScrollAreaPrimitive.Root.Props & {
scrollFade?: boolean;
@@ -38,10 +39,16 @@ function ScrollArea({
scrollbarGutter?: boolean;
hideScrollbars?: boolean;
chainVerticalScroll?: boolean;
+ /** The viewport clips to the parent's radius; "none" for a region flush to an edge. */
+ radius?: "inherit" | "none";
}) {
return (
<ScrollAreaPrimitive.Root
- className={cn("relative size-full min-h-0 overflow-hidden rounded-[inherit]", className)}
+ className={cn(
+ "relative size-full min-h-0 overflow-hidden",
+ radius === "none" ? "rounded-none" : "rounded-[inherit]",
+ className,
+ )}
{...props}
>
<ScrollAreaPrimitive.Viewport
diff --git a/scripts/lint-restyle-ceiling.ts b/scripts/lint-restyle-ceiling.ts
index 00fb610635d..53e91c63073 100644
--- a/scripts/lint-restyle-ceiling.ts
+++ b/scripts/lint-restyle-ceiling.ts
@@ -8,7 +8,7 @@ import * as NodeURL from "node:url";
// components/ui exports are migrated to variants (see vite.config.ts). This gate keeps the
// count from growing: CI fails when findings exceed the ceiling. Lower the ceiling when you
// migrate a file, and delete this script when the rule becomes an error.
-export const RESTYLE_CEILING = 1070;
+export const RESTYLE_CEILING = 1060;
const RULE = "shadcn(no-restyle)";