File tree Expand file tree Collapse file tree
apps/code/src/renderer/features Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ interface CommandCenterStoreActions {
2929 setLayout : ( preset : LayoutPreset ) => void ;
3030 assignTask : ( cellIndex : number , taskId : string ) => void ;
3131 removeTask : ( cellIndex : number ) => void ;
32+ removeTaskById : ( taskId : string ) => void ;
3233 clearAll : ( ) => void ;
3334 setZoom : ( zoom : number ) => void ;
3435 zoomIn : ( ) => void ;
@@ -86,6 +87,15 @@ export const useCommandCenterStore = create<CommandCenterStore>()(
8687 return { cells } ;
8788 } ) ,
8889
90+ removeTaskById : ( taskId ) =>
91+ set ( ( state ) => {
92+ const index = state . cells . indexOf ( taskId ) ;
93+ if ( index === - 1 ) return state ;
94+ const cells = [ ...state . cells ] ;
95+ cells [ index ] = null ;
96+ return { cells } ;
97+ } ) ,
98+
8999 clearAll : ( ) =>
90100 set ( ( state ) => ( {
91101 cells : state . cells . map ( ( ) => null ) ,
Original file line number Diff line number Diff line change 1+ import { useCommandCenterStore } from "@features/command-center/stores/commandCenterStore" ;
12import { getSessionService } from "@features/sessions/service/service" ;
23import { pinnedTasksApi } from "@features/sidebar/hooks/usePinnedTasks" ;
34import { useTerminalStore } from "@features/terminal/stores/terminalStore" ;
@@ -33,6 +34,7 @@ export function useArchiveTask() {
3334
3435 pinnedTasksApi . unpin ( taskId ) ;
3536 useTerminalStore . getState ( ) . clearTerminalStatesForTask ( taskId ) ;
37+ useCommandCenterStore . getState ( ) . removeTaskById ( taskId ) ;
3638
3739 queryClient . setQueryData < string [ ] > (
3840 trpc . archive . archivedTaskIds . queryKey ( ) ,
You can’t perform that action at this time.
0 commit comments