{sortedProjects.map((project) => (
-
-
-
-
+ project={project}
+ isSelected={selectedProject?.id === project.id}
+ onSelect={onSelectProject}
+ />
))}
)}
diff --git a/src/components/SessionManagerProvider.tsx b/src/components/SessionManagerProvider.tsx
new file mode 100644
index 00000000..8c45c33f
--- /dev/null
+++ b/src/components/SessionManagerProvider.tsx
@@ -0,0 +1,37 @@
+import { ReactNode, useMemo, useEffect } from 'react';
+import { SessionManagerContext } from '@/contexts/SessionManagerContext';
+import { SessionManager } from '@/lib/SessionManager';
+import { useFS } from '@/hooks/useFS';
+import { useAISettings } from '@/hooks/useAISettings';
+
+interface SessionManagerProviderProps {
+ children: ReactNode;
+}
+
+/**
+ * Provider that creates and manages the global session manager instance
+ */
+export function SessionManagerProvider({ children }: SessionManagerProviderProps) {
+ const { fs } = useFS();
+ const { settings } = useAISettings();
+
+ const sessionManager = useMemo(() => {
+ return new SessionManager(fs, settings);
+ }, [fs, settings]);
+
+ // Cleanup on unmount
+ useEffect(() => {
+ return () => {
+ // Fire and forget cleanup - we don't need to await in useEffect cleanup
+ sessionManager.cleanup().catch(error => {
+ console.warn('Failed to cleanup session manager:', error);
+ });
+ };
+ }, [sessionManager]);
+
+ return (
+