Commit Graph

106 Commits

Author SHA1 Message Date
Agent Zero f287a0a4d1 fix: Context-Menu Konflikt mit draggable Ordner behoben 2026-07-20 02:29:40 +02:00
Agent Zero c3974c2ef9 fix: Neuer Chat Button erstellt Session, Ordner drag&drop im KI-Baum 2026-07-20 02:20:43 +02:00
Agent Zero 29202325a6 feat: Kontakt-Ordner mit Drag&Drop Baum (wie KI-Chat Sidebar)
- Backend: ContactFolder model (hierarchisch, parent_id, sort_order)
- Migration 0022: contact_folders Tabelle + folder_id FK auf contacts
- CRUD Routes: /api/v1/contact-folders (list, create, update, delete, reorder)
- Move Contact API: /api/v1/contact-folders/contacts/{id}/move
- folder_id Filter in contacts list API
- Frontend: ContactFolderTree mit Baum-Struktur, Drag&Drop, Kontext-Menü
- Kontakt-Personen-Icon statt Ordner-Symbol
- ContactList Items draggable (List/Table/Cards View)
- React Query Hooks für Folder CRUD + Move Contact
- Alle 266 Frontend-Tests passing
2026-07-20 01:33:44 +02:00
Agent Zero 4bc11efc25 UI: Suchfeld 10% niedriger, Kontakt-Baum mit Firmen/Privatpersonen Trennung, Toolbar vereinfacht (Sort+View Toggle) 2026-07-20 00:25:58 +02:00
Agent Zero beb4d7a9ff UI: Einstellungen+AuditLog aus Sidebar entfernt, AuditLog ins User-Menü, Suchfeld höher, Benachrichtigungs-Icon größer 2026-07-20 00:10:22 +02:00
Agent Zero 1d3b7a497b Fix: Suchfeld Höhe reduziert, Roboter-Symbol aus TopBar entfernt (nicht Sidebar!), Sidebar-Eintrag wiederhergestellt, Lösch-Buttons funktionsfähig mit State, Badge-Zahl dynamisch 2026-07-19 23:50:37 +02:00
Agent Zero d1a40c18e6 UI: schmaleres Suchfeld, KI-Symbol aus Sidebar entfernt, Lösch-Button bei Benachrichtigungen, KI Sidebar per Drag verstellbar (handleSide=left) 2026-07-19 23:16:22 +02:00
Agent Zero 3177daf47f Frontend: unified 3-column contacts page (folder tree | list/table/cards | detail), all Rentman fields, ContactPerson CRUD, removed old Contact/Company pages 2026-07-19 21:30:26 +02:00
Agent Zero 6f1655785e fix: resolve all 12 TypeScript errors (tsc --noEmit clean)
- mail.ts: add explicit types to decodeMimeHeader callback params
- SessionList.tsx: use React.MouseEvent instead of nativeEvent
- ComposeModal.tsx: construct name from first_name + last_name
- MailDetail.tsx: destructure onReply/onForward from props
- RichTextEditor.tsx: use SetContentOptions object instead of boolean
- MailSearchBar.tsx: add optional value prop to interface
- EmptyState.tsx: add optional children prop
- Badge.tsx: add secondary variant to BadgeVariant, variantClasses, dotColors
- ConfirmDialog.tsx: add optional children prop
- hooks.ts: extend SearchResult type to include mail/file/event
2026-07-19 17:41:39 +02:00
Agent Zero 27a8ad8b30 fix: resolve all 65 pre-existing frontend test failures (318/318 passing)
- Remove duplicate vi.mock(@/api/hooks) in SettingsRoles.test.tsx that overrode forceUpdate logic
- SettingsRoles mock: use vi.hoisted for shared forceUpdateRef between useRoles and useUpdateRole
- SettingsRoles mock: use plain async functions instead of vi.fn().mockImplementation for mutations
2026-07-19 14:41:38 +02:00
Agent Zero 5d9ddbebd2 fix: remove tenant switcher from TopBar, fix aiProactive API double-prefix
- Remove tenant switcher dropdown from TopBar (cleanup unused vars/imports)
- Fix aiProactive.ts: remove /api/v1 prefix from apiClient calls (baseURL already includes it)
- This fixes 404 errors on /api/v1/api/v1/ai-proactive/suggestions
2026-07-19 00:28:11 +02:00
Agent Zero ef6d011e16 ui: adjust toolbar heights and icon sizes, remove duplicate AI icon
- TopBar: h-16 → h-[58px] (10% lower), icons w-5 → w-4
- PluginToolbar: min-h-[36px] → min-h-[43px] (20% higher), icons w-3.5 → w-4
- Remove duplicate AI computer icon from TopBar (AISidebar collapsed icon remains)
- Clean up unused imports (toggleAISidebar, aiSidebarCollapsed)
2026-07-19 00:09:17 +02:00
Agent Zero 7e53b747c7 feat: add Proaktiv and KI Chat tabs to AI sidebar 2026-07-18 17:48:09 +02:00
Agent Zero 8cebb4f4e9 feat: unified_search + ai_proactive plugins with Ollama Cloud DeepSeek V4
- unified_search: Hybride Suche (PostgreSQL FTS + pgvector + RRF Fusion)
  - 5 Search Providers (Contact, Company, Mail, File, Event)
  - KI Query Understanding (Fuzzy, Facetten via LiteLLM)
  - DMS Text-Extraction (PDF, DOCX, XLSX, PPTX)
  - Embedding Pipeline (ollama/nomic-embed-text, 768 Dim)
  - Background Jobs für Indexierung
  - Plugin-basierte Provider Registry

- ai_proactive: Proaktiver KI-Agent
  - Context-Tracking (Frontend → Backend → Event Bus)
  - Proactive Engine mit LLM Suggestion-Generierung
  - SSE Real-time Push an Frontend
  - 6 AI Tools für Tool Registry
  - Rate-Limiting + User Settings
  - Deep Analysis Background Jobs

- Frontend Integration:
  - useAIContext Hook, SuggestionSidebar, SuggestionBadge
  - ProactiveAISettings Page, Search API Client
  - Globale Suche auf neue API umgestellt

- Tests: test_unified_search.py + test_ai_proactive.py (alle bestanden)
- Config: Ollama Cloud DeepSeek V4 als Default, konfigurierbar
- Dependencies: PyMuPDF, python-docx, python-pptx, pgvector
- Bugfixes: notification type_key length, migration IF NOT EXISTS
2026-07-18 11:21:51 +02:00
Agent Zero 4c9295de21 feat: AI sidebar mobile full-width overlay with back button
- Mobile: expanded sidebar is fixed inset-0 full-screen overlay with back button
- Mobile: collapsed icon strip hidden (no space on mobile)
- Desktop: unchanged resizable panel + collapsed icon strip
2026-07-18 01:51:01 +02:00
Agent Zero 88be33879c feat: AI sidebar full height with collapsed icon strip and drag resize
- AISidebar: full height, right of TopBar and Toolbar (all pages except AI Assistant)
- AISidebar: collapsed mode shows narrow 48px icon strip with KI button
- AISidebar: expanded mode uses ResizablePanel with drag-to-resize (240-600px)
- AppShell: moved AISidebar outside inner content container to full-height flex
- uiStore: renamed aiSidebarOpen→aiSidebarCollapsed (default: true=collapsed)
- TopBar: AI button highlights when sidebar is expanded
2026-07-18 00:53:00 +02:00
Agent Zero d029892d27 fix: tighter folder tree, smaller mail list font, smooth resize via DOM ref
- MailFolderTree: reduce padding/gap ~25% (py-2→py-1, gap-2→gap-1.5)
- MailList: text-sm→text-xs for from and subject lines
- ResizablePanel: use DOM ref for width during drag instead of React state
  - No re-renders during drag, only single setWidth on mouseup
  - panelRef on outer div, contentRef on inner div
  - pointer-events:none on content during drag
  - contain:strict on content area
2026-07-17 23:49:19 +02:00
Agent Zero db433e81f1 feat: mail UI improvements - folder mapping, display name, resize perf, list header
- Add configurable folder mapping (sent/drafts/spam/trash) per account
- Migration 0005_folder_mapping.sql with 4 new columns on mail_accounts
- Backend: send_mail uses account.sent_folder_imap_name if set
- Backend: _build_folder_hierarchy respects folder_mapping for is_standard
- Frontend: MailSettings shows folder mapping editor per account
- Frontend: MailSettings allows editing display_name for existing accounts
- Frontend: MailFolderTree shows display_name || email, removes MailIcon
- Frontend: ResizablePanel isDragging state with contain:strict + pointer-events:none
- Frontend: MailList merges select-all and sort controls into one line
2026-07-17 23:17:52 +02:00
Agent Zero 60081c5262 fix: add onDelete to TreeItem destructured props 2026-07-17 22:30:47 +02:00
Agent Zero 4f23c60fd4 feat: hover rename/delete icons in treeview, resizable tree and sidebar panels 2026-07-17 22:24:26 +02:00
Agent Zero 165350eda0 fix: user messages with primary-50 background and border for visual distinction 2026-07-17 21:05:47 +02:00
Agent Zero b137acb359 fix: custom markdown CSS styles for AI chat responses (tables, code, lists, headings) 2026-07-17 19:36:21 +02:00
Agent Zero 495d9c63ff fix: proper drag&drop with dataTransfer, context menu (rename/delete/new), bold active session 2026-07-17 17:59:18 +02:00
Agent Zero 5814b1691c fix: drag&drop events on folder headers with stopPropagation, separate root drop zone 2026-07-17 17:39:09 +02:00
Agent Zero ede37aced8 feat: remove header and buttons, move actions to toolbar, drag&drop to any folder level 2026-07-17 17:22:26 +02:00
Agent Zero f2d624720f feat: drag&drop treeview, flat chat UI, activity indicator, fixed toolbar registration 2026-07-17 17:09:26 +02:00
Agent Zero 70b8a66fd4 feat: attachment context for LLM, markdown rendering, mobile layout with back arrow 2026-07-17 13:45:21 +02:00
Agent Zero 202d80c750 feat: treeview with folders, toolbar, file attachments in chat 2026-07-17 09:21:40 +02:00
Agent Zero da8d0ce818 fix: add CSRF token to streaming fetch request 2026-07-17 01:43:52 +02:00
Agent Zero 2d5d0143e6 AI Assistant: frontend - chat app, sidebar, settings with 4 tabs 2026-07-17 00:52:17 +02:00
Agent Zero 2e5065c9d0 fix(mail): frontend filename decoding for attachments + backend robust decoding
- Frontend: decodeMimeHeader() on attachment filenames in MailDetail for display
- Backend: _decode_mime_filename() helper with Q-encoding fallback for edge cases
- Attachments now visible in mail detail UI (was 0 records, now 44+)
- Notifications table updated_at column added via migration 0020
2026-07-16 23:36:58 +02:00
Agent Zero 5b3e874cf2 fix(mail): account creation form - add username and is_shared fields
- Add username field to account creation form (defaults to email if empty)
- Add is_shared checkbox toggle for shared mailboxes
- Update CreateAccountPayload type with optional username and is_shared
- The infinite re-render fix (previous commit) resolves the main issue:
  accounts were not shown in settings because loadAccounts was looping,
  flooding the browser with requests and preventing API calls from completing
2026-07-16 22:41:44 +02:00
Agent Zero 68a9415e99 fix(mail): infinite re-render in MailSettings + error handling + sync result
- Fix infinite re-render: loadAccounts had selectedAccountId in deps causing
  repeated fetches every render; use functional setState and empty deps
- Fix all error handlers in MailSettings: err?.message || err?.detail instead of String(err)
- Fix sync result handling: backend returns {synced, error?} not {success, synced_count}
- This infinite re-render was flooding the browser with requests, causing
  Network Error for SignatureManager API calls
2026-07-16 22:20:41 +02:00
Agent Zero 214814785e fix(mail): signature manager error handling - prevent [object Object] display
- Fix error handling in SignatureManager load/save/delete to extract message from ApiError
- Same pattern as sync fix: err?.message || err?.detail instead of String(err)
2026-07-16 22:02:29 +02:00
Agent Zero 7cb1341a28 feat(mail): rich text editor for signatures + placeholder variables
- Replace textarea in SignatureManager with TipTap RichTextEditor
- Add placeholder variable buttons: {{user.name}}, {{user.first_name}},
  {{user.last_name}}, {{user.email}}, {{user.role}}, {{tenant.name}}, {{date}}
- Add replaceSignatureVariables() utility in mail API
- ComposeModal now replaces variables with actual user/tenant data when inserting signature
- Variables resolved from auth store (user name, email, role, tenant name)
2026-07-16 21:55:38 +02:00
Agent Zero 178bd84fd6 feat(mail): replace contentEditable with TipTap rich text editor
- Add RichTextEditor component with TipTap (ProseMirror-based) editor
- Full toolbar: bold, italic, underline, strikethrough, H1/H2/H3, bullet/numbered lists,
  blockquote, inline code, code block, text alignment (left/center/right/justify),
  text color picker, link insert/edit, image insert, clear formatting, undo/redo
- Replace old contentEditable div + document.execCommand in ComposeModal
- Add Placeholder extension for empty editor hint
- Add ProseMirror CSS styles (lists, blockquote, code, headings, links, images)
- Update signature/template insertion to work with new editor state
2026-07-16 17:14:14 +02:00
Agent Zero 2a80aeb0af fix(mail): sync Object error, MIME subject decoding, sticky compact pagination
- Fix sync error: backend returns {synced, error?} not {success, synced_count}; frontend now checks error field
- Decode MIME encoded-words (=?UTF-8?Q?...?=) in backend during IMAP sync for subject/from/to/cc headers
- Add frontend decodeMimeHeader() utility for already-stored encoded subjects (MailList + MailDetail)
- Make pagination sticky at bottom of mail list (flex-col h-full, ul scrolls, pagination flex-shrink-0)
- Make pagination compact: smaller padding (px-1.5 py-0.5), text-xs, smaller icons, tighter spacing
2026-07-16 09:40:59 +02:00
Agent Zero 560e4ac69d fix(mail): remove duplicate toolbar, fix iframe height, move attachments into scrollable body
- Remove duplicate action bar from MailDetail (actions are in global plugin toolbar)
- Change iframe sandbox from "" to "allow-same-origin" so height auto-resize works
- Move attachments inside the scrollable body container so they are visible
- Remove unused imports (clsx, Badge) and unused destructured props
2026-07-16 09:09:15 +02:00
Agent Zero bb6466b53d feat: phase 4 - frontend groups UI, permission-matrix, usePermission hook, field-level permissions tab, authStore permissions 2026-07-15 23:27:11 +02:00
Agent Zero b0e987f790 feat: notification preferences system with plugin registry
- Add NotificationType and NotificationPreference models
- Add get_notification_types() to BasePlugin for plugin registration
- Add sync_notification_types() to PluginRegistry
- Update create_notification() to check user preferences (returns Notification|None)
- Add API endpoints: GET /types, GET /preferences, PATCH /preferences/{type_key}
- Add NotificationPreferenceUpdate schema
- Mail plugin registers 10 notification types with metadata
- Add Alembic migration 0017 for new tables + seed data
- Frontend: SettingsNotifications page with toggle switches
- Frontend: Settings tab, route, hooks for notification preferences
- i18n: notification settings keys (de/en)
2026-07-15 21:00:32 +02:00
Agent Zero f1a12092a0 feat: mail phase 4 - IMAP folder create/delete + auto-sync
- Add imap_create_folder() and imap_delete_folder() service functions
- Call IMAP CREATE/DELETE in folder create/delete endpoints
- Add auto_sync_all_accounts() background task (every 5 min)
- Start auto-sync loop on plugin activation via asyncio.create_task
- Frontend: working sync button with isSyncing state and toast feedback
- i18n: syncSuccess, syncFailed, syncing, autoSyncEnabled keys (de/en)
2026-07-15 20:28:11 +02:00
Agent Zero 4e100e9d33 feat: mail phase 3 - sorting (date/from/subject, asc/desc)
- Add sort_by and sort_order query params to list_mails endpoint
- Add deleted_at IS NULL filter to exclude soft-deleted mails
- Frontend: sort state in Mail.tsx, sort header bar in MailList
- Sort dropdown (Datum/Absender/Betreff) + asc/desc toggle
- fetchMails API accepts optional sortBy/sortOrder params
- i18n: 6 new sort keys (de/en)
2026-07-15 20:17:27 +02:00
Agent Zero ed1eec87dc feat: mail phase 2 - delete, move, drafts
- Add deleted_at field to Mail/MailAccount/MailFolder models
- Add DELETE /{mail_id} endpoint (soft-delete + IMAP EXPUNGE)
- Add POST /{mail_id}/move endpoint (IMAP UID MOVE + folder_id update)
- Add POST /drafts and PUT /drafts/{id} endpoints (save/edit drafts)
- Add imap_delete_mail() and imap_move_mail() service functions
- Add save_draft() and update_draft() service functions
- Frontend: deleteMail, moveMail, saveDraft, updateDraft API functions
- ComposeModal: draft mode with Save Draft button
- MailDetail: delete/move buttons, edit-draft for drafts
- Mail.tsx: bulk delete/move, move dropdown, draft handlers
- i18n: 13 new keys (de/en)
2026-07-15 19:44:46 +02:00
Agent Zero df83cee10c feat: mail phase 1 - HTML iframe display, bulk read/unread, IMAP flag sync
- Fix FlagUpdatePayload field names to match backend schema (is_seen/is_flagged)
- Replace dangerouslySetInnerHTML with sandboxed iframe (srcDoc, sandbox="")
- Add bulk mark read/unread with checkbox selection in MailList
- Add floating bulk action bar in Mail.tsx
- Add imap_sync_mail_flags() to push Seen/Flagged flags to IMAP server
- Call IMAP flag sync in PATCH /flags endpoint
- Add i18n keys for bulk actions (de/en)
2026-07-15 19:26:37 +02:00
Agent Zero 2108bdb9c2 feat: mail attachment support — sync, display, download, upload 2026-07-15 18:43:38 +02:00
Agent Zero de74429f4e feat: mobile-responsive mail plugin UI 2026-07-15 17:53:56 +02:00
Agent Zero 57b6df5357 fix: IMAP hierarchical folder sync, deduplication, folder tree display, resizable panel 2026-07-15 15:59:04 +02:00
Agent Zero e0975f4044 fix: mail UI German labels, multi-folder sync, account management, resizable panel fix 2026-07-15 14:36:45 +02:00
Agent Zero 0409a08002 feat(mail): resizable columns, account in folder tree, mail settings in CRM settings
- Add ResizablePanel component (components/ui/ResizablePanel.tsx) with
  drag-to-resize via mouse events, no external dependencies
- Replace fixed-width columns in Mail.tsx with ResizablePanel for all
  three panes (folder tree, mail list, mail detail)
- Remove account-select toolbar item from Mail.tsx; account selection
  is now integrated into the folder tree
- Restructure MailFolderTree to show mail accounts as top-level nodes
  with folders nested underneath, built from flat list via parent_id
- Add expand/collapse chevrons for accounts and folders with children
- Load folders for ALL accounts (not just selected one) so multi-account
  tree works
- Derive selectedAccountId from selected folder instead of separate
  account selector
- Add Mail tab to CRM Settings page (Settings.tsx) with 📧 icon
- Add /settings/mail route pointing to MailSettingsPage
- Update settings link in mail toolbar to point to /settings/mail
- Update no-accounts empty state link to /settings/mail
2026-07-15 13:37:22 +02:00
Agent Zero 5693fe1c3a fix: stabilize store functions with selectors to prevent infinite loop
- Use usePluginToolbarStore((s) => s.registerItems) selector pattern
- Remove store functions from useEffect dependency array
- Store functions are stable references from zustand selectors
2026-07-15 13:10:27 +02:00