Feat: add hidden mode and new documentation

This commit is contained in:
2026-02-26 12:31:56 +01:00
parent e1cf57918e
commit 70032acc75
95 changed files with 1055 additions and 286 deletions

View File

@@ -31,12 +31,14 @@ pub mod transform;
use ratatui::style::Color;
use std::cell::RefCell;
/// Entry in the theme registry: id, display label, and palette constructor.
pub struct ThemeEntry {
pub id: &'static str,
pub label: &'static str,
pub palette: fn() -> palette::Palette,
}
/// All available themes.
pub const THEMES: &[ThemeEntry] = &[
ThemeEntry { id: "CatppuccinMocha", label: "Catppuccin Mocha", palette: catppuccin_mocha::palette },
ThemeEntry { id: "CatppuccinLatte", label: "Catppuccin Latte", palette: catppuccin_latte::palette },
@@ -67,14 +69,17 @@ thread_local! {
static CURRENT_THEME: RefCell<ThemeColors> = RefCell::new(build::build(&(THEMES[0].palette)()));
}
/// Return the current thread-local theme.
pub fn get() -> ThemeColors {
CURRENT_THEME.with(|t| t.borrow().clone())
}
/// Set the current thread-local theme.
pub fn set(theme: ThemeColors) {
CURRENT_THEME.with(|t| *t.borrow_mut() = theme);
}
/// Complete set of resolved colors for all UI components.
#[derive(Clone)]
pub struct ThemeColors {
pub ui: UiColors,
@@ -105,6 +110,7 @@ pub struct ThemeColors {
pub confirm: ConfirmColors,
}
/// Core UI colors: background, text, borders.
#[derive(Clone)]
pub struct UiColors {
pub bg: Color,
@@ -119,6 +125,7 @@ pub struct UiColors {
pub surface: Color,
}
/// Playback status bar colors.
#[derive(Clone)]
pub struct StatusColors {
pub playing_bg: Color,
@@ -130,6 +137,7 @@ pub struct StatusColors {
pub fill_bg: Color,
}
/// Step grid selection and cursor colors.
#[derive(Clone)]
pub struct SelectionColors {
pub cursor_bg: Color,
@@ -143,6 +151,7 @@ pub struct SelectionColors {
pub in_range: Color,
}
/// Step tile colors for various states.
#[derive(Clone)]
pub struct TileColors {
pub playing_active_bg: Color,
@@ -160,6 +169,7 @@ pub struct TileColors {
pub link_dim: [(u8, u8, u8); 5],
}
/// Top header bar segment colors.
#[derive(Clone)]
pub struct HeaderColors {
pub tempo_bg: Color,
@@ -172,6 +182,7 @@ pub struct HeaderColors {
pub stats_fg: Color,
}
/// Modal dialog border colors.
#[derive(Clone)]
pub struct ModalColors {
pub border: Color,
@@ -185,6 +196,7 @@ pub struct ModalColors {
pub preview: Color,
}
/// Flash notification colors.
#[derive(Clone)]
pub struct FlashColors {
pub error_bg: Color,
@@ -195,6 +207,7 @@ pub struct FlashColors {
pub info_fg: Color,
}
/// Pattern list row state colors.
#[derive(Clone)]
pub struct ListColors {
pub playing_bg: Color,
@@ -213,6 +226,7 @@ pub struct ListColors {
pub soloed_fg: Color,
}
/// Ableton Link status indicator colors.
#[derive(Clone)]
pub struct LinkStatusColors {
pub disabled: Color,
@@ -220,6 +234,7 @@ pub struct LinkStatusColors {
pub listening: Color,
}
/// Syntax highlighting (fg, bg) pairs per token category.
#[derive(Clone)]
pub struct SyntaxColors {
pub gap_bg: Color,
@@ -244,30 +259,35 @@ pub struct SyntaxColors {
pub default: (Color, Color),
}
/// Alternating table row colors.
#[derive(Clone)]
pub struct TableColors {
pub row_even: Color,
pub row_odd: Color,
}
/// Value display colors.
#[derive(Clone)]
pub struct ValuesColors {
pub tempo: Color,
pub value: Color,
}
/// Keyboard hint key/text colors.
#[derive(Clone)]
pub struct HintColors {
pub key: Color,
pub text: Color,
}
/// View badge pill colors.
#[derive(Clone)]
pub struct ViewBadgeColors {
pub bg: Color,
pub fg: Color,
}
/// Navigation minimap tile colors.
#[derive(Clone)]
pub struct NavColors {
pub selected_bg: Color,
@@ -276,6 +296,7 @@ pub struct NavColors {
pub unselected_fg: Color,
}
/// Script editor colors.
#[derive(Clone)]
pub struct EditorWidgetColors {
pub cursor_bg: Color,
@@ -287,6 +308,7 @@ pub struct EditorWidgetColors {
pub completion_example: Color,
}
/// File and sample browser colors.
#[derive(Clone)]
pub struct BrowserColors {
pub directory: Color,
@@ -301,6 +323,7 @@ pub struct BrowserColors {
pub empty_text: Color,
}
/// Text input field colors.
#[derive(Clone)]
pub struct InputColors {
pub text: Color,
@@ -308,6 +331,7 @@ pub struct InputColors {
pub hint: Color,
}
/// Search bar and match highlight colors.
#[derive(Clone)]
pub struct SearchColors {
pub active: Color,
@@ -316,6 +340,7 @@ pub struct SearchColors {
pub match_fg: Color,
}
/// Markdown renderer colors.
#[derive(Clone)]
pub struct MarkdownColors {
pub h1: Color,
@@ -330,6 +355,7 @@ pub struct MarkdownColors {
pub list: Color,
}
/// Engine view panel colors.
#[derive(Clone)]
pub struct EngineColors {
pub header: Color,
@@ -352,6 +378,7 @@ pub struct EngineColors {
pub hint_inactive: Color,
}
/// Dictionary view colors.
#[derive(Clone)]
pub struct DictColors {
pub word_name: Color,
@@ -369,6 +396,7 @@ pub struct DictColors {
pub header_desc: Color,
}
/// Title screen colors.
#[derive(Clone)]
pub struct TitleColors {
pub big_title: Color,
@@ -379,6 +407,7 @@ pub struct TitleColors {
pub subtitle: Color,
}
/// VU meter and spectrum level colors.
#[derive(Clone)]
pub struct MeterColors {
pub low: Color,
@@ -389,11 +418,13 @@ pub struct MeterColors {
pub high_rgb: (u8, u8, u8),
}
/// Sparkle particle colors.
#[derive(Clone)]
pub struct SparkleColors {
pub colors: [(u8, u8, u8); 5],
}
/// Confirm dialog colors.
#[derive(Clone)]
pub struct ConfirmColors {
pub border: Color,