Expand description
UI widgets for the TUI
This module provides the core UI widgets used in the RiceCoder TUI, including:
ChatWidget: Displays conversation messages with markdown rendering and streaming supportMessage: Represents a single message in the chatStreamingMessage: Manages real-time token streaming for AI responsesMessageAuthor: Identifies the sender of a message (user or AI)
§Examples
Creating and displaying a chat message:
ⓘ
use ricecoder_tui::{Message, MessageAuthor};
let message = Message {
content: "Hello, how can I help?".to_string(),
author: MessageAuthor::AI,
streaming: false,
};Streaming a response token by token:
ⓘ
use ricecoder_tui::StreamingMessage;
let mut streaming = StreamingMessage::new();
streaming.append("Hello");
streaming.append(" ");
streaming.append("world");
assert_eq!(streaming.content, "Hello world");Structs§
- Chat
Widget - Chat widget for displaying conversations
- Dialog
Widget - Dialog widget for user interactions
- List
Widget - List widget for displaying items
- Menu
Widget - Menu widget for navigation
- Message
- Message in the chat
- Prompt
Widget - Prompt widget for displaying the command prompt
- Streaming
Message - Streaming message state
Enums§
- Message
Action - Message action
- Message
Author - Message author