Skip to content

feat: import local mods by dropping files anywhere in the window - #373

Open
Slush97 wants to merge 1 commit into
mainfrom
feat/global-mod-file-drop
Open

feat: import local mods by dropping files anywhere in the window#373
Slush97 wants to merge 1 commit into
mainfrom
feat/global-mod-file-drop

Conversation

@Slush97

@Slush97 Slush97 commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • Dropping .vpk/.zip/.7z/.rar files anywhere in the app now stages them in the existing batch import modal, with an app-wide drag indicator. Design doc: docs/global-mod-file-drop-plan.md.
  • New capture-phase controller (src/lib/useGlobalModFileDrop.ts) classifies drops by extension at drop time: supported mod files are claimed and handed to the modal through the store; everything else passes through so the image, MP3, and GLB zones keep their file types. Default file-navigation protection is preserved.
  • Shared pure parser classifyDroppedModFiles() in customModImport.ts replaces the modal's inline classification; both the controller and the modal use it (unresolved > rejected error priority kept, including the Windows archive-viewer virtual-file guidance).
  • Store handoff in appStore: openBatchImport(paths?), consumeBatchImportPaths, setBatchImportBusy, closeBatchImport, setSuppressGlobalModDrop (replaces setBatchImportOpen). Pending paths are consumed with functional updates so rapid successive drops are never lost.
  • The add-variants instance of ImportCustomModsModal registers suppressGlobalModDrop while mounted, so its own VPK drop zone keeps ownership and the batch importer never opens on top of it. Drops during an active batch submission are rejected with a toast instead of being silently discarded.
  • Two new i18n keys (layout.modDrop.indicator, layout.modDrop.busy); locale manifest regenerated.

Test plan

  • pnpm exec vitest run (1319 tests, includes new parser and store handoff suites)
  • pnpm typecheck, pnpm lint, pnpm i18n:check, manifest check
  • Manual cross-platform drag scenarios from the plan doc (Windows/Linux/macOS file managers)

🤖 Generated with Claude Code

https://claude.ai/code/session_01MjfS6sYi3NrviAzA4LWifk

Dropping .vpk/.zip/.7z/.rar files on any page or surface now stages them
in the existing batch import modal. A capture-phase window controller
classifies drops by extension, hands paths to the modal through the
store, and shows an app-wide drag indicator. The add-variants modal
suppresses the global controller while mounted so its own drop zone
keeps ownership; drops during an active batch are rejected with
feedback instead of being silently lost. Specialized image/MP3/GLB
zones keep every file type the controller does not claim.

Claude-Session: https://claude.ai/code/session_01MjfS6sYi3NrviAzA4LWifk
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.

1 participant