-
Notifications
You must be signed in to change notification settings - Fork 0
feat: ui tweaks #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ui tweaks #13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the standalone Tauri application with system tray functionality, checkpoint querying capabilities, and refined UI/icon handling. The changes improve user experience by providing quick access to recent tasks via the system tray and displaying checkpoint information in the task detail view.
Key changes:
- Added system tray menu with recent tasks, worker status, and quick actions (show/quit)
- Implemented checkpoint querying APIs with status tracking and display in task details
- Updated icon handling to use higher-resolution assets and added new tray icon
- Enhanced task duration calculation using millisecond timestamps
Reviewed changes
Copilot reviewed 13 out of 28 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| standalone/src-tauri/src/ui/tray.rs | New system tray implementation with periodic updates and event handling |
| standalone/src-tauri/src/lib.rs | Integrated tray setup, menu event handlers, and window close behavior |
| standalone/src-tauri/src/db_commands.rs | Added checkpoint query functions and updated TaskRun with millisecond timestamps |
| standalone/src/lib/providers/absurdData.ts | Extended provider interface with checkpoint methods and mock data |
| standalone/src/routes/tasks/[taskId]/+page.svelte | Added checkpoint display and duration calculation logic |
| standalone/src/routes/+layout.svelte | Updated header with logo image and compact mode styling |
| standalone/src-tauri/tauri.conf.json | Reduced icon sizes to higher-resolution variants only |
| standalone/src-tauri/Cargo.toml | Enabled tray-icon and image-png features for Tauri |
| assets/generate-icon.sh | Reduced generated icon size set |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <div class="mx-auto flex w-full max-w-screen-2xl items-center justify-between px-8 py-4 transition-all duration-200 header-inner"> | ||
| <p class="text-base font-semibold text-slate-900 header-logo select-none">Absurd Habitat</p> | ||
| <div class="flex items-center gap-2 text-base font-semibold text-slate-900 header-logo select-none"> | ||
| <img src="/logo.png" alt="Absurd SQLite logo" class="h-10 w-10 header-logo-icon" /> |
Copilot
AI
Jan 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logo image path is hardcoded to "/logo.png" which may not resolve correctly depending on the deployment base path or route configuration. Consider using a proper asset import or a configurable base path.
| let script = format!( | ||
| "window.location.assign({});", | ||
| serde_json::to_string(&format!("/tasks/{}", task_id)) | ||
| .unwrap_or_else(|_| "\"/tasks\"".to_string()) | ||
| ); | ||
| let _ = window.eval(&script); |
Copilot
AI
Jan 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using window.location.assign() for navigation bypasses the SvelteKit router, which can cause loss of client-side state and disable SvelteKit's optimizations. Use the goto() function from $app/navigation instead for proper client-side routing.
| pub fn start_updates(app_handle: AppHandle) { | ||
| async_runtime::spawn(async move { | ||
| let mut ticker = interval(TRAY_UPDATE_INTERVAL); | ||
| loop { | ||
| ticker.tick().await; | ||
| if let Err(err) = update_menu_state(&app_handle) { | ||
| log::warn!("Failed to update tray menu: {}", err); | ||
| } | ||
| } | ||
| }); |
Copilot
AI
Jan 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tray menu update runs every 30 seconds in an infinite loop without any error recovery mechanism. If update_menu_state fails repeatedly, errors will continue to accumulate in the logs. Consider implementing exponential backoff or circuit breaker pattern to handle persistent failures gracefully.
| createdAtMs: Date.parse("Dec 22, 2025, 9:13 AM"), | ||
| updatedAtMs: Date.parse("Dec 27, 2025, 3:03 PM"), |
Copilot
AI
Jan 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded timestamp strings passed to Date.parse() will produce inconsistent results across different locales and time zones. Date.parse() behavior varies by browser implementation and should be avoided. Consider using ISO 8601 format timestamps or Unix timestamps in milliseconds instead.
| createdAtMs: Date.parse("Dec 22, 2025, 9:13 AM"), | |
| updatedAtMs: Date.parse("Dec 27, 2025, 3:03 PM"), | |
| createdAtMs: Date.parse("2025-12-22T09:13:00.000Z"), | |
| updatedAtMs: Date.parse("2025-12-27T15:03:00.000Z"), |
| const minCreated = Math.min(...createdValues); | ||
| const maxUpdated = Math.max(...updatedValues); | ||
| if (!Number.isFinite(minCreated) || !Number.isFinite(maxUpdated)) return "—"; | ||
| return formatDuration(Math.max(0, maxUpdated - minCreated)); |
Copilot
AI
Jan 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The subtraction calculation here will always return a non-negative number due to Math.max(0, ...), making the Math.max unnecessary on line 47. The logic would be clearer without the redundant Math.max wrapping.
| return formatDuration(Math.max(0, maxUpdated - minCreated)); | |
| return formatDuration(maxUpdated - minCreated); |
This pull request introduces a new system tray menu for the standalone Tauri application, adds checkpoint querying capabilities to the database API, and updates build assets for improved icon handling. The main changes are grouped below by theme.
System Tray Integration and UI Improvements
ui::traymodule (standalone/src-tauri/src/ui/tray.rs) to implement a system tray menu, displaying recent tasks, worker status, and providing quick actions like show and quit. The tray menu updates every 30 seconds and responds to user events. Integration hooks were added tolib.rsto set up and manage the tray icon and its menu. [1] [2] [3] [4] [5]Database API Extensions
TaskRunand related mapping logic to include millisecond timestamps for creation and updates, improving time-based UI and API features. [1] [2]Build and Asset Updates
generate-icon.shand updatedtauri.conf.jsonto use higher-resolution icons, streamlining build outputs and improving visual quality. [1] [2]assets/absurd-sqlite-standalone.icon/icon.json) for automatic gradient and platform-specific icon support.Dependency and Feature Updates
tray-iconandimage-pngfeatures for thetauricrate inCargo.tomlto support tray icon functionality.Code Organization
lib.rsto support the new tray UI and event handling. [1] [2]References:
System Tray Integration: [1] [2] [3] [4] [5]
Database API Extensions: [1] [2] [3] [4] [5] [6]
Build and Asset Updates: [1] [2] [3]
Dependency and Feature Updates: standalone/src-tauri/Cargo.tomlL28-R28
Code Organization: [1] [2]