mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #3366] [CLOSED] fix(gallery): keep image/video preview open on a text-selection drag #5904
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#5904
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/3366
Author: @kolacheee
Created: 7/8/2026
Status: ❌ Closed
Base:
staging← Head:fix/3363-gallery-lightbox-close📝 Commits (1)
c80dc3dfix(gallery): keep image/video preview open on a text-selection drag (#3363)📊 Changes
1 file changed (+18 additions, -2 deletions)
View changed files
📝
packages/client/src/components/chat/ChatImageLightbox.tsx(+18 -2)📄 Description
Linked issue
Closes #3363.
Important: the primary symptom in #3363 — the whole in-chat Gallery drawer closing on any lightbox interaction (Copy prompt, selecting text, clicking the image), plus the missing "Prompt copied." toast — was already fixed on
stagingby8f677f789("Fix message and agent image prompt edges", #3361), which tags the lightbox portal withdata-chat-floating-panelso the drawer's document-level outside-click listener excludes it. This PR handles the one remaining way an image interaction can still dismiss the preview.Why this change
With the drawer-close fixed, one residual remains. The image/video preview (
ChatImageLightbox) closes on a backdrop click viaonClick={(e) => { if (e.target === e.currentTarget) onClose() }}. When a text-selection drag starts inside the preview and releases on the backdrop, the browser resolves theclicktarget to the backdrop (the common ancestor of the drag's start and end), soe.target === e.currentTargetis true and the preview closes. So highlighting the prompt text and dragging slightly past the panel still dismisses the image — and #3363 explicitly asks that selecting text not dismiss anything.What changed
packages/client/src/components/chat/ChatImageLightbox.tsx(both the image and video lightbox) — the backdrop now records, onpointerdown, whether the press landed on the backdrop itself, and only closes onclickwhen both the pointer-down and the click are on the backdrop. A genuine backdrop click still closes the preview; a text-selection drag that merely releases on the backdrop does not.No server, shared, or drawer changes (the drawer fix is already on
staging).Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm --filter @marinara-engine/client build,pnpm --filter @marinara-engine/client lint.8f677f789— worth re-confirming).Docs and release impact
Event-handling-only change; no docs or version impact.
UI evidence (if applicable)
N/A — pointer/click event handling only; no visual change.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.