Skip to content
TypeScript

lint/unknown and static (#13366)

Julius Marminge80fc23ac32cd
diff --git a/apps/web/src/components/AppSidebarLayout.tsx b/apps/web/src/components/AppSidebarLayout.tsx
index eccf3ef2135..97c0bd44eb9 100644
--- a/apps/web/src/components/AppSidebarLayout.tsx
+++ b/apps/web/src/components/AppSidebarLayout.tsx
@@ -35,10 +35,7 @@ import LegacyThreadSidebar from "./LegacySidebar";
import ThreadSidebar from "./Sidebar";
import { SettingsSidebarNav } from "./settings/SettingsSidebarNav";
import { SidebarChromeHeader } from "./sidebar/SidebarChrome";
-import {
- resolveSidebarStageFocusRingOffsetClass,
- useSidebarStageBackdropVariant,
-} from "./SidebarStageBackdrop";
+import { useSidebarStageBackdropVariant } from "./SidebarStageBackdrop";
import { useProjects } from "../state/entities";
import {
resolveInitialThreadSidebarWidth,
@@ -138,9 +135,6 @@ function SidebarControl() {
className={cn(
"pointer-events-auto",
isSidebarVisible && stageBackdropVariant && "relative top-auto translate-y-0",
- isSidebarVisible &&
- stageBackdropVariant &&
- resolveSidebarStageFocusRingOffsetClass(stageBackdropVariant),
)}
aria-label="Toggle main sidebar"
/>
diff --git a/apps/web/src/components/ChatMarkdown.test.tsx b/apps/web/src/components/ChatMarkdown.test.tsx
index 3e1222e0ebb..d8a5f651ff8 100644
--- a/apps/web/src/components/ChatMarkdown.test.tsx
+++ b/apps/web/src/components/ChatMarkdown.test.tsx
@@ -639,7 +639,7 @@ describe("ChatMarkdown artifact-template cards", () => {
);
expect(html).not.toContain("::artifact-template");
- expect(html).toContain("chat-markdown-artifact-template");
+ expect(html).toContain("data-chat-markdown-artifact-template");
expect(html).toContain('data-artifact-kind="document"');
expect(html).toContain('data-markdown-copy="Hello World (Document template)\n\n"');
expect(html).toContain('data-skill-name="artifact-template-hello-world"');
@@ -654,7 +654,7 @@ describe("ChatMarkdown artifact-template cards", () => {
<ChatMarkdown cwd="/tmp/project" text={ARTIFACT_TEMPLATE_DIRECTIVE} />,
);
- expect(html).toContain("chat-markdown-artifact-template");
+ expect(html).toContain("data-chat-markdown-artifact-template");
expect(html).not.toContain("Use template");
});
@@ -666,7 +666,7 @@ describe("ChatMarkdown artifact-template cards", () => {
for (const text of [malformed, unfinished]) {
const html = renderToStaticMarkup(<ChatMarkdown cwd="/tmp/project" text={text} />);
expect(html).toContain("::artifact-template");
- expect(html).not.toContain("chat-markdown-artifact-template");
+ expect(html).not.toContain("data-chat-markdown-artifact-template");
}
});
@@ -678,7 +678,7 @@ describe("ChatMarkdown artifact-template cards", () => {
const html = renderToStaticMarkup(<ChatMarkdown cwd="/tmp/project" text={text} />);
expect(html).toContain("::artifact-template");
- expect(html).not.toContain("chat-markdown-artifact-template");
+ expect(html).not.toContain("data-chat-markdown-artifact-template");
}
});
@@ -691,7 +691,7 @@ describe("ChatMarkdown artifact-template cards", () => {
);
expect(html.match(/::artifact-template/g)).toHaveLength(2);
- expect(html).not.toContain("chat-markdown-artifact-template");
+ expect(html).not.toContain("data-chat-markdown-artifact-template");
});
});
diff --git a/apps/web/src/components/ChatMarkdown.tsx b/apps/web/src/components/ChatMarkdown.tsx
index f48c573aa8b..56d46c01089 100644
--- a/apps/web/src/components/ChatMarkdown.tsx
+++ b/apps/web/src/components/ChatMarkdown.tsx
@@ -299,7 +299,8 @@ function CodexArtifactTemplateCard(props: {
<div
role="group"
aria-label={`${props.template.displayName} template`}
- className="chat-markdown-artifact-template my-[0.65rem] flex w-full min-w-0 items-center gap-3 rounded-xl border border-border/70 bg-card/60 px-3 py-2.5 text-foreground shadow-xs"
+ data-chat-markdown-artifact-template
+ className="my-[0.65rem] flex w-full min-w-0 items-center gap-3 rounded-xl border border-border/70 bg-card/60 px-3 py-2.5 text-foreground shadow-xs"
data-artifact-kind={props.template.artifactKind}
data-markdown-copy={`${props.template.displayName} (${presentationLabel})\n\n`}
data-skill-name={props.template.skillName}
diff --git a/apps/web/src/components/CommandPalette.tsx b/apps/web/src/components/CommandPalette.tsx
index 7ee1d12036d..d216828eb3e 100644
--- a/apps/web/src/components/CommandPalette.tsx
+++ b/apps/web/src/components/CommandPalette.tsx
@@ -2985,7 +2985,6 @@ function OpenCommandPaletteDialog(props: {
setHighlightedItemValue(typeof value === "string" ? value : null);
}}
onValueChange={handleQueryChange}
- panelClassName="max-h-[min(28rem,70vh)]"
showBackHint={isSubmenu}
value={query}
>
diff --git a/apps/web/src/components/CommandPaletteContent.tsx b/apps/web/src/components/CommandPaletteContent.tsx
index e9e6149b6cd..8732c6ef926 100644
--- a/apps/web/src/components/CommandPaletteContent.tsx
+++ b/apps/web/src/components/CommandPaletteContent.tsx
@@ -11,7 +11,11 @@ type CommandPaletteContentProps = Omit<ComponentProps<typeof Command>, "children
readonly footerTrailing?: ReactNode;
readonly inputAccessory?: ReactNode;
readonly inputProps: ComponentProps<typeof CommandInput>;
- readonly panelClassName?: string;
+ /**
+ * How tall the results panel may grow: the palette's list, a taller file list, or the whole
+ * dialog body (for modes that lay out their own status and empty states).
+ */
+ readonly panelSize?: "list" | "tall-list" | "fill";
readonly showBackHint?: boolean;
readonly testId?: string;
};
@@ -28,7 +32,7 @@ export function CommandPaletteContent({
footerTrailing,
inputAccessory,
inputProps,
- panelClassName,
+ panelSize = "list",
showBackHint,
testId,
...commandProps
@@ -49,7 +53,17 @@ export function CommandPaletteContent({
<CommandInput {...inputProps} ref={inputRef} />
{inputAccessory}
</div>
- <CommandPanel className={panelClassName}>{children}</CommandPanel>
+ <CommandPanel
+ className={
+ panelSize === "fill"
+ ? "flex min-h-0 flex-1 flex-col"
+ : panelSize === "tall-list"
+ ? "max-h-[min(34rem,76vh)]"
+ : "max-h-[min(28rem,70vh)]"
+ }
+ >
+ {children}
+ </CommandPanel>
<CommandFooter className="max-sm:flex-col max-sm:items-start">
<div className="flex items-center gap-3">
<KbdGroup>
diff --git a/apps/web/src/components/DiffPanelShell.tsx b/apps/web/src/components/DiffPanelShell.tsx
index 61d78518b00..0b7da6ab635 100644
--- a/apps/web/src/components/DiffPanelShell.tsx
+++ b/apps/web/src/components/DiffPanelShell.tsx
@@ -46,14 +46,27 @@ export function DiffPanelShell(props: {
);
}
-export function DiffFileHeaderSkeleton({ titleClassName }: { titleClassName: string }) {
+export function DiffFileHeaderSkeleton({
+ titleWidth,
+}: {
+ titleWidth: "short" | "medium" | "long";
+}) {
return (
<div className="flex h-8 items-center gap-2 px-2 pr-3">
<div className="flex size-5 shrink-0 items-center justify-center">
<Skeleton className="size-2.5" />
</div>
<Skeleton className="size-5 shrink-0" />
- <Skeleton shape="pill" className={cn("h-3", titleClassName)} />
+ <Skeleton
+ shape="pill"
+ className={
+ titleWidth === "short"
+ ? "h-3 w-2/5 max-w-52"
+ : titleWidth === "medium"
+ ? "h-3 w-1/2 max-w-64"
+ : "h-3 w-3/5 max-w-72"
+ }
+ />
<div className="ml-auto flex shrink-0 items-center gap-2">
<Skeleton shape="pill" className="h-3 w-5" />
<Skeleton shape="pill" className="h-3 w-5" />
@@ -62,11 +75,16 @@ export function DiffFileHeaderSkeleton({ titleClassName }: { titleClassName: str
);
}
-function DiffCodeLineSkeleton({ contentClassName }: { contentClassName: string }) {
+function DiffCodeLineSkeleton({ width }: { width: "short" | "medium" | "long" }) {
return (
<div className="flex items-center gap-3">
<Skeleton shape="pill" className="h-2.5 w-5 shrink-0" />
- <Skeleton shape="pill" className={cn("h-2.5", contentClassName)} />
+ <Skeleton
+ shape="pill"
+ className={
+ width === "short" ? "h-2.5 w-3/5" : width === "medium" ? "h-2.5 w-2/3" : "h-2.5 w-4/5"
+ }
+ />
</div>
);
}
@@ -79,19 +97,19 @@ export function DiffPanelLoadingState(props: { label: string }) {
aria-live="polite"
aria-label={props.label}
>
- <DiffFileHeaderSkeleton titleClassName="w-1/2 max-w-64" />
+ <DiffFileHeaderSkeleton titleWidth="medium" />
<div className="flex h-6 items-center gap-2 px-2 pr-3">
<div className="h-px flex-1 bg-border/40" />
<Skeleton shape="pill" className="h-2.5 w-24" />
<div className="h-px flex-1 bg-border/40" />
</div>
<div className="space-y-2 px-3 py-2">
- <DiffCodeLineSkeleton contentClassName="w-2/3" />
- <DiffCodeLineSkeleton contentClassName="w-4/5" />
- <DiffCodeLineSkeleton contentClassName="w-3/5" />
+ <DiffCodeLineSkeleton width="medium" />
+ <DiffCodeLineSkeleton width="long" />
+ <DiffCodeLineSkeleton width="short" />
</div>
- <DiffFileHeaderSkeleton titleClassName="w-2/5 max-w-52" />
- <DiffFileHeaderSkeleton titleClassName="w-3/5 max-w-72" />
+ <DiffFileHeaderSkeleton titleWidth="short" />
+ <DiffFileHeaderSkeleton titleWidth="long" />
<span className="sr-only">{props.label}</span>
</div>
);
diff --git a/apps/web/src/components/LegacySidebar.tsx b/apps/web/src/components/LegacySidebar.tsx
index 075ccea0a1c..82c5af7de13 100644
--- a/apps/web/src/components/LegacySidebar.tsx
+++ b/apps/web/src/components/LegacySidebar.tsx
@@ -26,6 +26,7 @@ import { ProjectFavicon } from "./ProjectFavicon";
import { useAtomValue } from "@effect/atom-react";
import { autoAnimate } from "@formkit/auto-animate";
import React, { useCallback, useEffect, memo, useMemo, useRef, useState } from "react";
+import { cn } from "~/lib/utils";
import { useShallow } from "zustand/react/shallow";
import {
DndContext,
@@ -184,7 +185,6 @@ import {
isSidebarNestedLinkClick,
isTrailingDoubleClick,
resolveProjectStatusIndicator,
- resolveThreadRowClassName,
resolveThreadStatusPill,
orderItemsByPreferredIds,
shouldClearThreadSelectionOnMouseDown,
@@ -696,7 +696,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
},
[attemptArchiveThread, threadRef],
);
- const rowButtonRender = useMemo(() => <div role="button" tabIndex={0} />, []);
return (
<SidebarMenuSubItem
@@ -707,15 +706,25 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
onMouseLeave={handleMouseLeave}
onBlurCapture={handleBlurCapture}
>
- <SidebarMenuSubButton
- render={rowButtonRender}
- size="sm"
- isActive={isActive}
+ {/* A thread row is the legacy sidebar's own control (a focusable div that hosts nested
+ links and buttons), not a SidebarMenuSubButton, so it owns its look here. */}
+ <div
+ role="button"
+ tabIndex={0}
+ data-active={isActive}
+ data-slot="sidebar-menu-sub-button"
+ data-sidebar="menu-sub-button"
+ data-size="sm"
data-testid={`thread-row-${thread.id}`}
- className={`${resolveThreadRowClassName({
- isActive,
- isSelected,
- })} relative isolate${isFileDragOver ? " ring-1 ring-inset ring-primary/70" : ""}`}
+ className={cn(
+ "relative isolate flex h-8 w-full min-w-0 cursor-pointer select-none items-center gap-2 overflow-hidden rounded-md px-2 text-left text-xs outline-hidden focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring group-data-[collapsible=icon]:hidden [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-muted-foreground",
+ isActive
+ ? "bg-sidebar-row-active font-medium text-sidebar-foreground hover:bg-sidebar-row-active"
+ : isSelected
+ ? "bg-sidebar-row-selected text-sidebar-foreground hover:bg-sidebar-row-active"
+ : "text-sidebar-muted-foreground/80 hover:bg-sidebar-row-hover hover:text-sidebar-foreground",
+ isFileDragOver && "ring-1 ring-inset ring-primary/70",
+ )}
onClick={handleRowClick}
onDoubleClick={handleRowDoubleClick}
onKeyDown={handleRowKeyDown}
@@ -934,7 +943,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
</span>
</div>
</div>
- </SidebarMenuSubButton>
+ </div>
</SidebarMenuSubItem>
);
});
diff --git a/apps/web/src/components/RightPanelSheet.tsx b/apps/web/src/components/RightPanelSheet.tsx
index e3468034396..044369ed0f7 100644
--- a/apps/web/src/components/RightPanelSheet.tsx
+++ b/apps/web/src/components/RightPanelSheet.tsx
@@ -1,6 +1,5 @@
import { type ReactNode } from "react";
-import { RIGHT_PANEL_SHEET_CLASS_NAME } from "../rightPanelLayout";
import { Sheet, SheetPopup } from "./ui/sheet";
export function RightPanelSheet(props: {
@@ -23,7 +22,7 @@ export function RightPanelSheet(props: {
side="right"
showCloseButton={false}
keepMounted
- className={RIGHT_PANEL_SHEET_CLASS_NAME}
+ className="w-[min(42vw,28rem)] min-w-80 max-w-[28rem] max-[760px]:w-[min(88vw,24rem)] max-[760px]:min-w-0 wco:mt-[env(titlebar-area-height)] wco:h-[calc(100%-env(titlebar-area-height))] wco:max-h-[calc(100%-env(titlebar-area-height))]"
>
{props.children}
</SheetPopup>
diff --git a/apps/web/src/components/Sidebar.logic.test.ts b/apps/web/src/components/Sidebar.logic.test.ts
index 76960f3f533..30044e64113 100644
--- a/apps/web/src/components/Sidebar.logic.test.ts
+++ b/apps/web/src/components/Sidebar.logic.test.ts
@@ -23,7 +23,6 @@ import {
isTrailingDoubleClick,
orderItemsByPreferredIds,
resolveProjectStatusIndicator,
- resolveThreadRowClassName,
resolveSidebarThreadStatus,
resolveThreadStatusPill,
resolveWorkingStartedAt,
@@ -2059,28 +2058,6 @@ describe("resolveThreadStatusPill", () => {
});
});
-describe("resolveThreadRowClassName", () => {
- it("uses the active sidebar surface when a thread is both selected and active", () => {
- const className = resolveThreadRowClassName({ isActive: true, isSelected: true });
- expect(className).toContain("bg-sidebar-row-active");
- expect(className).toContain("text-sidebar-foreground");
- expect(className).not.toContain("bg-primary");
- });
-
- it("uses selected hover colors for selected threads", () => {
- const className = resolveThreadRowClassName({ isActive: false, isSelected: true });
- expect(className).toContain("bg-sidebar-row-selected");
- expect(className).toContain("hover:bg-sidebar-row-active");
- expect(className).not.toContain("bg-primary");
- });
-
- it("uses the active sidebar surface for active-only threads", () => {
- const className = resolveThreadRowClassName({ isActive: true, isSelected: false });
- expect(className).toContain("bg-sidebar-row-active");
- expect(className).toContain("hover:bg-sidebar-row-active");
- });
-});
-
describe("resolveProjectStatusIndicator", () => {
it("returns null when no threads have a notable status", () => {
expect(resolveProjectStatusIndicator([null, null])).toBeNull();
diff --git a/apps/web/src/components/Sidebar.logic.ts b/apps/web/src/components/Sidebar.logic.ts
index fcedf46ce50..f4b13a5000b 100644
--- a/apps/web/src/components/Sidebar.logic.ts
+++ b/apps/web/src/components/Sidebar.logic.ts
@@ -768,40 +768,6 @@ export function isContextMenuPointerDown(input: {
return input.isMac && input.button === 0 && input.ctrlKey;
}
-export function resolveThreadRowClassName(input: {
- isActive: boolean;
- isSelected: boolean;
-}): string {
- const baseClassName =
- "h-8 w-full translate-x-0 cursor-pointer justify-start rounded-md px-2 text-left text-sm select-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring";
-
- if (input.isSelected && input.isActive) {
- return cn(
- baseClassName,
- "bg-sidebar-row-active text-sidebar-foreground font-medium hover:bg-sidebar-row-active hover:text-sidebar-foreground",
- );
- }
-
- if (input.isSelected) {
- return cn(
- baseClassName,
- "bg-sidebar-row-selected text-sidebar-foreground hover:bg-sidebar-row-active hover:text-sidebar-foreground",
- );
- }
-
- if (input.isActive) {
- return cn(
- baseClassName,
- "bg-sidebar-row-active text-sidebar-foreground font-medium hover:bg-sidebar-row-active hover:text-sidebar-foreground",
- );
- }
-
- return cn(
- baseClassName,
- "text-sidebar-muted-foreground/80 hover:bg-sidebar-row-hover hover:text-sidebar-foreground",
- );
-}
-
// ── Sidebar thread status model ─────────────────────────────────────
// Five visual states, three colors: color is reserved for "act now"
// (approval), "in motion" (working), and "broken" (failed). Ready is the
diff --git a/apps/web/src/components/SidebarStageBackdrop.tsx b/apps/web/src/components/SidebarStageBackdrop.tsx
index 9f77d7298c3..c1e02090649 100644
--- a/apps/web/src/components/SidebarStageBackdrop.tsx
+++ b/apps/web/src/components/SidebarStageBackdrop.tsx
@@ -23,14 +23,6 @@ export function resolveSidebarStageBackdropVariant(
return null;
}
-export function resolveSidebarStageFocusRingOffsetClass(
- variant: SidebarStageBackdropVariant,
-): string {
- return variant === "nightly"
- ? "focus-visible:ring-offset-(--stage-night-bottom)"
- : "focus-visible:ring-offset-(--stage-art-bottom)";
-}
-
export function resolveEnvironmentIdentificationPillLabel(
stageLabel: string,
): EnvironmentIdentificationPillLabel | null {
@@ -116,7 +108,8 @@ function NightlySkyArt({ compact = false }: { compact?: boolean }) {
return (
<svg
- className="stage-art stage-nightly h-full w-full"
+ data-stage-art="nightly"
+ className="h-full w-full"
fill="none"
preserveAspectRatio="xMinYMin slice"
viewBox={compact ? "96 0 8192 96" : STAGE_BACKDROP_VIEW_BOX}
@@ -230,7 +223,8 @@ function DevBlueprintArt({ compact = false }: { compact?: boolean }) {
return (
<svg
- className="stage-art stage-blueprint h-full w-full"
+ data-stage-art="blueprint"
+ className="h-full w-full"
fill="none"
preserveAspectRatio="xMinYMin slice"
viewBox={compact ? "64 0 8192 96" : STAGE_BACKDROP_VIEW_BOX}
diff --git a/apps/web/src/components/ThreadTerminalDrawer.tsx b/apps/web/src/components/ThreadTerminalDrawer.tsx
index 91c7cc85559..e86a100e056 100644
--- a/apps/web/src/components/ThreadTerminalDrawer.tsx
+++ b/apps/web/src/components/ThreadTerminalDrawer.tsx
@@ -175,8 +175,8 @@ function terminalFontOptions(family: string, size: number): { family?: string; s
export function terminalThemeFromApp(mountElement?: HTMLElement | null): GhosttyTheme {
const drawerSurface =
- mountElement?.closest(".thread-terminal-drawer") ??
- document.querySelector(".thread-terminal-drawer") ??
+ mountElement?.closest("[data-thread-terminal-drawer]") ??
+ document.querySelector("[data-thread-terminal-drawer]") ??
document.body;
const drawerStyles = getComputedStyle(drawerSurface);
const themeStyles = mountElement ? getComputedStyle(mountElement) : drawerStyles;
@@ -1392,9 +1392,10 @@ export default function ThreadTerminalDrawer({
if (normalizedTerminalIds.length === 0) {
return (
<aside
+ data-thread-terminal-drawer
data-terminal-owner={isPanel ? "right-panel" : "drawer"}
className={cn(
- "thread-terminal-drawer relative flex min-w-0 flex-col overflow-hidden bg-background",
+ "relative flex min-w-0 flex-col overflow-hidden bg-background",
isPanel ? "h-full flex-1" : "shrink-0 border-t border-border/80",
)}
style={isPanel ? undefined : { height: `${drawerHeight}px` }}
@@ -1422,9 +1423,10 @@ export default function ThreadTerminalDrawer({
return (
<aside
+ data-thread-terminal-drawer
data-terminal-owner={isPanel ? "right-panel" : "drawer"}
className={cn(
- "thread-terminal-drawer relative flex min-w-0 flex-col overflow-hidden bg-background",
+ "relative flex min-w-0 flex-col overflow-hidden bg-background",
isPanel ? "h-full flex-1" : "shrink-0 border-t border-border/80",
)}
style={isPanel ? undefined : { height: `${drawerHeight}px` }}
diff --git a/apps/web/src/components/diffs/DiffFileLoadingBoundary.tsx b/apps/web/src/components/diffs/DiffFileLoadingBoundary.tsx
index 0ce87e142e2..6bf4302fbcc 100644
--- a/apps/web/src/components/diffs/DiffFileLoadingBoundary.tsx
+++ b/apps/web/src/components/diffs/DiffFileLoadingBoundary.tsx
@@ -19,7 +19,7 @@ export function DiffFileLoadingBoundary({ load, count }: { load: () => void; cou
<div ref={ref} role="status" aria-label="Loading diff…">
{Array.from({ length: Math.min(count, 4) }, (_, index) => (
<div key={index} aria-hidden className="border-b border-border/40">
- <DiffFileHeaderSkeleton titleClassName="w-1/2 max-w-64" />
+ <DiffFileHeaderSkeleton titleWidth="medium" />
</div>
))}
</div>
diff --git a/apps/web/src/components/files/ProjectFilePicker.tsx b/apps/web/src/components/files/ProjectFilePicker.tsx
index a59e8dd77e4..38d21f6c100 100644
--- a/apps/web/src/components/files/ProjectFilePicker.tsx
+++ b/apps/web/src/components/files/ProjectFilePicker.tsx
@@ -130,7 +130,7 @@ function OpenProjectFilePicker(props: ProjectFilePickerProps & { target: ActiveP
setHighlightedItemValue(null);
setQuery(value);
}}
- panelClassName="max-h-[min(34rem,76vh)]"
+ panelSize="tall-list"
testId="project-file-picker"
value={query}
>
diff --git a/apps/web/src/components/onboarding/WelcomeWizard.tsx b/apps/web/src/components/onboarding/WelcomeWizard.tsx
index 26ba0cea419..169f1f8b057 100644
--- a/apps/web/src/components/onboarding/WelcomeWizard.tsx
+++ b/apps/web/src/components/onboarding/WelcomeWizard.tsx
@@ -887,7 +887,10 @@ function AgentInstallTerminal({
]);
return (
- <div className="thread-terminal-drawer mt-4 overflow-hidden rounded-lg border border-border/70 bg-background text-foreground">
+ <div
+ data-thread-terminal-drawer
+ className="mt-4 overflow-hidden rounded-lg border border-border/70 bg-background text-foreground"
+ >
<div className="flex items-center justify-between border-b border-border/60 bg-background/60 px-3 py-1.5">
<span className="text-[11px] font-medium text-muted-foreground">
{setupState === "writeFailed" ? (
diff --git a/apps/web/src/components/preview/PreviewPanelShell.tsx b/apps/web/src/components/preview/PreviewPanelShell.tsx
index eddb549cf22..71dde5b3ad9 100644
--- a/apps/web/src/components/preview/PreviewPanelShell.tsx
+++ b/apps/web/src/components/preview/PreviewPanelShell.tsx
@@ -7,7 +7,6 @@ import {
useState,
} from "react";
-import { isElectron } from "~/env";
import { useResizableWidth } from "~/hooks/useResizableWidth";
import { cn } from "~/lib/utils";
@@ -64,7 +63,6 @@ export function PreviewPanelShell(props: {
defaultWidth?: number;
children: ReactNode;
}) {
- const useDragRegion = isElectron && props.mode !== "sheet" && props.mode !== "embedded";
const isInline = props.mode === "inline";
const collapsible = isInline && props.open !== undefined;
const open = props.open ?? true;
@@ -149,7 +147,6 @@ export function PreviewPanelShell(props: {
className="flex h-full min-h-0 min-w-0 flex-col"
style={collapsible && !maximized ? { width: `calc(${width}px - 1px)` } : undefined}
>
- {useDragRegion ? <div className="electron-drag-region h-0 w-full" aria-hidden /> : null}
{props.children}
</div>
</div>
diff --git a/apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx b/apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
index 536bab75b43..de2ee18f9d9 100644
--- a/apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
@@ -1980,9 +1980,11 @@ export function PullRequestDetailPanel({
</Tooltip>
) : (primaryAction === "merged" || primaryAction === "closed") &&
statePresentation !== null ? (
- <Badge size="control" variant="outline" className={statePresentation.toneClassName}>
- <statePresentation.Icon className="size-3.5" />
- {statePresentation.label}
+ <Badge size="control" variant="outline">
+ <span className={cn("flex items-center gap-1", statePresentation.toneClassName)}>
+ <statePresentation.Icon className="size-3.5" />
+ {statePresentation.label}
+ </span>
</Badge>
) : null}
<Menu>
diff --git a/apps/web/src/components/pullRequest/PullRequestGhosts.tsx b/apps/web/src/components/pullRequest/PullRequestGhosts.tsx
index 78d93915e0d..85c9802c217 100644
--- a/apps/web/src/components/pullRequest/PullRequestGhosts.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestGhosts.tsx
@@ -169,10 +169,9 @@ export function PullRequestDetailGhost({
<span className="min-w-0 truncate font-medium">{seed.repository}</span>
<InlineButton
onClick={() => void readLocalApi()?.shell.openExternal(seed.url)}
- className={statePresentation?.toneClassName}
aria-label={`Open pull request #${seed.number} on host`}
>
- #{seed.number}
+ <span className={statePresentation?.toneClassName}>#{seed.number}</span>
<ExternalLinkIcon aria-hidden className="size-2.5" />
</InlineButton>
</>
diff --git a/apps/web/src/components/pullRequest/PullRequestRow.tsx b/apps/web/src/components/pullRequest/PullRequestRow.tsx
index e32decde136..898f58ecb22 100644
--- a/apps/web/src/components/pullRequest/PullRequestRow.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestRow.tsx
@@ -27,10 +27,11 @@ import {
* narrow row shows one label and a "+N" while a wide one spreads out up to three. The "+N"
* rides on whichever pill is the last visible one, and is hidden as soon as the next slot shows.
*/
+// Each slot's pill appears at a wider row, and its overflow count yields to the next slot.
const LABEL_SLOTS = [
- { pill: "", overflow: "@xl/pr-row-meta:hidden" },
- { pill: "hidden @xl/pr-row-meta:inline-flex", overflow: "@3xl/pr-row-meta:hidden" },
- { pill: "hidden @3xl/pr-row-meta:inline-flex", overflow: "" },
+ { overflow: "@xl/pr-row-meta:hidden" },
+ { overflow: "@3xl/pr-row-meta:hidden" },
+ { overflow: "" },
] as const;
function PullRequestRowLabels({ labels }: { labels: EnvironmentPullRequestEntry["labels"] }) {
@@ -42,7 +43,17 @@ function PullRequestRowLabels({ labels }: { labels: EnvironmentPullRequestEntry[
if (!label) return null;
const remaining = labels.length - index - 1;
return (
- <PullRequestLabelChip key={label.name} label={label} className={slot.pill}>
+ <PullRequestLabelChip
+ key={label.name}
+ label={label}
+ className={
+ index === 0
+ ? ""
+ : index === 1
+ ? "hidden @xl/pr-row-meta:inline-flex"
+ : "hidden @3xl/pr-row-meta:inline-flex"
+ }
+ >
{remaining > 0 ? (
<span className={cn("shrink-0", slot.overflow)}>+{remaining}</span>
) : null}
diff --git a/apps/web/src/components/search/ProjectContentSearchDialog.tsx b/apps/web/src/components/search/ProjectContentSearchDialog.tsx
index e037dd0ee9c..2812b600469 100644
--- a/apps/web/src/components/search/ProjectContentSearchDialog.tsx
+++ b/apps/web/src/components/search/ProjectContentSearchDialog.tsx
@@ -88,11 +88,11 @@ function EmptyContentSearchDialog() {
footerActionLabel="Open file"
inputProps={{ disabled: true, placeholder: "Search project contents…" }}
mode="none"
- panelClassName="flex min-h-0 flex-1 items-center justify-center"
+ panelSize="fill"
testId="project-content-search"
value=""
>
- <p className="px-6 text-center text-muted-foreground text-sm">
+ <p className="m-auto px-6 text-center text-muted-foreground text-sm">
Open a project to search its files.
</p>
</CommandPaletteContent>
@@ -219,7 +219,7 @@ function OpenContentSearchDialog(props: {
}}
mode="none"
onValueChange={setQuery}
- panelClassName="flex min-h-0 flex-1 flex-col"
+ panelSize="fill"
testId="project-content-search"
value={query}
>
diff --git a/apps/web/src/components/settings/ProjectFaviconPickerDialog.tsx b/apps/web/src/components/settings/ProjectFaviconPickerDialog.tsx
index a0971db3ac2..5ed077f31bc 100644
--- a/apps/web/src/components/settings/ProjectFaviconPickerDialog.tsx
+++ b/apps/web/src/components/settings/ProjectFaviconPickerDialog.tsx
@@ -115,7 +115,7 @@ export function ProjectFaviconPickerDialog(props: {
setHighlightedItemValue(null);
setQuery(value);
}}
- panelClassName="max-h-[min(34rem,76vh)]"
+ panelSize="tall-list"
testId="project-favicon-picker"
value={query}
>
diff --git a/apps/web/src/components/sidebar/SidebarChrome.tsx b/apps/web/src/components/sidebar/SidebarChrome.tsx
index c956ab0a63c..a37aba27b8d 100644
--- a/apps/web/src/components/sidebar/SidebarChrome.tsx
+++ b/apps/web/src/components/sidebar/SidebarChrome.tsx
@@ -10,7 +10,6 @@ import { T3Wordmark } from "../T3Wordmark";
import {
resolveEnvironmentIdentificationPillLabel,
resolveSidebarStageBackdropVariant,
- resolveSidebarStageFocusRingOffsetClass,
SidebarStageBackdrop,
useEnvironmentStageLabel,
} from "../SidebarStageBackdrop";
@@ -58,10 +57,7 @@ export const SidebarChromeHeader = memo(function SidebarChromeHeader({
<SidebarTrigger
// Over the stage artwork: the media viewer's control-on-imagery treatment.
variant={backdropVariant ? "media-navigation" : "ghost"}
- className={cn(
- "relative top-auto z-10 translate-y-0 md:hidden",
- backdropVariant && resolveSidebarStageFocusRingOffsetClass(backdropVariant),
- )}
+ className="relative top-auto z-10 translate-y-0 md:hidden"
/>
<SidebarBrand onBackdrop={backdropVariant !== null} />
{pillLabel ? (
diff --git a/apps/web/src/components/sidebar/SidebarProviderUpdatePill.tsx b/apps/web/src/components/sidebar/SidebarProviderUpdatePill.tsx
index 2d1159bdb40..b77848f96f2 100644
--- a/apps/web/src/components/sidebar/SidebarProviderUpdatePill.tsx
+++ b/apps/web/src/components/sidebar/SidebarProviderUpdatePill.tsx
@@ -14,13 +14,13 @@ import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
const PROVIDER_UPDATE_PILL_STYLES = {
loading:
- "bg-sidebar-control-surface text-sidebar-foreground group-has-[button.provider-update-main:hover]/provider-update:bg-sidebar-row-hover",
+ "bg-sidebar-control-surface text-sidebar-foreground group-has-[button[data-provider-update-main]:hover]/provider-update:bg-sidebar-row-hover",
success:
- "bg-sidebar-control-surface text-sidebar-foreground group-has-[button.provider-update-main:hover]/provider-update:bg-sidebar-row-hover",
+ "bg-sidebar-control-surface text-sidebar-foreground group-has-[button[data-provider-update-main]:hover]/provider-update:bg-sidebar-row-hover",
warning:
- "bg-warning/12 text-warning group-has-[button.provider-update-main:hover]/provider-update:bg-warning/18",
+ "bg-warning/12 text-warning group-has-[button[data-provider-update-main]:hover]/provider-update:bg-warning/18",
error:
- "bg-destructive/12 text-destructive group-has-[button.provider-update-main:hover]/provider-update:bg-destructive/18",
+ "bg-destructive/12 text-destructive group-has-[button[data-provider-update-main]:hover]/provider-update:bg-destructive/18",
} as const;
const PROVIDER_UPDATE_PILL_PROGRESS_STYLES = {
@@ -169,7 +169,8 @@ export function SidebarProviderUpdatePill() {
<button
type="button"
aria-label={displayedView.description}
- className="provider-update-main relative z-[1] flex min-w-0 flex-1 items-center gap-2 px-2 py-1.5 text-left"
+ data-provider-update-main
+ className="relative z-[1] flex min-w-0 flex-1 items-center gap-2 px-2 py-1.5 text-left"
onClick={openProviderSettings}
>
{displayedView.tone === "loading" ? (
diff --git a/apps/web/src/components/ui/alert-dialog.tsx b/apps/web/src/components/ui/alert-dialog.tsx
index 7cd6d40c59e..2dae216fa88 100644
--- a/apps/web/src/components/ui/alert-dialog.tsx
+++ b/apps/web/src/components/ui/alert-dialog.tsx
@@ -101,7 +101,7 @@ function AlertDialogFooter({
function AlertDialogTitle({ className, ...props }: AlertDialogPrimitive.Title.Props) {
return (
<AlertDialogPrimitive.Title
- className={cn("wrap-anywhere font-heading font-semibold text-xl leading-none", className)}
+ className={cn("wrap-anywhere font-semibold text-xl leading-none", className)}
data-slot="alert-dialog-title"
{...props}
/>
diff --git a/apps/web/src/components/ui/button.tsx b/apps/web/src/components/ui/button.tsx
index 8ef1b602ae7..1a101f10711 100644
--- a/apps/web/src/components/ui/button.tsx
+++ b/apps/web/src/components/ui/button.tsx
@@ -57,7 +57,7 @@ const buttonVariants = cva(
"media-close":
"[--control-icon-color:currentColor] border-transparent bg-black/65 text-white shadow-sm ring-1 ring-white/20 [:hover,[data-pressed]]:bg-black/80 focus-visible:ring-white",
"media-navigation":
- "[--control-icon-color:currentColor] absolute top-1/2 z-20 -translate-y-1/2 border-transparent text-white/90 [:hover,[data-pressed]]:bg-white/10 [:hover,[data-pressed]]:text-white focus-visible:ring-white",
+ "[--control-icon-color:currentColor] absolute top-1/2 z-20 -translate-y-1/2 border-transparent text-white/90 [:hover,[data-pressed]]:bg-white/10 [:hover,[data-pressed]]:text-white focus-visible:ring-white focus-visible:ring-offset-transparent",
outline:
"[--control-icon-color:var(--contrast-muted-foreground)] border-input bg-popover not-dark:bg-clip-padding text-foreground shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64",
overlay: "border-transparent bg-black/70 text-white/65 [:hover,[data-pressed]]:bg-black/90",
diff --git a/apps/web/src/components/ui/dialog.tsx b/apps/web/src/components/ui/dialog.tsx
index 7ce6dcc9342..463cedd79fb 100644
--- a/apps/web/src/components/ui/dialog.tsx
+++ b/apps/web/src/components/ui/dialog.tsx
@@ -143,7 +143,7 @@ function DialogFooter({
function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
return (
<DialogPrimitive.Title
- className={cn("wrap-anywhere font-heading font-semibold text-xl leading-none", className)}
+ className={cn("wrap-anywhere font-semibold text-xl leading-none", className)}
data-slot="dialog-title"
{...props}
/>
diff --git a/apps/web/src/components/ui/empty.tsx b/apps/web/src/components/ui/empty.tsx
index 8b41a710e1f..aa69c362401 100644
--- a/apps/web/src/components/ui/empty.tsx
+++ b/apps/web/src/components/ui/empty.tsx
@@ -91,11 +91,7 @@ function EmptyMedia({
function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {
return (
- <div
- className={cn("font-heading font-semibold text-xl", className)}
- data-slot="empty-title"
- {...props}
- />
+ <div className={cn("font-semibold text-xl", className)} data-slot="empty-title" {...props} />
);
}
diff --git a/apps/web/src/components/ui/scroll-area.tsx b/apps/web/src/components/ui/scroll-area.tsx
index 47076d99f25..7792b9606e4 100644
--- a/apps/web/src/components/ui/scroll-area.tsx
+++ b/apps/web/src/components/ui/scroll-area.tsx
@@ -53,7 +53,7 @@ function ScrollArea({
>
<ScrollAreaPrimitive.Viewport
className={cn(
- "h-full max-h-[inherit] overflow-auto overscroll-contain rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-has-overflow-x:overscroll-x-contain",
+ "h-full max-h-[inherit] overflow-auto overscroll-contain rounded-[inherit] outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-has-overflow-x:overscroll-x-contain",
chainVerticalScroll && "overscroll-y-auto",
scrollFade &&
"mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]",
diff --git a/apps/web/src/components/ui/sheet.tsx b/apps/web/src/components/ui/sheet.tsx
index 4fb4644fe81..f0b0017976c 100644
--- a/apps/web/src/components/ui/sheet.tsx
+++ b/apps/web/src/components/ui/sheet.tsx
@@ -138,7 +138,7 @@ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {
return (
<SheetPrimitive.Title
- className={cn("font-heading font-semibold text-xl leading-none", className)}
+ className={cn("font-semibold text-xl leading-none", className)}
data-slot="sheet-title"
{...props}
/>
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index e40b3d384cd..828f8def37c 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -192,6 +192,8 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
--color-popover: var(--popover);
--color-card-foreground: var(--contrast-card-foreground);
--color-card: var(--card);
+ --color-code: var(--code-background);
+ --color-code-foreground: var(--code-foreground);
--color-foreground: var(--contrast-foreground);
--color-background: var(--background);
--color-surface-raised: var(--surface-raised);
diff --git a/apps/web/src/rightPanelLayout.ts b/apps/web/src/rightPanelLayout.ts
index 5528072e57b..69b796c7ae7 100644
--- a/apps/web/src/rightPanelLayout.ts
+++ b/apps/web/src/rightPanelLayout.ts
@@ -1,3 +1 @@
export const RIGHT_PANEL_INLINE_LAYOUT_MEDIA_QUERY = "(max-width: 980px)";
-export const RIGHT_PANEL_SHEET_CLASS_NAME =
- "w-[min(42vw,28rem)] min-w-80 max-w-[28rem] p-0 max-[760px]:w-[min(88vw,24rem)] max-[760px]:min-w-0 wco:mt-[env(titlebar-area-height)] wco:h-[calc(100%-env(titlebar-area-height))] wco:max-h-[calc(100%-env(titlebar-area-height))]";
diff --git a/vite.config.ts b/vite.config.ts
index 0c8dec8c9f9..cee554c5b6d 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -197,6 +197,12 @@ export default defineConfig({
files: ["apps/mobile/src/**"],
rules: { "t3code/no-mobile-uniwind-theme-escape-hatches": "error" },
},
+ {
+ // Every class in web code must be one Tailwind generates: a typo or a class nothing
+ // declares ships silently unstyled. JS hooks use data attributes, not class names.
+ files: ["apps/web/src/**"],
+ rules: { "shadcn/no-unknown-classes": "error" },
+ },
{
// components/ui exports own their look. App code picks a variant or size instead
// of restyling with className; layout classes (width, flex, margin, position) stay
@@ -205,6 +211,8 @@ export default defineConfig({
files: ["apps/web/src/**"],
excludeFiles: ["apps/web/src/components/ui/**"],
rules: {
+ // A className built at runtime on a ui component is one no-restyle cannot read.
+ "shadcn/require-static-classes": "error",
"shadcn/no-restyle": [
"error",
{