feat(workshop): add button for adding .wad.client files/folders#166
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a UI affordance (button + drag/drop overlay) to import .wad, .wad.client, and .wad.mobile files/folders into a selected Workshop layer, backed by a new Tauri IPC command that extracts packed WADs or copies WAD directories into the layer content directory with conflict detection and structured error reporting.
Changes:
- Add “Add WAD” menu actions and OS-level drag/drop handling in the Workshop content browser UI.
- Introduce a new
add_files_to_layerIPC API (+ React Query mutation) returning anAddFilesReport. - Add a Workshop-domain error (
WORKSHOPcode +WorkshopErrorcontext) to report file conflicts cleanly to the frontend.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/modules/workshop/components/LayerFileDropOverlay.tsx | New drop overlay UI for layer imports. |
| src/modules/workshop/components/index.ts | Re-export the new overlay component. |
| src/modules/workshop/components/ContentBrowserLayerSection.tsx | Add “Add WAD” button/menu to import a file or folder into the layer. |
| src/modules/workshop/components/ContentBrowser.tsx | Wire up drag/drop import and overlay; pass layer display name through. |
| src/modules/workshop/api/useLayerFileDrop.ts | New hook to listen for OS drag/drop events and filter WAD paths. |
| src/modules/workshop/api/useAddFilesToLayer.ts | New React Query mutation for addFilesToLayer + conflict-aware toast errors. |
| src/modules/workshop/api/index.ts | Export the new hooks. |
| src/lib/tauri.ts | Add api.addFilesToLayer IPC wrapper. |
| src/lib/bindings/WorkshopError.ts | New generated TS binding for workshop domain errors. |
| src/lib/bindings/Severity.ts | Clarify ordering semantics in generated doc comment. |
| src/lib/bindings/index.ts | Export new generated bindings (AddFilesReport, WorkshopError). |
| src/lib/bindings/ErrorCode.ts | Add WORKSHOP error code. |
| src/lib/bindings/EditModMetadataArgs.ts | Align generated arg shape with Rust (required nullable fields). |
| src/lib/bindings/AddFilesReport.ts | New generated TS binding for import report payload. |
| src-tauri/src/workshop/mod.rs | Define/export WorkshopError + AddFilesReport for IPC/TS bindings. |
| src-tauri/src/workshop/layers.rs | Implement import logic (extract/copy, conflict detection) + tests. |
| src-tauri/src/main.rs | Register the new add_files_to_layer command. |
| src-tauri/src/error.rs | Add WORKSHOP error code and serialize workshop error context into IPC errors. |
| src-tauri/src/commands/workshop.rs | Add Tauri command handler for add_files_to_layer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+354
to
+357
| let basename = canonical | ||
| .file_name() | ||
| .and_then(|s| s.to_str()) | ||
| .ok_or_else(|| { |
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.
No description provided.