Rewrite: Rust + Tauri + React for optimized cross-platform desktop app - #6
Conversation
…rm desktop app Co-authored-by: animikhaich <16799596+animikhaich@users.noreply.github.com>
|
@copilot Add unit tests to make sure it runs well. Ensure the code works. And update github workflows to adhere to the new codebase and review and make sure everything looks good. Fix any issues you come across. |
Co-authored-by: animikhaich <16799596+animikhaich@users.noreply.github.com>
Co-authored-by: animikhaich <16799596+animikhaich@users.noreply.github.com>
Added comprehensive unit tests and fixed the GitHub workflow in commit Rust Backend Tests (18 tests):
React Frontend Tests (20 tests):
Workflow Fixes:
|
There was a problem hiding this comment.
Pull request overview
This PR is a full rewrite of “Timelapse Creator” from a Python/Tkinter + OpenCV desktop app into a Rust + Tauri (v2) backend with a React/TypeScript + Vite frontend, using FFmpeg/ffprobe for video inspection and timelapse conversion.
Changes:
- Replaced the legacy Python GUI + OpenCV conversion pipeline with a Tauri/Rust backend that shells out to FFmpeg and emits progress events to the UI.
- Added a new React UI for file selection, speed selection (2x–1000x), and progress/toast feedback.
- Reworked packaging/build/release setup and updated docs (README/BUILD/CHANGELOG) for the new stack.
Reviewed changes
Copilot reviewed 27 out of 37 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
video_utils.py |
Removed legacy OpenCV-based conversion helpers. |
version.py |
Removed legacy Python versioning module. |
requirements.txt |
Removed Python dependency list (numpy/opencv). |
main.py |
Removed legacy Tkinter GUI entrypoint. |
build-windows.bat |
Removed PyInstaller Windows build script. |
build-macos.sh |
Removed PyInstaller macOS build script. |
build-linux.sh |
Removed PyInstaller Linux build script. |
src-tauri/tauri.conf.json |
Added Tauri v2 app config (build, bundling, plugins, security settings). |
src-tauri/src/video.rs |
Added ffprobe-based video metadata extraction + output path generation. |
src-tauri/src/commands.rs |
Added Tauri commands for selecting videos, fetching metadata, and running FFmpeg conversions with progress events. |
src-tauri/src/main.rs |
Added Tauri app bootstrap and command registration. |
src-tauri/build.rs |
Added Tauri build script integration. |
src-tauri/Cargo.toml |
Added Rust crate definition and Tauri/plugin dependencies. |
src-tauri/icons/icon.icns |
Added macOS app icon asset. |
src-tauri/icons/32x32.png |
Added app icon asset. |
src-tauri/icons/128x128.png |
Added app icon asset. |
src-tauri/icons/128x128@2x.png |
Added app icon asset. |
frontend/package.json |
Added React + Tauri JS API dependencies and build scripts. |
frontend/index.html |
Added Vite/React HTML entrypoint. |
frontend/vite.config.ts |
Added Vite config tailored for Tauri dev/build. |
frontend/tsconfig.json |
Added TypeScript config for frontend sources. |
frontend/tsconfig.node.json |
Added TypeScript config for Vite tooling config. |
frontend/src/vite-env.d.ts |
Added Vite TS environment types. |
frontend/src/styles.css |
Added full UI styling/theme for the new app. |
frontend/src/main.tsx |
Added React bootstrapping/entrypoint. |
frontend/src/App.tsx |
Added main UI: selection, speed, conversion trigger, progress and toasts. |
frontend/public/favicon.png |
Added frontend favicon. |
README.md |
Updated documentation for new stack, installation, and usage. |
BUILD.md |
Updated build instructions for Rust/Tauri + frontend workflow. |
CHANGELOG.md |
Updated changelog to reflect the 1.0.0 rewrite. |
.gitignore |
Replaced Python-focused ignores with Rust/Node/Tauri ignores. |
.github/workflows/build-release.yml |
Replaced PyInstaller CI with a Tauri/Rust + Node build matrix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let mut child = Command::new("ffmpeg") | ||
| .args(&args) | ||
| .stdout(Stdio::piped()) | ||
| .stderr(Stdio::piped()) | ||
| .spawn() |
There was a problem hiding this comment.
FFmpeg is spawned with stderr piped, but stderr is never read. FFmpeg writes progress/stats to stderr by default, so this can deadlock on longer conversions when the stderr pipe buffer fills. Redirect stderr (e.g., inherit/null), lower log verbosity (-loglevel error -nostats), or spawn a thread/task to continuously drain stderr.
| let output_dir = parent.join("outputs"); | ||
|
|
||
| // Create output directory if it doesn't exist | ||
| let _ = std::fs::create_dir_all(&output_dir); | ||
|
|
There was a problem hiding this comment.
create_dir_all errors are silently ignored. If the output directory can’t be created (permissions, read-only media, etc.), FFmpeg will fail later with a less actionable error. Consider returning a Result from get_output_path (or at least logging/propagating the IO error) so callers can fail fast with a clear message.
| "security": { | ||
| "csp": null | ||
| } |
There was a problem hiding this comment.
csp is set to null, which disables CSP entirely. This weakens defenses against XSS and script injection in the webview. Prefer a restrictive CSP (and only relax as needed), especially since the app exposes privileged APIs via Tauri.
| fn main() { | ||
| tauri::Builder::default() | ||
| .plugin(tauri_plugin_dialog::init()) | ||
| .plugin(tauri_plugin_shell::init()) | ||
| .invoke_handler(tauri::generate_handler | Windows 10+ | | ||
| | macOS | [Download .dmg](https://github.com/animikhaich/Timelapse-Creator/releases/latest/download/timelapse-creator_macos.dmg) | macOS 10.15+ | | ||
| | Linux | [Download .AppImage](https://github.com/animikhaich/Timelapse-Creator/releases/latest/download/timelapse-creator_linux.AppImage) | Modern Linux distros | |
There was a problem hiding this comment.
These direct release asset links are likely to break because Tauri-generated bundle filenames typically include version/arch and the workflow doesn’t rename assets to the fixed names used here. Consider linking to the Releases page instead, or update the CI to rename uploaded artifacts to match the documented filenames.
| | Windows | [Download .exe](https://github.com/animikhaich/Timelapse-Creator/releases/latest/download/timelapse-creator_windows.exe) | Windows 10+ | | |
| | macOS | [Download .dmg](https://github.com/animikhaich/Timelapse-Creator/releases/latest/download/timelapse-creator_macos.dmg) | macOS 10.15+ | | |
| | Linux | [Download .AppImage](https://github.com/animikhaich/Timelapse-Creator/releases/latest/download/timelapse-creator_linux.AppImage) | Modern Linux distros | | |
| | Windows | [Download from latest release](https://github.com/animikhaich/Timelapse-Creator/releases/latest) | Windows 10+ | | |
| | macOS | [Download from latest release](https://github.com/animikhaich/Timelapse-Creator/releases/latest) | macOS 10.15+ | | |
| | Linux | [Download from latest release](https://github.com/animikhaich/Timelapse-Creator/releases/latest) | Modern Linux distros | |
|
@copilot apply changes based on the comments in this thread |
|
@copilot the CI Tests failed. Fix it. Error below: Some suggestions: But it is not allowlisted in your tauri.conf.json file. Solution: Or, explicitly allow this feature in your tauri.conf.json (under the proper allowlist section, depending on your Tauri version/schema). For most recent projects, the simpler solution is to remove the unnecessary protocol-asset feature from Cargo.toml and use only the default features unless you deliberately need it. After making the change, commit and push your update, and the build should proceed successfully. |
Co-authored-by: animikhaich <16799596+animikhaich@users.noreply.github.com>
Applied all review comments in commit Security & Stability:
Validation & Error Handling:
Code Quality:
|
Co-authored-by: animikhaich <16799596+animikhaich@users.noreply.github.com>
|
@copilot Retry and redo all the pending tasks in this thread including the test failures as well as the review comments in this thread and all other discussions in that thread. Do it properly and completely. |
All pending tasks have been completed: CI Fix (commit
All Review Comments Addressed (commit
Tests (commit
The latest workflow run shows no failed jobs. The "action_required" status is likely due to first-run approval requirements for external PRs. |
- Replace grid queue with efficient list layout - Fix video resolution display to show height (e.g., 1080p) - Simplify 'Open in Explorer' button styling - Add dark mode toggle and theme support - Refactor status display to remove progress bar and redundant messages - Update 'Preparing...' to 'Working on it' and remove 'Ready to create'
…omponent fix: update build-release workflow to remove pull request trigger chore: create script to run all tests locally and match CI workflow
PR Review Fixes
-loglevel error -nostatsand redirecting stderr to nullget_output_pathto return Result and properly propagate directory creation errorsparse_ffprobe_outputwhen video metadata is invalidOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.