-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Description
Why?
Problem:
- Current architecture has centralized "god object" controller managing multiple concerns, causing tight coupling, difficult testing, and scalability issues.
- Add new feature = touching existing code base
How?
Solution: Introduce Repository Pattern with clear separation between app-level state, feature-level state, and UI controllers.
- App-level state repositories (singleton): Own canonical state, expose streams
- EmailStateRepository
- MailboxStateRepository
- UserStateRepository
- ...
- Feature-level state: Manage feature-specific state
- ComposerStateRepository
- SearchStateRepository
- ...
- UI controllers: Handle UI events, subscribe to streams
- MailboxTreeController
- EmailListController
- ComposerController
- ...
- UI reactions
Impact
- Each repository owns one domain (mailbox, email, user)
- Only repository can mutate state
- Controllers subscribe only to what they need
- Controllers read-only via streams
- No controller knows about other controllers
Metadata
Metadata
Assignees
Labels
No labels