1#[non_exhaustive]
9#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
10pub enum OrbState {
11 #[default]
13 Working,
14 Searching,
16 Solving,
18 Listening,
20 Connecting,
22 Weaving,
24 Composing,
26 Breathing,
28 Shaping,
30 Focusing,
32 Reasoning,
34 Recalling,
36}
37
38impl OrbState {
39 pub const ALL_STATES: &'static [OrbState] = &[
43 OrbState::Working,
44 OrbState::Searching,
45 OrbState::Solving,
46 OrbState::Listening,
47 OrbState::Connecting,
48 OrbState::Weaving,
49 OrbState::Composing,
50 OrbState::Breathing,
51 OrbState::Shaping,
52 OrbState::Focusing,
53 OrbState::Reasoning,
54 OrbState::Recalling,
55 ];
56
57 #[deprecated(since = "0.2.0", note = "use OrbState::ALL_STATES")]
62 pub const ALL: [OrbState; 9] = [
63 OrbState::Working,
64 OrbState::Searching,
65 OrbState::Solving,
66 OrbState::Listening,
67 OrbState::Connecting,
68 OrbState::Weaving,
69 OrbState::Composing,
70 OrbState::Breathing,
71 OrbState::Shaping,
72 ];
73
74 pub fn label(self) -> &'static str {
76 match self {
77 OrbState::Working => "Working…",
78 OrbState::Searching => "Searching…",
79 OrbState::Solving => "Solving…",
80 OrbState::Listening => "Listening…",
81 OrbState::Connecting => "Connecting…",
82 OrbState::Weaving => "Weaving…",
83 OrbState::Composing => "Composing…",
84 OrbState::Breathing => "Thinking…",
85 OrbState::Shaping => "Shaping…",
86 OrbState::Focusing => "Focusing…",
87 OrbState::Reasoning => "Reasoning…",
88 OrbState::Recalling => "Recalling…",
89 }
90 }
91
92 pub fn as_str(self) -> &'static str {
94 match self {
95 OrbState::Working => "working",
96 OrbState::Searching => "searching",
97 OrbState::Solving => "solving",
98 OrbState::Listening => "listening",
99 OrbState::Connecting => "connecting",
100 OrbState::Weaving => "weaving",
101 OrbState::Composing => "composing",
102 OrbState::Breathing => "breathing",
103 OrbState::Shaping => "shaping",
104 OrbState::Focusing => "focusing",
105 OrbState::Reasoning => "reasoning",
106 OrbState::Recalling => "recalling",
107 }
108 }
109}
110
111#[non_exhaustive]
115#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
116pub enum OrbSize {
117 #[default]
119 Avatar,
120 Inline,
122 Large,
124 Hero,
126}
127
128impl OrbSize {
129 pub const ALL_SIZES: &'static [OrbSize] = &[
131 OrbSize::Inline,
132 OrbSize::Avatar,
133 OrbSize::Large,
134 OrbSize::Hero,
135 ];
136
137 pub fn pixels(self) -> f32 {
139 match self {
140 OrbSize::Inline => 20.0,
141 OrbSize::Avatar => 64.0,
142 OrbSize::Large => 96.0,
143 OrbSize::Hero => 128.0,
144 }
145 }
146
147 pub fn as_str(self) -> &'static str {
149 match self {
150 OrbSize::Inline => "inline",
151 OrbSize::Avatar => "avatar",
152 OrbSize::Large => "large",
153 OrbSize::Hero => "hero",
154 }
155 }
156
157 pub fn label(self) -> &'static str {
159 match self {
160 OrbSize::Inline => "20 · inline",
161 OrbSize::Avatar => "64 · avatar",
162 OrbSize::Large => "96 · large",
163 OrbSize::Hero => "128 · hero",
164 }
165 }
166}
167
168#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
170pub enum OrbTheme {
171 #[default]
173 Auto,
174 Dark,
176 Light,
178}
179
180#[non_exhaustive]
183#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
184pub enum ModeKey {
185 Orbits,
186 Globe,
187 Rubik,
188 Wave,
189 Web,
190 Braid,
191 Ribbon,
192 Ring,
193 Morph,
194 Focus,
195 Gyroscope,
196 Echo,
197}
198
199impl ModeKey {
200 pub fn from_state(state: OrbState) -> Self {
201 match state {
202 OrbState::Working => ModeKey::Orbits,
203 OrbState::Searching => ModeKey::Globe,
204 OrbState::Solving => ModeKey::Rubik,
205 OrbState::Listening => ModeKey::Wave,
206 OrbState::Connecting => ModeKey::Web,
207 OrbState::Weaving => ModeKey::Braid,
208 OrbState::Composing => ModeKey::Ribbon,
209 OrbState::Breathing => ModeKey::Ring,
210 OrbState::Shaping => ModeKey::Morph,
211 OrbState::Focusing => ModeKey::Focus,
212 OrbState::Reasoning => ModeKey::Gyroscope,
213 OrbState::Recalling => ModeKey::Echo,
214 }
215 }
216}