The Chat UI is built around two distinct, non-overlapping views: the Thread List View and the Chat View.
- Thread List View: Used for navigating between different conversations. It displays a paginated list of threads. Navigation is handled via
j/k or arrow keys, with Enter to select a thread. - Chat View: Used for reading and sending messages within a specific thread. It features a message list, an input box for messages/commands, and a status bar. Navigation uses
j/k for scrolling and Esc to return to the thread list.
Transitions between these views are complete replacements: entering a chat clears the thread list and loads messages, while exiting a chat clears the chat view and resets the state to show the thread list again.
/* View Hierarchy Concept */
// THREAD LIST VIEW
┌─────────────────────────────────────┐
│ Status Bar (current view, username) │
├─────────────────────────────────────┤
│ THREAD LIST VIEW │
│ ┌─────────────────────────────────┐ │
│ │ Thread 1 [selected] │ │
│ │ Thread 2 │ │
│ └─────────────────────────────────┘ │
├─────────────────────────────────────┤
│ Help: j/k navigate, Enter select │
└─────────────────────────────────────┘
// CHAT VIEW
┌─────────────────────────────────────┐
│ Status Bar (chat view, thread name) │
├─────────────────────────────────────┤
│ CHAT VIEW │
│ ┌─────────────────────────────────┐ │
│ │ [Message 1] │ │
│ │ [Message 2] │ │
│ └─────────────────────────────────┘ │
│ ┌─────────────────────────────────┐ │
│ │ Message: [input field] │ │
│ └─────────────────────────────────┘ │
├─────────────────────────────────────┤
│ Help: Esc back, j/k scroll │
└─────────────────────────────────────┘