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
77 changes: 39 additions & 38 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
PlusIcon,
RocketIcon,
SettingsIcon,
SquarePenIcon,
TerminalIcon,
TriangleAlertIcon,
} from "lucide-react";
Expand Down Expand Up @@ -81,7 +80,6 @@ import {
SidebarFooter,
SidebarGroup,
SidebarHeader,
SidebarMenuAction,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
Expand Down Expand Up @@ -1302,7 +1300,7 @@ export default function Sidebar() {
el.select();
}
}}
className="min-w-0 flex-1 truncate text-xs bg-transparent outline-none border border-ring rounded px-0.5"
className="min-w-0 flex-1 truncate text-xs bg-accent/30 outline-none rounded px-1 py-px ring-1 ring-ring/40 transition-[box-shadow] duration-150 focus:ring-ring/70"
value={renamingTitle}
onChange={(e) => setRenamingTitle(e.target.value)}
onKeyDown={(e) => {
Expand Down Expand Up @@ -1405,37 +1403,6 @@ export default function Sidebar() {
{project.name}
</span>
</SidebarMenuButton>
<Tooltip>
<TooltipTrigger
render={
<SidebarMenuAction
render={
<button
type="button"
aria-label={`Create new thread in ${project.name}`}
data-testid="new-thread-button"
/>
}
showOnHover
className="top-1 right-1 size-5 rounded-md p-0 text-muted-foreground/70 hover:bg-secondary hover:text-foreground"
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
void handleNewThread(project.id, {
envMode: resolveSidebarNewThreadEnvMode({
defaultEnvMode: appSettings.defaultThreadEnvMode,
}),
});
}}
>
<SquarePenIcon className="size-3.5" />
</SidebarMenuAction>
}
/>
<TooltipPopup side="top">
{newThreadShortcutLabel ? `New thread (${newThreadShortcutLabel})` : "New thread"}
</TooltipPopup>
</Tooltip>
</div>

<CollapsibleContent>
Expand Down Expand Up @@ -1475,6 +1442,40 @@ export default function Sidebar() {
</SidebarMenuSubButton>
</SidebarMenuSubItem>
)}

{project.expanded && (
<SidebarMenuSubItem className="w-full">
<SidebarMenuSubButton
render={
<button
type="button"
aria-label={`Create new thread in ${project.name}`}
data-testid="new-thread-button"
title={
newThreadShortcutLabel
? `New thread (${newThreadShortcutLabel})`
: "New thread"
}
/>
}
data-thread-selection-safe
size="sm"
className="h-6 w-full translate-x-0 justify-start gap-1.5 px-2 text-left text-[11px] text-muted-foreground/35 transition-colors duration-150 hover:bg-accent/50 hover:text-muted-foreground/65"
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
void handleNewThread(project.id, {
envMode: resolveSidebarNewThreadEnvMode({
defaultEnvMode: appSettings.defaultThreadEnvMode,
}),
});
}}
>
<PlusIcon className="size-3 shrink-0" />
<span>New thread</span>
</SidebarMenuSubButton>
</SidebarMenuSubItem>
)}
</SidebarMenuSub>

{project.expanded && activeProjectThread ? (
Expand Down Expand Up @@ -1902,7 +1903,7 @@ export default function Sidebar() {
<div className="mb-2 px-1">
<button
type="button"
className="mb-1.5 flex w-full items-center justify-center gap-2 rounded-md border border-border bg-secondary py-1.5 text-xs text-foreground/80 transition-colors duration-150 hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-60"
className="mb-1.5 flex w-full items-center justify-center gap-2 rounded-md border border-border bg-secondary py-1.5 text-xs text-foreground/80 transition-[background-color,border-color,color] duration-150 ease-out hover:border-border/80 hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-60"
onClick={() => void handlePickFolder()}
disabled={isPickingFolder || isAddingProject}
>
Expand All @@ -1924,10 +1925,10 @@ export default function Sidebar() {
<div className="flex gap-1.5">
<input
ref={addProjectInputRef}
className={`min-w-0 flex-1 rounded-md border bg-secondary px-2 py-1 font-mono text-xs text-foreground placeholder:text-muted-foreground/40 focus:outline-none ${
className={`min-w-0 flex-1 rounded-md border bg-secondary px-2 py-1 font-mono text-xs text-foreground placeholder:text-muted-foreground/40 outline-none transition-[border-color,box-shadow] duration-150 ease-out ${
addProjectError
? "border-red-500/70 focus:border-red-500"
: "border-border focus:border-ring"
? "border-red-500/70 focus:border-red-500 focus:ring-1 focus:ring-red-500/20"
: "border-border focus:border-ring focus:ring-1 focus:ring-ring/20"
} ${!manualProjectPathEntry ? "cursor-pointer" : ""}`}
readOnly={!manualProjectPathEntry}
placeholder={
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/ui/collapsible.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function CollapsiblePanel({ className, ...props }: CollapsiblePrimitive.Panel.Pr
return (
<CollapsiblePrimitive.Panel
className={cn(
"h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 data-ending-style:h-0 data-starting-style:h-0 data-open:data-ending-style:[height:var(--collapsible-panel-height)]",
"h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 ease-out data-ending-style:h-0 data-starting-style:h-0 data-open:data-ending-style:[height:var(--collapsible-panel-height)]",
className,
)}
data-slot="collapsible-panel"
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function Input({
className={
cn(
!unstyled &&
"relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] sm:text-sm dark:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]",
"relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-[box-shadow,border-color] duration-150 ease-out before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] sm:text-sm dark:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]",
className,
) || undefined
}
Expand Down
Loading