Skip to content

Commit 1776d88

Browse files
authored
🤖 refactor: remove VerticalTokenMeter component (#1227)
Remove VerticalTokenMeter now that we have the context usage indicator in the chat area. **Changes:** - Removed `VerticalTokenMeter.tsx` and `ChatMetaSidebar.tsx` components - Removed auto-collapse hysteresis logic (was based on chatAreaWidth) - Added manual collapse/expand toggle using shared `SidebarCollapseButton` component - Both sidebars now use same collapse button style (20px width, `«»` chevrons) - Tab keyboard shortcuts (`Ctrl+1/2/3`) auto-expand the right sidebar if collapsed - Stories default to collapsed right sidebar; rightsidebar stories explicitly expand **Shared component:** `src/browser/components/ui/SidebarCollapseButton.tsx` - Used by both ProjectSidebar and RightSidebar - `side` prop controls chevron direction - Optional `shortcut` prop for tooltip --- _Generated with `mux` • Model: `anthropic:claude-sonnet-4-20250514` • Thinking: `none`_
1 parent 8cdf42d commit 1776d88

File tree

10 files changed

+125
-337
lines changed

10 files changed

+125
-337
lines changed

src/browser/components/AIView.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,6 @@ const AIViewInner: React.FC<AIViewProps> = ({
797797
key={workspaceId}
798798
workspaceId={workspaceId}
799799
workspacePath={namedWorkspacePath}
800-
chatAreaRef={chatAreaRef}
801800
width={sidebarWidth}
802801
onStartResize={startResize}
803802
isResizing={isResizing}

src/browser/components/ChatMetaSidebar.tsx

Lines changed: 0 additions & 84 deletions
This file was deleted.

src/browser/components/LeftSidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function LeftSidebar(props: LeftSidebarProps) {
5151
className={cn(
5252
"h-screen bg-sidebar border-r border-border flex flex-col shrink-0",
5353
"transition-all duration-200 overflow-hidden relative z-20",
54-
collapsed ? "w-8" : "w-72",
54+
collapsed ? "w-5" : "w-72",
5555
"mobile-sidebar",
5656
collapsed && "mobile-sidebar-collapsed"
5757
)}

src/browser/components/ProjectSidebar.tsx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
AGE_THRESHOLDS_DAYS,
2020
} from "@/browser/utils/ui/workspaceFiltering";
2121
import { Tooltip, TooltipTrigger, TooltipContent } from "./ui/tooltip";
22+
import { SidebarCollapseButton } from "./ui/SidebarCollapseButton";
2223
import SecretsModal from "./SecretsModal";
2324
import type { Secret } from "@/common/types/secrets";
2425
import { ForceDeleteModal } from "./ForceDeleteModal";
@@ -714,21 +715,12 @@ const ProjectSidebarInner: React.FC<ProjectSidebarProps> = ({
714715
</div>
715716
</>
716717
)}
717-
<Tooltip>
718-
<TooltipTrigger asChild>
719-
<button
720-
onClick={onToggleCollapsed}
721-
aria-label={collapsed ? "Expand sidebar" : "Collapse sidebar"}
722-
className="text-muted border-dark hover:bg-hover hover:text-foreground mt-auto flex h-9 w-full cursor-pointer items-center justify-center border-t border-none bg-transparent p-0 text-sm transition-all duration-200"
723-
>
724-
{collapsed ? "»" : "«"}
725-
</button>
726-
</TooltipTrigger>
727-
<TooltipContent align="center">
728-
{collapsed ? "Expand sidebar" : "Collapse sidebar"} (
729-
{formatKeybind(KEYBINDS.TOGGLE_SIDEBAR)})
730-
</TooltipContent>
731-
</Tooltip>
718+
<SidebarCollapseButton
719+
collapsed={collapsed}
720+
onToggle={onToggleCollapsed}
721+
side="left"
722+
shortcut={formatKeybind(KEYBINDS.TOGGLE_SIDEBAR)}
723+
/>
732724
{secretsModalState && (
733725
<SecretsModal
734726
isOpen={secretsModalState.isOpen}

0 commit comments

Comments
 (0)