1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 20:54:50 +00:00
Commit Graph

169 Commits

Author SHA1 Message Date
tw93
e12a40f6bf fix: use \033[2K to fully clear spinner lines and prevent text remnants
Fixes text remnants and extra blank lines when spinner messages change.

Issues fixed:
1. Text remnants when switching from longer to shorter messages (e.g., 'Cleaning...ems...')
2. Extra blank lines appearing after section headers

Root causes:
- \033[K only clears from cursor to end of line, leaving remnants when new messages are shorter
- stop_section_spinner was clearing lines even when no spinner was running

Changes:
- lib/core/base.sh:
  - Changed stop_section_spinner(), safe_clear_line(), safe_clear_lines() to use \033[2K
  - Added guard in stop_section_spinner to only clear when spinner is actually running
- lib/core/ui.sh:
  - Clear line once when starting spinner (before loop) to ensure clean start
  - Normal spinner rotation uses \r without clearing (performance optimization)

Performance: Line clearing happens only once per spinner start, not on every loop iteration.

Fixes #390
2026-01-31 10:09:02 +08:00
tw93
0a46bf2077 fix: improve status icons and fix spinner cleanup
- Show ✓ for empty trash and discovered versions (normal states)
- Fix inline spinner not stopping, causing residual display artifacts
2026-01-28 20:15:26 +08:00
Gokul
9a109b2b39 fix(clean): handle singular 4K movie summary (#376) 2026-01-27 19:42:54 +08:00
Tw93
09f0cf9e53 chore: auto format code 2026-01-26 07:46:58 +00:00
tw93
b67d149cef Merge branch 'main' of https://github.com/tw93/Mole 2026-01-26 15:46:05 +08:00
tw93
0fbf88a6c6 fix: harden cleanup path validation 2026-01-26 15:43:11 +08:00
Tw93
f272d29490 chore: auto format code 2026-01-26 07:32:44 +00:00
tw93
981c79cfd1 fix: clear cleaning spinner after cleanup 2026-01-26 15:31:30 +08:00
tw93
8c4cd7f82e feat: log cleanup operations for troubleshooting 2026-01-26 15:22:07 +08:00
tw93
e966838c82 style: standardize punctuation across codebase
- Replace parentheses with commas for supplementary info
- Use commas instead of em-dashes for separators
- Update bullet points from - to * in some contexts
- Improve version extraction regex with fallback logic
2026-01-26 14:36:06 +08:00
Tw93
fbff0ec3bd fix: show spinner during cleanup phase
Add progress indicator when deleting files to prevent the terminal
from appearing frozen during long-running cleanup operations.

Closes #358
2026-01-24 08:31:04 +08:00
Tw93
d7a0d480bc fix: improve dry-run mode and error handling
- Export MOLE_DRY_RUN env var for subprocess visibility
- Add || true to grep commands to prevent pipeline failures
- Add dry-run test for clean_orphaned_system_services
- Simplify clean_local_snapshots tests
2026-01-23 18:05:09 +08:00
Tw93
cde39aaeb2 feat(clean): add large file review and unify warnings 2026-01-22 20:15:13 +08:00
Tw93
dad15a5dc6 clean: auto-enable system cleanup when sudo session is active 2026-01-22 17:10:18 +08:00
Tw93
3f85c8238f Use gray color for warning icons to reduce visual noise 2026-01-20 15:07:37 +08:00
Tw93
b4b9b0c474 Add cleanup for orphaned system services
Detect and remove leftover LaunchDaemons, LaunchAgents, and
PrivilegedHelperTools from uninstalled apps like Sogou Input,
ClashX, ClashMac, and Nektony App Cleaner.
2026-01-20 14:25:32 +08:00
Tw93
46472bc86e chore: auto format code 2026-01-17 02:13:54 +00:00
Tw93
e6fc0613d5 perf: improve cleanup UI responsiveness and reduce visual flicker
- Speed up spinner animation from 100ms to 50ms for smoother visuals
- Fix spinner flicker by deferring stop until output is ready
- Remove unnecessary 'Preparing...' spinner at section start
- Hide whitelist-protected items from output (Trash, Finder metadata)
- Add spinner feedback for system diagnostic log cleanup
- Remove redundant stop_section_spinner calls in cleanup modules

The cleanup process now feels significantly faster and more polished,
with continuous visual feedback and no jarring gaps between operations.
2026-01-17 10:12:23 +08:00
Tw93
e58c7128b0 fix: resolve unbound variable error in safe_clean (bash 3.2 compatibility) 2026-01-11 09:58:37 +08:00
Tw93
54be4e30a2 fix: global optimization for safe_clean and doc update 2026-01-11 09:55:18 +08:00
Tw93
9e7f2a87cf Repair output 2026-01-08 16:12:39 +08:00
Tw93
9d59649b51 feat(debug): add detailed debug output for clean operations
- Add classify_cleanup_risk() for risk level classification (LOW/MEDIUM/HIGH)
- Enhance safe_clean() with operation details and risk info
- Show item counts and file lists in debug mode
- Support for lib/clean/user.sh debug enhancements
- Part of GitHub issue #242 implementation
2026-01-04 17:30:41 +08:00
Tw93
6dfd675417 refactor: standardize epoch time retrieval with get_epoch_seconds and ensure locale-independent string transformations. 2026-01-03 18:07:47 +08:00
Tw93
1e8ff30fa1 chore: auto format code 2025-12-31 08:24:02 +00:00
Tw93
9aa569cbb6 feat: Enhance clean, optimize, analyze, and status commands, and update security audit documentation. 2025-12-31 16:23:31 +08:00
Tw93
bb49ec3170 fix: Improve shell script robustness by adding variable validation and safer du output parsing. 2025-12-30 18:07:48 +08:00
Tw93
fcde129d2f fix: expand default whitelist patterns for accurate comparison and list all active patterns in dry-run output 2025-12-30 17:46:21 +08:00
Tw93
6c1fcd23d7 feat: optimize clean operation performance by pre-expanding whitelist patterns, improving size calculation, and adapting parallel processing based on file types, alongside test suite enhancements. 2025-12-30 17:13:43 +08:00
Tw93
41ce597f02 fix: improve CI stability and Bluetooth audio detection 2025-12-30 16:27:52 +08:00
Tw93
8e45da97b5 chore: auto format code 2025-12-30 07:45:31 +00:00
Tw93
08aec02283 fix: ensure 0KB files or du failures are still cleaned (potential under-cleaning fix)
- Refactor safe_clean to decouple deletion logic from size calculation
 - Attempt deletion for all existing paths, even if size is 0 or unknown
 - Correctly count failures only for files that existed but couldn't be removed
2025-12-30 15:02:35 +08:00
Tw93
1c4b033cf7 refactor: rename total_size_bytes to total_size_kb in clean.sh for clarity 2025-12-30 14:55:43 +08:00
Tw93
34d202eb01 fix: resolve syntax error in size calculation (Issue #203)
- Add numeric validation for size variables in safe_clean()
- Fix get_path_size_kb() to handle non-numeric du output
- Display custom whitelist patterns in dry-run output (Issue #206)
2025-12-30 14:38:02 +08:00
Tw93
694c55f73b fix: implement layered error tolerance and accurate cleanup reporting (#175 #176 #180)
- Fix safe_remove set -e trap in command substitution
  - Fix has_full_disk_access false positives and unknown state handling
  - Use set +e in perform_cleanup for graceful degradation
  - Track removal failures and only count actually deleted items (#180)
  - Add "Skipped X items (permission denied or in use)" notification
  - Improve spinner reliability with cooperative stop mechanism (#175)
2025-12-29 14:27:47 +08:00
Tw93
b67204f959 feat: remove SQLite vacuum optimization, enhance CJK/emoji width calculation, and improve system cleanup and UI feedback. 2025-12-29 00:29:42 +08:00
Tw93
52d50a0a80 Improve spinner subprocess and trap cleanup handling 2025-12-28 19:35:29 +08:00
Tw93
c8e33931c2 refactor: centralize whitelist path checking with a new is_path_whitelisted helper function 2025-12-28 09:21:04 +08:00
Tw93
36e480333b Add inline spinners for better UI feedback and integrate recent items cleanup into the main flow. 2025-12-27 10:15:58 +08:00
Tw93
a7c989588e improve code quality and fix signal handling 2025-12-26 20:34:38 +08:00
Tw93
2c23d15eb7 Clean performance speed optimization 2025-12-26 18:25:38 +08:00
Luke Bullimore
785032635a feat: harden user file handling and gate LaunchServices rebuild (#159)
- add ensure_user_dir/ensure_user_file helpers in lib/core/base.sh, including
  sudo-aware ownership correction under the invoking user’s home
- use the helpers across clean/optimize/purge/uninstall/whitelist to create
  cache and export files safely (no naked mkdir/touch), including log files and
  dry-run exports
- ensure purge stats/count files and update message caches are pre-created with
  safe permissions
- add Darwin version helpers and skip LaunchServices/dyld rebuild on macOS 15+,
  keeping the existing corruption protection for earlier versions
- guard brew cache timestamp writes and TCC permission flags with safe file
  creation to avoid root-owned artifacts
2025-12-26 10:54:56 +08:00
Tw93
d5c41a6fb7 chore: Remove whitelist skipped count from clean script output summaries. 2025-12-22 16:57:25 +08:00
Tw93
240202dfa9 refactor: Extract Apple Silicon cache cleaning to a shared function and improve optimization summary calculation. 2025-12-19 20:35:54 +08:00
Tw93
8eeed7d079 feat(clean, optimize): enhance recent items cleanup safety 2025-12-18 17:19:18 +08:00
Tw93
af03452f6d feat: Enhance clean and optimize operations with new configuration constants 2025-12-18 17:02:04 +08:00
Tw93
9d72eab95a feat: add interactive purge command with comprehensive tests 2025-12-18 14:16:56 +08:00
Tw93
df7e5c8a04 feat: enhance system protection by adding critical path safeguards and removing problematic Spotlight and Finder/Dock cleanups. 2025-12-18 10:42:13 +08:00
Tw93
7e229bbf41 feat: Improve cleaning protection for system settings and control center, 2025-12-18 09:34:38 +08:00
Tw93
34bdd14a6f feat: add purge command to clean project build artifacts and update clean dry-run message. 2025-12-17 20:35:45 +08:00
Tw93
a77638da8d feat: Add com.apple.finder cache to cleaning, protect specific apps from critical cleaning, implement login item whitelist checks 2025-12-15 15:32:49 +08:00