diff --git a/src/App.jsx b/src/App.jsx index 6315a12..660f418 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -32,7 +32,6 @@ import { TaskMasterProvider } from './contexts/TaskMasterContext'; import { TasksSettingsProvider } from './contexts/TasksSettingsContext'; import { WebSocketProvider, useWebSocket } from './contexts/WebSocketContext'; import ProtectedRoute from './components/ProtectedRoute'; -import { useUiPreferences } from './hooks/useUiPreferences'; import { api, authenticatedFetch } from './utils/api'; import { I18nextProvider, useTranslation } from 'react-i18next'; import i18n from './i18n/config.js'; @@ -59,9 +58,6 @@ function AppContent() { const [isInputFocused, setIsInputFocused] = useState(false); const [showSettings, setShowSettings] = useState(false); const [settingsInitialTab, setSettingsInitialTab] = useState('agents'); - - const { preferences, setPreference } = useUiPreferences(); - const { sidebarVisible } = preferences; // Session Protection System: Track sessions with active conversations to prevent // automatic project updates from interrupting ongoing chats. When a user sends // a message, the session is marked as "active" and project updates are paused @@ -575,14 +571,6 @@ function AppContent() { setShowSettings(true); }, []); - const handleCollapseSidebar = useCallback(() => { - setPreference('sidebarVisible', false); - }, [setPreference]); - - const handleExpandSidebar = useCallback(() => { - setPreference('sidebarVisible', true); - }, [setPreference]); - const sidebarSharedProps = useMemo(() => ({ projects, selectedProject, @@ -597,9 +585,7 @@ function AppContent() { onRefresh: handleSidebarRefresh, onShowSettings: handleShowSettings, isPWA, - isMobile, - onToggleSidebar: handleCollapseSidebar, - onExpandSidebar: handleExpandSidebar + isMobile }), [ projects, selectedProject, @@ -614,9 +600,7 @@ function AppContent() { handleSidebarRefresh, handleShowSettings, isPWA, - isMobile, - handleCollapseSidebar, - handleExpandSidebar + isMobile ]); @@ -624,14 +608,9 @@ function AppContent() {
{/* Fixed Desktop Sidebar */} {!isMobile && ( -
+
)} @@ -663,7 +642,6 @@ function AppContent() { >
diff --git a/src/components/Sidebar.jsx b/src/components/Sidebar.jsx index 851d0a8..9b05452 100644 --- a/src/components/Sidebar.jsx +++ b/src/components/Sidebar.jsx @@ -15,6 +15,7 @@ import TaskIndicator from './TaskIndicator'; import ProjectCreationWizard from './ProjectCreationWizard'; import VersionUpgradeModal from './modals/VersionUpgradeModal'; import { useVersionCheck } from '../hooks/useVersionCheck'; +import { useUiPreferences } from '../hooks/useUiPreferences'; import { api } from '../utils/api'; import { useTaskMaster } from '../contexts/TaskMasterContext'; import { useTasksSettings } from '../contexts/TasksSettingsContext'; @@ -36,13 +37,13 @@ function Sidebar({ onRefresh, onShowSettings, isPWA, - isMobile, - onToggleSidebar, - isCollapsed = false, - onExpandSidebar + isMobile }) { const { t } = useTranslation(['sidebar', 'common']); const { updateAvailable, latestVersion, currentVersion, releaseInfo } = useVersionCheck('siteboon', 'claudecodeui'); + const { preferences, setPreference } = useUiPreferences(); + const { sidebarVisible } = preferences; + const isSidebarCollapsed = !isMobile && !sidebarVisible; const [expandedProjects, setExpandedProjects] = useState(new Set()); const [editingProject, setEditingProject] = useState(null); const [showNewProject, setShowNewProject] = useState(false); @@ -470,10 +471,18 @@ function Sidebar({ setCurrentProject(project); }; + const handleCollapseSidebar = () => { + setPreference('sidebarVisible', false); + }; + + const handleExpandSidebar = () => { + setPreference('sidebarVisible', true); + }; + const collapsedSidebar = (
)} - {onToggleSidebar && ( - - )} + + + {/* Mobile Header */}