[PR #1245] [MERGED] Add image upload dropzones #5003

Closed
opened 2026-10-22 04:12:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1245
Author: @Xelvanis
Created: 5/26/2026
Status: ✅ Merged
Merged: 5/26/2026
Merged by: @Xelvanis

Base: refactor ← Head: feat/image-upload-dropzones


📝 Commits (4)

  • c097dd1 Add image upload dropzones
  • 4570ac4 Merge remote-tracking branch 'origin/refactor' into codex/adapt-044891a
  • f35e57f Add image upload dropzones
  • 3e721af Address image upload review findings

📊 Changes

10 files changed (+486 additions, -66 deletions)

View changed files

📝 src-tauri/src/commands/storage.rs (+1 -1)
📝 src-tauri/src/commands/storage/backgrounds.rs (+4 -4)
📝 src-tauri/src/commands/storage/shared.rs (+84 -5)
📝 src-tauri/src/http_dispatch.rs (+136 -1)
📝 src/features/catalog/characters/components/CharacterEditor.tsx (+13 -17)
📝 src/features/catalog/gallery/hooks/use-gallery.ts (+17 -2)
📝 src/features/modes/shared/chat-ui/components/ChatGallery.tsx (+22 -22)
📝 src/features/shell/settings/components/SettingsPanel.tsx (+11 -14)
📝 src/shared/api/remote-runtime.ts (+3 -0)
➕ src/shared/components/ui/ImageUploadDropzone.tsx (+195 -0)

📄 Description

Linked issue

No linked issue. This is a refactor-adaptation/parity branch from Xel's request.

Why this change

  • The refactor branch needed the legacy image-upload/dropzone behavior adapted for chat gallery, character gallery, and settings background imports.
  • Follow-up review found remote runtime upload commands were not routed through the HTTP invoke pipeline and image upload payloads needed explicit size/count guards.

What changed

  • Added a shared ImageUploadDropzone component for image-only click/select and drag/drop uploads.
  • Replaced bespoke upload buttons in chat gallery, character gallery, and background settings with the shared dropzone.
  • Preserved chat-gallery partial-success behavior while surfacing failed uploads clearly.
  • Added client-side upload limits: 50 images per batch and 20 MB per image.
  • Added Rust-side 20 MB image upload guards for gallery/background upload payloads.
  • Added remote-runtime allowlist and HTTP dispatch support for background_upload, character_gallery_upload, and chat_gallery_upload.

Refactor impact

Primary owner:

  • Shared UI, catalog/gallery, app shell settings, shared API, remote runtime, Rust storage.

Impact areas reviewed:

  • Chat gallery image uploads
  • Character gallery image uploads
  • Settings background imports
  • Shared image upload UX/error paths
  • Remote runtime /api/invoke command routing
  • Rust storage upload decode/persistence boundaries

Boundary notes:

  • Feature/UI surfaces call a shared UI component and existing shared API wrappers.
  • Remote-capable upload commands were added to src/shared/api/remote-runtime.ts and mirrored in src-tauri/src/http_dispatch.rs.
  • Rust storage remains in src-tauri; the background module was made pub(crate) only so HTTP dispatch can route the existing storage owner.
  • Engine code was not touched.

Pressure points touched:

  • Shared mode UI chat gallery
  • Character editor gallery tab
  • Settings background picker
  • Rust HTTP dispatch
  • Rust storage upload helpers

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

Agent-run verification before PR:

  • pnpm typecheck
  • pnpm lint
  • pnpm check:architecture
  • pnpm build passed with existing Vite chunk/dynamic-import warnings
  • cargo check --manifest-path src-tauri/Cargo.toml
  • cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
  • cargo test --manifest-path src-tauri/Cargo.toml
  • pnpm tauri build --debug --no-bundle
  • Native Tauri/WebDriver QA in the real Tauri window covered chat gallery image drop, character gallery image drop, settings background image drop, non-image/non-file rejection paths, and oversized image rejection with no storage row created.
  • GitHub CI was initially blocked by action archive download failures during setup; rerunning failed jobs made the workflow pass.

Remaining manual gaps:

  • OS file-picker selection was not manually exercised; native QA covered drag/drop paths.
  • The 50-file batch cap was not manually exercised.
  • A separate remote-runtime host process was not manually exercised; the remote upload dispatch paths are covered by Rust tests.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No changelog update: this branch currently has no CHANGELOG* file.

UI evidence

Native QA screenshots were generated locally under scratch/tauri-qa-artifacts/qa-1779798954816-*.png and were not committed.

Summary by CodeRabbit

  • New Features
    • Added drag-and-drop image upload interface for character gallery, chat gallery, and background settings.
    • Implemented image upload size validation with automatic rejection of oversized files.
    • Enhanced error reporting for batch uploads with per-file failure tracking and user-friendly messaging.

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1245 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/26/2026 **Status:** ✅ Merged **Merged:** 5/26/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `feat/image-upload-dropzones` --- ### 📝 Commits (4) - [`c097dd1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c097dd14ceda3d4244029ebd64decacdf3c693d3) Add image upload dropzones - [`4570ac4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4570ac40e77dee67e6451c07950064fa47df0679) Merge remote-tracking branch 'origin/refactor' into codex/adapt-044891a - [`f35e57f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f35e57f5aafcb9df9ecc380c3b9ceabafcea9e48) Add image upload dropzones - [`3e721af`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3e721afffeaa697f518a35b5e5c6d461b3280d68) Address image upload review findings ### 📊 Changes **10 files changed** (+486 additions, -66 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage.rs` (+1 -1) 📝 `src-tauri/src/commands/storage/backgrounds.rs` (+4 -4) 📝 `src-tauri/src/commands/storage/shared.rs` (+84 -5) 📝 `src-tauri/src/http_dispatch.rs` (+136 -1) 📝 `src/features/catalog/characters/components/CharacterEditor.tsx` (+13 -17) 📝 `src/features/catalog/gallery/hooks/use-gallery.ts` (+17 -2) 📝 `src/features/modes/shared/chat-ui/components/ChatGallery.tsx` (+22 -22) 📝 `src/features/shell/settings/components/SettingsPanel.tsx` (+11 -14) 📝 `src/shared/api/remote-runtime.ts` (+3 -0) ➕ `src/shared/components/ui/ImageUploadDropzone.tsx` (+195 -0) </details> ### 📄 Description ## Linked issue No linked issue. This is a refactor-adaptation/parity branch from Xel's request. ## Why this change - The refactor branch needed the legacy image-upload/dropzone behavior adapted for chat gallery, character gallery, and settings background imports. - Follow-up review found remote runtime upload commands were not routed through the HTTP invoke pipeline and image upload payloads needed explicit size/count guards. ## What changed - Added a shared `ImageUploadDropzone` component for image-only click/select and drag/drop uploads. - Replaced bespoke upload buttons in chat gallery, character gallery, and background settings with the shared dropzone. - Preserved chat-gallery partial-success behavior while surfacing failed uploads clearly. - Added client-side upload limits: 50 images per batch and 20 MB per image. - Added Rust-side 20 MB image upload guards for gallery/background upload payloads. - Added remote-runtime allowlist and HTTP dispatch support for `background_upload`, `character_gallery_upload`, and `chat_gallery_upload`. ## Refactor impact Primary owner: - Shared UI, catalog/gallery, app shell settings, shared API, remote runtime, Rust storage. Impact areas reviewed: - Chat gallery image uploads - Character gallery image uploads - Settings background imports - Shared image upload UX/error paths - Remote runtime `/api/invoke` command routing - Rust storage upload decode/persistence boundaries Boundary notes: - Feature/UI surfaces call a shared UI component and existing shared API wrappers. - Remote-capable upload commands were added to `src/shared/api/remote-runtime.ts` and mirrored in `src-tauri/src/http_dispatch.rs`. - Rust storage remains in `src-tauri`; the background module was made `pub(crate)` only so HTTP dispatch can route the existing storage owner. - Engine code was not touched. Pressure points touched: - Shared mode UI chat gallery - Character editor gallery tab - Settings background picker - Rust HTTP dispatch - Rust storage upload helpers ## Validation - [x] `pnpm check` passes locally - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [x] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [x] Rust clippy/tests were run for Rust behavior changes - [x] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [x] Remote runtime smoke checked when relevant ### Manual verification notes Agent-run verification before PR: - `pnpm typecheck` - `pnpm lint` - `pnpm check:architecture` - `pnpm build` passed with existing Vite chunk/dynamic-import warnings - `cargo check --manifest-path src-tauri/Cargo.toml` - `cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings` - `cargo test --manifest-path src-tauri/Cargo.toml` - `pnpm tauri build --debug --no-bundle` - Native Tauri/WebDriver QA in the real Tauri window covered chat gallery image drop, character gallery image drop, settings background image drop, non-image/non-file rejection paths, and oversized image rejection with no storage row created. - GitHub CI was initially blocked by action archive download failures during setup; rerunning failed jobs made the workflow pass. Remaining manual gaps: - OS file-picker selection was not manually exercised; native QA covered drag/drop paths. - The 50-file batch cap was not manually exercised. - A separate remote-runtime host process was not manually exercised; the remote upload dispatch paths are covered by Rust tests. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims No changelog update: this branch currently has no `CHANGELOG*` file. ## UI evidence Native QA screenshots were generated locally under `scratch/tauri-qa-artifacts/qa-1779798954816-*.png` and were not committed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added drag-and-drop image upload interface for character gallery, chat gallery, and background settings. * Implemented image upload size validation with automatic rejection of oversized files. * Enhanced error reporting for batch uploads with per-file failure tracking and user-friendly messaging. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1245?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:12:23 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5003
No description provided.