219 files, 2.0 MB, untracked in souveraine/docs and existing nowhere else. The volume is at 100% with no snapshots.
3.7 KiB
3.7 KiB
| task_id | title | status | assignee | priority | phase |
|---|---|---|---|---|---|
| ui-chat-code-001 | Differentiate Chat and Code Screens | pending | medium | 3.0 |
Task: Differentiate Chat and Code Screens
Objective
The "Chat" and "Code" menu items currently route to the same screen (Screen::Chat for both, at src/ui/app.rs:693). They should be distinct: the Code screen is for agent-assisted coding sessions where diff output, file content, and compiler errors take priority over conversational prose.
Current State
At src/ui/app.rs:684-708, the menu selection handler routes both menu items 1 (Chat) and 2 (Code) to the same path:
1 | 2 => {
if self.chat.is_none() {
match ChatState::connect(...)
}
self.current_screen = Screen::Chat;
}
Both screens share Screen::Chat entirely — same header, same message rendering, same input area, same cockpit.
Target State
A distinct Screen::Code that optimizes for the coding workflow:
- Layout priority: Code output and tool results take precedence over chat bubbles. The message list should be more compact — no markdown-rendered bubbles for tool outputs, raw text preferred.
- Tool result visibility:
BackendEvent::ToolResultcontent renders inline instead of collapsed inside a tool card. The "you said / agent said" bubble pattern is secondary; what matters is what files were changed, what errors occurred, what diffs were applied. - Input area: Same as chat, but with a code-oriented prompt prefix (e.g.
≡ code ›instead of›). Tab-completion could prefer code commands (/diff,/files,/compile). - Potential: Future phases could add a
souveraine codesubcommand that spawns the TUI directly into Code mode, and a Code screen could wire insouve difffor inline diff rendering.
Key Questions (Investigate Before Building)
- Does Code need its own
ChatStateor can it share one? They use the same Backend, same conversation, same agent. The difference is purely in how the message history is rendered — not what's in it. A rendering flag (render_mode: ChatMode::Conversation | ChatMode::Code) on ChatState would be simpler than a parallel state struct. - How should tool results render in Code mode? Current bubble rendering wraps tool results in markdown + truncated preview + "... (N more lines)". In Code mode: full raw output, monospace, no truncation, maybe line-numbered.
- Should Code mode auto-expand all tool cards? Or skip the card concept entirely and render tool calls as raw
→ bashheader lines with full output below? - Should there be a
/codetoggle command to switch modes mid-session? Allows starting in Chat, entering a coding sub-session, then returning.
Implementation Sketch
- Add
Screen::Codevariant tosrc/ui/app.rs - Add
render_mode: ChatModefield toChatState(defaultConversation) - In
chat.rsrendering, branch onrender_mode:Conversation: current behavior (bubbles, collapsed tool cards, markdown)Code: raw tool results, monospace, full output, no bubble wrapping for tool content
- Wire
Screen::Codeinapp.rsto passChatMode::Codewhen connecting - Add
/codeslash command to toggle between modes
Files to Modify
| File | Change |
|---|---|
src/ui/app.rs |
Add Screen::Code handler, pass mode flag to ChatState |
src/ui/chat.rs |
Add ChatMode enum and rendering branches |
src/ui/chat.rs — bubble/tool_card functions |
Add code-mode variants that skip bubble wrapping |
Not in Scope
- Diff visualization (inline +/— syntax highlighting in TUI)
- Compilation error parsing and highlighting
- Git integration in Code mode
- Separate Code-mode conversation history