@@ -20,6 +20,7 @@ import { useTaskViewedStore } from "../stores/taskViewedStore";
2020import { HomeItem } from "./items/HomeItem" ;
2121import { NewTaskItem } from "./items/NewTaskItem" ;
2222import { TaskItem } from "./items/TaskItem" ;
23+ import { SidebarFooter } from "./SidebarFooter" ;
2324import { SortableFolderSection } from "./SortableFolderSection" ;
2425
2526function SidebarMenuComponent ( ) {
@@ -143,85 +144,91 @@ function SidebarMenuComponent() {
143144 onOpenChange = { setRenameDialogOpen }
144145 />
145146
146- < Box
147- style = { {
148- flexGrow : 1 ,
149- overflowY : "auto" ,
150- overflowX : "hidden" ,
151- } }
152- >
153- < Flex direction = "column" py = "2" >
154- < HomeItem
155- isActive = { sidebarData . isHomeActive }
156- onClick = { handleHomeClick }
157- />
158-
159- < DragDropProvider
160- onDragOver = { handleDragOver }
161- sensors = { [
162- PointerSensor . configure ( {
163- activationConstraints : {
164- distance : { value : 5 } ,
165- } ,
166- } ) ,
167- ] }
168- >
169- { sidebarData . folders . map ( ( folder , index ) => {
170- const isExpanded = ! collapsedSections . has ( folder . id ) ;
171- return (
172- < SortableFolderSection
173- key = { folder . id }
174- id = { folder . id }
175- index = { index }
176- label = { folder . name }
177- icon = {
178- isExpanded ? (
179- < FolderOpenIcon size = { 14 } weight = "regular" />
180- ) : (
181- < FolderIcon size = { 14 } weight = "regular" />
182- )
183- }
184- isExpanded = { isExpanded }
185- onToggle = { ( ) => toggleSection ( folder . id ) }
186- onContextMenu = { ( e ) => handleFolderContextMenu ( folder . id , e ) }
187- >
188- < NewTaskItem onClick = { ( ) => handleFolderNewTask ( folder . id ) } />
189- { folder . tasks . map ( ( task ) => (
190- < TaskItem
191- key = { task . id }
192- id = { task . id }
193- label = { task . title }
194- isActive = { sidebarData . activeTaskId === task . id }
195- worktreeName = {
196- workspaces [ task . id ] ?. worktreeName ?? undefined
197- }
198- worktreePath = {
199- workspaces [ task . id ] ?. worktreePath ??
200- workspaces [ task . id ] ?. folderPath
201- }
202- workspaceMode = { taskStates [ task . id ] ?. workspaceMode }
203- lastActivityAt = { task . lastActivityAt }
204- isGenerating = { task . isGenerating }
205- isUnread = { task . isUnread }
206- onClick = { ( ) => handleTaskClick ( task . id ) }
207- onContextMenu = { ( e ) => handleTaskContextMenu ( task . id , e ) }
147+ < Box height = "100%" position = "relative" >
148+ < Box
149+ style = { {
150+ height : "100%" ,
151+ overflowY : "auto" ,
152+ overflowX : "hidden" ,
153+ paddingBottom : "52px" ,
154+ } }
155+ >
156+ < Flex direction = "column" py = "2" >
157+ < HomeItem
158+ isActive = { sidebarData . isHomeActive }
159+ onClick = { handleHomeClick }
160+ />
161+
162+ < DragDropProvider
163+ onDragOver = { handleDragOver }
164+ sensors = { [
165+ PointerSensor . configure ( {
166+ activationConstraints : {
167+ distance : { value : 5 } ,
168+ } ,
169+ } ) ,
170+ ] }
171+ >
172+ { sidebarData . folders . map ( ( folder , index ) => {
173+ const isExpanded = ! collapsedSections . has ( folder . id ) ;
174+ return (
175+ < SortableFolderSection
176+ key = { folder . id }
177+ id = { folder . id }
178+ index = { index }
179+ label = { folder . name }
180+ icon = {
181+ isExpanded ? (
182+ < FolderOpenIcon size = { 14 } weight = "regular" />
183+ ) : (
184+ < FolderIcon size = { 14 } weight = "regular" />
185+ )
186+ }
187+ isExpanded = { isExpanded }
188+ onToggle = { ( ) => toggleSection ( folder . id ) }
189+ onContextMenu = { ( e ) => handleFolderContextMenu ( folder . id , e ) }
190+ >
191+ < NewTaskItem
192+ onClick = { ( ) => handleFolderNewTask ( folder . id ) }
208193 />
209- ) ) }
210- </ SortableFolderSection >
211- ) ;
212- } ) }
213- < DragOverlay >
214- { ( source ) =>
215- source ?. type === "folder" ? (
216- < div className = "flex w-full items-center gap-1 rounded bg-gray-2 px-2 py-1 font-mono text-[12px] text-gray-11 shadow-lg" >
217- < FolderIcon size = { 14 } weight = "regular" />
218- < span className = "font-medium" > { source . data ?. label } </ span >
219- </ div >
220- ) : null
221- }
222- </ DragOverlay >
223- </ DragDropProvider >
224- </ Flex >
194+ { folder . tasks . map ( ( task ) => (
195+ < TaskItem
196+ key = { task . id }
197+ id = { task . id }
198+ label = { task . title }
199+ isActive = { sidebarData . activeTaskId === task . id }
200+ worktreeName = {
201+ workspaces [ task . id ] ?. worktreeName ?? undefined
202+ }
203+ worktreePath = {
204+ workspaces [ task . id ] ?. worktreePath ??
205+ workspaces [ task . id ] ?. folderPath
206+ }
207+ workspaceMode = { taskStates [ task . id ] ?. workspaceMode }
208+ lastActivityAt = { task . lastActivityAt }
209+ isGenerating = { task . isGenerating }
210+ isUnread = { task . isUnread }
211+ onClick = { ( ) => handleTaskClick ( task . id ) }
212+ onContextMenu = { ( e ) => handleTaskContextMenu ( task . id , e ) }
213+ />
214+ ) ) }
215+ </ SortableFolderSection >
216+ ) ;
217+ } ) }
218+ < DragOverlay >
219+ { ( source ) =>
220+ source ?. type === "folder" ? (
221+ < div className = "flex w-full items-center gap-1 rounded bg-gray-2 px-2 py-1 font-mono text-[12px] text-gray-11 shadow-lg" >
222+ < FolderIcon size = { 14 } weight = "regular" />
223+ < span className = "font-medium" > { source . data ?. label } </ span >
224+ </ div >
225+ ) : null
226+ }
227+ </ DragOverlay >
228+ </ DragDropProvider >
229+ </ Flex >
230+ </ Box >
231+ < SidebarFooter />
225232 </ Box >
226233 </ >
227234 ) ;
0 commit comments