- Replace automation execute stub with run_automation() from execution_engine.py
- Replace agent execute stub with run_agent() from agent_runner.py
- Persist automation settings in system_settings.automation_config JSONB
- Add migration 0034 for automation_config column
- Settings are now saved and loaded from database instead of being ignored
- Replace 9 hardcoded MCP tools with single call_crm_api tool
- MCP clients now have full access to all 259 CRM API endpoints
- Same generic approach as AI Assistant: method + path + body
- Internal auth via X-Internal-Call headers with tenant/user context
- Create call_crm_api tool: single tool that can call ANY CRM API endpoint
- Inject OpenAPI spec into system prompt so AI knows all available endpoints
- Always include call_crm_api in agent tools (not just via tool_ids)
- Extend get_current_user to support internal header-based auth (X-Internal-Call,
X-Tenant-Id, X-User-Id) for AI tool API access
- No more manual tool-per-endpoint registration needed
- Add /communication route at top level (not inside /settings)
- Add CommunicationPage lazy import alongside other pages
- This ensures the page is properly code-split and loaded in production
- Create Communication.tsx page with tree structure (System, KI, Kollegen)
- Chat window with messages, reactions, attachments, mini-apps
- WebSocket real-time updates
- AI streaming integration for AI conversations
- Fix search.ts: map backend fields (entity_type/entity_id/title/snippet)
to frontend format (type/id/name/description/url)
- Fix hooks.ts: import SearchResult from search.ts instead of redefining
- Fix JSX syntax error in Communication.tsx title attribute
Standalone buttons:
- Add ExternalLink button to Dms, Calendar, Mail, ContactsList toolbars
- Create standalone pages for each (no sidebar, full screen)
- Add standalone routes outside ProtectedRoute
Window system for modals:
- AppointmentModal -> AppointmentEditForm + openWindow()
- ComposeModal -> MailComposeForm + openWindow()
- FilePreviewModal -> FilePreviewContent + openWindow()
- Calendar, Mail, Dms use openWindow() instead of modal state
- Add ExternalLink button to AI assistant toolbar
- New route /ai-assistant-standalone renders AIAssistantPage without sidebar
- Opens in new browser window via window.open
- Window manager store (Zustand) for managing open/minimized/fullscreen windows
- Window component with header controls: KI-Chat toggle, fullscreen, minimize, close
- AI chat panel with streaming chat via existing /ai/sessions API
- WindowContainer renders all non-minimized windows
- TopBar shows minimized windows as clickable pills
- ContactEditForm extracted from ContactEditModal for window rendering
- ContactsList and ContactDetailPage use openWindow() instead of modal state
- Draggable windows with z-index management
- New SettingsAI page with 3 tabs: KI Assistent, Proaktive KI, MCP
- Remove individual AI/proactive/mcp from settings nav
- Settings nav now 6 items: Stammdaten, Nutzerverwaltung, System, Mail, KI Einstellungen, Benachrichtigungen
TopBar:
- Add Automation and Agenten to user dropdown menu
Settings restructure:
- Stammdaten: Firmendaten, Adressen (CRUD), Konten (CRUD), Sonstige Daten
- Nutzerverwaltung: Benutzer, Rollen, Gruppen as tabs
- System: Menü, Theme, Plugins as tabs
- Reduce nav items from 15+ to 8
- Add end prop to all settings NavLinks
- Remove Einstellungen from E-Mail group (accessible via Settings page)
- Remove Automation and Agenten from sidebar (accessible via Topbar profile menu)
- Remove Settings from sidebar bottom items
Navigation:
- Remove Plugins header from sidebar
- Merge static items and plugin items into unified sorted list
- Group related menu items (Dateien, E-Mail, Kalender, Automation)
- German labels for all menu items
- Sort by order field, alphabetical fallback for ties
Drag-and-Drop Menu:
- New backend endpoints: GET/PUT /api/v1/users/me/menu-order
- Store menu order in user preferences JSONB field
- New SettingsMenuOrder page with @dnd-kit drag-and-drop
- New Settings tab: Menu ordering
- Sidebar reads saved menu order and sorts accordingly
- Reset to default option
- APIRouter had no prefix, so WebSocket was on /ws not /api/v1/ai-ui-control/ws
- This caused 403 on every WebSocket connection attempt
- Remove debug print statements
- 160 new tests across 22 test files (Tasks 7.1-7.5)
- 0 new TSC errors, 0 new test failures
- All settings, AI, calendar, DMS, and contact sub-component tests passing
- ContactDetail: display name, edit/delete buttons, persons, tags, loading/empty states
(stub-based due to OOM from lucide-react namespace import in source)
- ContactEditModal: modal open/close, type select, name input, submit/cancel, edit vs create
(stub-based due to OOM from lucide-react namespace import in source)
- ContactFolderTree: folder tree, all contacts, tags, click handlers, contact counts
All 27 contact sub-component tests passing.
- SettingsCurrencies: RHF+Zod (code required max 3, name required, symbol required max 5)
- SettingsTaxes: RHF+Zod (name required, rate numeric 0-100, country max 2)
- SettingsSequences: RHF+Zod (name required, padding numeric 1-10)
- SettingsUsers: RHF+Zod (name required, email valid, password min 8)
- SettingsRoles: RHF+Zod for create form (name required)
- SettingsGroups: RHF+Zod for create form (name required, description optional)
- Error display under each field
- Preserved all existing functionality: CRUD, permissions, members
- Added 2 validation tests for SettingsCurrencies
- Migrated AppointmentModal from useState to React Hook Form + Zod
- Zod schema: title (required), calendar_id (required), start_at/end_at (required, end > start)
- Object-level superRefine for date validation (end must be after start)
- Error display via Input error prop and summary error div
- Preserved all existing functionality: create, edit, delete, prefill
- Added 3 validation tests (empty title, end before start, valid submit)