Skip to content

Commit 8971a34

Browse files
ryaneggzclaude
andauthored
feat: VS Code-style activity bar sidebar redesign (#920) (#921)
* plan: VS Code-style activity bar sidebar redesign (#920) Add implementation plan and reference screenshots for converting the text-label sidebar into a VS Code-style activity bar with icon tabs and collapsible content panels. Closes #920 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: ryaneggz <kre8mymedia@gmail.com> * feat: implement VS Code-style activity bar sidebar (#920) Replace the text-label sidebar with a two-column layout: a 48px icon activity bar (always visible) and a collapsible content panel. Uses existing shadcn/ui sidebar primitives with collapsible="icon" mode. New components: - ActivityBar: vertical icon strip with logo, 5 nav icons, settings - ActivityBarItem: icon button with left-border active indicator + tooltip - SidePanel: conditional content renderer for active section - ThreadsPanel: extracted virtual-scroll thread list - ProjectsPanel: extracted project list with create button - SchedulesPanel: extracted schedule execution list Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: ryaneggz <kre8mymedia@gmail.com> * fix: switch to horizontal icon tabs layout instead of vertical side panel Replace the two-column activity bar + side panel approach with the correct VS Code pattern: horizontal icon tabs row at top of sidebar, content panel below. Icons sit directly under the logo/header, replacing the text-label navigation rows to save vertical space. - ActivityBar now renders as a horizontal flex row of icon buttons - ActivityBarItem uses bottom border indicator for active state - Sidebar keeps standard single-column layout (header → tabs → content → footer) - Restored SidebarHeader, SidebarContent, SidebarFooter structure Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: ryaneggz <kre8mymedia@gmail.com> * fix: resolve blurry icons - use valid Tailwind classes and improve UX Root cause: `w-4.5 h-4.5` is not a valid Tailwind class (no 4.5 step), so the CSS was ignored and SVGs rendered at their raw 24x24 attribute size instead of the intended 18px. This caused misalignment and subpixel blurriness. Changes: - Icon size: invalid `w-4.5 h-4.5` -> valid `w-5 h-5` (20px, crisp) - Button size: `w-9 h-9` (36px) -> `w-10 h-10` (40px) for better targets - Active icon: thicker stroke (2.25) vs inactive (1.75) for visual weight - Inactive opacity: tuned to /40 resting, /70 hover for clear hierarchy - Tab row: increased gap from 0.5 to 1 (4px) and padding for breathing room - Active indicator: moved to bottom-0.5 with rounded-full for polish Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: ryaneggz <kre8mymedia@gmail.com> * chore: add plan agent artifact for activity bar redesign Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: ryaneggz <kre8mymedia@gmail.com> --------- Signed-off-by: ryaneggz <kre8mymedia@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9d0992c commit 8971a34

11 files changed

Lines changed: 1124 additions & 488 deletions

File tree

.claude/plans/unified-purring-dream-agent-a1b0154ffe1c41831.md

Lines changed: 485 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
# Plan: VS Code-Style Activity Bar Sidebar Redesign
2+
3+
## Context
4+
5+
The current sidebar uses a traditional text-label + collapsible-section layout (~307px wide) that consumes significant horizontal space. The goal is to replicate the VS Code activity bar pattern: a narrow icon strip (~48px) on the far left, with a content panel that opens/closes beside it. This saves space when the panel is collapsed while keeping all navigation one click away.
6+
7+
**Screenshots studied:**
8+
- `current.png` — Current text-row sidebar with Assistants, Memories, Projects, Schedules, Threads
9+
- `vscode-example.png` — VS Code activity bar with icon tabs (search, files, git, extensions, testing)
10+
11+
## Recommended Approach
12+
13+
**Build new components inside the existing `<Sidebar>` primitive** rather than replacing `sidebar.tsx`. The existing infrastructure (SidebarProvider context, mobile Sheet, Ctrl+B shortcut, cookie persistence, CSS variable widths) is consumed by 16+ files and is too expensive to replace.
14+
15+
**Key insight:** The existing `collapsible="icon"` mode already shrinks the sidebar to `SIDEBAR_WIDTH_ICON = "3rem"` (48px) — exactly the width of a VS Code activity bar. We restructure the sidebar's internal layout from a single column to a two-column flex-row: activity bar (always visible) + content panel (hidden when collapsed).
16+
17+
### Architecture
18+
19+
```
20+
┌──────────────────────────────────────────────────────┐
21+
│ <Sidebar collapsible="icon"> │
22+
│ ┌─────────────────────────────────────────────────┐ │
23+
│ │ <div className="flex flex-row h-full w-full"> │ │
24+
│ │ ┌──────────┐ ┌────────────────────────────┐ │ │
25+
│ │ │ Activity │ │ SidePanel │ │ │
26+
│ │ │ Bar │ │ (hidden when collapsed) │ │ │
27+
│ │ │ (48px) │ │ (~259px) │ │ │
28+
│ │ │ │ │ │ │ │
29+
│ │ │ [Logo] │ │ Panel header + content: │ │ │
30+
│ │ │ [Bot] │ │ - ThreadsPanel │ │ │
31+
│ │ │ [Brain] │ │ - ProjectsPanel │ │ │
32+
│ │ │ [Folder] │ │ - SchedulesPanel │ │ │
33+
│ │ │ [Cal] │ │ (Assistants/Memories are │ │ │
34+
│ │ │ [Msg] │ │ route-only, no panel) │ │ │
35+
│ │ │ │ │ │ │ │
36+
│ │ │ [Gear] │ │ │ │ │
37+
│ │ └──────────┘ └────────────────────────────┘ │ │
38+
│ └─────────────────────────────────────────────────┘ │
39+
│ <SidebarRail /> (absolute, unchanged) │
40+
└──────────────────────────────────────────────────────┘
41+
```
42+
43+
### State Management
44+
45+
Single `useState<PanelId>` inside `AppSidebar` — no new context needed:
46+
47+
```typescript
48+
type PanelId = "assistants" | "memories" | "projects" | "schedules" | "threads" | null;
49+
```
50+
51+
- Clicking **active** icon: `setActivePanel(null)` + `setOpen(false)` (collapses to icon-only)
52+
- Clicking **inactive** icon: `setActivePanel(id)` + `setOpen(true)` (expands panel)
53+
- Assistants/Memories: navigate via React Router AND set `activePanel` for visual highlight
54+
- Projects/Schedules/Threads: toggle their content panel (no route change)
55+
- `Ctrl+B`: existing `toggleSidebar()` toggles `open` state, activity bar stays visible in both states
56+
- `useLocation()` auto-highlights Assistants/Memories icons based on current route
57+
58+
### Width Constants (unchanged in sidebar.tsx)
59+
60+
| Constant | Value | Meaning |
61+
|---|---|---|
62+
| `SIDEBAR_WIDTH` | `19.2rem` (307px) | 48px activity bar + 259px panel |
63+
| `SIDEBAR_WIDTH_ICON` | `3rem` (48px) | Activity bar only (collapsed) |
64+
| `SIDEBAR_WIDTH_MOBILE` | `21.6rem` (346px) | Both columns in mobile Sheet |
65+
66+
## Files to Create
67+
68+
### 1. `frontend/src/components/sidebar/ActivityBarItem.tsx`
69+
- Icon button with VS Code-style left-border active indicator (`border-l-2 border-white` when active)
70+
- Wraps content in existing `<Tooltip>` for hover label
71+
- Props: `icon`, `label`, `isActive`, `onClick`, `data-tour?`
72+
- ~40 lines
73+
74+
### 2. `frontend/src/components/sidebar/ActivityBar.tsx`
75+
- 48px wide, full height, flex-col with `justify-between`
76+
- Top section: small logo icon (links to `/`)
77+
- Middle section: 5 nav icons (Bot, Brain, FolderKanban, Calendar, MessageSquare)
78+
- Bottom section: Settings icon (reuses `SettingsPopover`)
79+
- Wraps icons in `<TooltipProvider>`
80+
- ~80 lines
81+
82+
### 3. `frontend/src/components/sidebar/panels/ThreadsPanel.tsx`
83+
- Extract from `CollapsibleGroup` (type="threads" branch, lines 567-719)
84+
- Contains `useVirtualizer`, infinite scroll handler, search button
85+
- Renders `ThreadItem` components (imported, not duplicated)
86+
- Props: threads, projects, loadMore, hasMore, isLoadingMore, onSearchClick
87+
- ~100 lines
88+
89+
### 4. `frontend/src/components/sidebar/panels/ProjectsPanel.tsx`
90+
- Extract from `ProjectsCollapsibleGroup` (lines 494-553)
91+
- Contains "Create Project" button, renders `ProjectItem` list
92+
- Props: projects, onCreateProject, onAddSource
93+
- ~50 lines
94+
95+
### 5. `frontend/src/components/sidebar/panels/SchedulesPanel.tsx`
96+
- Extract from `SchedulesCollapsibleGroup` (lines 722-801)
97+
- Self-contained with own `useScheduleExecutions`/`useSchedules` hooks
98+
- ~60 lines
99+
100+
### 6. `frontend/src/components/sidebar/SidePanel.tsx`
101+
- Renders panel header (title text) + active panel content
102+
- Switch on `activePanel` to render the correct panel component
103+
- Hidden when sidebar is collapsed (via existing `group-data-[collapsible=icon]` CSS)
104+
- ~60 lines
105+
106+
## Files to Modify
107+
108+
### 7. `frontend/src/components/drawers/app-sidebar.tsx`
109+
- **Major refactor**: Replace the current `SidebarHeader + SidebarContent (collapsible groups) + SidebarFooter` with a `flex-row` wrapper containing `<ActivityBar />` + `<SidePanel />`
110+
- Move `ThreadItem`, `ProjectItem`, `AssistantItem` definitions to separate files or keep inline (they're used only here)
111+
- Add `activePanel` state and toggle logic
112+
- Pass `collapsible="icon"` to `<Sidebar>` (instead of default `"offcanvas"`)
113+
- Keep all modals (`CreateProjectModal`, `AddSourceModal`, `ThreadSearchModal`) at bottom
114+
- Keep all context hooks (`useChatContext`, `useProjectContext`, etc.)
115+
116+
### 8. `frontend/src/components/ui/sidebar.tsx` (minimal change)
117+
- No structural changes needed
118+
- The only change: `AppSidebar` passes `collapsible="icon"` explicitly to `<Sidebar>`
119+
120+
### 9. `frontend/src/lib/config/onboardingSteps.ts`
121+
- Update `data-tour` selectors to match new DOM structure
122+
123+
## Files NOT Modified
124+
- `frontend/src/layouts/chat-layout-v2.tsx` — No changes needed, layout wrapper stays the same
125+
- `frontend/src/components/sidebar/ScheduleSidebarItem.tsx` — Used as-is inside SchedulesPanel
126+
- All context providers, hooks, services — No changes
127+
128+
## Visual Design
129+
130+
### Activity Bar Icons
131+
```
132+
Background: sidebar-background (matches current sidebar)
133+
Icon size: 24px (w-6 h-6)
134+
Icon color: sidebar-foreground/60 (inactive), sidebar-foreground (active)
135+
Active indicator: 2px left border in primary/white color
136+
Hover: bg-sidebar-accent/50
137+
Spacing: gap-1 between icons
138+
```
139+
140+
### Side Panel
141+
```
142+
Width: fills remaining space (~259px)
143+
Header: section title + action button (search for threads, create for projects)
144+
Content: scrollable, matches current styling
145+
Border: border-l border-sidebar-border between activity bar and panel
146+
```
147+
148+
## Verification Plan
149+
150+
1. `npm run build` — Ensure no TypeScript errors
151+
2. `npm run test` — Ensure existing tests pass
152+
3. `npm run dev:claude` — Visual verification:
153+
- Activity bar renders with 5 icons + logo + settings
154+
- Clicking Threads icon opens threads panel with virtual scroll
155+
- Clicking Projects icon switches to projects panel
156+
- Clicking active icon collapses to icon-only (48px)
157+
- Clicking Assistants icon navigates to `/assistants` route
158+
- Ctrl+B toggles panel open/closed
159+
- Tooltips appear on icon hover
160+
- Mobile: Sheet renders with both activity bar + panel
161+
4. Use `agent-browser` skill with 1920x1080 viewport for screenshot validation
102 KB
Loading
12.5 KB
Loading

0 commit comments

Comments
 (0)