diff --git a/src/components/StatusBar.tsx b/src/components/StatusBar.tsx index ab867a7..2ac0958 100644 --- a/src/components/StatusBar.tsx +++ b/src/components/StatusBar.tsx @@ -3,15 +3,9 @@ import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { isProcessRunning, startGeminiNexus, closeGeminiNexus } from '@/actions/process'; import { Button } from '@/components/ui/button'; import { cn } from '@/lib/utils'; -import { Play, Square, Loader2, Power } from 'lucide-react'; +import { Play, Square, Loader2 } from 'lucide-react'; import { useTranslation } from 'react-i18next'; -import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; - -interface StatusBarProps { - isCollapsed?: boolean; -} - -export const StatusBar: React.FC = ({ isCollapsed = false }) => { +export const StatusBar: React.FC = () => { const { t } = useTranslation(); const queryClient = useQueryClient(); @@ -44,112 +38,48 @@ export const StatusBar: React.FC = ({ isCollapsed = false }) => }; const isPending = startMutation.isPending || stopMutation.isPending; - - // Collapsed View - if (isCollapsed) { - return ( -
- - - - - - -
- - {isLoading - ? t('status.checking') - : isRunning - ? t('status.running') - : t('status.stopped')} - - - - -
- ); - } - - // Expanded View return ( -
+ {isLoading ? ( + + ) : ( +
)} - > -
- {isLoading ? ( - - ) : ( -
+ - - Status - - - {isLoading - ? t('status.checking') - : isRunning - ? t('status.running') - : t('status.stopped')} - -
-
+ > + {isLoading ? '...' : isRunning ? 'Running' : 'Stopped'} +
); diff --git a/src/layouts/MainLayout.tsx b/src/layouts/MainLayout.tsx index b48f75b..b081005 100644 --- a/src/layouts/MainLayout.tsx +++ b/src/layouts/MainLayout.tsx @@ -1,19 +1,10 @@ -import React, { useState, useEffect, useRef } from 'react'; +import React, { useRef } from 'react'; import { Link, Outlet, useLocation } from '@tanstack/react-router'; import { cn } from '@/lib/utils'; import { StatusBar } from '@/components/StatusBar'; -import { - LayoutDashboard, - Settings, - Network, - ChevronLeft, - ChevronRight, - RefreshCw, - BarChart3, -} from 'lucide-react'; +import { LayoutDashboard, Settings, Network, RefreshCw, BarChart3 } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { Button } from '@/components/ui/button'; -import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; import { ErrorBoundary } from 'react-error-boundary'; import { useToast } from '@/components/ui/use-toast'; import { getLocalizedErrorMessage } from '@/utils/errorMessages'; @@ -25,17 +16,6 @@ export const MainLayout: React.FC = () => { const { toast } = useToast(); const hasShownRouteErrorToastRef = useRef(false); - // Initialize state from localStorage if available, default to false (expanded) - const [isCollapsed, setIsCollapsed] = useState(() => { - const saved = localStorage.getItem('sidebar-collapsed'); - return saved ? JSON.parse(saved) : false; - }); - - // Persist state changes - useEffect(() => { - localStorage.setItem('sidebar-collapsed', JSON.stringify(isCollapsed)); - }, [isCollapsed]); - const navItems = [ { to: '/', @@ -61,146 +41,77 @@ export const MainLayout: React.FC = () => { return (
-
- {/* Sidebar */} -
- - {/* Navigation */} - - - {/* Status bar */} -
- -
- - - {/* Content Area */} -
- { - hasShownRouteErrorToastRef.current = false; - }} - onError={(error) => { - if (hasShownRouteErrorToastRef.current) { - return; - } - - toast({ - title: t('error.generic'), - description: getLocalizedErrorMessage(error, t), - variant: 'destructive', - }); - hasShownRouteErrorToastRef.current = true; - }} - fallbackRender={({ resetErrorBoundary }) => ( -
-
-
{t('error.generic')}
-
{t('action.retry')}
- -
-
- )} - > - -
-
-
+ )} + > + + +
); }; diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 4a89da3..07b3769 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -9,7 +9,7 @@ import { useTranslation } from 'react-i18next'; function HomePage() { return ( -
+
);