Skip to content

Commit f465227

Browse files
refactor(web): app code stops restyling sidebar, popover, table and misc ui exports (pingdotgg#13207)
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 2107939 commit f465227

41 files changed

Lines changed: 686 additions & 713 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/web/src/components/AppSidebarLayout.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,12 @@ function SidebarControl() {
125125
<TooltipTrigger
126126
render={
127127
<SidebarTrigger
128+
// Over the stage artwork the trigger is a control on imagery, like the media
129+
// viewer's arrows; that variant positions itself, so the layout is reset here.
130+
variant={isSidebarVisible && stageBackdropVariant ? "media-navigation" : "ghost"}
128131
className={cn(
129132
"pointer-events-auto",
130-
isSidebarVisible &&
131-
stageBackdropVariant &&
132-
"focus-visible:ring-white/90 [&_svg]:stroke-white/90! [&_svg]:opacity-100! [&_svg]:hover:stroke-white! [:hover,[data-pressed]]:bg-white/15",
133+
isSidebarVisible && stageBackdropVariant && "relative top-auto translate-y-0",
133134
isSidebarVisible &&
134135
stageBackdropVariant &&
135136
resolveSidebarStageFocusRingOffsetClass(stageBackdropVariant),
@@ -244,7 +245,6 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
244245
side="left"
245246
collapsible="offcanvas"
246247
data-app-sidebar=""
247-
className="border-r border-sidebar-border"
248248
resizable={{
249249
maxWidth: sidebarMaximumWidth,
250250
minWidth: THREAD_SIDEBAR_MIN_WIDTH,

‎apps/web/src/components/BranchToolbarBranchSelector.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -817,11 +817,12 @@ export function BranchToolbarBranchSelector({
817817
data-composer-label
818818
className="min-w-0 max-w-[240px] group-data-[compact]/composer-context:max-w-0"
819819
>
820-
<MiddleTruncate
821-
value={triggerLabel}
820+
<span
822821
data-composer-label-motion
823822
className="flex w-full max-w-[240px] transition-opacity duration-180 ease-[cubic-bezier(0.32,0.72,0,1)] group-data-[compact]/composer-context:opacity-0 motion-reduce:transition-none"
824-
/>
823+
>
824+
<MiddleTruncate value={triggerLabel} />
825+
</span>
825826
</span>
826827
<ChevronDownIcon className="size-3 shrink-0 opacity-50" />
827828
</ComboboxTrigger>

‎apps/web/src/components/CustomSnoozeDialog.tsx‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function CustomSnoozeDialog() {
9393
<DialogTitle>Custom snooze</DialogTitle>
9494
<DialogDescription>Choose when snoozed threads return to your inbox.</DialogDescription>
9595
</DialogHeader>
96-
<DialogPanel className="text-base sm:text-sm">
96+
<DialogPanel>
9797
<div className="flex flex-col gap-4">
9898
<ToggleGroup
9999
aria-label="Schedule type"
@@ -147,10 +147,7 @@ function CustomSnoozeDialog() {
147147
</PopoverPopup>
148148
</Popover>
149149
</div>
150-
<Label
151-
className="flex min-w-0 flex-col items-stretch gap-1.5"
152-
htmlFor={`${id}-time`}
153-
>
150+
<Label className="flex min-w-0 flex-col items-stretch" htmlFor={`${id}-time`}>
154151
Time
155152
<Input
156153
nativeInput
@@ -185,10 +182,7 @@ function CustomSnoozeDialog() {
185182
<NumberFieldIncrement aria-label="Increase duration" />
186183
</NumberFieldGroup>
187184
</NumberField>
188-
<Label
189-
className="flex min-w-0 flex-col items-stretch gap-1.5"
190-
htmlFor={`${id}-unit`}
191-
>
185+
<Label className="flex min-w-0 flex-col items-stretch" htmlFor={`${id}-unit`}>
192186
Unit
193187
<Select
194188
value={unit}

‎apps/web/src/components/GitActionsControl.tsx‎

Lines changed: 59 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ function PublishRepositoryDialog(props: PublishRepositoryDialogProps) {
627627
setPublishRepositoryOverride(null);
628628
}}
629629
aria-labelledby="publish-provider-cards-label"
630-
className="grid grid-cols-2 gap-2.5"
630+
className="grid grid-cols-2"
631631
>
632632
{sortedPublishProviderOptions.map((option) => {
633633
const readiness = publishProviderReadiness[option.value];
@@ -737,7 +737,7 @@ function PublishRepositoryDialog(props: PublishRepositoryDialogProps) {
737737
}
738738
aria-labelledby="publish-visibility-cards-label"
739739
disabled={publishRepositoryAction.isPending}
740-
className="grid grid-cols-2 gap-2.5"
740+
className="grid grid-cols-2"
741741
>
742742
{[
743743
{
@@ -1915,57 +1915,63 @@ export default function GitActionsControl({
19151915
<p className="font-medium">none</p>
19161916
) : (
19171917
<div className="space-y-2">
1918-
<ScrollArea className="h-44 rounded-lg bg-card ring-1 ring-black/5 dark:bg-white/[0.025] dark:ring-white/5">
1919-
<div className="space-y-1 p-1">
1920-
{allFiles.map((file) => {
1921-
const isExcluded = excludedFiles.has(file.path);
1922-
return (
1923-
<div
1924-
key={file.path}
1925-
className="flex w-full items-center gap-2 rounded-md px-2 py-1 font-mono hover:bg-accent/50"
1926-
>
1927-
{isEditingFiles && (
1928-
<Checkbox
1929-
checked={!excludedFiles.has(file.path)}
1930-
onCheckedChange={() => {
1931-
setExcludedFiles((prev) => {
1932-
const next = new Set(prev);
1933-
if (next.has(file.path)) {
1934-
next.delete(file.path);
1935-
} else {
1936-
next.add(file.path);
1937-
}
1938-
return next;
1939-
});
1940-
}}
1941-
/>
1942-
)}
1943-
<button
1944-
type="button"
1945-
className="flex min-w-0 flex-1 items-center justify-between gap-3 text-left"
1946-
onClick={() => openChangedFileInEditor(file.path)}
1918+
<div className="h-44 rounded-lg bg-card ring-1 ring-black/5 dark:bg-white/[0.025] dark:ring-white/5">
1919+
<ScrollArea>
1920+
<div className="space-y-1 p-1">
1921+
{allFiles.map((file) => {
1922+
const isExcluded = excludedFiles.has(file.path);
1923+
return (
1924+
<div
1925+
key={file.path}
1926+
className="flex w-full items-center gap-2 rounded-md px-2 py-1 font-mono hover:bg-accent/50"
19471927
>
1948-
<StartTruncatedPath
1949-
path={file.path}
1950-
className={`flex-1${isExcluded ? " text-muted-foreground" : ""}`}
1951-
/>
1952-
<span className="shrink-0">
1953-
{isExcluded ? (
1954-
<span className="text-muted-foreground">Excluded</span>
1955-
) : (
1956-
<>
1957-
<span className="text-diff-addition">+{file.insertions}</span>
1958-
<span className="text-muted-foreground"> / </span>
1959-
<span className="text-diff-deletion">-{file.deletions}</span>
1960-
</>
1961-
)}
1962-
</span>
1963-
</button>
1964-
</div>
1965-
);
1966-
})}
1967-
</div>
1968-
</ScrollArea>
1928+
{isEditingFiles && (
1929+
<Checkbox
1930+
checked={!excludedFiles.has(file.path)}
1931+
onCheckedChange={() => {
1932+
setExcludedFiles((prev) => {
1933+
const next = new Set(prev);
1934+
if (next.has(file.path)) {
1935+
next.delete(file.path);
1936+
} else {
1937+
next.add(file.path);
1938+
}
1939+
return next;
1940+
});
1941+
}}
1942+
/>
1943+
)}
1944+
<button
1945+
type="button"
1946+
className="flex min-w-0 flex-1 items-center justify-between gap-3 text-left"
1947+
onClick={() => openChangedFileInEditor(file.path)}
1948+
>
1949+
<StartTruncatedPath
1950+
path={file.path}
1951+
className={`flex-1${isExcluded ? " text-muted-foreground" : ""}`}
1952+
/>
1953+
<span className="shrink-0">
1954+
{isExcluded ? (
1955+
<span className="text-muted-foreground">Excluded</span>
1956+
) : (
1957+
<>
1958+
<span className="text-diff-addition">
1959+
+{file.insertions}
1960+
</span>
1961+
<span className="text-muted-foreground"> / </span>
1962+
<span className="text-diff-deletion">
1963+
-{file.deletions}
1964+
</span>
1965+
</>
1966+
)}
1967+
</span>
1968+
</button>
1969+
</div>
1970+
);
1971+
})}
1972+
</div>
1973+
</ScrollArea>
1974+
</div>
19691975
<div className="flex justify-end font-mono">
19701976
<span className="text-diff-addition">
19711977
+{selectedFiles.reduce((sum, f) => sum + f.insertions, 0)}
@@ -2040,7 +2046,7 @@ export default function GitActionsControl({
20402046
</DialogTitle>
20412047
<DialogDescription>{pendingDefaultBranchActionCopy?.description}</DialogDescription>
20422048
</DialogHeader>
2043-
<DialogFooter className="dark:border-transparent dark:bg-transparent sm:flex-wrap sm:items-center">
2049+
<DialogFooter variant="bare" className="sm:flex-wrap sm:items-center">
20442050
<Button
20452051
className="w-full sm:mr-auto sm:w-auto"
20462052
variant="outline"

‎apps/web/src/components/LegacySidebar.tsx‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ const SidebarProjectThreadList = memo(function SidebarProjectThreadList(
10381038
return (
10391039
<SidebarMenuSub
10401040
ref={attachThreadListAutoAnimateRef}
1041-
className="mx-0.5 my-0 w-full translate-x-0 gap-0.5 overflow-hidden border-l-0 px-1 py-0 sm:mx-1 sm:px-1.5"
1041+
className="mx-0.5 my-0 w-full translate-x-0 overflow-hidden sm:mx-1"
10421042
>
10431043
{shouldShowThreadPanel && showEmptyThreadState ? (
10441044
<SidebarMenuSubItem className="w-full" data-thread-selection-safe>
@@ -2357,9 +2357,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
23572357
<div className="group/project-header relative">
23582358
<SidebarMenuButton
23592359
ref={isManualProjectSorting ? dragHandleProps?.setActivatorNodeRef : undefined}
2360-
className={`pr-8 group-hover/project-header:bg-sidebar-row-hover group-hover/project-header:text-sidebar-foreground max-sm:pr-14 ${
2361-
isManualProjectSorting ? "cursor-grab active:cursor-grabbing" : ""
2362-
}`}
2360+
className={isManualProjectSorting ? "cursor-grab active:cursor-grabbing" : undefined}
23632361
{...(isManualProjectSorting && dragHandleProps ? dragHandleProps.attributes : {})}
23642362
{...(isManualProjectSorting && dragHandleProps ? dragHandleProps.listeners : {})}
23652363
onPointerDownCapture={handleProjectButtonPointerDownCapture}
@@ -2408,6 +2406,9 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
24082406
</span>
24092407
) : null}
24102408
</span>
2409+
{/* Keeps the name clear of the environment badge and new-thread button overlaid on
2410+
the row's end (two slots on touch, where both stay visible). */}
2411+
<span aria-hidden className="w-4 shrink-0 max-sm:w-10" />
24112412
</SidebarMenuButton>
24122413
{/* Environment badge – visible by default, crossfades with the
24132414
"new thread" button on hover using the same pointer-events +
@@ -2618,7 +2619,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
26182619

26192620
const SidebarProjectListRow = memo(function SidebarProjectListRow(props: SidebarProjectItemProps) {
26202621
return (
2621-
<SidebarMenuItem className="rounded-md">
2622+
<SidebarMenuItem>
26222623
<SidebarProjectItem {...props} />
26232624
</SidebarMenuItem>
26242625
);
@@ -2963,12 +2964,7 @@ const SidebarProjectsContent = memo(function SidebarProjectsContent(
29632964
<SidebarMenu>
29642965
<SidebarMenuItem>
29652966
<CommandDialogTrigger
2966-
render={
2967-
<SidebarMenuButton
2968-
className="focus-visible:ring-0"
2969-
data-testid="command-palette-trigger"
2970-
/>
2971-
}
2967+
render={<SidebarMenuButton data-testid="command-palette-trigger" />}
29722968
>
29732969
<SearchIcon />
29742970
<span className="flex-1 truncate">Search</span>

‎apps/web/src/components/PullRequestThreadDialog.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ export function PullRequestThreadDialog({
196196
>
197197
<DialogPopup className="max-w-xl">
198198
<DialogHeader>
199-
<DialogTitle className="flex items-center gap-2">
200-
<SourceControlIcon className="size-4" />
199+
<DialogTitle className="flex items-center">
200+
<SourceControlIcon className="me-2 size-4" />
201201
Checkout {terminology.singular}
202202
</DialogTitle>
203203
<DialogDescription>

‎apps/web/src/components/Sidebar.tsx‎

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,9 @@ function SidebarThreadTooltip({
345345
const driverKind = providerEntry?.driverKind ?? null;
346346
const supportsMultiplePullRequests = useSupportsMultiplePullRequests(thread.environmentId);
347347
return (
348-
<TooltipPopup
349-
side="right"
350-
align="start"
351-
sideOffset={4}
352-
variant="glass"
353-
className="[&_[data-slot=tooltip-viewport]]:p-0"
354-
>
355-
<div className="flex min-w-0 max-w-80 flex-col gap-2 p-[var(--floating-content-inset)]">
348+
<TooltipPopup side="right" align="start" sideOffset={4} variant="glass">
349+
{/* The viewport's own inset (py-1 px-2) plus this one make the floating inset. */}
350+
<div className="flex min-w-0 max-w-80 flex-col gap-2 px-1 py-2">
356351
<div className="min-w-0 truncate text-xs leading-tight font-medium text-foreground">
357352
{thread.title}
358353
</div>
@@ -373,9 +368,9 @@ function SidebarThreadTooltip({
373368
</div>
374369
) : null}
375370
{thread.branch ? (
376-
<div className="flex min-w-0 items-center gap-2">
371+
<div className="flex min-w-0 items-center gap-2 text-foreground/75">
377372
<GitBranchIcon className="size-3 shrink-0 stroke-muted-foreground" />
378-
<MiddleTruncate value={thread.branch} className="flex text-foreground/75" />
373+
<MiddleTruncate value={thread.branch} className="flex" />
379374
</div>
380375
) : null}
381376
{branchMismatch ? (
@@ -1920,11 +1915,9 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
19201915
{thread.branch ? (
19211916
<>
19221917
<ThreadWorktreeIndicator thread={thread} />
1923-
<MiddleTruncate
1924-
value={thread.branch}
1925-
showTitle={false}
1926-
className="flex-1 text-muted-foreground/40"
1927-
/>
1918+
<span className="flex min-w-0 flex-1 text-muted-foreground/40">
1919+
<MiddleTruncate value={thread.branch} showTitle={false} />
1920+
</span>
19281921
</>
19291922
) : (
19301923
<span className="flex-1" />
@@ -4544,7 +4537,7 @@ export default function Sidebar() {
45444537
</SidebarGroup>
45454538
}
45464539
>
4547-
<SidebarGroup className="flex-1 ps-[calc(var(--sidebar-content-inset)+1px)]">
4540+
<SidebarGroup className="flex-1">
45484541
{isSearchingThreads ? (
45494542
threadSearchResults.length > 0 ? (
45504543
<TooltipProvider

‎apps/web/src/components/chat/ChangedFilesTree.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,9 @@ export const ChangedFilesTree = memo(function ChangedFilesTree(props: {
247247
theme={resolvedTheme}
248248
className="size-3.5 text-muted-foreground/70"
249249
/>
250-
<MiddleTruncate
251-
value={node.name}
252-
className="font-mono text-xs text-foreground/85 group-hover:text-foreground"
253-
/>
250+
<span className="flex min-w-0 font-mono text-xs text-foreground/85 group-hover:text-foreground">
251+
<MiddleTruncate value={node.name} />
252+
</span>
254253
{node.stat && (
255254
<span className="ml-auto shrink-0 font-mono text-[10px] tabular-nums">
256255
<DiffStatLabel additions={node.stat.additions} deletions={node.stat.deletions} />

‎apps/web/src/components/chat/ComposerBanner.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,17 +279,17 @@ function Children({ className, render, ...props }: useRender.ComponentProps<"div
279279
}
280280

281281
/** Bounded banner content uses the app's scroll area and fades only overflowing edges. */
282-
function Scroll({ className, ...props }: ComponentProps<typeof ScrollArea>) {
282+
function Scroll({ className, children, ...props }: ComponentProps<typeof ScrollArea>) {
283283
return (
284284
<ScrollArea
285285
radius="none"
286286
scrollFade
287-
className={cn(
288-
"h-auto max-h-[min(24rem,40dvh)] [&>[data-slot=scroll-area-viewport][data-has-overflow-y]]:pe-2",
289-
className,
290-
)}
287+
className={cn("h-auto max-h-[min(24rem,40dvh)]", className)}
291288
{...props}
292-
/>
289+
>
290+
{/* Clears the overlay scrollbar only once there is something to scroll. */}
291+
<div className="[[data-has-overflow-y]>&]:pe-2">{children}</div>
292+
</ScrollArea>
293293
);
294294
}
295295

‎apps/web/src/components/chat/ComposerBannerStack.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ function NoticeDescription({ children, compact }: { children: ReactNode; compact
306306
aria-label="Notice details"
307307
tooltipStyle
308308
side="top"
309-
className="max-w-80 whitespace-normal text-pretty wrap-anywhere"
309+
className="max-w-80 whitespace-normal wrap-anywhere"
310310
>
311311
<ComposerBanner.Scroll className="max-h-[min(var(--available-height),24rem,40dvh)]">
312312
{children}

0 commit comments

Comments
 (0)