Add system metrics + UI, smooth progress updates, and enhance guided tour/emotional mode#8
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7dbe99fd52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }; | ||
|
|
||
| poll(); | ||
| setInterval(poll, 1500); |
There was a problem hiding this comment.
Make system-metrics polling non-blocking
startSystemMetrics polls every 1.5s, but get_system_metrics is a synchronous Tauri command that calls std::thread::sleep before returning. In Tauri, non-async commands run on the main thread, so this introduces regular UI stalls during normal app usage (especially noticeable while interacting with controls or progress updates). Converting the command to async/offloaded execution (or removing the blocking sleep path) avoids periodic jank.
Useful? React with 👍 / 👎.
| let mut sys = System::new_all(); | ||
| sys.refresh_memory(); | ||
| sys.refresh_cpu(); | ||
| std::thread::sleep(std::time::Duration::from_millis(120)); |
There was a problem hiding this comment.
Use sysinfo minimum CPU sampling interval
The CPU percentage is sampled with a fixed 120ms delay between refresh_cpu calls, but sysinfo requires waiting at least MINIMUM_CPU_UPDATE_INTERVAL (OS-dependent) for valid CPU usage deltas. On platforms where the minimum is higher (commonly Linux), this can produce inaccurate values (often zero or unstable spikes), so the metrics feature can report misleading CPU numbers.
Useful? React with 👍 / 👎.
Motivation
Description
sysinfodependency and related Cargo.lock updates (and transitively pulled inrayon,crossbeam-*,either,ntapi, and Windows target entries) and exposed a new Tauri commandget_system_metricsthat returns CPU and RAM percentages.process_videoto keep progress monotonic and only emit progress events on increases, preventing UI regression.invoke_handlerso the frontend can callget_system_metrics.index.html, styles for metric rings and indeterminate progress tostyle.css, and polling/display logic insrc/main.js(startSystemMetrics,setProgressMode,setProgressSmooth, metric ring helpers, and emotional toggle wiring).tour.jsto add better tooltip positioning/clamping, keyboard navigation, publicwindowAPIs (startTour,nextTourStep,startEmotionalMode,stopEmotionalMode, etc.), configurable emotional mode settings, auto-stop behavior, and UI synchronization hooks.Testing
cargo check(insrc-tauri) andcargo buildto validate Rust changes and dependency resolution, both completed successfully.Codex Task