Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 70 additions & 50 deletions apps/code/src/renderer/features/sidebar/components/SidebarMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { useTasks, useUpdateTask } from "@features/tasks/hooks/useTasks";
import { useWorkspaces } from "@features/workspace/hooks/useWorkspace";
import { useTaskContextMenu } from "@hooks/useTaskContextMenu";
import { ScrollArea, Separator } from "@posthog/quill";
import { MenuLabel, Separator } from "@posthog/quill";
import { Box, Flex } from "@radix-ui/themes";
import type { Schemas } from "@renderer/api/generated";
import type { Task } from "@shared/types";
Expand All @@ -35,7 +35,7 @@ import { McpServersItem } from "./items/McpServersItem";
import { SearchItem } from "./items/SearchItem";
import { SkillsItem } from "./items/SkillsItem";
import { SidebarItem } from "./SidebarItem";
import { TaskListView } from "./TaskListView";
import { TaskFilterMenu, TaskListView, TaskSearchButton } from "./TaskListView";

function SidebarMenuComponent() {
const {
Expand Down Expand Up @@ -293,53 +293,73 @@ function SidebarMenuComponent() {
}, [setEditingTaskId]);

return (
<Box height="100%" position="relative" id="side-bar-menu">
<ScrollArea className="h-full overflow-y-auto overflow-x-hidden">
<Flex direction="column" py="2" px="2" gap="1px">
<Box mb="2">
<NewTaskItem
isActive={sidebarData.isHomeActive}
onClick={handleNewTaskClick}
variant="primary"
/>
</Box>

<Box>
<SearchItem onClick={handleSearchClick} />
</Box>

<Box>
<InboxItem
isActive={sidebarData.isInboxActive}
onClick={handleInboxClick}
signalCount={inboxSignalCount}
/>
</Box>

<Box>
<SkillsItem
isActive={sidebarData.isSkillsActive}
onClick={handleSkillsClick}
/>
</Box>

<Box>
<McpServersItem
isActive={sidebarData.isMcpServersActive}
onClick={handleMcpServersClick}
/>
</Box>

<Box mb="2">
<CommandCenterItem
isActive={sidebarData.isCommandCenterActive}
onClick={handleCommandCenterClick}
activeCount={commandCenterActiveCount}
/>
</Box>

<Separator className="mx-2 my-2" />

<Box
height="100%"
position="relative"
id="side-bar-menu"
className="flex min-h-0 flex-col"
>
<Flex direction="column" className="shrink-0 px-2 py-2" gap="1px">
<Box mb="2">
<NewTaskItem
isActive={sidebarData.isHomeActive}
onClick={handleNewTaskClick}
variant="primary"
/>
</Box>

<Box>
<SearchItem onClick={handleSearchClick} />
</Box>

<Box>
<InboxItem
isActive={sidebarData.isInboxActive}
onClick={handleInboxClick}
signalCount={inboxSignalCount}
/>
</Box>

<Box>
<SkillsItem
isActive={sidebarData.isSkillsActive}
onClick={handleSkillsClick}
/>
</Box>

<Box>
<McpServersItem
isActive={sidebarData.isMcpServersActive}
onClick={handleMcpServersClick}
/>
</Box>

<Box mb="2">
<CommandCenterItem
isActive={sidebarData.isCommandCenterActive}
onClick={handleCommandCenterClick}
activeCount={commandCenterActiveCount}
/>
</Box>
</Flex>

<Separator className="mx-2 my-2 shrink-0" />

<div className="shrink-0 px-2">
<MenuLabel
className="flex items-center justify-between pt-0 pr-0 pb-[2px]"
htmlFor="null"
>
Tasks
<span className="flex items-center">
<TaskSearchButton />
<TaskFilterMenu />
</span>
</MenuLabel>
</div>

<div className="min-h-0 flex-1 overflow-y-auto overflow-x-hidden">
<Flex direction="column" gap="1px" px="2" pb="2">
{sidebarData.isLoading ? (
<SidebarItem
depth={0}
Expand All @@ -365,7 +385,7 @@ function SidebarMenuComponent() {
/>
)}
</Flex>
</ScrollArea>
</div>
</Box>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function TaskRow({
);
}

function TaskSearchButton() {
export function TaskSearchButton() {
const openCommandMenu = useCommandMenuStore((state) => state.open);
return (
<Button
Expand All @@ -148,7 +148,7 @@ function TaskSearchButton() {
);
}

function TaskFilterMenu() {
export function TaskFilterMenu() {
const organizeMode = useSidebarStore((state) => state.organizeMode);
const sortMode = useSidebarStore((state) => state.sortMode);
const showAllUsers = useSidebarStore((state) => state.showAllUsers);
Expand Down Expand Up @@ -336,16 +336,6 @@ export function TaskListView({
</>
)}

<SectionLabel
label="Tasks"
endContent={
<span className="flex items-center">
<TaskSearchButton />
<TaskFilterMenu />
</span>
}
/>

{pinnedTasks.length === 0 &&
flatTasks.length === 0 &&
groupedTasks.length === 0 ? (
Expand Down