Background update check, music extension detection, and misc fixes#61
Open
AeEn123AI wants to merge 2 commits into
Open
Background update check, music extension detection, and misc fixes#61AeEn123AI wants to merge 2 commits into
AeEn123AI wants to merge 2 commits into
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UpdatePromptwidget surfaces the result when an update is found./soundsmusic stored without HTTP headers) now have their extension detected from magic bytes (OggS→.ogg,ID3/frame-sync →.mp3), falling back to.oggfor the Music tab.Arc(perf) —FILE_LIST/FILTERED_FILE_LISTare nowMutex<Arc<Vec<AssetInfo>>>. The GUI takes a cheapArcsnapshot each frame (a refcount bump) instead of deep-cloning the wholeVecand all itsStrings on every repaint. Writes useArc::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 (noarc-swapcrate) since the lock is uncontended and the binary is size-constrained.extract_bytesunderflow fix — replaced direct subtraction withsaturating_subso a header found before the offset bytes cannot underflow the index and cause a slice panic.egui::Key::from_name(...).expect(...)replaced with afrom_name+continueguard so tabs beyond key 9 don't panic.filter_file_listsimplification — filter collects into aVeconce, then assigns under a single lock, removing repeated per-entry lock acquisitions.Test plan
.ogg/.mp3extensions are set correctlyVerification performed
cargo test— 22 passed (includes newtest_file_list_arc_snapshot_and_filtercovering the copy-on-write snapshot-stability guarantee the render loop relies on)--list --mode musiclists all assets;--extract --mode music --extensionproduces byte-for-byte-identical files with correct.ogg/.mp3extensions detected from magic bytes🤖 Generated with Claude Code