Skip to content

Commit 0ad0cef

Browse files
authored
Reduce the outdenting of workspaces in the sidebar (#609)
1 parent 0cf1057 commit 0ad0cef

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

src/App.stories.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,12 @@ export const ActiveWorkspaceWithChat: Story = {
418418
],
419419
},
420420
],
421+
[
422+
"/home/user/projects/another-app",
423+
{
424+
workspaces: [],
425+
},
426+
],
421427
]);
422428

423429
const workspaces: FrontendWorkspaceMetadata[] = [

src/components/ProjectSidebar.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { useProjectContext } from "@/contexts/ProjectContext";
2323
import { useSortedWorkspacesByProject } from "@/hooks/useSortedWorkspacesByProject";
2424
import { useApp } from "@/contexts/AppContext";
2525
import { useWorkspaceRecency } from "@/stores/WorkspaceStore";
26+
import { ChevronRight, KeyRound } from "lucide-react";
2627

2728
// Re-export WorkspaceSelection for backwards compatibility
2829
export type { WorkspaceSelection } from "./WorkspaceListItem";
@@ -141,7 +142,6 @@ const ProjectDragLayer: React.FC = () => {
141142
<div className="pointer-events-none fixed inset-0 z-[9999] cursor-grabbing">
142143
<div style={{ transform: `translate(${currentOffset.x + 10}px, ${currentOffset.y + 10}px)` }}>
143144
<div className="bg-hover/95 text-foreground border-l-accent flex w-fit max-w-72 min-w-44 items-center rounded border-l-[3px] px-3 py-1.5 shadow-[0_6px_24px_rgba(0,0,0,0.4)]">
144-
<span className="text-dim mr-1.5 text-xs"></span>
145145
<span className="text-muted mr-2 text-xs"></span>
146146
<div className="min-w-0 flex-1">
147147
<div className="text-muted-dark font-monospace truncate text-sm leading-tight">
@@ -499,20 +499,13 @@ const ProjectSidebarInner: React.FC<ProjectSidebarProps> = ({
499499
aria-label={`${isExpanded ? "Collapse" : "Expand"} project ${projectName}`}
500500
data-project-path={projectPath}
501501
>
502-
<span
503-
data-drag-handle
504-
aria-hidden
505-
className="text-dim mr-1.5 cursor-grab text-xs opacity-0 transition-opacity duration-150 select-none"
506-
>
507-
508-
</span>
509502
<span
510503
data-project-path={projectPath}
511504
aria-hidden="true"
512505
className="text-muted mr-2 shrink-0 text-xs transition-transform duration-200"
513506
style={{ transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)" }}
514507
>
515-
508+
<ChevronRight size={12} />
516509
</span>
517510
<div className="flex min-w-0 flex-1 items-center pr-2">
518511
<TooltipWrapper inline>
@@ -544,9 +537,9 @@ const ProjectSidebarInner: React.FC<ProjectSidebarProps> = ({
544537
}}
545538
aria-label={`Manage secrets for ${projectName}`}
546539
data-project-path={projectPath}
547-
className="text-muted-dark hover:text-accent hover:bg-accent/10 mr-1 flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded-[3px] border-none bg-transparent text-sm opacity-0 transition-all duration-200"
540+
className="text-muted-dark mr-1 flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded-[3px] border-none bg-transparent text-sm opacity-0 transition-all duration-200 hover:bg-yellow-500/10 hover:text-yellow-500"
548541
>
549-
🔑
542+
<KeyRound size={12} />
550543
</button>
551544
<Tooltip className="tooltip" align="right">
552545
Manage secrets
@@ -577,7 +570,7 @@ const ProjectSidebarInner: React.FC<ProjectSidebarProps> = ({
577570
role="region"
578571
aria-label={`Workspaces for ${projectName}`}
579572
>
580-
<div className="border-hover border-b px-3 py-2 pl-[22px]">
573+
<div className="border-hover border-b px-3 py-2">
581574
<button
582575
onClick={() => handleAddWorkspace(projectPath)}
583576
data-project-path={projectPath}
@@ -641,7 +634,7 @@ const ProjectSidebarInner: React.FC<ProjectSidebarProps> = ({
641634
: "rotate(0deg)",
642635
}}
643636
>
644-
637+
<ChevronRight size={12} />
645638
</span>
646639
</button>
647640
{showOldWorkspaces && old.map(renderWorkspace)}

src/components/WorkspaceListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
103103
<React.Fragment>
104104
<div
105105
className={cn(
106-
"py-1.5 pl-8 pr-2 cursor-pointer border-l-[3px] border-transparent transition-all duration-150 text-[13px] relative hover:bg-hover [&:hover_button]:opacity-100 flex gap-2",
106+
"py-1.5 pl-4 pr-2 cursor-pointer border-l-[3px] border-transparent transition-all duration-150 text-[13px] relative hover:bg-hover [&:hover_button]:opacity-100 flex gap-2",
107107
isSelected && "bg-hover border-l-blue-400"
108108
)}
109109
onClick={() =>

0 commit comments

Comments
 (0)