[PR #1241] [CLOSED] Fix character import drag-and-drop handling [Issue #1161] #4996

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1241
Author: @Promansis
Created: 5/26/2026
Status: ❌ Closed

Base: refactor ← Head: fix/issue-1161-character-import-drop


📝 Commits (2)

  • fc59cf0 Centralize agent debug mode diagnostics
  • b83470c fix character import drops

📊 Changes

10 files changed (+328 additions, -130 deletions)

View changed files

➕ src/engine/agents-runtime/debug.test.ts (+58 -0)
➕ src/engine/agents-runtime/debug.ts (+50 -0)
📝 src/engine/agents-runtime/executor/agent-executor.ts (+8 -43)
📝 src/engine/agents-runtime/knowledge/knowledge-router.ts (+26 -11)
📝 src/engine/agents-runtime/pipeline/agent-pipeline.ts (+7 -27)
📝 src/engine/contracts/types/agent.ts (+2 -2)
📝 src/features/catalog/characters/components/ImportCharacterModal.tsx (+37 -46)
➕ src/features/catalog/characters/lib/import-drop.test.ts (+69 -0)
➕ src/features/catalog/characters/lib/import-drop.ts (+70 -0)
📝 src/features/shell/settings/components/SettingsPanel.tsx (+1 -1)

📄 Description

Linked issue

Closes #1161

Why this change

  • Character import drag-and-drop could behave inconsistently when users dropped folders, non-file drag items, unsupported files, or moved across nested drop-zone elements.
  • Unsupported filenames could flow into JSON parsing and fail the whole drop instead of producing a clear per-file failure.

What changed

  • Added a focused character import drop extraction helper with explicit folder and non-file rejection.
  • Switched the modal drop path to use that helper and preserve browser FileList fallback behavior.
  • Kept drag highlight stable when moving across nested drop-zone children.
  • Added per-file failures for unsupported filenames and invalid JSON.
  • Added Vitest coverage for file item extraction, folder rejection, non-file rejection, FileList fallback, and supported filename detection.

Refactor impact

Primary owner:

catalog characters

Impact areas reviewed:

  • Character import modal drag-and-drop UI
  • Character import file filtering before shared import API calls
  • Tauri window drag-drop config

Boundary notes:

  • Feature-only change under src/features/catalog/characters.
  • Shared import API, Rust import commands, engine code, remote runtime, chat/roleplay/game mode owners unchanged.
  • src-tauri/tauri.conf.json already has dragDropEnabled: false, so browser drop events remain UI-owned.

Pressure points touched:

  • Character import module

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

Additional validation:

  • pnpm test -- src/features/catalog/characters/lib/import-drop.test.ts passes locally

Manual verification notes

  • Not manually verified in Tauri/browser. Recommended manual check: open character import modal, drop a supported .json/.png, drop a folder, drop an unsupported file, and move the drag cursor across nested text/icons inside the drop zone. Expected: supported files import or show normal import errors, folders/non-file drags show clear errors, unsupported files show per-file failure, and drag highlight remains stable until leaving the drop zone.

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

UI evidence

No screenshot or recording added. Logic covered by focused helper tests; manual drag-drop pass still recommended.


🔄 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/1241 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 5/26/2026 **Status:** ❌ Closed **Base:** `refactor` ← **Head:** `fix/issue-1161-character-import-drop` --- ### 📝 Commits (2) - [`fc59cf0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fc59cf0d1b3457e564bb1f2257f3cf093f69a490) Centralize agent debug mode diagnostics - [`b83470c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b83470c4ffb358e107513e7b92b3ad86f02223b7) fix character import drops ### 📊 Changes **10 files changed** (+328 additions, -130 deletions) <details> <summary>View changed files</summary> ➕ `src/engine/agents-runtime/debug.test.ts` (+58 -0) ➕ `src/engine/agents-runtime/debug.ts` (+50 -0) 📝 `src/engine/agents-runtime/executor/agent-executor.ts` (+8 -43) 📝 `src/engine/agents-runtime/knowledge/knowledge-router.ts` (+26 -11) 📝 `src/engine/agents-runtime/pipeline/agent-pipeline.ts` (+7 -27) 📝 `src/engine/contracts/types/agent.ts` (+2 -2) 📝 `src/features/catalog/characters/components/ImportCharacterModal.tsx` (+37 -46) ➕ `src/features/catalog/characters/lib/import-drop.test.ts` (+69 -0) ➕ `src/features/catalog/characters/lib/import-drop.ts` (+70 -0) 📝 `src/features/shell/settings/components/SettingsPanel.tsx` (+1 -1) </details> ### 📄 Description ## Linked issue Closes #1161 ## Why this change - Character import drag-and-drop could behave inconsistently when users dropped folders, non-file drag items, unsupported files, or moved across nested drop-zone elements. - Unsupported filenames could flow into JSON parsing and fail the whole drop instead of producing a clear per-file failure. ## What changed - Added a focused character import drop extraction helper with explicit folder and non-file rejection. - Switched the modal drop path to use that helper and preserve browser FileList fallback behavior. - Kept drag highlight stable when moving across nested drop-zone children. - Added per-file failures for unsupported filenames and invalid JSON. - Added Vitest coverage for file item extraction, folder rejection, non-file rejection, FileList fallback, and supported filename detection. ## Refactor impact Primary owner: catalog characters Impact areas reviewed: - Character import modal drag-and-drop UI - Character import file filtering before shared import API calls - Tauri window drag-drop config Boundary notes: - Feature-only change under `src/features/catalog/characters`. - Shared import API, Rust import commands, engine code, remote runtime, chat/roleplay/game mode owners unchanged. - `src-tauri/tauri.conf.json` already has `dragDropEnabled: false`, so browser drop events remain UI-owned. Pressure points touched: - Character import module ## 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 - [x] Playwright, screenshot, or recording evidence added for UI changes - [x] Remote runtime smoke checked when relevant Additional validation: - [x] `pnpm test -- src/features/catalog/characters/lib/import-drop.test.ts` passes locally ### Manual verification notes - Not manually verified in Tauri/browser. Recommended manual check: open character import modal, drop a supported `.json`/`.png`, drop a folder, drop an unsupported file, and move the drag cursor across nested text/icons inside the drop zone. Expected: supported files import or show normal import errors, folders/non-file drags show clear errors, unsupported files show per-file failure, and drag highlight remains stable until leaving the drop zone. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence No screenshot or recording added. Logic covered by focused helper tests; manual drag-drop pass still recommended. --- <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:20 +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#4996
No description provided.