Module widgets

Module widgets 

Source
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 support
  • Message: Represents a single message in the chat
  • StreamingMessage: Manages real-time token streaming for AI responses
  • MessageAuthor: 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§

ChatWidget
Chat widget for displaying conversations
DialogWidget
Dialog widget for user interactions
ListWidget
List widget for displaying items
MenuWidget
Menu widget for navigation
Message
Message in the chat
PromptWidget
Prompt widget for displaying the command prompt
StreamingMessage
Streaming message state

Enums§

MessageAction
Message action
MessageAuthor
Message author