Email Module
Section titled “Email Module”Status: In progress
Purpose
Section titled “Purpose”The Email module provides mailbox browsing, thread viewing, compose/reply/forward flows, bulk actions, and mailbox-linked operations (for example Teams meeting creation from an email context).
Entry Points
Section titled “Entry Points”- Module folder:
src/modules/Email - Module component:
src/modules/Email/module.tsx - Registry key:
emailinsrc/utils/moduleRegistry.ts - Route:
/app/email
Key Flows
Section titled “Key Flows”- Microsoft connection gate
- If Microsoft is not connected, module renders
MailEmptyStatewith re-auth action.
- Folder/mailbox initialization
- Uses
useEmailData()anduseEmailDefaults()to initialize mailbox/folder state.
- URL-driven selection state
useEmailUrlState()maintains folder/mail/thread query params (iid,mbid,cid,mid, etc.).
- Main split view
Sidebar+EmailMainViewrender list/thread/composer panes.EmailMainViewmanages compose state, selected thread, and bulk actions through dedicated hooks.
- Calendar meeting creation from email context
- Opens
CalendarEventModaland creates events viacreateCalendarEvent().
Important Components
Section titled “Important Components”EmailMainViewEmailComposerPaneEmailThreadPaneMailListRendererEmailPanePlaceholder
Important Hooks
Section titled “Important Hooks”useEmailUrlStateuseEmailQueriesuseEmailComposerStateuseBulkMailActionsuseMutedSenders
URL and State Notes
Section titled “URL and State Notes”Compose state is query-param-driven (compose, recipient, draft).
Folder changes should clear compose params and reset active thread view.
Risks and Regression Areas
Section titled “Risks and Regression Areas”- Query-param/state desync between list/thread/compose panes
- Cache invalidation correctness after reply/send/delete/bulk actions
- Mailbox switching behavior (state reset and title updates)
- Thread fallback behavior when mail detail and thread payload differ
Documentation TODO
Section titled “Documentation TODO”- Add request/response contracts for email service calls
- Add sequence diagram for compose and reply lifecycle
- Add test matrix for inbox tab (
focused/other) and mailbox changes