Skip to content

Commit af4e1d9

Browse files
committed
fix: sidebar nav layout — proper vertical stack, cleaner styling
- Fixed expanded nav: flex-col gap-0.5 (was space-y causing layout issues) - Added position:relative for active indicator pseudo-element - Cleaner button styles: border:none, background:transparent, text-align:left - Reduced font to 13px/500 weight for tighter fit - Mapped view items declaratively for consistency - Restored Prompts view in both collapsed and expanded states
1 parent 69e38fb commit af4e1d9

2 files changed

Lines changed: 32 additions & 52 deletions

File tree

app/globals.css

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3470,16 +3470,21 @@ p {
34703470

34713471
/* Expanded sidebar view navigation */
34723472
.sidebar-view-nav {
3473+
position: relative;
34733474
display: flex;
34743475
align-items: center;
3475-
gap: 12px;
3476+
gap: 10px;
34763477
width: 100%;
3477-
padding: 8px 12px;
3478+
padding: 7px 10px;
34783479
border-radius: 8px;
3479-
font-size: 14px;
3480+
border: none;
3481+
background: transparent;
3482+
font-size: 13px;
3483+
font-weight: 500;
34803484
color: var(--text-secondary);
34813485
transition: all 180ms ease;
34823486
cursor: pointer;
3487+
text-align: left;
34833488
position: relative;
34843489
text-align: left;
34853490
}

components/workspace-sidebar.tsx

Lines changed: 24 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export function WorkspaceSidebar({ collapsed, onToggle, repoName }: Props) {
201201
<button
202202
onClick={() => setView('prompts')}
203203
className={`activity-bar-btn ${activeView === 'prompts' ? 'activity-bar-btn--active' : ''}`}
204-
title="Prompt Library"
204+
title="Prompts"
205205
>
206206
<Icon icon="lucide:book-open" width={24} height={24} />
207207
</button>
@@ -274,54 +274,29 @@ export function WorkspaceSidebar({ collapsed, onToggle, repoName }: Props) {
274274
</div>
275275

276276
{/* View Navigation */}
277-
<div className="mt-2 space-y-0.5">
278-
<button
279-
onClick={() => setView('chat')}
280-
className={`sidebar-view-nav ${activeView === 'chat' ? 'sidebar-view-nav--active' : ''}`}
281-
>
282-
<Icon icon="lucide:message-circle" width={18} height={18} />
283-
Chat
284-
</button>
285-
<button
286-
onClick={() => setView('editor')}
287-
className={`sidebar-view-nav ${activeView === 'editor' ? 'sidebar-view-nav--active' : ''}`}
288-
>
289-
<Icon icon="lucide:code" width={18} height={18} />
290-
Editor
291-
</button>
292-
<button
293-
onClick={() => setView('git')}
294-
className={`sidebar-view-nav ${activeView === 'git' ? 'sidebar-view-nav--active' : ''}`}
295-
>
296-
<Icon icon="lucide:git-branch" width={18} height={18} />
297-
Git
298-
{dirtyCount > 0 && (
299-
<span className="ml-auto px-2 min-w-[22px] text-center rounded-full bg-[var(--brand)] text-[var(--brand-contrast)] text-[11px] leading-[18px] font-bold">
300-
{dirtyCount}
301-
</span>
302-
)}
303-
</button>
304-
<button
305-
onClick={() => setView('mcp')}
306-
className={`sidebar-view-nav ${activeView === 'mcp' ? 'sidebar-view-nav--active' : ''}`}
307-
>
308-
<Icon icon="lucide:plug" width={18} height={18} />
309-
MCP
310-
</button>
311-
<button
312-
onClick={() => setView('skills')}
313-
className={`sidebar-view-nav ${activeView === 'skills' ? 'sidebar-view-nav--active' : ''}`}
314-
>
315-
<Icon icon="lucide:wand-2" width={18} height={18} />
316-
Skills
317-
</button>
318-
<button
319-
onClick={() => setView('prompts')}
320-
className={`sidebar-view-nav ${activeView === 'prompts' ? 'sidebar-view-nav--active' : ''}`}
321-
>
322-
<Icon icon="lucide:book-open" width={18} height={18} />
323-
Prompts
324-
</button>
277+
<div className="mt-2 flex flex-col gap-0.5">
278+
{([
279+
{ id: 'chat' as const, icon: 'lucide:message-circle', label: 'Chat' },
280+
{ id: 'editor' as const, icon: 'lucide:code', label: 'Editor' },
281+
{ id: 'git' as const, icon: 'lucide:git-branch', label: 'Git' },
282+
{ id: 'mcp' as const, icon: 'lucide:plug', label: 'MCP' },
283+
{ id: 'skills' as const, icon: 'lucide:wand-2', label: 'Skills' },
284+
{ id: 'prompts' as const, icon: 'lucide:book-open', label: 'Prompts' },
285+
] as const).map((item) => (
286+
<button
287+
key={item.id}
288+
onClick={() => setView(item.id)}
289+
className={`sidebar-view-nav ${activeView === item.id ? 'sidebar-view-nav--active' : ''}`}
290+
>
291+
<Icon icon={item.icon} width={16} height={16} className="shrink-0" />
292+
<span className="truncate">{item.label}</span>
293+
{item.id === 'git' && dirtyCount > 0 && (
294+
<span className="ml-auto px-1.5 min-w-[20px] text-center rounded-full bg-[var(--brand)] text-[var(--brand-contrast)] text-[10px] leading-[18px] font-bold shrink-0">
295+
{dirtyCount}
296+
</span>
297+
)}
298+
</button>
299+
))}
325300
</div>
326301
</div>
327302

0 commit comments

Comments
 (0)