Skip to main content

vtcode_core/ui/
mod.rs

1//! User interface utilities and shared UI components
2//!
3//! This module contains shared UI functionality including loading indicators,
4//! markdown rendering, and terminal utilities.
5
6/// Unified diff rendering with ANSI styling and bounded excerpts.
7pub mod diff_renderer;
8/// Git color configuration parsing.
9pub mod git_config;
10/// Markdown-to-ANSI rendering for chat output.
11pub mod markdown;
12/// Fuzzy search utilities.
13pub mod search;
14/// Slash command discovery and suggestion.
15pub mod slash;
16/// Styled text helpers.
17pub mod styled;
18/// Syntax highlighting integration.
19pub mod syntax_highlight;
20/// Terminal capability detection.
21pub mod terminal;
22/// Built-in theme definitions and active style accessors.
23pub mod theme;
24/// Theme configuration file parsing (`.vtcode/theme.toml`).
25pub mod theme_config;
26/// Theme manager for loading and applying custom themes.
27#[cfg(feature = "tui")]
28pub mod theme_manager;
29/// TUI module re-exports.
30pub mod tui;
31/// Compatibility layer between core config types and TUI types.
32pub mod tui_compat;
33/// Global TUI mode flag.
34pub mod tui_mode;
35/// User confirmation dialogs.
36pub mod user_confirmation;
37
38pub use git_config::GitColorConfig;
39pub use markdown::*;
40pub use search::*;
41pub use slash::*;
42pub use styled::*;
43pub use terminal::*;
44pub use theme::*;
45pub use theme_config::ThemeConfig;
46#[cfg(feature = "tui")]
47pub use theme_manager::ThemeManager;
48pub use tui::*;
49pub use tui_compat::*;
50pub use tui_mode::*;
51#[cfg(feature = "tui")]
52pub use vtcode_ui::tui::ui::FileColorizer;
53
54#[cfg(test)]
55mod tests {
56    use super::*;
57
58    #[test]
59    fn test_render_markdown() {
60        let markdown_text = r#"
61# Welcome to VT Code
62
63This is a **bold** statement and this is *italic*.
64
65## Features
66
67- Advanced code analysis
68- Multi-language support
69- Real-time collaboration
70"#;
71
72        // This should not panic
73        render_markdown(markdown_text);
74    }
75}