refactor: cleanup pass — bug fixes, deduplication, dead code removal#10
Merged
Conversation
Replace the `?` operator on fs::rename with a match that: - Emits an error event with the failure reason - Removes the temporary file to avoid orphans - Continues to the next job instead of aborting the batch This matches the existing GS failure pattern and ensures that a single file's rename failure doesn't abort all remaining jobs.
- Rename formatSavedBytes → formatBytes in notification.ts - Update buildNotificationBody to call formatBytes - Delete formatSize function from DetailPanel.svelte - Import formatBytes from notification.ts in DetailPanel.svelte - Replace all 3 formatSize call sites with formatBytes - Update tests to use formatBytes instead of formatSavedBytes Uses the Math.round version from notification.ts (more idiomatic than .toFixed(0)) as the canonical implementation.
The #[tauri::command] wrapper function check_path_writable_cmd was never called from any frontend TypeScript/Svelte code. Remove the wrapper and its entry in generate_handler! while keeping the underlying pub fn check_path_writable which is used by unit tests. Tests: all 38 tests pass
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
compress_filesno longer aborts the entire job batch — it now emits an error event and continues to the next file, matching the existing GS error pathformatSizein DetailPanel,formatSavedBytesin notification.ts) merged into a singleformatBytesexport, eliminating silent divergence riskcheck_path_writable_cmdTauri command (registered but never called from the frontend)revealInFinder,basename,checkAndShowUpdateToast, andstrip_vhelpers to eliminate copy-pasted logic across components and Rust modulesmenu_ids_sync_with_build_menutest to catch future divergence between theMENU_IDSconstant andbuild_menu's map inserts; added missingcheck-for-updateassertion to existing menu testTest Plan
npm test— 88 tests passcargo test(fromsrc-tauri/) — 39 tests pass🤖 Generated with Claude Code