[PR #4403] [MERGED] feat: polish chat resource drop targets and offer greeting/lorebook options on character drop #6363

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4403
Author: @Gunterlie
Created: 8/1/2026
Status: ✅ Merged
Merged: 8/1/2026
Merged by: @SpicyMarinara

Base: staging ← Head: drag-me-baby-one-more-time


📝 Commits (10+)

  • 2f88753 feat: drag resources into active chats
  • 7574747 feat: support chat resource replacements
  • 95044c7 feat: drag backgrounds into active chats
  • 3b6d980 feat: add active chat resource actions
  • 0916236 fix: route chat resource assignment through existing setup flows
  • 46bd96f feat: explain blocked chat resource drops
  • c66c7b1 feat: offer greeting and lorebook options after character drop
  • 782983f Enhance chat resource drop overlay with accent colors and hints
  • 0c3eb18 Validate agent mode support in chat resource drops
  • 6bc7a03 Merge remote-tracking branch 'origin/staging' into drag-me-baby-one-more-time

📊 Changes

28 files changed (+2474 additions, -87 deletions)

View changed files

➕ docs/development/chat-resource-drag-drop-plan.md (+475 -0)
📝 e2e/core-flows.e2e.ts (+157 -0)
📝 package.json (+2 -1)
📝 packages/client/src/components/chat/ChatArea.tsx (+6 -0)
➕ packages/client/src/components/chat/ChatCharacterDropOptions.tsx (+222 -0)
📝 packages/client/src/components/chat/ChatInput.tsx (+4 -0)
➕ packages/client/src/components/chat/ChatResourceActionButton.tsx (+36 -0)
➕ packages/client/src/components/chat/ChatResourceDropOverlay.tsx (+668 -0)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+1 -1)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+67 -41)
📝 packages/client/src/components/chat/ConversationInput.tsx (+4 -0)
📝 packages/client/src/components/chat/ConversationView.tsx (+5 -1)
📝 packages/client/src/components/game/GameInput.tsx (+1 -0)
📝 packages/client/src/components/game/GameSurface.tsx (+5 -1)
📝 packages/client/src/components/panels/AgentsPanel.tsx (+57 -7)
📝 packages/client/src/components/panels/CharactersPanel.tsx (+41 -7)
📝 packages/client/src/components/panels/ConnectionsPanel.tsx (+25 -3)
📝 packages/client/src/components/panels/LorebooksPanel.tsx (+20 -3)
📝 packages/client/src/components/panels/PersonasPanel.tsx (+45 -16)
📝 packages/client/src/components/panels/PresetsPanel.tsx (+17 -3)

...and 8 more files

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.

Linked issue

Closes #4405

Why this change

  • Dropping a library resource onto a chat worked, but the drop target read as a faint tinted rectangle with a small neutral card: it was hard to tell what you were about to drop, where it would land, and what would happen once you let go. The overlay also used the same colour for every resource type, so the visual link to the library panel you dragged from was lost.
  • Dropping a character silently added them and nothing else. In every other flow (chat setup wizard, settings drawer) adding a character offers their greeting as a first message, and a character's lorebooks quietly activate in the chat with no way to say "not that one". Drag-and-drop skipped both, so the fast path gave a worse result than the slow one.

What changed

  • Drop overlay visuals (ChatResourceDropOverlay.tsx, globals.css): larger zone and card, 4px dotted border, soft radial tint and inner glow, gradient icon tile. The previous animated dashed border ("marching lines") is gone; only a short fade/scale-in remains, and it is disabled under prefers-reduced-motion.
  • Per-resource colours: the overlay now pulls the existing .mari-panel-gradient--* tokens, so a dragged lorebook reads amber, a persona emerald, a preset purple, a connection sky, an agent violet, a character pink/rose. Added a --backgrounds variant (indigo) since backgrounds had no panel entry. Blocked drops override to the destructive colour.
  • Wording: every state gains a second line explaining the consequence ("They join the cast and can reply in this chat.", "Its entries become available as context here.", "It becomes the scene behind this chat.", …); blocked reads "Nothing changes if you drop it here." The title/hint/accent lookups replaced a seven-deep nested ternary with three small Records.
  • Character drop follow-up (new ChatCharacterDropOptions.tsx): after a single character is dropped, a modal offers to post their first message (with the greeting picker, remaining greetings stored as silent swipes) and lists the character's linked lorebooks — unchecking one writes it to the chat's excludedLorebookIds metadata, which the server already honours. Skipped in conversation mode for the greeting half, self-closes when the character has neither greetings nor lorebooks, and is dismissed if the add is undone.
  • Greeting parsing extracted to packages/client/src/lib/character-greetings.ts and covered by scripts/regressions/chat-resource-drop.regression.ts (wired into regression:issues).
  • Merged latest origin/staging.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

pnpm check, pnpm version:check, pnpm regression:chat-resource-drop, and the focused Playwright drag/drop lane pass on the final v2.4.0 branch. pnpm smoke:ui completed 173 tests; its only two failures are the same pre-existing character-card width assertion reproduced on the untouched PR head. The manual browser checks below remain unchecked for human verification.

  • Manually verify in browser: drag one resource of each type (character, lorebook, agent, persona, preset, connection, background) over an active chat and confirm the dotted zone and icon tile take that resource's library colour and the hint text matches the action.
  • Manually verify in browser: drag a resource that is already active and confirm the blocked state renders in the destructive colour with "Nothing changes if you drop it here."
  • Manually verify in browser: drop a character with a first message plus alternate greetings — confirm the options modal appears, the chosen greeting posts as the character's message, and the remaining greetings are reachable as swipes.
  • Manually verify in browser: drop a character with a linked lorebook, uncheck it, then confirm that lorebook no longer appears in the chat's lorebook preview / prompt.
  • Manually verify in browser: drop a character in a conversation-mode chat and confirm no greeting section is offered.
  • Manually verify in browser: hit Undo on the "Added X to this chat" toast and confirm the options modal closes without side effects.
  • Manually verify: light + dark themes, mobile viewport, and a reduced-motion system setting (no animation).

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

No docs/ files changed, so no docs-i18n mirroring is required. New user-facing strings were added to packages/client/src/localization/locales/en.json only; other locales fall back to English until translated.

UI evidence (if applicable)

Screenshots of the new drop overlay (per-type colours) and the character options modal still need to be attached by a human reviewer/author.

Summary by CodeRabbit

  • New Features
    • Added desktop drag-and-drop assignment of characters, agents, lorebooks, personas, presets, connections, and backgrounds to chats.
    • Added contextual drop targets, action buttons, compatibility checks, replacement confirmations, and undo support.
    • Added character greeting and lorebook selection when adding characters.
    • Added queued agent setup through chat resource actions.
  • Documentation
    • Added guidance on supported operations, accessibility, localization, testing, and rollout.
  • Tests
    • Added end-to-end and regression coverage for assignments, replacements, validation, and greeting handling.

🔄 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/4403 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 8/1/2026 **Status:** ✅ Merged **Merged:** 8/1/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `drag-me-baby-one-more-time` --- ### 📝 Commits (10+) - [`2f88753`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2f887536e7812606a6e0ba7b56dfdae72faf4361) feat: drag resources into active chats - [`7574747`](https://github.com/Pasta-Devs/Marinara-Engine/commit/757474750f78ebeaf57b3050806ed4bfb1fe090b) feat: support chat resource replacements - [`95044c7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/95044c7b0c84278185e5a80bf94b8e8866d88948) feat: drag backgrounds into active chats - [`3b6d980`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3b6d9808d192c0947ecf7116006ebd91d62f1c84) feat: add active chat resource actions - [`0916236`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0916236b21258b93c2ef69a4ccdffd1b86a1f387) fix: route chat resource assignment through existing setup flows - [`46bd96f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/46bd96ff3eaee4fa6e80cd914c0da91a192819de) feat: explain blocked chat resource drops - [`c66c7b1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c66c7b1c137394f52ecf18ec6edfe4f681ef80fe) feat: offer greeting and lorebook options after character drop - [`782983f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/782983fd71f8022813e7f36573f97109a0cc6f52) Enhance chat resource drop overlay with accent colors and hints - [`0c3eb18`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0c3eb18a5e1f3b9d96a3687ed8b99601e3fc48a5) Validate agent mode support in chat resource drops - [`6bc7a03`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6bc7a03ad34b56609e254cac5cec84d2619b91be) Merge remote-tracking branch 'origin/staging' into drag-me-baby-one-more-time ### 📊 Changes **28 files changed** (+2474 additions, -87 deletions) <details> <summary>View changed files</summary> ➕ `docs/development/chat-resource-drag-drop-plan.md` (+475 -0) 📝 `e2e/core-flows.e2e.ts` (+157 -0) 📝 `package.json` (+2 -1) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+6 -0) ➕ `packages/client/src/components/chat/ChatCharacterDropOptions.tsx` (+222 -0) 📝 `packages/client/src/components/chat/ChatInput.tsx` (+4 -0) ➕ `packages/client/src/components/chat/ChatResourceActionButton.tsx` (+36 -0) ➕ `packages/client/src/components/chat/ChatResourceDropOverlay.tsx` (+668 -0) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+1 -1) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+67 -41) 📝 `packages/client/src/components/chat/ConversationInput.tsx` (+4 -0) 📝 `packages/client/src/components/chat/ConversationView.tsx` (+5 -1) 📝 `packages/client/src/components/game/GameInput.tsx` (+1 -0) 📝 `packages/client/src/components/game/GameSurface.tsx` (+5 -1) 📝 `packages/client/src/components/panels/AgentsPanel.tsx` (+57 -7) 📝 `packages/client/src/components/panels/CharactersPanel.tsx` (+41 -7) 📝 `packages/client/src/components/panels/ConnectionsPanel.tsx` (+25 -3) 📝 `packages/client/src/components/panels/LorebooksPanel.tsx` (+20 -3) 📝 `packages/client/src/components/panels/PersonasPanel.tsx` (+45 -16) 📝 `packages/client/src/components/panels/PresetsPanel.tsx` (+17 -3) _...and 8 more files_ </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. ## Linked issue Closes #4405 ## Why this change - Dropping a library resource onto a chat worked, but the drop target read as a faint tinted rectangle with a small neutral card: it was hard to tell *what* you were about to drop, *where* it would land, and *what would happen* once you let go. The overlay also used the same colour for every resource type, so the visual link to the library panel you dragged from was lost. - Dropping a character silently added them and nothing else. In every other flow (chat setup wizard, settings drawer) adding a character offers their greeting as a first message, and a character's lorebooks quietly activate in the chat with no way to say "not that one". Drag-and-drop skipped both, so the fast path gave a worse result than the slow one. ## What changed - **Drop overlay visuals** (`ChatResourceDropOverlay.tsx`, `globals.css`): larger zone and card, 4px dotted border, soft radial tint and inner glow, gradient icon tile. The previous animated dashed border ("marching lines") is gone; only a short fade/scale-in remains, and it is disabled under `prefers-reduced-motion`. - **Per-resource colours**: the overlay now pulls the existing `.mari-panel-gradient--*` tokens, so a dragged lorebook reads amber, a persona emerald, a preset purple, a connection sky, an agent violet, a character pink/rose. Added a `--backgrounds` variant (indigo) since backgrounds had no panel entry. Blocked drops override to the destructive colour. - **Wording**: every state gains a second line explaining the consequence ("They join the cast and can reply in this chat.", "Its entries become available as context here.", "It becomes the scene behind this chat.", …); blocked reads "Nothing changes if you drop it here." The title/hint/accent lookups replaced a seven-deep nested ternary with three small `Record`s. - **Character drop follow-up** (new `ChatCharacterDropOptions.tsx`): after a single character is dropped, a modal offers to post their first message (with the greeting picker, remaining greetings stored as silent swipes) and lists the character's linked lorebooks — unchecking one writes it to the chat's `excludedLorebookIds` metadata, which the server already honours. Skipped in conversation mode for the greeting half, self-closes when the character has neither greetings nor lorebooks, and is dismissed if the add is undone. - Greeting parsing extracted to `packages/client/src/lib/character-greetings.ts` and covered by `scripts/regressions/chat-resource-drop.regression.ts` (wired into `regression:issues`). - Merged latest `origin/staging`. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes `pnpm check`, `pnpm version:check`, `pnpm regression:chat-resource-drop`, and the focused Playwright drag/drop lane pass on the final v2.4.0 branch. `pnpm smoke:ui` completed 173 tests; its only two failures are the same pre-existing character-card width assertion reproduced on the untouched PR head. The manual browser checks below remain unchecked for human verification. - Manually verify in browser: drag one resource of each type (character, lorebook, agent, persona, preset, connection, background) over an active chat and confirm the dotted zone and icon tile take that resource's library colour and the hint text matches the action. - Manually verify in browser: drag a resource that is already active and confirm the blocked state renders in the destructive colour with "Nothing changes if you drop it here." - Manually verify in browser: drop a character with a first message plus alternate greetings — confirm the options modal appears, the chosen greeting posts as the character's message, and the remaining greetings are reachable as swipes. - Manually verify in browser: drop a character with a linked lorebook, uncheck it, then confirm that lorebook no longer appears in the chat's lorebook preview / prompt. - Manually verify in browser: drop a character in a conversation-mode chat and confirm no greeting section is offered. - Manually verify in browser: hit Undo on the "Added X to this chat" toast and confirm the options modal closes without side effects. - Manually verify: light + dark themes, mobile viewport, and a reduced-motion system setting (no animation). ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) No `docs/` files changed, so no `docs-i18n` mirroring is required. New user-facing strings were added to `packages/client/src/localization/locales/en.json` only; other locales fall back to English until translated. ## UI evidence (if applicable) Screenshots of the new drop overlay (per-type colours) and the character options modal still need to be attached by a human reviewer/author. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added desktop drag-and-drop assignment of characters, agents, lorebooks, personas, presets, connections, and backgrounds to chats. * Added contextual drop targets, action buttons, compatibility checks, replacement confirmations, and undo support. * Added character greeting and lorebook selection when adding characters. * Added queued agent setup through chat resource actions. * **Documentation** * Added guidance on supported operations, accessibility, localization, testing, and rollout. * **Tests** * Added end-to-end and regression coverage for assignments, replacements, validation, and greeting handling. <!-- 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-23 04:09:42 +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#6363
No description provided.