| 225 | } |
| 226 | |
| 227 | fn render_ui(&self) -> Result<(), Box<dyn std::error::Error>> { |
| 228 | execute!( |
| 229 | stdout(), |
| 230 | Clear(ClearType::All), |
| 231 | cursor::MoveTo(0, 0), |
| 232 | SetForegroundColor(Color::Cyan), |
| 233 | Print("╔════════════════════════════════════════════╗\n"), |
| 234 | Print("║ RustUI Development Hub ║\n"), |
| 235 | Print("╚════════════════════════════════════════════╝\n\n"), |
| 236 | )?; |
| 237 | |
| 238 | // Show current platform with highlight |
| 239 | let platforms = vec![ |
| 240 | (Platform::Desktop, "1. Desktop 🖥️ "), |
| 241 | (Platform::IOS, "2. iOS 📱"), |
| 242 | (Platform::Android, "3. Android 🤖"), |
| 243 | (Platform::Web, "4. Web 🌐"), |
| 244 | ]; |
| 245 | |
| 246 | for (platform, label) in platforms { |
| 247 | let color = if platform == self.target_platform { |
| 248 | Color::Green |
| 249 | } else { |
| 250 | Color::White |
| 251 | }; |
| 252 | execute!( |
| 253 | stdout(), |
| 254 | SetForegroundColor(color), |
| 255 | Print(format!("{}{}\n", |
| 256 | if platform == self.target_platform { "▶ " } else { " " }, |
| 257 | label |
| 258 | )), |
| 259 | )?; |
| 260 | } |
| 261 | |
| 262 | // Show progress and status |
| 263 | let status = self.get_status(); |
| 264 | if let Some((current, total)) = status.progress { |
| 265 | let width = 40; |
| 266 | let progress = (current as f32 / total as f32 * width as f32) as usize; |
| 267 | let bar = format!( |
| 268 | "▕{}{}▏", |
| 269 | "█".repeat(progress), |
| 270 | "░".repeat(width - progress), |
| 271 | ); |
| 272 | |
| 273 | execute!( |
| 274 | stdout(), |
| 275 | SetForegroundColor(Color::Yellow), |
| 276 | Print(format!("\n⏳ Progress: {}\n", bar)), |
| 277 | )?; |
| 278 | } |
| 279 | |
| 280 | // Show status message with emoji |
| 281 | if let Some(msg) = &status.message { |
| 282 | let (emoji, color) = if status.in_progress { |
| 283 | ("🔄", Color::Yellow) |
| 284 | } else if status.error.is_some() { |