feat(soundpacks): ship the default sound pack inside the binary - #150
Merged
Conversation
A fresh install wrote an empty default manifest and no audio, so only users upgrading from the Python version heard any cues. The twenty default sounds are now embedded in portkeydrop-core and written to the packs directory on first start. Missing files and manifest entries are added on later starts without overwriting anything the user replaced, so existing installs gain the new connect_waiting cue too. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012D47k3ztaJPbaxwNMRYe1C
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.
Problem
A fresh install makes no sound.
PackManifest::default_pack_json()was anempty stub,
ensure_default_pack()wrote only that stub and no audio, andneither the installer nor the release workflow copied any sound files. Only
users upgrading from the Python version heard cues, because the
~/.portkeydropmigration carried their old pack across. Surfaced by #149.Fix
crates/portkeydrop-core/assets/soundpacks/default/, next to theconnect_waiting.oggfrom feat(soundpack): add the connect_waiting cue audio #149. Each is byte-identical to the blob that wasin git before the Python app was removed.
soundpacks/builtin.rsembeds all 20 withinclude_bytes!in one table ofevent, pack-relative path, and bytes. The default manifest is generated from
that table, so the JSON and the files cannot drift. Nothing changes in the
installer or
build.yml; the binary carries the audio, which coversnightlies and portable builds too. About 450 KB.
ensure_default_pack()writes any built-in file that is missing and adds amanifest entry for any built-in event the on-disk manifest lacks. It never
overwrites a file or an existing entry, so a user who replaced a sound keeps
it, and existing users gain
connect_waiting. An unparseable manifest isstill left alone, and a complete one is not rewritten.
SoundEntryandPackManifestskipNoneand empty fields whenserialising, so the rewritten manifest has no
nulls.Tests
builtin.rs: every embedded event is in the catalogue, every catalogueevent has a built-in sound, events and paths are unique, and every embedded
file decodes.
mod.rs: a fresh directory gets every file and resolves every event; auser's replacement file is not overwritten; a user-edited manifest keeps its
entries and gains the rest; a complete manifest is not rewritten; the old
empty placeholder is filled in.
manifest.rs: the generated default lists every built-in sound; amanifest round-trips through JSON without
nullfields.cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,and
cargo test --workspacepass.🤖 Generated with Claude Code
https://claude.ai/code/session_012D47k3ztaJPbaxwNMRYe1C