Skip to content

feat: auto-detect and import existing mods#115

Open
Teyk0o wants to merge 2 commits into
mainfrom
feat/auto-detect-existing-mods
Open

feat: auto-detect and import existing mods#115
Teyk0o wants to merge 2 commits into
mainfrom
feat/auto-detect-existing-mods

Conversation

@Teyk0o

@Teyk0o Teyk0o commented Apr 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Scan the Sims 4 Mods folder for existing .package/.ts4script files
  • Group multi-file mods by parent folder (e.g. WickedWhims/ = 1 mod)
  • Import into SimsForge cache with unique UUID per mod (fixes old modId:-1 bug)
  • Create a "My Old Mods" profile automatically
  • Parallel Rust scan with progress events — no UI freeze

Changes

  • Rust: scan_mods_folder (walkdir + rayon parallel hash), copy_file_to
  • ModCacheService: handle non-ZIP files, new addGroupToCache() method
  • ExistingModScanService: orchestrator (scan → cache → profile)
  • ScanExistingModsModal: UI with confirm → progress → summary
  • Profiles page: "Scan Existing Mods" button

Test plan

  • 279 TS unit tests pass (17 new)
  • 6 Rust unit tests pass (all new)
  • Manual test with real Sims 4 Mods folder

Closes #61

🤖 Generated with Claude Code

Teyk0o and others added 2 commits April 25, 2026 19:09
- Add Rust `scan_mods_folder` command: parallel directory walk with
  per-group progress events, groups files by parent folder
- Add Rust `copy_file_to` command for efficient single-file copy
- Add `ExistingModScanService`: orchestrates scan, cache import, and
  profile creation with unique UUID per mod (no more modId:-1)
- Update `ModCacheService`: support non-ZIP files (.package, .ts4script)
  and batch group import via `addGroupToCache()`
- Add `ScanExistingModsModal` UI: confirm → progress → summary
- Add "Scan Existing Mods" button to profiles page

Closes #61

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ExistingModScanService: 9 tests covering scan, import, dedup,
  progress, error handling, folder vs loose file grouping
- ModCacheService: 8 tests covering non-ZIP file handling,
  addGroupToCache, dedup, findModFiles
- Rust: 6 tests for copy_file_to, calculate_file_hash, copy_dir_recursive

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Auto-Detection & Import of Existing Mods

1 participant