Skip to content
TypeScript

refactor(web): drop className overrides that repeat the base styles (#12984)

Julius Marmingec26119ada356
diff --git a/apps/web/src/components/AppSidebarLayout.tsx b/apps/web/src/components/AppSidebarLayout.tsx
index 52b45ab8405..14d871c4180 100644
--- a/apps/web/src/components/AppSidebarLayout.tsx
+++ b/apps/web/src/components/AppSidebarLayout.tsx
@@ -244,7 +244,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
side="left"
collapsible="offcanvas"
data-app-sidebar=""
- className="border-r border-sidebar-border bg-sidebar text-sidebar-foreground"
+ className="border-r border-sidebar-border"
resizable={{
maxWidth: sidebarMaximumWidth,
minWidth: THREAD_SIDEBAR_MIN_WIDTH,
diff --git a/apps/web/src/components/BranchToolbarBranchSelector.tsx b/apps/web/src/components/BranchToolbarBranchSelector.tsx
index 9838593a23f..8830b6bd180 100644
--- a/apps/web/src/components/BranchToolbarBranchSelector.tsx
+++ b/apps/web/src/components/BranchToolbarBranchSelector.tsx
@@ -861,7 +861,7 @@ export function BranchToolbarBranchSelector({
<div className="flex min-h-0 flex-1 flex-col overflow-hidden">
<ComboboxEmpty>No refs found.</ComboboxEmpty>
<div className="relative min-h-0 w-full max-h-56 flex-1 overflow-hidden">
- <ComboboxListVirtualized className="size-full min-w-0 p-0">
+ <ComboboxListVirtualized>
<LegendList<string>
ref={branchListRef}
data={filteredBranchPickerItems}
diff --git a/apps/web/src/components/ConfirmDialogHost.tsx b/apps/web/src/components/ConfirmDialogHost.tsx
index 322423c40a9..3e19606bd4c 100644
--- a/apps/web/src/components/ConfirmDialogHost.tsx
+++ b/apps/web/src/components/ConfirmDialogHost.tsx
@@ -75,7 +75,7 @@ export function ConfirmDialogHost() {
if (!open) completeConfirmDialogClose();
}}
>
- <AlertDialogPopup className="max-w-lg">
+ <AlertDialogPopup>
<AlertDialogHeader>
<AlertDialogTitle className="wrap-anywhere">{copy.title}</AlertDialogTitle>
{copy.description ? (
diff --git a/apps/web/src/components/NoActiveThreadState.tsx b/apps/web/src/components/NoActiveThreadState.tsx
index 3e7b0769d48..79da7a0cad1 100644
--- a/apps/web/src/components/NoActiveThreadState.tsx
+++ b/apps/web/src/components/NoActiveThreadState.tsx
@@ -5,7 +5,7 @@ import { WorkspacePageHeader } from "./WorkspacePageHeader";
export function NoActiveThreadState() {
return (
- <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
+ <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none">
<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background">
<WorkspacePageHeader electron={isElectron} className="border-b border-border">
{isElectron ? (
@@ -22,8 +22,8 @@ export function NoActiveThreadState() {
<Empty className="flex-1">
<div className="w-full max-w-lg px-8 py-12">
<EmptyHeader className="max-w-none">
- <EmptyTitle className="text-foreground text-xl">Pick a thread to continue</EmptyTitle>
- <EmptyDescription className="mt-2 text-sm text-muted-foreground/78">
+ <EmptyTitle className="text-foreground">Pick a thread to continue</EmptyTitle>
+ <EmptyDescription className="mt-2 text-muted-foreground/78">
Select an existing thread or create a new one to get started.
</EmptyDescription>
</EmptyHeader>
diff --git a/apps/web/src/components/NoProjectsHero.tsx b/apps/web/src/components/NoProjectsHero.tsx
index 09bd92c82ec..5aa29a729b6 100644
--- a/apps/web/src/components/NoProjectsHero.tsx
+++ b/apps/web/src/components/NoProjectsHero.tsx
@@ -10,7 +10,7 @@ export function NoProjectsHero() {
const openAddProject = useCallback(() => openCommandPalette({ open: "add-project" }), []);
return (
- <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
+ <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none">
<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background">
<Empty className="flex-1">
<div className="w-full max-w-lg px-8 py-12">
@@ -18,7 +18,7 @@ export function NoProjectsHero() {
<EmptyTitle className="text-foreground text-2xl sm:text-3xl">
What should we work on?
</EmptyTitle>
- <EmptyDescription className="mt-2 text-sm text-muted-foreground/78">
+ <EmptyDescription className="mt-2 text-muted-foreground/78">
Add a project to start your first thread.
</EmptyDescription>
<div className="mt-6 flex justify-center">
diff --git a/apps/web/src/components/ProjectScriptsControl.tsx b/apps/web/src/components/ProjectScriptsControl.tsx
index 9736821afa6..74bd8491871 100644
--- a/apps/web/src/components/ProjectScriptsControl.tsx
+++ b/apps/web/src/components/ProjectScriptsControl.tsx
@@ -158,7 +158,7 @@ export default function ProjectScriptsControl({
>
<ScriptIcon icon={fileScript.icon ?? "play"} className="size-4" />
<MenuItemLabel className="truncate">{fileScript.name}</MenuItemLabel>
- <MenuShortcut className="ms-auto">
+ <MenuShortcut>
<DownloadIcon className="size-3.5" aria-label="Import" />
</MenuShortcut>
</MenuItem>
diff --git a/apps/web/src/components/ThreadRouteView.tsx b/apps/web/src/components/ThreadRouteView.tsx
index ed902d06ede..90bff34051d 100644
--- a/apps/web/src/components/ThreadRouteView.tsx
+++ b/apps/web/src/components/ThreadRouteView.tsx
@@ -207,7 +207,7 @@ export function ThreadRouteView({ target }: { target: ThreadRouteTarget }) {
}
return (
- <SidebarInset className="h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh">
+ <SidebarInset className="h-svh min-h-0 overflow-hidden overscroll-y-none md:h-dvh">
{view}
</SidebarInset>
);
diff --git a/apps/web/src/components/chat/ModelPickerContent.tsx b/apps/web/src/components/chat/ModelPickerContent.tsx
index 9c8be73e7cb..d66065b0e57 100644
--- a/apps/web/src/components/chat/ModelPickerContent.tsx
+++ b/apps/web/src/components/chat/ModelPickerContent.tsx
@@ -956,7 +956,7 @@ export const ModelPickerContent = memo(function ModelPickerContent(props: {
{/* Model list */}
<div className="relative min-h-0 flex-1 overflow-hidden pr-px">
- <ComboboxListVirtualized className="size-full min-w-0 p-0 not-empty:p-0">
+ <ComboboxListVirtualized className="not-empty:p-0">
<LegendList<string>
ref={modelListRef}
data={filteredItemKeys}
diff --git a/apps/web/src/components/settings/FontFamilyPicker.tsx b/apps/web/src/components/settings/FontFamilyPicker.tsx
index 4be5e43e566..1981b852c03 100644
--- a/apps/web/src/components/settings/FontFamilyPicker.tsx
+++ b/apps/web/src/components/settings/FontFamilyPicker.tsx
@@ -219,7 +219,7 @@ export function FontFamilyPicker({
<div className="flex min-h-0 flex-1 flex-col overflow-hidden">
<ComboboxEmpty>No fonts found.</ComboboxEmpty>
<div className="relative min-h-0 max-h-72 w-full flex-1 overflow-hidden">
- <ComboboxListVirtualized className="size-full min-w-0 p-0">
+ <ComboboxListVirtualized>
<LegendList<string>
ref={listRef}
data={items}
diff --git a/apps/web/src/components/settings/SettingsPanels.tsx b/apps/web/src/components/settings/SettingsPanels.tsx
index 180ab45361d..a827cfe7bb2 100644
--- a/apps/web/src/components/settings/SettingsPanels.tsx
+++ b/apps/web/src/components/settings/SettingsPanels.tsx
@@ -845,7 +845,7 @@ function TokenStreamingWarningDialog({
}) {
return (
<AlertDialog open={open} onOpenChange={onOpenChange}>
- <AlertDialogPopup className="max-w-lg">
+ <AlertDialogPopup>
<AlertDialogHeader>
<AlertDialogTitle>Token by token is a worse experience</AlertDialogTitle>
<AlertDialogDescription>
diff --git a/apps/web/src/components/settings/SettingsSidebarNav.tsx b/apps/web/src/components/settings/SettingsSidebarNav.tsx
index 87a7e3ce745..ffddb278b6c 100644
--- a/apps/web/src/components/settings/SettingsSidebarNav.tsx
+++ b/apps/web/src/components/settings/SettingsSidebarNav.tsx
@@ -344,7 +344,7 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
)}
</SidebarGroup>
</SidebarContent>
- <SidebarFooter className="px-[var(--sidebar-content-inset)] py-1">
+ <SidebarFooter>
<Suspense fallback={null}>
<T3ConnectSidebarSignIn />
</Suspense>
diff --git a/apps/web/src/components/sidebar/SidebarChrome.tsx b/apps/web/src/components/sidebar/SidebarChrome.tsx
index 6433a1cba81..8ab05b166f5 100644
--- a/apps/web/src/components/sidebar/SidebarChrome.tsx
+++ b/apps/web/src/components/sidebar/SidebarChrome.tsx
@@ -221,7 +221,7 @@ export const SidebarUtilityMenu = memo(function SidebarUtilityMenu() {
export const SidebarChromeFooter = memo(function SidebarChromeFooter() {
return (
- <SidebarFooter className="px-[var(--sidebar-content-inset)] py-1">
+ <SidebarFooter>
<SidebarThreadUndoNotice />
<SidebarProviderUpdatePill />
<SidebarUpdateArchitectureWarning />
diff --git a/apps/web/src/components/ui/combobox.tsx b/apps/web/src/components/ui/combobox.tsx
index 42a3b815e2f..44281763182 100644
--- a/apps/web/src/components/ui/combobox.tsx
+++ b/apps/web/src/components/ui/combobox.tsx
@@ -247,7 +247,7 @@ function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
function ComboboxListVirtualized({ className, ...props }: ComboboxPrimitive.List.Props) {
return (
<ComboboxPrimitive.List
- className={cn("not-empty:px-1 not-empty:py-1", className)}
+ className={cn("size-full min-w-0 not-empty:px-1 not-empty:py-1", className)}
data-slot="combobox-list"
{...props}
/>
diff --git a/apps/web/src/components/ui/sidebar.tsx b/apps/web/src/components/ui/sidebar.tsx
index 92f185e6f62..180985620ba 100644
--- a/apps/web/src/components/ui/sidebar.tsx
+++ b/apps/web/src/components/ui/sidebar.tsx
@@ -558,7 +558,7 @@ function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {
function SidebarFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
- className={cn("flex flex-col gap-2 p-2", className)}
+ className={cn("flex flex-col gap-2 px-[var(--sidebar-content-inset)] py-1", className)}
data-sidebar="footer"
data-slot="sidebar-footer"
{...props}
diff --git a/apps/web/src/components/usage/UsagePage.tsx b/apps/web/src/components/usage/UsagePage.tsx
index 95fee0e4b52..6e22f5ad85e 100644
--- a/apps/web/src/components/usage/UsagePage.tsx
+++ b/apps/web/src/components/usage/UsagePage.tsx
@@ -366,7 +366,7 @@ export function UsagePage() {
);
return (
- <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground isolate">
+ <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none isolate">
<div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground">
<WorkspacePageHeader electron={isElectron} className="h-auto">
{topbarContent}
diff --git a/apps/web/src/routes/_chat.index.tsx b/apps/web/src/routes/_chat.index.tsx
index b32524bdde1..c001e52775b 100644
--- a/apps/web/src/routes/_chat.index.tsx
+++ b/apps/web/src/routes/_chat.index.tsx
@@ -90,11 +90,11 @@ function IndexDraftLanding() {
function DraftStartError({ onRetry }: { readonly onRetry: () => void }) {
return (
- <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
+ <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none">
<Empty className="flex-1">
<EmptyHeader className="max-w-md">
- <EmptyTitle className="text-foreground text-xl">Couldn’t start a new thread</EmptyTitle>
- <EmptyDescription className="mt-2 text-sm text-muted-foreground/78">
+ <EmptyTitle className="text-foreground">Couldn’t start a new thread</EmptyTitle>
+ <EmptyDescription className="mt-2 text-muted-foreground/78">
The project is still available. Try opening the draft again.
</EmptyDescription>
<div className="mt-5 flex justify-center">
@@ -123,7 +123,7 @@ function HostedStaticOnboardingState() {
: "Open Connections and add that machine using its pairing link. This app must be able to reach it.";
return (
- <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
+ <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none">
<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background">
<WorkspacePageHeader electron={isElectron} className="border-b border-border">
<div className="flex items-center gap-2">
@@ -139,14 +139,14 @@ function HostedStaticOnboardingState() {
<div className="mx-auto mb-5 flex size-11 items-center justify-center rounded-xl border border-border/70 bg-background/70 text-muted-foreground">
<LinkIcon className="size-5" />
</div>
- <EmptyTitle className="text-foreground text-xl">
+ <EmptyTitle className="text-foreground">
Connect to a computer running T3 Code
</EmptyTitle>
- <EmptyDescription className="mt-2 text-sm leading-relaxed text-muted-foreground/78">
+ <EmptyDescription className="mt-2 leading-relaxed text-muted-foreground/78">
This app connects to T3 Code running on your computer or a server. Start the T3 Code
desktop app or command-line server on that machine and keep it running.
</EmptyDescription>
- <EmptyDescription className="mt-2 text-sm leading-relaxed text-muted-foreground/78">
+ <EmptyDescription className="mt-2 leading-relaxed text-muted-foreground/78">
{description}
</EmptyDescription>
<div className="mt-6 flex justify-center">
diff --git a/apps/web/src/routes/_chat.pull-requests.tsx b/apps/web/src/routes/_chat.pull-requests.tsx
index 59368351359..5ed33d27b5a 100644
--- a/apps/web/src/routes/_chat.pull-requests.tsx
+++ b/apps/web/src/routes/_chat.pull-requests.tsx
@@ -2068,7 +2068,7 @@ function PullRequestsRouteView() {
}, [keybindings]);
return (
- <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
+ <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none">
<div className="relative flex min-h-0 flex-1">
{pullRequestsSupported && rightPanelPresent ? openPanelControls : null}
<PullRequestsColumn {...columnProps} />
diff --git a/apps/web/src/routes/settings.tsx b/apps/web/src/routes/settings.tsx
index cd6ca454649..e95895926d4 100644
--- a/apps/web/src/routes/settings.tsx
+++ b/apps/web/src/routes/settings.tsx
@@ -153,7 +153,7 @@ function SettingsContentLayout() {
}, [navigateBackWithinApp]);
return (
- <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground isolate">
+ <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none isolate">
<div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground">
<WorkspacePageHeader electron={isElectron}>
<div className="flex w-full items-center gap-3">
diff --git a/scripts/lint-restyle-ceiling.ts b/scripts/lint-restyle-ceiling.ts
index db608db1648..9c93a8d466e 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 = 1247;
+export const RESTYLE_CEILING = 1214;
const RULE = "shadcn(no-restyle)";