- When user switches folders quickly, multiple fetchMails requests are in flight
- Responses arrive out of order, last response wins regardless of which folder it was for
- Now loadMails checks selectedFolderIdRef before applying results
- Only updates mails state if the response is for the currently selected folder
- When user switches folders quickly, syncFolder(A) callback fires after user already selected B
- loadMails() was called with stale selectedFolderId, loading wrong mails
- Add useRef to track current folder ID, only reload if still on same folder
- Also fix backend: message_id dedup now only within same folder (not cross-folder)
- imap_sync_folder now searches only UID > max_known_uid instead of ALL
- First sync gets last 50, subsequent syncs only get new mails
- UI loads cached mails immediately from DB, sync runs in background
- Folder counts updated after sync
- New imap_sync_folder function: syncs single folder quickly for live use
- New POST /mail/folders/{folder_id}/sync route
- Frontend: syncFolder API + called on every folder selection
- Auto-sync interval reduced from 300s to 60s
- Sent mail IMAP APPEND already uploads full body via msg.as_bytes()
- Mail list: title and subject font text-xs -> text-sm
- Remove Termin (create-event) toolbar button
- Rename Flagge -> Markierung with select dropdown (star, flag, bookmark, important, question)
- Backend: add flag_type column to Mail model + migration 0006
- Backend: flag_type in MailFlagsUpdate schema, update_flags route, mail_to_response
- Frontend: flag_type in Mail interface, FlagUpdatePayload, MailList symbol display
- MailFolderTree: compact styling matching AI assistant SessionList (py-1, text-sm, depth*12+8 padding, no space-y)
- Added right-click context menu on folders with "Ordner leeren" entry
- Backend: POST /mail/folders/{folder_id}/empty soft-deletes all mails in folder
- Frontend API: emptyFolder() function added to mail.ts
- Mail.tsx: onFolderEmptied callback reloads mails and folders
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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)
- 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)
- 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
- 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