@@ -320,7 +364,7 @@ export function Sidebar({
type="button"
onClick={onCollapse}
title={t("actions.expand")}
- className="flex w-full items-center gap-2.5 rounded-md px-3 py-1.5 text-sm text-foreground transition-colors duration-200 hover:text-foreground"
+ className="flex w-full items-center gap-2.5 rounded-md px-3 py-1.5 text-sm text-muted-foreground transition-colors duration-200 hover:text-foreground"
aria-label={t("actions.expand")}
>
@@ -455,6 +499,10 @@ export function Sidebar({
onRenameChat={onRenameChat}
onMoveToProject={onMoveToProject}
onReorderProject={onReorderProject}
+ projectsSectionOpen={sectionVisibility.projects}
+ recentsSectionOpen={sectionVisibility.recents}
+ onToggleProjectsSection={() => toggleSection("projects")}
+ onToggleRecentsSection={() => toggleSection("recents")}
/>
))}
diff --git a/ui/goose2/src/features/sidebar/ui/SidebarProjectsSection.tsx b/ui/goose2/src/features/sidebar/ui/SidebarProjectsSection.tsx
index 39d5517a4d..dd2fa159c1 100644
--- a/ui/goose2/src/features/sidebar/ui/SidebarProjectsSection.tsx
+++ b/ui/goose2/src/features/sidebar/ui/SidebarProjectsSection.tsx
@@ -1,4 +1,5 @@
import { useTranslation } from "react-i18next";
+import { IconChevronDown } from "@tabler/icons-react";
import type { AppView } from "@/app/AppShell";
import type { ProjectInfo } from "@/features/projects/api/projects";
import { cn } from "@/shared/lib/cn";
@@ -36,8 +37,15 @@ interface SidebarProjectsSectionProps {
onRenameChat?: (sessionId: string, nextTitle: string) => void;
onMoveToProject?: (sessionId: string, projectId: string | null) => void;
onReorderProject?: (fromId: string, toId: string) => void;
+ projectsSectionOpen: boolean;
+ recentsSectionOpen: boolean;
+ onToggleProjectsSection: () => void;
+ onToggleRecentsSection: () => void;
}
+const SECTION_HEADER_TEXT_CLASS =
+ "text-[11px] font-medium uppercase tracking-[0.08em] text-foreground-subtle";
+
export function SidebarProjectsSection({
projects,
projectSessions,
@@ -58,8 +66,13 @@ export function SidebarProjectsSection({
onRenameChat,
onMoveToProject,
onReorderProject,
+ projectsSectionOpen,
+ recentsSectionOpen,
+ onToggleProjectsSection,
+ onToggleRecentsSection,
}: SidebarProjectsSectionProps) {
const { t } = useTranslation(["sidebar", "common"]);
+ const showProjects = collapsed || projectsSectionOpen;
return (
-
- {t("sections.projects")}
-
+ {!collapsed && (
+
+ )}
{!collapsed && (
);
diff --git a/ui/goose2/src/features/sidebar/ui/SidebarRecentsSection.tsx b/ui/goose2/src/features/sidebar/ui/SidebarRecentsSection.tsx
index 19f6dea6dc..3f905410a0 100644
--- a/ui/goose2/src/features/sidebar/ui/SidebarRecentsSection.tsx
+++ b/ui/goose2/src/features/sidebar/ui/SidebarRecentsSection.tsx
@@ -1,6 +1,6 @@
import { useCallback, useState, type DragEvent } from "react";
import { useTranslation } from "react-i18next";
-import { IconEdit, IconMessage } from "@tabler/icons-react";
+import { IconChevronDown, IconEdit, IconMessage } from "@tabler/icons-react";
import { getDisplaySessionTitle } from "@/features/chat/lib/sessionTitle";
import { cn } from "@/shared/lib/cn";
import { Button } from "@/shared/ui/button";
@@ -26,6 +26,9 @@ export function SidebarRecentsSection({
onArchiveChat,
onRenameChat,
onMoveToProject,
+ isOpen,
+ onToggleOpen,
+ sectionHeaderTextClass,
}: {
sessions: TabInfo[];
collapsed: boolean;
@@ -37,9 +40,13 @@ export function SidebarRecentsSection({
onArchiveChat?: (sessionId: string) => void;
onRenameChat?: (sessionId: string, nextTitle: string) => void;
onMoveToProject?: (sessionId: string, projectId: string | null) => void;
+ isOpen: boolean;
+ onToggleOpen: () => void;
+ sectionHeaderTextClass: string;
}) {
const { t } = useTranslation(["sidebar", "common"]);
const [recentsDragOver, setRecentsDragOver] = useState(false);
+ const showContent = collapsed || isOpen;
const handleRecentsDragOver = useCallback((e: DragEvent
) => {
const hasSession = e.dataTransfer.types.includes("text/x-session-id");
@@ -81,17 +88,30 @@ export function SidebarRecentsSection({
collapsed ? "px-0 pt-0 pb-1 justify-center" : "pt-5 pb-1.5",
)}
>
-
- {t("sections.recents")}
-
+ {!collapsed && (
+
+ )}
{!collapsed && onNewChat && (