diff --git a/src/browser/components/AddSectionButton/AddSectionButton.tsx b/src/browser/components/AddSectionButton/AddSectionButton.tsx deleted file mode 100644 index beff820652..0000000000 --- a/src/browser/components/AddSectionButton/AddSectionButton.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import React, { useState, useRef, useEffect } from "react"; -import { Plus } from "lucide-react"; -// import { Tooltip, TooltipTrigger, TooltipContent } from "../Tooltip/Tooltip"; - -interface AddSectionButtonProps { - onCreateSection: (name: string) => void; -} - -export const AddSectionButton: React.FC = ({ onCreateSection }) => { - const [isCreating, setIsCreating] = useState(false); - const [name, setName] = useState(""); - const inputRef = useRef(null); - - useEffect(() => { - if (isCreating && inputRef.current) { - inputRef.current.focus(); - } - }, [isCreating]); - - const handleSubmit = () => { - const trimmed = name.trim(); - if (trimmed) { - onCreateSection(trimmed); - } - setName(""); - setIsCreating(false); - }; - - if (isCreating) { - return ( -
- setName(e.target.value)} - onBlur={handleSubmit} - onKeyDown={(e) => { - if (e.key === "Enter") handleSubmit(); - if (e.key === "Escape") { - setName(""); - setIsCreating(false); - } - }} - placeholder="Section name..." - data-testid="add-section-input" - 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" - /> -
- ); - } - - return ( - - ); -}; diff --git a/src/browser/components/ProjectSidebar/ProjectSidebar.test.tsx b/src/browser/components/ProjectSidebar/ProjectSidebar.test.tsx index e0847ac919..c774b168e0 100644 --- a/src/browser/components/ProjectSidebar/ProjectSidebar.test.tsx +++ b/src/browser/components/ProjectSidebar/ProjectSidebar.test.tsx @@ -33,7 +33,6 @@ import * as ProjectDeleteConfirmationModalModule from "../ProjectDeleteConfirmat import * as WorkspaceStatusIndicatorModule from "../WorkspaceStatusIndicator/WorkspaceStatusIndicator"; import * as PopoverErrorModule from "../PopoverError/PopoverError"; import * as SectionHeaderModule from "../SectionHeader/SectionHeader"; -import * as AddSectionButtonModule from "../AddSectionButton/AddSectionButton"; import * as WorkspaceSectionDropZoneModule from "../WorkspaceSectionDropZone/WorkspaceSectionDropZone"; import * as WorkspaceDragLayerModule from "../WorkspaceDragLayer/WorkspaceDragLayer"; import * as SectionDragLayerModule from "../SectionDragLayer/SectionDragLayer"; @@ -488,9 +487,6 @@ function installProjectSidebarTestDoubles() { spyOn(SectionHeaderModule, "SectionHeader").mockImplementation( (() => null) as unknown as typeof SectionHeaderModule.SectionHeader ); - spyOn(AddSectionButtonModule, "AddSectionButton").mockImplementation( - (() => null) as unknown as typeof AddSectionButtonModule.AddSectionButton - ); spyOn(WorkspaceSectionDropZoneModule, "WorkspaceSectionDropZone").mockImplementation( TestWrapper as unknown as typeof WorkspaceSectionDropZoneModule.WorkspaceSectionDropZone ); diff --git a/src/browser/components/ProjectSidebar/ProjectSidebar.tsx b/src/browser/components/ProjectSidebar/ProjectSidebar.tsx index f89e4bd8e5..c3375028f2 100644 --- a/src/browser/components/ProjectSidebar/ProjectSidebar.tsx +++ b/src/browser/components/ProjectSidebar/ProjectSidebar.tsx @@ -250,6 +250,10 @@ function useWorkspaceAttentionSubscription( const PROJECT_ITEM_BASE_CLASS = "group sticky top-0 z-30 py-2 pl-2 pr-1 flex select-none items-center border-l-transparent bg-surface-primary transition-colors duration-150"; +// Shared classes for the chevron toggle buttons on project/section headers. +const PROJECT_TOGGLE_BUTTON_CLASSES = + "text-secondary hover:bg-hover hover:border-border-light mr-1.5 flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded border border-transparent bg-transparent p-0 transition-all duration-200"; + function getProjectFallbackLabel(projectPath: string): string { const abbreviatedPath = PlatformPaths.abbreviate(projectPath); const { basename } = PlatformPaths.splitAbbreviated(abbreviatedPath); @@ -1696,7 +1700,7 @@ const ProjectSidebarInner: React.FC = ({