feat(ui): move back arrow from topbar to sidebar header on all pages

This commit is contained in:
Agent Zero
2026-08-17 12:24:04 +02:00
parent aa20aba2e7
commit c3cc19da10
7 changed files with 71 additions and 24 deletions
+12 -3
View File
@@ -1,9 +1,9 @@
import React, { useState, useEffect, useMemo } from 'react';
import clsx from 'clsx';
import { NavLink, useLocation } from 'react-router-dom';
import { NavLink, useLocation, useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { useUIStore } from '@/store/uiStore';
import { ChevronRight, FileText, Home, Settings, Users } from 'lucide-react';
import { ChevronRight, FileText, Home, Settings, Users, ArrowLeft } from 'lucide-react';
import { usePluginStore } from '@/store/pluginStore';
// Curated icon map — avoids `import * as LucideIcons` which loads ALL icons and causes OOM in tests
import {
@@ -58,6 +58,7 @@ const singleItems: NavSingleItem[] = [
const bottomItems: NavSingleItem[] = [];
export function Sidebar() {
const navigate = useNavigate();
const { t } = useTranslation();
const { sidebarOpen, setSidebarOpen } = useUIStore();
const location = useLocation();
@@ -178,7 +179,15 @@ export function Sidebar() {
aria-label="Seitenleiste Navigation"
data-testid="sidebar"
>
<div className="h-[58px] flex items-center px-4 border-b border-secondary-700">
<div className="h-[58px] flex items-center gap-2 px-4 border-b border-secondary-700">
<button
onClick={() => navigate('/start')}
className="p-1.5 rounded-md text-secondary-400 hover:bg-secondary-700 hover:text-white flex items-center justify-center focus:outline-none"
aria-label="Zurück zur Startseite"
title="Zurück zur Startseite"
>
<ArrowLeft className="w-4 h-4" />
</button>
<span className="text-xl font-bold text-white">leocrm</span>
</div>
<nav className="flex-1 overflow-y-auto py-4" aria-label="Hauptnavigation">
+1 -11
View File
@@ -8,7 +8,7 @@ import { useLogout } from '@/api/hooks';
import { Avatar } from '@/components/ui/Avatar';
import { SearchDropdown } from '@/components/shared/SearchDropdown';
import { SuggestionBadge } from '@/components/ai/SuggestionBadge';
import { Building, ChevronDown, Menu, Zap, Bot, Layers, Code, Search, ArrowLeft } from 'lucide-react';
import { Building, ChevronDown, Menu, Zap, Bot, Layers, Code, Search } from 'lucide-react';
import { NotificationBell } from '@/components/layout/NotificationBell';
import { WorkspaceSwitcher } from '@/components/layout/WorkspaceSwitcher';
import { useWindowStore } from '@/store/windowStore';
@@ -69,16 +69,6 @@ export function TopBar() {
<Menu className="w-4 h-4" aria-hidden="true" strokeWidth={2} />
</button>
{/* Back to start arrow */}
<button
onClick={() => navigate('/start')}
className="p-2 rounded-md text-secondary-500 hover:bg-secondary-100 hover:text-secondary-700 min-h-touch min-w-touch flex items-center justify-center focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"
aria-label="Zurück zur Startseite"
title="Zurück zur Startseite"
>
<ArrowLeft className="w-4 h-4" aria-hidden="true" strokeWidth={2} />
</button>
{/* Tenant switcher */}
{tenants && tenants.length > 0 && (
<div className="relative">