Skip to content

Commit 9c2808a

Browse files
committed
🤖 fix: restore pre-redesign sidebar hierarchy
Restore the flatter sidebar hierarchy so project rows, section headers, and "Older than …" buckets read as distinct layers again. --- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `n/a`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=n/a -->
1 parent 3102607 commit 9c2808a

6 files changed

Lines changed: 111 additions & 179 deletions

File tree

‎src/browser/components/AddSectionButton/AddSectionButton.tsx‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export const AddSectionButton: React.FC<AddSectionButtonProps> = ({ onCreateSect
2828

2929
if (isCreating) {
3030
return (
31-
<div className="flex items-center px-2 py-0.5">
31+
<div className="flex items-center gap-1 px-2 py-0.5">
32+
<div className="flex h-5 w-5 shrink-0 items-center justify-center">
33+
<Plus size={12} className="text-muted/60" />
34+
</div>
3235
<input
3336
ref={inputRef}
3437
type="text"
@@ -44,7 +47,7 @@ export const AddSectionButton: React.FC<AddSectionButtonProps> = ({ onCreateSect
4447
}}
4548
placeholder="Section name..."
4649
data-testid="add-section-input"
47-
className="bg-background/50 text-foreground ml-6 min-w-0 flex-1 rounded border border-white/20 px-1.5 py-0.5 text-[11px] outline-none select-text"
50+
className="bg-background/50 text-foreground min-w-0 flex-1 rounded border border-white/20 px-1.5 py-0.5 text-[11px] outline-none select-text"
4851
/>
4952
</div>
5053
);
@@ -54,9 +57,13 @@ export const AddSectionButton: React.FC<AddSectionButtonProps> = ({ onCreateSect
5457
<button
5558
onClick={() => setIsCreating(true)}
5659
data-testid="add-section-button"
57-
className="text-muted/60 hover:text-muted flex w-full cursor-pointer items-center justify-center gap-1 border-none bg-transparent px-2 py-0.5 text-[11px] transition-colors"
60+
// Keep the affordance in the same icon/text columns as section rows so the
61+
// add-sub-folder action reads as part of the project hierarchy.
62+
className="text-muted/60 hover:text-muted flex w-full cursor-pointer items-center gap-1 border-none bg-transparent px-2 py-0.5 text-left text-[11px] transition-colors"
5863
>
59-
<Plus size={12} />
64+
<div className="flex h-5 w-5 shrink-0 items-center justify-center">
65+
<Plus size={12} />
66+
</div>
6067
<span>Add section</span>
6168
</button>
6269
);

‎src/browser/components/AgentListItem/AgentListItem.tsx‎

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ export interface AgentListItemProps extends AgentListItemBaseProps {
8686
variant?: "workspace";
8787
metadata: FrontendWorkspaceMetadata;
8888
projectName: string;
89-
subAgentConnectorLayout?: "default" | "task-group-member";
9089
isArchiving?: boolean;
9190
/** True when deletion is in-flight (optimistic UI while backend removes). */
9291
isRemoving?: boolean;
@@ -128,19 +127,7 @@ const SHOW_INLINE_ACTIONS_ON_WIDE_TOUCH =
128127
/** Calculate left padding based on nesting depth */
129128
function getItemPaddingLeft(depth?: number): number {
130129
const safeDepth = typeof depth === "number" && Number.isFinite(depth) ? Math.max(0, depth) : 0;
131-
return 8 + Math.min(32, safeDepth) * 12;
132-
}
133-
134-
function getSubAgentConnectorLeft(
135-
indentLeft: number,
136-
layout: "default" | "task-group-member"
137-
): number {
138-
return layout === "task-group-member" ? indentLeft - 2 : indentLeft + 9;
139-
}
140-
141-
function getAncestorTrunkLeft(depth: number, layout: "default" | "task-group-member"): number {
142-
const indentLeft = getItemPaddingLeft(depth);
143-
return layout === "task-group-member" ? indentLeft + 6 : indentLeft + 8;
130+
return 12 + Math.min(32, safeDepth) * 12;
144131
}
145132

146133
type VisualState = "active" | "idle" | "seen" | "hidden" | "error" | "question";
@@ -294,31 +281,20 @@ function ActionButtonWrapper(props: { children: React.ReactNode; className?: str
294281
// ─────────────────────────────────────────────────────────────────────────────
295282

296283
function DraftAgentListItemInner(props: DraftAgentListItemProps) {
297-
const { projectPath, isSelected, depth, sectionId, draft } = props;
284+
const { projectPath, isSelected, depth, draft } = props;
298285
const paddingLeft = getItemPaddingLeft(depth);
299286
const hasPromptPreview = draft.promptPreview.length > 0;
300-
const draftBorderStyle: React.CSSProperties = {
301-
backgroundImage: [
302-
"repeating-linear-gradient(to right, var(--color-border) 0 5px, transparent 5px 10px)",
303-
"repeating-linear-gradient(to right, var(--color-border) 0 5px, transparent 5px 10px)",
304-
"repeating-linear-gradient(to bottom, var(--color-border) 0 5px, transparent 5px 10px)",
305-
].join(", "),
306-
backgroundSize: "100% 1.5px, 100% 1.5px, 1.5px 100%",
307-
backgroundPosition: "left top, left bottom, left top",
308-
backgroundRepeat: "no-repeat",
309-
};
310287

311288
const ctxMenu = useContextMenuPosition({ longPress: true });
312289

313290
return (
314291
<div
315292
className={cn(
316293
LIST_ITEM_BASE_CLASSES,
317-
sectionId != null ? "ml-8" : "ml-6.5",
318-
"cursor-pointer pl-1 hover:bg-surface-secondary [&:hover_button]:opacity-100",
294+
"border-border cursor-pointer border-t border-b border-l border-dashed pl-1 hover:bg-surface-secondary [&:hover_button]:opacity-100",
319295
isSelected && "bg-surface-secondary"
320296
)}
321-
style={{ paddingLeft, ...draftBorderStyle }}
297+
style={{ paddingLeft }}
322298
onClick={() => {
323299
if (ctxMenu.suppressClickIfLongPress()) return;
324300
draft.onOpen();
@@ -687,7 +663,6 @@ function RegularAgentListItemInner(props: AgentListItemProps) {
687663
className={cn(
688664
LIST_ITEM_BASE_CLASSES,
689665
"group/row",
690-
sectionId != null ? "ml-7.5" : "ml-5",
691666
isDragging && "opacity-50",
692667
isRemoving && "opacity-70",
693668
// Keep hover styles enabled for initializing workspaces so the row feels interactive.
@@ -1104,15 +1079,9 @@ function AgentListItemInner(props: UnifiedAgentListItemProps) {
11041079
// Connector geometry is driven by render metadata so visible siblings keep
11051080
// consistent single/middle/last shapes as parents expand/collapse children.
11061081
const isElbowActive = props.metadata.taskStatus === "running";
1107-
// Task-group members use a slightly different left rail so their connector
1108-
// trunk aligns with the group's leading chevron column.
1109-
const connectorLayout = props.subAgentConnectorLayout ?? "default";
1110-
const connectorLeft = getSubAgentConnectorLeft(
1111-
getItemPaddingLeft(props.depth),
1112-
connectorLayout
1113-
);
1082+
const indentLeft = getItemPaddingLeft(props.depth);
11141083
const ancestorTrunks = rowMeta.ancestorTrunks.map((trunk) => ({
1115-
left: getAncestorTrunkLeft(trunk.depth, connectorLayout),
1084+
left: getItemPaddingLeft(trunk.depth) - 4,
11161085
active: trunk.active,
11171086
}));
11181087

@@ -1123,7 +1092,7 @@ function AgentListItemInner(props: UnifiedAgentListItemProps) {
11231092
sharedTrunkActiveThroughRow={rowMeta.sharedTrunkActiveThroughRow}
11241093
sharedTrunkActiveBelowRow={rowMeta.sharedTrunkActiveBelowRow}
11251094
ancestorTrunks={ancestorTrunks}
1126-
connectorLeft={connectorLeft}
1095+
indentLeft={indentLeft}
11271096
isSelected={props.isSelected}
11281097
isElbowActive={isElbowActive}
11291098
>

‎src/browser/components/AgentListItem/SubAgentListItem.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ interface SubAgentListItemProps {
77
sharedTrunkActiveThroughRow: boolean;
88
sharedTrunkActiveBelowRow: boolean;
99
ancestorTrunks: ReadonlyArray<{ left: number; active: boolean }>;
10-
connectorLeft: number;
10+
indentLeft: number;
1111
isSelected: boolean;
1212
isElbowActive: boolean;
1313
children: React.ReactNode;
1414
}
1515

1616
export function SubAgentListItem(props: SubAgentListItemProps) {
17-
// The parent passes the absolute row-space x position for this connector trunk.
18-
const connectorLeft = props.connectorLeft;
17+
const connectorLeft = props.indentLeft - 10;
1918
const connectorFillClass = props.isSelected ? "bg-border" : "bg-border-light";
2019
const connectorBorderClass = props.isSelected ? "border-border" : "border-border-light";
2120
const connectorColor = props.isSelected ? "var(--color-border)" : "var(--color-border-light)";

0 commit comments

Comments
 (0)