GREEN phase of TDD for Task 2:
- Implement addMessageFromWebSocket with full logic:
* getChannelKey helper for session vs global channel keys
* Channel initialization on first message
* Message deduplication by msg_id using Array.some()
* Sort messages by createdAt after insertion
* Unread increment: only if window closed OR viewing different channel
- Implement setActiveChannel: sets activeChannel + channelType
- Implement openChatWindow: sets isWindowOpen, resets unread count, updates lastReadAt
- Implement closeChatWindow: sets isWindowOpen false only
- Export all 4 action creators
All 28 tests pass. Message deduplication validated.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>