- 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)