Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/web/src/components/AppSidebarLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,12 @@ function SidebarControl() {
<TooltipTrigger
render={
<SidebarTrigger
// Over the stage artwork the trigger is a control on imagery, like the media
// viewer's arrows; that variant positions itself, so the layout is reset here.
variant={isSidebarVisible && stageBackdropVariant ? "media-navigation" : "ghost"}
className={cn(
"pointer-events-auto",
isSidebarVisible &&
stageBackdropVariant &&
"focus-visible:ring-white/90 [&_svg]:stroke-white/90! [&_svg]:opacity-100! [&_svg]:hover:stroke-white! [:hover,[data-pressed]]:bg-white/15",
isSidebarVisible && stageBackdropVariant && "relative top-auto translate-y-0",
isSidebarVisible &&
stageBackdropVariant &&
resolveSidebarStageFocusRingOffsetClass(stageBackdropVariant),
Expand Down Expand Up @@ -244,7 +245,6 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
side="left"
collapsible="offcanvas"
data-app-sidebar=""
className="border-r border-sidebar-border"
resizable={{
maxWidth: sidebarMaximumWidth,
minWidth: THREAD_SIDEBAR_MIN_WIDTH,
Expand Down
7 changes: 4 additions & 3 deletions apps/web/src/components/BranchToolbarBranchSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -817,11 +817,12 @@ export function BranchToolbarBranchSelector({
data-composer-label
className="min-w-0 max-w-[240px] group-data-[compact]/composer-context:max-w-0"
>
<MiddleTruncate
value={triggerLabel}
<span
data-composer-label-motion
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"
/>
>
<MiddleTruncate value={triggerLabel} />
</span>
</span>
<ChevronDownIcon className="size-3 shrink-0 opacity-50" />
</ComboboxTrigger>
Expand Down
12 changes: 3 additions & 9 deletions apps/web/src/components/CustomSnoozeDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function CustomSnoozeDialog() {
<DialogTitle>Custom snooze</DialogTitle>
<DialogDescription>Choose when snoozed threads return to your inbox.</DialogDescription>
</DialogHeader>
<DialogPanel className="text-base sm:text-sm">
<DialogPanel>
<div className="flex flex-col gap-4">
<ToggleGroup
aria-label="Schedule type"
Expand Down Expand Up @@ -147,10 +147,7 @@ function CustomSnoozeDialog() {
</PopoverPopup>
</Popover>
</div>
<Label
className="flex min-w-0 flex-col items-stretch gap-1.5"
htmlFor={`${id}-time`}
>
<Label className="flex min-w-0 flex-col items-stretch" htmlFor={`${id}-time`}>
Time
<Input
nativeInput
Expand Down Expand Up @@ -185,10 +182,7 @@ function CustomSnoozeDialog() {
<NumberFieldIncrement aria-label="Increase duration" />
</NumberFieldGroup>
</NumberField>
<Label
className="flex min-w-0 flex-col items-stretch gap-1.5"
htmlFor={`${id}-unit`}
>
<Label className="flex min-w-0 flex-col items-stretch" htmlFor={`${id}-unit`}>
Unit
<Select
value={unit}
Expand Down
112 changes: 59 additions & 53 deletions apps/web/src/components/GitActionsControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ function PublishRepositoryDialog(props: PublishRepositoryDialogProps) {
setPublishRepositoryOverride(null);
}}
aria-labelledby="publish-provider-cards-label"
className="grid grid-cols-2 gap-2.5"
className="grid grid-cols-2"
>
{sortedPublishProviderOptions.map((option) => {
const readiness = publishProviderReadiness[option.value];
Expand Down Expand Up @@ -737,7 +737,7 @@ function PublishRepositoryDialog(props: PublishRepositoryDialogProps) {
}
aria-labelledby="publish-visibility-cards-label"
disabled={publishRepositoryAction.isPending}
className="grid grid-cols-2 gap-2.5"
className="grid grid-cols-2"
>
{[
{
Expand Down Expand Up @@ -1915,57 +1915,63 @@ export default function GitActionsControl({
<p className="font-medium">none</p>
) : (
<div className="space-y-2">
<ScrollArea className="h-44 rounded-lg bg-card ring-1 ring-black/5 dark:bg-white/[0.025] dark:ring-white/5">
<div className="space-y-1 p-1">
{allFiles.map((file) => {
const isExcluded = excludedFiles.has(file.path);
return (
<div
key={file.path}
className="flex w-full items-center gap-2 rounded-md px-2 py-1 font-mono hover:bg-accent/50"
>
{isEditingFiles && (
<Checkbox
checked={!excludedFiles.has(file.path)}
onCheckedChange={() => {
setExcludedFiles((prev) => {
const next = new Set(prev);
if (next.has(file.path)) {
next.delete(file.path);
} else {
next.add(file.path);
}
return next;
});
}}
/>
)}
<button
type="button"
className="flex min-w-0 flex-1 items-center justify-between gap-3 text-left"
onClick={() => openChangedFileInEditor(file.path)}
<div className="h-44 rounded-lg bg-card ring-1 ring-black/5 dark:bg-white/[0.025] dark:ring-white/5">
<ScrollArea>
<div className="space-y-1 p-1">
{allFiles.map((file) => {
const isExcluded = excludedFiles.has(file.path);
return (
<div
key={file.path}
className="flex w-full items-center gap-2 rounded-md px-2 py-1 font-mono hover:bg-accent/50"
>
<StartTruncatedPath
path={file.path}
className={`flex-1${isExcluded ? " text-muted-foreground" : ""}`}
/>
<span className="shrink-0">
{isExcluded ? (
<span className="text-muted-foreground">Excluded</span>
) : (
<>
<span className="text-diff-addition">+{file.insertions}</span>
<span className="text-muted-foreground"> / </span>
<span className="text-diff-deletion">-{file.deletions}</span>
</>
)}
</span>
</button>
</div>
);
})}
</div>
</ScrollArea>
{isEditingFiles && (
<Checkbox
checked={!excludedFiles.has(file.path)}
onCheckedChange={() => {
setExcludedFiles((prev) => {
const next = new Set(prev);
if (next.has(file.path)) {
next.delete(file.path);
} else {
next.add(file.path);
}
return next;
});
}}
/>
)}
<button
type="button"
className="flex min-w-0 flex-1 items-center justify-between gap-3 text-left"
onClick={() => openChangedFileInEditor(file.path)}
>
<StartTruncatedPath
path={file.path}
className={`flex-1${isExcluded ? " text-muted-foreground" : ""}`}
/>
<span className="shrink-0">
{isExcluded ? (
<span className="text-muted-foreground">Excluded</span>
) : (
<>
<span className="text-diff-addition">
+{file.insertions}
</span>
<span className="text-muted-foreground"> / </span>
<span className="text-diff-deletion">
-{file.deletions}
</span>
</>
)}
</span>
</button>
</div>
);
})}
</div>
</ScrollArea>
</div>
<div className="flex justify-end font-mono">
<span className="text-diff-addition">
+{selectedFiles.reduce((sum, f) => sum + f.insertions, 0)}
Expand Down Expand Up @@ -2040,7 +2046,7 @@ export default function GitActionsControl({
</DialogTitle>
<DialogDescription>{pendingDefaultBranchActionCopy?.description}</DialogDescription>
</DialogHeader>
<DialogFooter className="dark:border-transparent dark:bg-transparent sm:flex-wrap sm:items-center">
<DialogFooter variant="bare" className="sm:flex-wrap sm:items-center">
<Button
className="w-full sm:mr-auto sm:w-auto"
variant="outline"
Expand Down
18 changes: 7 additions & 11 deletions apps/web/src/components/LegacySidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ const SidebarProjectThreadList = memo(function SidebarProjectThreadList(
return (
<SidebarMenuSub
ref={attachThreadListAutoAnimateRef}
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"
className="mx-0.5 my-0 w-full translate-x-0 overflow-hidden sm:mx-1"
>
{shouldShowThreadPanel && showEmptyThreadState ? (
<SidebarMenuSubItem className="w-full" data-thread-selection-safe>
Expand Down Expand Up @@ -2357,9 +2357,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
<div className="group/project-header relative">
<SidebarMenuButton
ref={isManualProjectSorting ? dragHandleProps?.setActivatorNodeRef : undefined}
className={`pr-8 group-hover/project-header:bg-sidebar-row-hover group-hover/project-header:text-sidebar-foreground max-sm:pr-14 ${
isManualProjectSorting ? "cursor-grab active:cursor-grabbing" : ""
}`}
className={isManualProjectSorting ? "cursor-grab active:cursor-grabbing" : undefined}
{...(isManualProjectSorting && dragHandleProps ? dragHandleProps.attributes : {})}
{...(isManualProjectSorting && dragHandleProps ? dragHandleProps.listeners : {})}
onPointerDownCapture={handleProjectButtonPointerDownCapture}
Expand Down Expand Up @@ -2408,6 +2406,9 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
</span>
) : null}
</span>
{/* Keeps the name clear of the environment badge and new-thread button overlaid on
the row's end (two slots on touch, where both stay visible). */}
<span aria-hidden className="w-4 shrink-0 max-sm:w-10" />
</SidebarMenuButton>
{/* Environment badge – visible by default, crossfades with the
"new thread" button on hover using the same pointer-events +
Expand Down Expand Up @@ -2618,7 +2619,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec

const SidebarProjectListRow = memo(function SidebarProjectListRow(props: SidebarProjectItemProps) {
return (
<SidebarMenuItem className="rounded-md">
<SidebarMenuItem>
<SidebarProjectItem {...props} />
</SidebarMenuItem>
);
Expand Down Expand Up @@ -2963,12 +2964,7 @@ const SidebarProjectsContent = memo(function SidebarProjectsContent(
<SidebarMenu>
<SidebarMenuItem>
<CommandDialogTrigger
render={
<SidebarMenuButton
className="focus-visible:ring-0"
data-testid="command-palette-trigger"
/>
}
render={<SidebarMenuButton data-testid="command-palette-trigger" />}
>
<SearchIcon />
<span className="flex-1 truncate">Search</span>
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/PullRequestThreadDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ export function PullRequestThreadDialog({
>
<DialogPopup className="max-w-xl">
<DialogHeader>
<DialogTitle className="flex items-center gap-2">
<SourceControlIcon className="size-4" />
<DialogTitle className="flex items-center">
<SourceControlIcon className="me-2 size-4" />
Checkout {terminology.singular}
</DialogTitle>
<DialogDescription>
Expand Down
25 changes: 9 additions & 16 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,9 @@ function SidebarThreadTooltip({
const driverKind = providerEntry?.driverKind ?? null;
const supportsMultiplePullRequests = useSupportsMultiplePullRequests(thread.environmentId);
return (
<TooltipPopup
side="right"
align="start"
sideOffset={4}
variant="glass"
className="[&_[data-slot=tooltip-viewport]]:p-0"
>
<div className="flex min-w-0 max-w-80 flex-col gap-2 p-[var(--floating-content-inset)]">
<TooltipPopup side="right" align="start" sideOffset={4} variant="glass">
{/* The viewport's own inset (py-1 px-2) plus this one make the floating inset. */}
<div className="flex min-w-0 max-w-80 flex-col gap-2 px-1 py-2">
<div className="min-w-0 truncate text-xs leading-tight font-medium text-foreground">
{thread.title}
</div>
Expand All @@ -373,9 +368,9 @@ function SidebarThreadTooltip({
</div>
) : null}
{thread.branch ? (
<div className="flex min-w-0 items-center gap-2">
<div className="flex min-w-0 items-center gap-2 text-foreground/75">
<GitBranchIcon className="size-3 shrink-0 stroke-muted-foreground" />
<MiddleTruncate value={thread.branch} className="flex text-foreground/75" />
<MiddleTruncate value={thread.branch} className="flex" />
</div>
) : null}
{branchMismatch ? (
Expand Down Expand Up @@ -1920,11 +1915,9 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
{thread.branch ? (
<>
<ThreadWorktreeIndicator thread={thread} />
<MiddleTruncate
value={thread.branch}
showTitle={false}
className="flex-1 text-muted-foreground/40"
/>
<span className="flex min-w-0 flex-1 text-muted-foreground/40">
<MiddleTruncate value={thread.branch} showTitle={false} />
</span>
</>
) : (
<span className="flex-1" />
Expand Down Expand Up @@ -4544,7 +4537,7 @@ export default function Sidebar() {
</SidebarGroup>
}
>
<SidebarGroup className="flex-1 ps-[calc(var(--sidebar-content-inset)+1px)]">
<SidebarGroup className="flex-1">
{isSearchingThreads ? (
threadSearchResults.length > 0 ? (
<TooltipProvider
Expand Down
7 changes: 3 additions & 4 deletions apps/web/src/components/chat/ChangedFilesTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,9 @@ export const ChangedFilesTree = memo(function ChangedFilesTree(props: {
theme={resolvedTheme}
className="size-3.5 text-muted-foreground/70"
/>
<MiddleTruncate
value={node.name}
className="font-mono text-xs text-foreground/85 group-hover:text-foreground"
/>
<span className="flex min-w-0 font-mono text-xs text-foreground/85 group-hover:text-foreground">
<MiddleTruncate value={node.name} />
</span>
{node.stat && (
<span className="ml-auto shrink-0 font-mono text-[10px] tabular-nums">
<DiffStatLabel additions={node.stat.additions} deletions={node.stat.deletions} />
Expand Down
12 changes: 6 additions & 6 deletions apps/web/src/components/chat/ComposerBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,17 @@ function Children({ className, render, ...props }: useRender.ComponentProps<"div
}

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

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/chat/ComposerBannerStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function NoticeDescription({ children, compact }: { children: ReactNode; compact
aria-label="Notice details"
tooltipStyle
side="top"
className="max-w-80 whitespace-normal text-pretty wrap-anywhere"
className="max-w-80 whitespace-normal wrap-anywhere"
>
<ComposerBanner.Scroll className="max-h-[min(var(--available-height),24rem,40dvh)]">
{children}
Expand Down
8 changes: 1 addition & 7 deletions apps/web/src/components/chat/MessagesTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2562,13 +2562,7 @@ function BackgroundWorktreeSetupChip({ snapshot }: { snapshot: WorktreeSetupSnap
<Spinner size="xs" className="shrink-0" />
<span className="truncate">{scriptName}</span>
</PopoverTrigger>
<PopoverPopup
side="bottom"
align="end"
width="lg"
className="surface-glass!"
padding="compact"
>
<PopoverPopup side="bottom" align="end" width="lg" padding="compact">
<WorktreeSetupCard
snapshot={snapshot}
embedded
Expand Down
Loading
Loading