fix(frontend): Anwendungen-Gruppe bei Start eingeklappt, Dashboard-Klick resettet auf Home-Tab

- AppLayout: appsOpen initial false (Anwendungen immer eingeklappt beim Laden)
- DashboardPage: useLocation + useEffect auf location.key → setzt activeTab
  auf 'home' bei jedem Navigations-Klick auf Dashboard in der Sidebar

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Reitz 2026-03-13 13:51:04 +01:00
parent 5f50ba1315
commit d9c6240a3e
2 changed files with 9 additions and 2 deletions

View file

@ -125,7 +125,7 @@ export function AppLayout() {
isModuleEnabled('deals') ||
isModuleEnabled('pipelines');
const [crmOpen, setCrmOpen] = useState(true);
const [appsOpen, setAppsOpen] = useState(true);
const [appsOpen, setAppsOpen] = useState(false);
const [collapsed, setCollapsed] = useState(() => {
return localStorage.getItem('sidebar-collapsed') === 'true';
});

View file

@ -1,4 +1,5 @@
import { useState } from 'react';
import { useState, useEffect } from 'react';
import { useLocation } from 'react-router-dom';
import { useAuth } from '../auth/AuthContext';
import { WeatherWidget } from '../components/WeatherWidget';
import { AnalogClock } from '../components/AnalogClock';
@ -698,8 +699,14 @@ function ComingSoonTab({ label }: { label: string }) {
export function DashboardPage() {
const { user } = useAuth();
const location = useLocation();
const [activeTab, setActiveTab] = useState<DashboardTab>('home');
// Immer auf Home-Tab springen wenn Dashboard-NavLink geklickt wird
useEffect(() => {
setActiveTab('home');
}, [location.key]);
return (
<div>
{/* Tab-Leiste */}