UI: schmaleres Suchfeld, KI-Symbol aus Sidebar entfernt, Lösch-Button bei Benachrichtigungen, KI Sidebar per Drag verstellbar (handleSide=left)

This commit is contained in:
Agent Zero
2026-07-19 23:16:22 +02:00
parent caaf239aa9
commit d1a40c18e6
5 changed files with 31 additions and 15 deletions
@@ -141,6 +141,7 @@ export function AISidebar() {
initialWidth={320}
minWidth={240}
maxWidth={600}
handleSide="left"
className="hidden md:flex border-l border-secondary-200 bg-white"
data-testid="ai-sidebar-pane"
>
@@ -22,7 +22,6 @@ const navItems: NavItem[] = [
{ to: '/calendar', labelKey: 'nav.calendar', icon: navIcon('M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z') },
{ to: '/dms', labelKey: 'nav.files', icon: navIcon('M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z') },
{ to: '/mail', labelKey: 'nav.email', icon: navIcon('M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z') },
{ to: '/ai-assistant', labelKey: 'nav.aiAssistant', icon: navIcon('M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z') },
{ to: '/settings', labelKey: 'nav.settings', icon: navIcon('M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z') },
{ to: '/audit-log', labelKey: 'nav.auditLog', icon: navIcon('M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z') },
];
+17 -8
View File
@@ -108,15 +108,24 @@ export function TopBar() {
<h3 className="text-sm font-semibold text-secondary-900">{t('topbar.notifications')}</h3>
</div>
<ul className="max-h-64 overflow-y-auto py-1" role="list">
<li className="px-4 py-2 hover:bg-secondary-50 cursor-pointer text-sm text-secondary-700">
Neuer Kontakt hinzugefügt: Max Mustermann
</li>
<li className="px-4 py-2 hover:bg-secondary-50 cursor-pointer text-sm text-secondary-700">
Firma aktualisiert: TechCorp GmbH
</li>
<li className="px-4 py-2 hover:bg-secondary-50 cursor-pointer text-sm text-secondary-700">
Meeting um 14:00 Uhr mit Müller AG
{[
'Neuer Kontakt hinzugefügt: Max Mustermann',
'Firma aktualisiert: TechCorp GmbH',
'Meeting um 14:00 Uhr mit Müller AG',
].map((msg, i) => (
<li key={i} className="flex items-center justify-between px-4 py-2 hover:bg-secondary-50 cursor-pointer text-sm text-secondary-700 group">
<span className="flex-1 truncate">{msg}</span>
<button
className="ml-2 p-1 rounded text-secondary-300 hover:text-danger-600 hover:bg-danger-50 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"
aria-label="Benachrichtigung löschen"
onClick={(e) => { e.stopPropagation(); }}
>
<svg className="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</li>
))}
</ul>
</div>
)}
@@ -89,7 +89,7 @@ export function SearchDropdown({ placeholder }: SearchDropdownProps) {
onFocus={() => query && setOpen(true)}
onKeyDown={handleKeyDown}
placeholder={placeholder || t('topbar.search')}
className="w-64 pl-10 pr-3 py-2 text-sm rounded-md border border-secondary-300 focus:outline-none focus:ring-2 focus:ring-primary-500 min-h-touch"
className="w-52 pl-10 pr-3 py-1.5 text-sm rounded-md border border-secondary-300 focus:outline-none focus:ring-2 focus:ring-primary-500 min-h-touch"
aria-label={t('topbar.search')}
role="combobox"
aria-expanded={open}
+11 -4
View File
@@ -28,6 +28,8 @@ export interface ResizablePanelProps {
className?: string;
/** When false, panel becomes flex-1 with no drag handle */
resizable?: boolean;
/** Which side the drag handle is on ('right' default, 'left' for right-aligned panels) */
handleSide?: 'left' | 'right';
/** testid forwarded to the container div */
'data-testid'?: string;
}
@@ -39,6 +41,7 @@ export function ResizablePanel({
children,
className,
resizable = true,
handleSide = 'right',
...rest
}: ResizablePanelProps) {
const [width, setWidth] = useState(initialWidth);
@@ -69,7 +72,8 @@ export function ResizablePanel({
const handleMouseMove = (e: MouseEvent) => {
if (!isResizing.current) return;
const delta = e.clientX - startX.current;
const newWidth = Math.max(minWidth, Math.min(maxWidth, startWidth.current + delta));
const adjustedDelta = handleSide === 'left' ? -delta : delta;
const newWidth = Math.max(minWidth, Math.min(maxWidth, startWidth.current + adjustedDelta));
// Apply width directly to DOM — no React re-render during drag
if (panelRef.current) {
panelRef.current.style.width = `${newWidth}px`;
@@ -101,7 +105,7 @@ export function ResizablePanel({
document.removeEventListener('mousemove', handleMouseMove);
document.removeEventListener('mouseup', handleMouseUp);
};
}, [minWidth, maxWidth]);
}, [minWidth, maxWidth, handleSide]);
return (
<div
@@ -125,8 +129,11 @@ export function ResizablePanel({
</div>
{resizable && (
<div
className="absolute top-0 right-0 h-full w-1.5 cursor-col-resize bg-transparent hover:bg-primary-300 active:bg-primary-400 transition-colors z-50 pointer-events-auto"
style={{ marginRight: '-3px' }}
className={clsx(
'absolute top-0 h-full w-1.5 cursor-col-resize bg-transparent hover:bg-primary-300 active:bg-primary-400 transition-colors z-50 pointer-events-auto',
handleSide === 'left' ? 'left-0' : 'right-0',
)}
style={handleSide === 'left' ? { marginLeft: '-3px' } : { marginRight: '-3px' }}
onMouseDown={handleMouseDown}
data-testid="resize-handle"
role="separator"