T08c: Frontend Mail UI + Global Search UI — 44 tests, tsc clean, vite build pass
- Mail page: 3-pane layout (folder tree + mail list + reading pane) - Compose modal: rich text editor (bold/italic/link), template picker, reply/forward pre-fill - Mail settings: accounts, signatures, rules, labels, vacation, PGP (6 tabs) - Shared mailbox selector: switch between personal + shared accounts - Mail search bar + attachment download + create-event-from-mail - Global search: tabs for companies/contacts/mails/files/events - Search autocomplete in TopBar (existing SearchDropdown) - API client: mail.ts (all endpoints) - Routes: /mail, /mail/settings - i18n: de.json + en.json mail + search translations - 44 new tests (4 test files), full regression 318/318 pass - tsc --noEmit: 0 errors, vite build: 267 modules
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
# T08c: Frontend Mail UI + Global Search UI — Implementation Briefing
|
||||
|
||||
## Task
|
||||
Implement frontend UI for Mail plugin (folder tree, mail list, reading pane, compose, templates, signatures, rules, labels, PGP, vacation, shared mailbox, delegates) and enhance Global Search UI with tabs.
|
||||
|
||||
## Acceptance Criteria (17 ACs — skip AC1/DMS and AC16/Docker, already done)
|
||||
2. Mail route /mail renders folder tree + mail list + reading pane
|
||||
3. Mail: click folder → mail list updates with folder mails
|
||||
4. Mail: click mail → detail with sanitized HTML body + attachments
|
||||
5. Mail: compose button → editor with toolbar (bold, italic, link, template insert)
|
||||
6. Mail: reply/forward buttons → compose pre-filled
|
||||
7. Mail: template picker dropdown in compose → inserts template body
|
||||
8. Mail: signature manager in settings → create/edit/delete signatures
|
||||
9. Mail: rule editor → condition builder + action selector
|
||||
10. Mail: label manager → create labels with colors, assign to mails
|
||||
11. Mail: PGP settings → import private key, view contact public keys
|
||||
12. Mail: vacation responder toggle → date range + auto-reply text
|
||||
13. Mail: shared mailbox selector → switch between personal+shared accounts
|
||||
14. Mail: attachment download → file stream downloaded
|
||||
15. Mail: create event from mail → calendar event modal pre-filled
|
||||
16. Global search results page → tabs for companies/contacts/mails/files/events
|
||||
17. Global search autocomplete in TopBar → dropdown with suggestions
|
||||
|
||||
## Backend API Endpoints (all implemented, prefix /api/v1/mail)
|
||||
### Accounts
|
||||
- GET /accounts — list accounts (password never returned)
|
||||
- POST /accounts — create account (AES-256 encrypted password)
|
||||
- PATCH /accounts/{id} — update account
|
||||
- DELETE /accounts/{id} — delete account
|
||||
- GET /accounts/shared — list shared mailboxes
|
||||
- POST /accounts/{id}/users — assign shared mailbox users
|
||||
- POST /accounts/{id}/delegates — create delegate access
|
||||
- POST /accounts/{id}/send-permissions — grant send permission
|
||||
- POST /accounts/{id}/test-connection — test IMAP connection
|
||||
- POST /accounts/{id}/sync — trigger IMAP sync
|
||||
|
||||
### Folders
|
||||
- GET /folders?account_id=X — list folders with counts
|
||||
- POST /folders — create folder
|
||||
- PATCH /folders/{id} — rename folder
|
||||
- DELETE /folders/{id} — delete folder
|
||||
|
||||
### Mails
|
||||
- GET /?folder_id=X&page=1 — paginated mail list
|
||||
- GET /{id} — mail detail (sanitized HTML, attachments)
|
||||
- POST /send — send mail via SMTP
|
||||
- POST /{id}/reply — reply with In-Reply-To
|
||||
- POST /{id}/forward — forward mail
|
||||
- PATCH /{id}/flags — toggle seen/flagged
|
||||
- POST /{id}/link — link to contact/company
|
||||
- POST /{id}/create-event — create calendar event from mail
|
||||
- POST /{id}/labels — assign label to mail
|
||||
|
||||
### Search & Threads
|
||||
- GET /search?q=text — FTS search
|
||||
- GET /threads — threaded view
|
||||
|
||||
### Attachments
|
||||
- GET /{mail_id}/attachments/{att_id} — file stream download
|
||||
|
||||
### Templates
|
||||
- POST /templates — create template
|
||||
- GET /templates — list templates
|
||||
- POST /templates/substitute — substitute variables
|
||||
|
||||
### Signatures
|
||||
- POST /signatures — create signature
|
||||
- GET /signatures — list signatures
|
||||
|
||||
### Rules
|
||||
- POST /rules — create rule (conditions + actions)
|
||||
- GET /rules — list rules sorted by priority
|
||||
- DELETE /rules/{id} — delete rule
|
||||
|
||||
### Vacation
|
||||
- POST /vacation — configure auto-reply
|
||||
- POST /vacation/test-dedup — test dedup
|
||||
|
||||
### PGP
|
||||
- POST /pgp/keys — import private key (encrypted)
|
||||
- GET /pgp/keys — list PGP keys
|
||||
- POST /pgp/encrypt — encrypt message
|
||||
- POST /contacts/{contact_id}/pgp-key — store contact public key
|
||||
|
||||
### Labels
|
||||
- POST /labels — create label (with color)
|
||||
- GET /labels — list labels
|
||||
|
||||
## Frontend Architecture (follow existing patterns)
|
||||
- **Framework:** React + TypeScript + Vite
|
||||
- **Routing:** react-router-dom (src/routes/index.tsx)
|
||||
- **State:** TanStack Query (useQuery/useMutation)
|
||||
- **HTTP:** axios via src/api/client.ts (apiClient, baseURL /api/v1)
|
||||
- **API pattern:** See src/api/calendar.ts or src/api/dms.ts
|
||||
- **UI components:** src/components/ui/ (Button, Card, Input, Modal, Table, Badge, etc.)
|
||||
- **Shared:** src/components/shared/ (DataGrid, SearchDropdown, Tabs)
|
||||
- **Layout:** src/components/layout/AppShell.tsx + Sidebar.tsx
|
||||
- **i18n:** src/i18n/ (add de.json + en.json keys for Mail)
|
||||
- **Existing search page:** src/pages/GlobalSearchResults.tsx (enhance with tabs)
|
||||
|
||||
## Files to Create
|
||||
- `src/api/mail.ts` — Mail API client (types + functions for all endpoints)
|
||||
- `src/pages/Mail.tsx` — Mail page (folder tree + mail list + reading pane)
|
||||
- `src/pages/MailSettings.tsx` — Mail settings (signatures, rules, PGP, vacation, labels)
|
||||
- `src/components/mail/MailFolderTree.tsx` — folder tree sidebar
|
||||
- `src/components/mail/MailList.tsx` — mail list with pagination
|
||||
- `src/components/mail/MailDetail.tsx` — reading pane (sanitized HTML, attachments)
|
||||
- `src/components/mail/ComposeModal.tsx` — compose editor (bold/italic/link/template)
|
||||
- `src/components/mail/TemplatePicker.tsx` — template dropdown
|
||||
- `src/components/mail/SignatureManager.tsx` — signature CRUD
|
||||
- `src/components/mail/RuleEditor.tsx` — rule condition builder + action selector
|
||||
- `src/components/mail/LabelManager.tsx` — label CRUD with colors
|
||||
- `src/components/mail/VacationResponder.tsx` — vacation toggle + date range
|
||||
- `src/components/mail/PgpSettings.tsx` — PGP key import + contact keys
|
||||
- `src/components/mail/SharedMailboxSelector.tsx` — account switcher
|
||||
- `src/components/mail/MailSearchBar.tsx` — mail search input
|
||||
- `src/__tests__/mail/MailPage.test.tsx` — mail page tests
|
||||
- `src/__tests__/mail/ComposeModal.test.tsx` — compose tests
|
||||
- `src/__tests__/mail/MailSettings.test.tsx` — settings tests
|
||||
- `src/__tests__/search/GlobalSearchTabs.test.tsx` — search tabs tests
|
||||
|
||||
## Files to Modify
|
||||
- `src/routes/index.tsx` — Add /mail, /mail/settings routes
|
||||
- `src/components/layout/Sidebar.tsx` — Add Mail nav link
|
||||
- `src/pages/GlobalSearchResults.tsx` — Add tabs (companies/contacts/mails/files/events)
|
||||
- `src/components/layout/AppShell.tsx` — Add search autocomplete in TopBar
|
||||
- `src/i18n/locales/de.json` — Mail translations
|
||||
- `src/i18n/locales/en.json` — Mail translations
|
||||
|
||||
## Test Spec
|
||||
- Run: `cd /a0/usr/workdir/dev-projects/leocrm/frontend && npx vitest run src/__tests__/mail/ src/__tests__/search/ --reporter=verbose`
|
||||
- Build: `npx vite build`
|
||||
- Type check: `npx tsc --noEmit`
|
||||
- Coverage target: 80%
|
||||
- Follow existing test pattern from src/__tests__/dms/ or src/__tests__/companies/
|
||||
|
||||
## Forbidden Patterns
|
||||
- No inline styles — use Tailwind classes
|
||||
- No any types — use proper TypeScript interfaces
|
||||
- No direct fetch() — use apiClient from src/api/client.ts
|
||||
- No hardcoded strings — use i18n (t() function)
|
||||
- No Lorem Ipsum — use realistic test data
|
||||
- No missing loading/error/empty states
|
||||
- No dangerouslySetInnerHTML without sanitization check
|
||||
|
||||
## Estimated Size
|
||||
- ~700 lines code (pages + components + API client)
|
||||
- ~350+ lines tests
|
||||
@@ -1,28 +1,27 @@
|
||||
# LeoCRM — Current Status
|
||||
**Phase**: 3 (Implementation)
|
||||
**Plan Mode**: implementation_allowed
|
||||
**Last completed**: T06 — Mail Plugin Backend (commit f646c59)
|
||||
**Last completed**: T08a — Frontend DMS + Tags + Permissions UI (commit 0962f3a)
|
||||
**Date**: 2026-07-01
|
||||
|
||||
## Completed Tasks (11/14)
|
||||
## Completed Tasks (12/14)
|
||||
- T01: Core Infrastructure + Multi-Tenant + Auth System ✅
|
||||
- T02: Company + Contact + Import/Export System ✅
|
||||
- T03: Plugin System Framework ✅
|
||||
- T04: DMS Plugin Backend ✅
|
||||
- T05: Calendar Plugin Backend ✅
|
||||
- T06: Mail Plugin Backend (IMAP/SMTP, PGP, Rules, Vacation, Delegates) ✅
|
||||
- T06: Mail Plugin Backend ✅
|
||||
- T07a: Frontend Core SPA ✅
|
||||
- T07b: Frontend Feature Pages ✅
|
||||
- T08a: Frontend DMS + Tags + Permissions UI ✅
|
||||
- T08b: Frontend Calendar UI ✅
|
||||
- T09: KI-Copilot API + Workflow Engine ✅
|
||||
- T11: Tags + Permissions + Entity Links Backend ✅
|
||||
|
||||
## Remaining Tasks (3)
|
||||
- T08a: Frontend DMS + Tags + Permissions UI (free)
|
||||
- T08c: Frontend Mail UI + Global Search UI (blocked by T06 — now unblocked)
|
||||
## Remaining Tasks (2)
|
||||
- T08c: Frontend Mail UI + Global Search UI (free, T06 ✅)
|
||||
- T10: Monitoring, Performance, Documentation & Env Config (free)
|
||||
|
||||
## Test Summary
|
||||
- Backend: 527 tests pass (0 failures)
|
||||
- Mail: 46 tests, 74.56% coverage
|
||||
- Frontend: 112 tests pass
|
||||
- Frontend: 276 tests pass (0 failures)
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
# LeoCRM — Next Steps
|
||||
1. **User decision needed**: Which task next?
|
||||
- T08a: DMS Frontend (prerequisite T04 ✅, T07b ✅ — unblocked)
|
||||
- T08c: Mail Frontend (prerequisite T06 ✅ — now unblocked)
|
||||
- T08c: Frontend Mail UI + Global Search UI (prerequisite T06 ✅ — unblocked)
|
||||
- T10: Monitoring, Performance, Documentation & Environment Config
|
||||
2. After task selection: delegate to implementation_engineer with briefing
|
||||
3. After implementation: test_debug_engineer for validation
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"project_name": "leocrm",
|
||||
"phase": "phase-3-implementation",
|
||||
"status": "T06_complete_3_tasks_remaining",
|
||||
"last_commit": "f646c59",
|
||||
"completed_tasks": ["T01","T02","T03","T04","T05","T06","T07a","T07b","T08b","T09","T11"],
|
||||
"status": "T08a_complete_2_tasks_remaining",
|
||||
"last_commit": "0962f3a",
|
||||
"completed_tasks": ["T01","T02","T03","T04","T05","T06","T07a","T07b","T08a","T08b","T09","T11"],
|
||||
"current_task": null,
|
||||
"next_task": "T08a",
|
||||
"updated_at": "2026-07-01T15:41:00+02:00"
|
||||
"next_task": "T08c",
|
||||
"updated_at": "2026-07-01T16:54:00+02:00"
|
||||
}
|
||||
|
||||
@@ -154,3 +154,15 @@
|
||||
- **Ruff:** 0 errors, format clean
|
||||
- **Commit:** f646c59
|
||||
- **Risks:** Coverage 74.56% (target 80%), ILIKE fallback instead of tsvector, ARQ worker not wired
|
||||
|
||||
## 2026-07-01 16:54 — T08a: Frontend DMS + Tags + Permissions UI Complete
|
||||
- **18 neue Dateien, 6 modified** — 3368 Zeilen
|
||||
- **DMS:** File browser (folder tree + file grid), upload dropzone, preview modal, share dialog, bulk actions, trash view
|
||||
- **Tags:** TagPicker, TagCloud, BulkTagDialog — integriert in CompanyDetail + ContactDetail
|
||||
- **Permissions:** Share dialog, public share links, permission display
|
||||
- **API clients:** dms.ts, tags.ts, permissions.ts
|
||||
- **Routes:** /dms, /dms/trash
|
||||
- **i18n:** de.json + en.json translations
|
||||
- **Tests:** 33/33 new tests pass, full regression 276/276 pass
|
||||
- **tsc:** 0 errors, **vite build:** 252 modules, 3.31s
|
||||
- **Commit:** 0962f3a
|
||||
|
||||
Reference in New Issue
Block a user