[PR #1166] [MERGED] Fix character import drag-and-drop handling #4952

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1166
Author: @ghost
Created: 5/24/2026
Status: ✅ Merged
Merged: 5/24/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/refactor-pr-51-character-import-dnd


📝 Commits (2)

  • 183dc9d Migrate Refactor PR #51: Fix character import drag-and-drop
  • f7680e0 Address review feedback for character import drops

📊 Changes

1 file changed (+88 additions, -7 deletions)

View changed files

📝 src/features/catalog/characters/components/ImportCharacterModal.tsx (+88 -7)

📄 Description

Migrated from Pasta-Devs/Marinara-Engine-Refactor PR 51: https://github.com/Pasta-Devs/Marinara-Engine-Refactor/pull/51
Original author: @Promansis
Target base: Pasta-Devs/Marinara-Engine refactor
Source issue: Pasta-Devs/Marinara-Engine-Refactor issue 38

Note: this intentionally references the refactor-repo issue. It does not close Pasta-Devs/Marinara-Engine issue 38, which is an unrelated Windows cp installer issue.


Why this change

  • The Import Character modal could lose drag hover state when dragged items crossed nested drop-zone elements.
  • Folder-like or unsupported drops could fail without a clear rejection.

What changed

  • React UI owner: src/features/catalog/characters/components/ImportCharacterModal.tsx.
  • Track drag depth for stable enter/leave handling.
  • Stop propagation on drop-zone drag events and set a copy drop effect for supported file drops.
  • Inspect DataTransferItems so unsupported or folder-like drops show a clear error instead of silently doing nothing.
  • Clear any pending embedded-lorebook prompt when an invalid drop is rejected.

Validation

Codex local verification:

  • pnpm check passed from D:\dev\Marinara-Engine-pr-1166-refactor with TEMP/TMP pointed at scratch\codex-temp because C: had no free temp space.
  • node scratch\pr1166-dnd-smoke.mjs passed against local Vite at http://127.0.0.1:5178:
    • opened the Import Character modal
    • confirmed nested drag enter/leave keeps the drag highlight active
    • confirmed unsupported non-file drops show a clear rejection
    • confirmed folder-like drops show a clear rejection
    • confirmed a supported .json drop enters the import path

GitHub verification:

  • CI / Frontend, Architecture, and Organization: pass
  • CI / Rust Capability Layer: pass
  • CI / Browser Smoke and Performance: pass
  • Pull Request Triage / Auto-label: pass

Manual verification notes

  • Tauri desktop native OS drag/drop was not manually exercised. The local browser smoke verifies the React drop-zone handler path; GitHub browser smoke and CI are green.

Docs impact

  • No docs changes needed.

UI evidence

  • Local screenshots were captured by scratch\pr1166-dnd-smoke.mjs for the modal, folder rejection, and supported-drop state. They are not embedded here because they are local proof artifacts, not GitHub-hosted attachments.

🔄 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/1166 **Author:** [@ghost](https://github.com/ghost) **Created:** 5/24/2026 **Status:** ✅ Merged **Merged:** 5/24/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/refactor-pr-51-character-import-dnd` --- ### 📝 Commits (2) - [`183dc9d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/183dc9d02cf82da2904efcb9e2758f8446dbc123) Migrate Refactor PR #51: Fix character import drag-and-drop - [`f7680e0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f7680e0ec68ac4b42c1b92b7dd859b8afafb389b) Address review feedback for character import drops ### 📊 Changes **1 file changed** (+88 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/features/catalog/characters/components/ImportCharacterModal.tsx` (+88 -7) </details> ### 📄 Description Migrated from Pasta-Devs/Marinara-Engine-Refactor PR 51: https://github.com/Pasta-Devs/Marinara-Engine-Refactor/pull/51 Original author: @Promansis Target base: Pasta-Devs/Marinara-Engine `refactor` Source issue: Pasta-Devs/Marinara-Engine-Refactor issue 38 Note: this intentionally references the refactor-repo issue. It does not close Pasta-Devs/Marinara-Engine issue 38, which is an unrelated Windows `cp` installer issue. --- ## Why this change - The Import Character modal could lose drag hover state when dragged items crossed nested drop-zone elements. - Folder-like or unsupported drops could fail without a clear rejection. ## What changed - React UI owner: `src/features/catalog/characters/components/ImportCharacterModal.tsx`. - Track drag depth for stable enter/leave handling. - Stop propagation on drop-zone drag events and set a copy drop effect for supported file drops. - Inspect `DataTransferItem`s so unsupported or folder-like drops show a clear error instead of silently doing nothing. - Clear any pending embedded-lorebook prompt when an invalid drop is rejected. ## Validation Codex local verification: - `pnpm check` passed from `D:\dev\Marinara-Engine-pr-1166-refactor` with `TEMP`/`TMP` pointed at `scratch\codex-temp` because `C:` had no free temp space. - `node scratch\pr1166-dnd-smoke.mjs` passed against local Vite at `http://127.0.0.1:5178`: - opened the Import Character modal - confirmed nested drag enter/leave keeps the drag highlight active - confirmed unsupported non-file drops show a clear rejection - confirmed folder-like drops show a clear rejection - confirmed a supported `.json` drop enters the import path GitHub verification: - CI / Frontend, Architecture, and Organization: pass - CI / Rust Capability Layer: pass - CI / Browser Smoke and Performance: pass - Pull Request Triage / Auto-label: pass ## Manual verification notes - Tauri desktop native OS drag/drop was not manually exercised. The local browser smoke verifies the React drop-zone handler path; GitHub browser smoke and CI are green. ## Docs impact - No docs changes needed. ## UI evidence - Local screenshots were captured by `scratch\pr1166-dnd-smoke.mjs` for the modal, folder rejection, and supported-drop state. They are not embedded here because they are local proof artifacts, not GitHub-hosted attachments. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:11:58 +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#4952
No description provided.