Repository navigation
feat(library): add local-first asset library for stickers and sounds (#52) - #53
Conversation
|
Hey! While reviewing the library implementation, I identified two issues worth addressing before merging: 1. Desktop asset deletion can leave inconsistent library state (P2) In 2. IndexedDB persistence adapter lacks direct test coverage The existing library tests primarily exercised the memory adapter rather than the actual I've implemented fixes for both issues and pushed the changes to my fork:
Fork branch: The deletion fix stages files before committing the catalog change and rolls them back if the catalog commit fails. I also added 10 direct IndexedDB adapter tests. Local verification:
Could you cherry-pick these two commits, in order, into the existing PR branch so we can keep the work together in PR #53? Thanks for your work on the project! |
…ibrary fix(library): make asset deletion recoverable and test IndexedDB
|
Thanks @malcommathela! Both fixes from #54 (\84faa7c\ recoverable desktop deletion with staging/rollback + \�1eabdb\ 10 IndexedDB adapter tests) have been merged into \eat/issue-52-local-asset-library\ (\c0449b9). Also synced \eat/issue-52-local-asset-library\ with \prerelease-v2.0\ (\�71c3a1), resolving the merge conflict in \StikSoundMinimalApp.tsx\ and updating \protocol.rs\ tests. Verified locally after merge:
|
…exclude audio-only formats
…hort-link probe timeout
…s stickers with audio input ready
Summary
Implements the local-first asset library requested in #52 across Desktop (Tauri), Web / PWA, and the Chrome Extension, with zero accounts, zero cloud sync, and no changes to the
.stiksound.zipproject format or the headless CLI.Closes #52
What's included
1. Explicit Consent & Local Persistence
.stiksound.zip) are deduplicated by SHA-256 and saved automatically.IndexedDB):stiksound-libraryv2 (entries,blobs,collections,thumbs) opened only after consent, with connection reuse and orphan-blob detection.Tauri / Rust): createsapp_data_dir/library/{files,thumbs,catalog.json,collections.json}only after acceptance (library-consent.jsonrecords refusal/auto-save beside it). All disk/hashing Tauri commands run asynchronously viaspawn_blocking.2. Browsing, Organization & Reuse
platform.videoStickersis enabled, and Images with counts + smart initial non-empty filter), Audio (with inline▶/■audio preview), and Recent (most recently used across media & audio).★toggle per card + Favorites filter).lastUsedAtonly), and Desktop reopens saved videos directly on disk vialibrary_open_video_job.KB/MB) and an Open folder action on Desktop.3. Lightweight Thumbnails, Performance & Resilience
<=256pxthumbnails: generated via<canvas>in the browser/extension (thumbsobject store) and FFmpeg frame capture for Desktop videos (library/thumbs/), while small animated stickers (<= 512 KiB) stay animated and animated WebP displays anANIMbadge.stiksound-jobcustom protocol (/library/{id}and/library-thumb/{id}) with HTTP206Range support and immediate file-handle release on Windows.IntersectionObserverthumbnail loading with off-screen object URL release + progressive pagination (Show more, 24 items per page).read_catalog_tolerantin Rust,normalizeStoredEntryin IndexedDB) isolates invalid or missing entries so the library stays usable and lets users delete broken items with confirmation.es,en,pt,fr,de,it,ru,zh,ar).Verification
npm run -w @stiksound/ui typecheck— PASSnpm run -w @stiksound/web typecheck/build— PASSnpm run -w @stiksound/desktop typecheck/build— PASSnpm run -w @stiksound/extension typecheck/build— PASSnpx vitest run packages/ apps/extension/test/— 10 test files, 86/86 tests passedcargo +stable-x86_64-pc-windows-msvc test(apps/desktop/src-tauri) — 8/8 tests passed (consent, dedup, collections, favorites, tolerant corrupted catalog, thumbnails, protocol streaming & traversal checks)