lint/unknown and static (#13366)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Julius MarmingeandClaude Opus 5.5 authored and GitHub committed 2026-09-24 10:49:04 -07:00
1 parent cb1a3f3467
commit 80fc23ac32
32 files changed
+138 -152

No files matched your search

+1 -7
View File
@@ -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"
/>
@@ -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");
});
});
+2 -1
View File
@@ -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}
@@ -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}
>
@@ -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>
+28 -10
View File
@@ -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>
);
+20 -11
View File
@@ -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>
);
});
+1 -2
View File
@@ -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>
@@ -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();
-34
View File
@@ -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
@@ -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}
@@ -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` }}
@@ -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>
@@ -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}
>
@@ -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" ? (
@@ -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>
@@ -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>
@@ -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>
</>
@@ -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}
@@ -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}
>
@@ -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}
>
@@ -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 ? (
@@ -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" ? (
+1 -1
View File
@@ -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}
/>
+1 -1
View File
@@ -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",
+1 -1
View File
@@ -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}
/>
+1 -5
View File
@@ -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} />
);
}
+1 -1
View File
@@ -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]",
+1 -1
View File
@@ -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}
/>
+2
View File
@@ -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);
-2
View File
@@ -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))]";
+8
View File
@@ -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",
{