Skip to content

Add system metrics + UI, smooth progress updates, and enhance guided tour/emotional mode#8

Open
DivyanshuChipa wants to merge 1 commit into
masterfrom
codex/fix-experience-tour-card-position-and-functionality-4vs8y4
Open

Add system metrics + UI, smooth progress updates, and enhance guided tour/emotional mode#8
DivyanshuChipa wants to merge 1 commit into
masterfrom
codex/fix-experience-tour-card-position-and-functionality-4vs8y4

Conversation

@DivyanshuChipa

Copy link
Copy Markdown
Owner

Motivation

  • Surface system CPU/RAM metrics to the UI and expose them to the frontend for richer UX and diagnostics.
  • Improve FFmpeg progress reporting to avoid UI regressions and provide a smooth, indeterminate fallback when duration is unknown.
  • Enhance the guided tour and "Emotional Mode" controls to be interactive, keyboard-accessible, and configurable from the sidebar.

Description

  • Added the sysinfo dependency and related Cargo.lock updates (and transitively pulled in rayon, crossbeam-*, either, ntapi, and Windows target entries) and exposed a new Tauri command get_system_metrics that returns CPU and RAM percentages.
  • Modified process_video to keep progress monotonic and only emit progress events on increases, preventing UI regression.
  • Registered the new command in the Tauri invoke_handler so the frontend can call get_system_metrics.
  • Frontend changes: added a System Metrics card and controls to index.html, styles for metric rings and indeterminate progress to style.css, and polling/display logic in src/main.js (startSystemMetrics, setProgressMode, setProgressSmooth, metric ring helpers, and emotional toggle wiring).
  • Improved progress handling in JS to support indeterminate mode when duration is unknown and to smooth increments for a better visual experience.
  • Reworked tour.js to add better tooltip positioning/clamping, keyboard navigation, public window APIs (startTour, nextTourStep, startEmotionalMode, stopEmotionalMode, etc.), configurable emotional mode settings, auto-stop behavior, and UI synchronization hooks.

Testing

  • Ran cargo check (in src-tauri) and cargo build to validate Rust changes and dependency resolution, both completed successfully.
  • No unit tests were present for new features; frontend behavior was exercised via automated build checks for assets during the build step which completed without errors.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/main.js
};

poll();
setInterval(poll, 1500);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src-tauri/src/main.rs
let mut sys = System::new_all();
sys.refresh_memory();
sys.refresh_cpu();
std::thread::sleep(std::time::Duration::from_millis(120));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant