Skip to content

Background update check, music extension detection, and misc fixes#61

Open
AeEn123AI wants to merge 2 commits into
AeEn123:mainfrom
AeEn123AI:feature/background-updater-and-fixes
Open

Background update check, music extension detection, and misc fixes#61
AeEn123AI wants to merge 2 commits into
AeEn123:mainfrom
AeEn123AI:feature/background-updater-and-fixes

Conversation

@AeEn123AI

@AeEn123AI AeEn123AI commented Jun 16, 2026

Copy link
Copy Markdown

Summary

  • Background update check — the update check is moved onto a background thread so the main window opens immediately instead of blocking on startup. An in-app UpdatePrompt widget surfaces the result when an update is found.
  • Music file extension detection — raw audio files (e.g. Roblox /sounds music stored without HTTP headers) now have their extension detected from magic bytes (OggS.ogg, ID3/frame-sync → .mp3), falling back to .ogg for the Music tab.
  • Asset lists backed by Arc (perf)FILE_LIST / FILTERED_FILE_LIST are now Mutex<Arc<Vec<AssetInfo>>>. The GUI takes a cheap Arc snapshot each frame (a refcount bump) instead of deep-cloning the whole Vec and all its Strings on every repaint. Writes use Arc::make_mut (copy-on-write): zero clones in the steady state, and at most one clone per frame during a refresh versus the old unconditional full clone every frame. Kept dependency-free (no arc-swap crate) since the lock is uncontended and the binary is size-constrained.
  • extract_bytes underflow fix — replaced direct subtraction with saturating_sub so a header found before the offset bytes cannot underflow the index and cause a slice panic.
  • Tab keyboard navigation panic fixegui::Key::from_name(...).expect(...) replaced with a from_name + continue guard so tabs beyond key 9 don't panic.
  • filter_file_list simplification — filter collects into a Vec once, then assigns under a single lock, removing repeated per-entry lock acquisitions.
  • Locale additions — new strings added across all supported locales (de-DE, en-GB, englifsh, ja-JP, pirate-speak, pl-PL, ru-RU, shakespearian-english, zh-CN).

Test plan

  • Launch the app — window should appear immediately without waiting for the update check
  • If an update is available, verify the in-app prompt appears
  • Extract music assets and confirm .ogg / .mp3 extensions are set correctly
  • Tab keyboard shortcuts (Ctrl/Alt + 1–9) work without panic
  • Search/filter in the file list returns correct results

Verification performed

  • cargo test — 22 passed (includes new test_file_list_arc_snapshot_and_filter covering the copy-on-write snapshot-stability guarantee the render loop relies on)
  • End-to-end CLI run against an isolated cache: --list --mode music lists all assets; --extract --mode music --extension produces byte-for-byte-identical files with correct .ogg/.mp3 extensions detected from magic bytes

🤖 Generated with Claude Code

AeEn123AI and others added 2 commits June 16, 2026 20:52
- Move update check to a background thread so the window opens
  immediately instead of blocking on startup
- Add in-app "update available" prompt (UpdatePrompt) surfaced from the
  background check result
- Detect .ogg / .mp3 extension from magic bytes for raw audio files
  (music stored without HTTP headers in /sounds)
- Fix potential index underflow in extract_bytes via saturating_sub
- Fix potential panic in tab keyboard navigation by using from_name +
  continue instead of expect
- Simplify filter_file_list to collect once under a single lock
- Various locale string additions across all supported languages

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Store FILE_LIST/FILTERED_FILE_LIST as Mutex<Arc<Vec<AssetInfo>>>. The GUI
now takes a cheap Arc snapshot each frame (a refcount bump) instead of
deep-cloning the whole Vec and all its Strings on every repaint.

Writes use Arc::make_mut (copy-on-write): zero clones in the steady
state, and at most one clone per frame during a refresh, versus the old
unconditional full clone every frame.

Kept dependency-free (Mutex<Arc<...>>) rather than the arc-swap crate
since the lock is uncontended and the binary is size-constrained.

Adds test_file_list_arc_snapshot_and_filter covering the copy-on-write
snapshot-stability guarantee the render loop relies on.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant