mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4413] [MERGED] feat(chat): mobile drop dock for chat resource drag-and-drop #6368
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6368
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4413
Author: @Gunterlie
Created: 8/1/2026
Status: ✅ Merged
Merged: 8/1/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/mobile-chat-resource-drop-dock📝 Commits (7)
c0308c7feat(chat): drop resources into the active chat from the mobile library panel13b5805fix(chat): shrink the mobile drop dock to an icon-sized target419ec7efeat(agents): make agent rows touch-draggable5350f0bfeat(chat): reopen the library panel after a mobile drop settles3eccddefeat(chat): surface agent setup after a drop and restore the panel after ita2c977bMerge branch 'staging' into feat/mobile-chat-resource-drop-dockac13988Merge branch 'staging' into feat/mobile-chat-resource-drop-dock📊 Changes
18 files changed (+449 additions, -18 deletions)
View changed files
📝
packages/client/src/components/chat/ChatArea.tsx(+8 -0)📝
packages/client/src/components/chat/ChatResourceDropOverlay.tsx(+36 -14)➕
packages/client/src/components/chat/ChatResourceMobileDropDock.tsx(+113 -0)📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+15 -1)📝
packages/client/src/components/layout/AppShell.tsx(+3 -0)📝
packages/client/src/components/panels/AgentsPanel.tsx(+95 -0)📝
packages/client/src/components/panels/CharactersPanel.tsx(+22 -0)📝
packages/client/src/components/panels/ConnectionsPanel.tsx(+7 -0)📝
packages/client/src/components/panels/LorebooksPanel.tsx(+11 -0)📝
packages/client/src/components/panels/PersonasPanel.tsx(+7 -0)📝
packages/client/src/components/panels/PresetsPanel.tsx(+1 -0)📝
packages/client/src/components/panels/settings/BackgroundPicker.tsx(+1 -0)📝
packages/client/src/hooks/use-touch-folder-drag.ts(+12 -0)📝
packages/client/src/lib/chat-resource-drag.ts(+46 -0)📝
packages/client/src/localization/locales/en.json(+1 -0)📝
packages/client/src/stores/ui.store.ts(+1 -1)📝
packages/client/src/styles/globals.css(+28 -1)📝
scripts/regressions/chat-resource-drop.regression.ts(+42 -1)📄 Description
Closes #4412
Why
Chat resource drag-and-drop is desktop-only in practice. On mobile the library panel is a full-width overlay over the chat, so a touch drag has nowhere to land — there is no visible
[data-chat-resource-drop-surface], and touch drops only ever resolved against folder targets inside the panel. Users on mobile can only use the tap-onlyChatResourceActionButton, so the gesture that the whole feature is built around simply does not exist for them.What
A left-edge drop dock that appears only while a chat-resource touch drag is active, sits above the panel (
z-9000, below modals atz-10000), and shows the same icon/accent/title as the desktop overlay — including the blocked state for already-active or unsupported resources.Dropping on it closes the right panel and dispatches
requestChatResourceAssignment(payload), i.e. the exact same assignment path the desktop overlay and the row action button already use. No new mutation, confirmation or modal logic.chat-resource-drag.ts: touch drags carry nodataTransfer, so the active payload is held in module state with a subscribe/notify pair the dock reads throughuseSyncExternalStore.use-touch-folder-drag.ts: one optionalchatResourcePayloadstart option; the hook sets it on activate and clears it on cancel/drop, so lifecycle stays in one place. No behavior change when the option is omitted.onDragStart.getBoundingClientRectpertouchmove, and listens in the capture phase so the payload is still set when it reads it.Panel folder drops need no changes: they resolve via
elementFromPoint(...).closest("[data-*-folder-id]"), and the dock is not a folder, so that branch already no-ops.Panel closes on drop
Deliberate divergence from the tap button, which leaves the panel open. A drop means "put this in the chat"; if the panel stayed open the success toast — the only route to undo — would fire behind a full-screen overlay. The connection-needs-setup branch reopens the panel afterwards, which is the correct ordering since the close happens before the assignment dispatches.
Validation
pnpm checkpnpm localization:checkpnpm regression:chat-resource-droppnpm smoke:uiTest plan
ChoiceSelectionModal) at 360px widthNotes
chat-resource-drop.regression.ts; the dock geometry and gesture itself are not covered by the Playwright lane and need the manual pass above.ui.chat.chatresourcemobiledropdock.labelis English-only, as with other new keys.Summary by CodeRabbit
New Features
Bug Fixes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.