Skip to content

Commit 82aa75b

Browse files
authored
🤖 fix: increase workspace list item dot padding to pl-8 (#598)
After the workspace sidebar redesign (#590), workspace names are no longer truncating properly due to insufficient left padding on the status dot container. **Changes:** - Increased left padding on status dot container from no explicit padding to `pl-8` (2rem) - Updated error message positioning from `left-7` to `left-8` to maintain alignment This restores proper text truncation for long workspace names in the sidebar. _Generated with `mux`_
1 parent 3643542 commit 82aa75b

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

src/App.stories.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import type { IPCApi } from "./types/ipc";
77
import type { ChatStats } from "./types/chatStats";
88
import { DEFAULT_RUNTIME_CONFIG } from "@/constants/workspace";
99

10-
// Recent timestamp for testing active states (use current time minus small offsets)
11-
// This ensures workspaces don't show as "Older than 1 day"
12-
const NOW = Date.now();
10+
// Stable timestamp for testing active states (use fixed time minus small offsets)
11+
// This ensures workspaces don't show as "Older than 1 day" and keeps stories deterministic
12+
const NOW = 1700000000000; // Fixed timestamp: Nov 14, 2023
1313
const STABLE_TIMESTAMP = NOW - 60000; // 1 minute ago
1414

1515
// Mock window.api for App component
@@ -830,7 +830,7 @@ export const ActiveWorkspaceWithChat: Story = {
830830
} else if (wsId === streamingWorkspaceId) {
831831
// Streaming workspace - show active work in progress
832832
setTimeout(() => {
833-
const now = Date.now();
833+
const now = NOW; // Use stable timestamp
834834

835835
// Previous completed message with status_set (MUST be sent BEFORE caught-up)
836836
callback({
@@ -932,7 +932,7 @@ export const ActiveWorkspaceWithChat: Story = {
932932
messageId: "stream-msg-2",
933933
delta: ".",
934934
tokens: 1,
935-
timestamp: Date.now(),
935+
timestamp: NOW,
936936
});
937937
}, 2000);
938938

src/components/WorkspaceListItem.tsx

Lines changed: 9 additions & 7 deletions
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 px-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-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",
107107
isSelected && "bg-hover border-l-blue-400"
108108
)}
109109
onClick={() =>
@@ -139,12 +139,12 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
139139
onClick={handleToggleUnread}
140140
/>
141141
</div>
142-
<div className="flex flex-1 flex-col gap-1">
142+
<div className="flex min-w-0 flex-1 flex-col gap-1">
143143
<div className="flex min-w-0 items-center gap-1.5">
144144
<RuntimeBadge runtimeConfig={metadata.runtimeConfig} />
145145
{isEditing ? (
146146
<input
147-
className="bg-input-bg text-input-text border-input-border font-inherit focus:border-input-border-focus -mx-1 min-w-0 rounded-sm border px-1 text-left text-[13px] outline-none"
147+
className="bg-input-bg text-input-text border-input-border font-inherit focus:border-input-border-focus -mx-1 min-w-0 flex-1 rounded-sm border px-1 text-left text-[13px] outline-none"
148148
value={editingName}
149149
onChange={(e) => setEditingName(e.target.value)}
150150
onKeyDown={handleRenameKeyDown}
@@ -156,15 +156,17 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
156156
/>
157157
) : (
158158
<span
159-
className="text-foreground -mx-1 min-w-0 cursor-pointer truncate rounded-sm px-1 text-left text-[14px] transition-colors duration-200 hover:bg-white/5"
159+
className="text-foreground -mx-1 min-w-0 flex-1 cursor-pointer rounded-sm px-1 text-left text-[14px] transition-colors duration-200 hover:bg-white/5"
160160
onDoubleClick={(e) => {
161161
e.stopPropagation();
162162
startRenaming();
163163
}}
164164
title="Double-click to rename"
165165
>
166166
{canInterrupt ? (
167-
<Shimmer colorClass="var(--color-foreground)">{displayName}</Shimmer>
167+
<Shimmer className="h-4 w-full truncate" colorClass="var(--color-foreground)">
168+
{displayName}
169+
</Shimmer>
168170
) : (
169171
displayName
170172
)}
@@ -196,13 +198,13 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
196198
</TooltipWrapper>
197199
</div>
198200
</div>
199-
<div>
201+
<div className="min-w-0">
200202
<WorkspaceStatusIndicator workspaceId={workspaceId} />
201203
</div>
202204
</div>
203205
</div>
204206
{renameError && isEditing && (
205-
<div className="bg-error-bg border-error text-error absolute top-full right-8 left-7 z-10 mt-1 rounded-sm border px-2 py-1.5 text-xs">
207+
<div className="bg-error-bg border-error text-error absolute top-full right-8 left-8 z-10 mt-1 rounded-sm border px-2 py-1.5 text-xs">
206208
{renameError}
207209
</div>
208210
)}

src/components/WorkspaceStatusIndicator.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ export const WorkspaceStatusIndicator = memo<{ workspaceId: string }>(({ workspa
1212
}
1313

1414
return (
15-
<div className="text-muted flex items-center gap-1.5 text-xs">
15+
<div className="text-muted flex min-w-0 items-center gap-1.5 text-xs">
1616
{agentStatus.emoji && (
1717
// Emojis do not visually center well, so we offset them
1818
// slightly with negative margin.
19-
<span className="-mt-0.5 text-[10px]">{agentStatus.emoji}</span>
19+
<span className="-mt-0.5 shrink-0 text-[10px]">{agentStatus.emoji}</span>
2020
)}
21-
{agentStatus.message}
21+
<span className="min-w-0 truncate">{agentStatus.message}</span>
2222
{agentStatus.url && (
2323
<TooltipWrapper inline>
2424
<Button
2525
variant="ghost"
2626
size="icon"
27-
className="flex h-4 w-4 items-center justify-center [&_svg]:size-3"
27+
className="flex h-4 w-4 shrink-0 items-center justify-center [&_svg]:size-3"
2828
>
2929
<a href={agentStatus.url} target="_blank" rel="noopener noreferrer">
3030
<ExternalLinkIcon />

0 commit comments

Comments
 (0)