#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub enum OrbState {
#[default]
Working,
Searching,
Solving,
Listening,
Connecting,
Weaving,
Composing,
Breathing,
Shaping,
Focusing,
Reasoning,
Recalling,
}
impl OrbState {
pub const ALL_STATES: &'static [OrbState] = &[
OrbState::Working,
OrbState::Searching,
OrbState::Solving,
OrbState::Listening,
OrbState::Connecting,
OrbState::Weaving,
OrbState::Composing,
OrbState::Breathing,
OrbState::Shaping,
OrbState::Focusing,
OrbState::Reasoning,
OrbState::Recalling,
];
#[deprecated(since = "0.2.0", note = "use OrbState::ALL_STATES")]
pub const ALL: [OrbState; 9] = [
OrbState::Working,
OrbState::Searching,
OrbState::Solving,
OrbState::Listening,
OrbState::Connecting,
OrbState::Weaving,
OrbState::Composing,
OrbState::Breathing,
OrbState::Shaping,
];
pub fn label(self) -> &'static str {
match self {
OrbState::Working => "Working…",
OrbState::Searching => "Searching…",
OrbState::Solving => "Solving…",
OrbState::Listening => "Listening…",
OrbState::Connecting => "Connecting…",
OrbState::Weaving => "Weaving…",
OrbState::Composing => "Composing…",
OrbState::Breathing => "Thinking…",
OrbState::Shaping => "Shaping…",
OrbState::Focusing => "Focusing…",
OrbState::Reasoning => "Reasoning…",
OrbState::Recalling => "Recalling…",
}
}
pub fn as_str(self) -> &'static str {
match self {
OrbState::Working => "working",
OrbState::Searching => "searching",
OrbState::Solving => "solving",
OrbState::Listening => "listening",
OrbState::Connecting => "connecting",
OrbState::Weaving => "weaving",
OrbState::Composing => "composing",
OrbState::Breathing => "breathing",
OrbState::Shaping => "shaping",
OrbState::Focusing => "focusing",
OrbState::Reasoning => "reasoning",
OrbState::Recalling => "recalling",
}
}
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub enum OrbSize {
#[default]
Avatar,
Inline,
Large,
Hero,
}
impl OrbSize {
pub const ALL_SIZES: &'static [OrbSize] = &[
OrbSize::Inline,
OrbSize::Avatar,
OrbSize::Large,
OrbSize::Hero,
];
pub fn pixels(self) -> f32 {
match self {
OrbSize::Inline => 20.0,
OrbSize::Avatar => 64.0,
OrbSize::Large => 96.0,
OrbSize::Hero => 128.0,
}
}
pub fn as_str(self) -> &'static str {
match self {
OrbSize::Inline => "inline",
OrbSize::Avatar => "avatar",
OrbSize::Large => "large",
OrbSize::Hero => "hero",
}
}
pub fn label(self) -> &'static str {
match self {
OrbSize::Inline => "20 · inline",
OrbSize::Avatar => "64 · avatar",
OrbSize::Large => "96 · large",
OrbSize::Hero => "128 · hero",
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub enum OrbTheme {
#[default]
Auto,
Dark,
Light,
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum ModeKey {
Orbits,
Globe,
Rubik,
Wave,
Web,
Braid,
Ribbon,
Ring,
Morph,
Focus,
Gyroscope,
Echo,
}
impl ModeKey {
pub fn from_state(state: OrbState) -> Self {
match state {
OrbState::Working => ModeKey::Orbits,
OrbState::Searching => ModeKey::Globe,
OrbState::Solving => ModeKey::Rubik,
OrbState::Listening => ModeKey::Wave,
OrbState::Connecting => ModeKey::Web,
OrbState::Weaving => ModeKey::Braid,
OrbState::Composing => ModeKey::Ribbon,
OrbState::Breathing => ModeKey::Ring,
OrbState::Shaping => ModeKey::Morph,
OrbState::Focusing => ModeKey::Focus,
OrbState::Reasoning => ModeKey::Gyroscope,
OrbState::Recalling => ModeKey::Echo,
}
}
}