mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3071] [Issue]: Per-segment "Copy" button on game narration/dialogue is hidden on mobile (hidden md:block) with no tap fallback, so phone players can't copy GM text #1639
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#1639
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?
Originally created by @kolacheee on GitHub (Jun 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3071
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
Each active narration / dialogue / readable segment in the game surface renders a small Copy button in the top-right corner of its card, but that button is styled
hidden md:block— meaningdisplay: nonebelow 768px and only visible at desktop width. On a phone the button never renders at all. Unlike the Edit affordance on the same cards (which got a dedicated mobile double-tap handler), there is no tap or long-press gesture wired to the copy action. The net effect is that copying the GM's narration or a character's dialogue line is a desktop-only action; a mobile player has no way to copy the text the GM just wrote.How to reproduce (try it yourself)
You'll see: no Copy button is rendered at all; a double-tap only enters Edit mode (and only when the segment is editable), and there is no way to copy the segment's text.
Expected: a reachable Copy control (a visible button, or a tap/long-press gesture) on mobile, matching the desktop affordance.
Where it is
In
packages/client/src/components/game/GameNarration.tsx, all three per-segment Copy buttons are gatedhidden ... md:block:"absolute top-1.5 hidden rounded p-1 text-[var(--muted-foreground)]/40 transition-colors hover:bg-[var(--muted)]/30 hover:text-[var(--muted-foreground)] md:block dark:text-white/20 dark:hover:bg-white/10 dark:hover:text-white/60""absolute right-1.5 top-1.5 hidden rounded p-1 text-amber-200/45 transition-colors hover:bg-amber-100/10 hover:text-amber-100/70 md:block"Contrast the Edit button on the same cards (also
hidden md:block) which IS backed by a mobile fallback: the segment container wiresonPointerDown={(event) => handleMobileSegmentPointerDown(event, active)}andonPointerUp={(event) => handleMobileSegmentTapToEdit(event, active)}(dialogue container 4064-4065, narration container 4208-4209). Those handlers are defined at lines 2125 and 2141 and callsetEditingContent(...)on a mobile double-tap. No equivalent gesture callshandleCopyMessage(defined at line 3399) — its only callers are the threemd:blockbuttons (4143 / 4269 / 4342) plus a separate log-copy feature at line 3426. The readable-variant container (around 4320) has no pointer handlers at all.What's happening
Tailwind
hidden md:blockcompiles todisplay: nonewith a@media (min-width: 768px) { display: block }override. At <=767px the Copy button is removed from the layout entirely (not merely transparent or off-screen), so it cannot be tapped. The narration container's pointer handlers gate strictly on edit (activeCanEditSegment) and only ever callsetEditingContent(line 2162) — they never callhandleCopyMessage. So at phone widths there is no rendered control AND no gesture code path that reaches the copy action. The control reappears at >=768px purely because of themd:blockoverride.Suggested fix
Render a mobile-only sibling Copy button next to (not replacing) each existing
md:blockbutton, wired to the existinghandleCopyMessage(activeCopyKey, activeCopyText). For each of the three sites, add a second button with the same per-variant color/hover tokens but classedblock md:hiddeninstead ofhidden md:block, and pin it toright-1.5unconditionally (drop theactiveCanEditSegment ? "right-7" : "right-1.5"branch on the mobile copy, since the Edit button is itselfhidden md:blockand never renders on phones, leaving the top-right corner free). Keep the desktop button exactly as-is. Reuse the existing per-variant tokens (var(--muted-foreground)/40 plusdark:variants for dialogue/narration;amber-200/45for readable) so light/dark/sillytavern theming stays identical, and gate onactiveCopyKeyexactly as the desktop button does. Amax-md:-visible pattern is already proven in this same file (max-md:opacity-100at lines 3997 and 4917). Alternatively (also acceptable, even lower visual risk), add a Copy entry to the mobile-visible meta-button row at line 4171 / 4285 / 4355, alongside Logs/Inventory.Regression avoided: do NOT remove or relax
hidden md:blockon the existing desktop button, and do NOT collapse it into a single always-visible button. Adding ablock md:hiddensibling leaves the desktop button byte-for-byte unchanged (zero desktop visual change) and adds a control only below 768px. Collapsing to one always-visible button would instead change desktop appearance and entangle theactiveCanEditSegment ? "right-7" : "right-1.5"offset (thatright-7exists to dodge the Edit button, which is absent on mobile, so an always-on button reusing it would float with a dead gap on phones). The buttons are absolutely positioned overlays inside their own relative card, so no flex reflow or z-index is affected, and the shared color tokens keep all themes consistent.AI-investigated against v2.0.6 (packages/client); cited lines read and confirmed. Mobile layout verified by reading the computed Tailwind classes + globals.css, not on a device — please confirm on a phone before fixing.
@SpicyMarinara commented on GitHub (Jun 29, 2026):
Addressed in PR #3072 by commit
4146a380. Validated locally with pnpm check and pnpm smoke:ui.