fix(compress): compressing works in a real library, and says how it went - #59
Merged
Merged
Conversation
**Compression failed on every clip in a real library, after the encode.** Rows store paths with forward slashes, the way fast-glob returns them, and `CompressClipAction` handed that straight to `shell.trashItem`, which on Windows refuses it with "Failed to parse path". `MoveFileToTrashAction` already normalises for exactly this; compression now goes through it. Checked in Electron: a forward-slash path fails, a normalised one lands in the Recycle Bin. 232 of the 233 clips in the real library store their path that way. **It was silent about it.** The menu said "It will finish in the background" and nothing more, so a compressed clip, one left alone for being already small, and one that failed all looked the same, with the card's old size. `useCompressionResult` now follows the job: the card gets the new row the moment it lands, and one toast says "60.6 MB to 19.2 MB", why it was left alone, or why it failed. Batch compression reports each. **The bench could not have caught it**, because its shell stub deleted any path it was given. It now refuses a forward slash the way Windows does and stores the row's path the way a real library does, and it takes a file: `node scripts/compress-check.mjs <file>`. Proved: without the fix it fails with "Failed to parse path"; with it, the real clip goes 60.6 to 19.2 MB. **The clip's name is bold in the question**, through a new `emphasis` option on the confirm dialog (plain text either side, never HTML). **A duplicate row found on the way.** `Edited_2026-09-19` had two rows, one per slash spelling, from a build older than the scan's path matching. The scan never removed the old one because the file exists. It now retires a second row for a file when that row holds nothing its twin lacks (`services/duplicateRows.ts`, unit-tested): rows only, never the file, and a duplicate carrying anything of its own is left and logged. In the test profile it removed the empty twin and kept the published row. Gates: `npm run check` 866; `compress-check.mjs` on the real clip, exit 0; `indexing`, `compress` and `modals` specs, 12 passed. Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Compressing a clip failed in a real library: rows store forward-slash paths and
shell.trashItemrejects them ("Failed to parse path"). Compression now goes throughMoveFileToTrashAction, which normalises the path, the same as delete.emphasisoption).Gates:
npm run check866; compress-check exit 0; indexing, compress and modals specs 12 passed.🤖 Generated with Claude Code