mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3065] [Issue]: In roleplay chats the emoji picker button is hidden on phone-width screens, leaving mobile users with no way to open the in-app emoji picker #1632
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#1632
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/3065
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
In roleplay-mode chats, the emoji picker button in the input bar is completely hidden on phone-width screens (anything below 640px wide, i.e. virtually every phone held in portrait). The button lives inside a
hidden sm:blockwrapper, which means it renders asdisplay:noneon phones and only appears on tablet/desktop widths. Unlike conversation-mode chats — which deliberately render a separate mobile-only smiley button that opens an emoji/GIF/sticker sheet — roleplay mode provides no mobile substitute whatsoever. The emoji picker itself works fine; it's just unreachable on a phone because its only entry point is unconditionally hidden with nothing rendered in its place. A mobile roleplay user simply has no way to reach the app's emoji picker.How to reproduce (try it yourself)
You'll see: roleplay mode has no emoji button anywhere on mobile; the picker is unreachable.
Expected: roleplay mode should expose the emoji picker on mobile too (e.g. via a mobile-only smiley button), matching how conversation mode behaves.
Where it is
packages/client/src/components/chat/ChatInput.tsxline 1504 wraps the only emoji entry point:This is the entire emoji affordance in the file —
Smileappears only at line 1516,EmojiPickeronly at line 1518, both nested inside this singlehidden sm:blockcontainer, and there is nosm:hiddenemoji affordance — the onlysm:hiddenelement in this input bar is the unrelatedQuickSwitcherMobile(line 1475, a connection/persona switcher), not an emoji entry point.The sibling that does it right is
packages/client/src/components/chat/ConversationInput.tsxlines 1951-1971, which render a mobile-onlysm:hiddenSmile button (comment at line 1950: "Mobile: one multipurpose button → Emoji/GIFs/Stickers sheet") togglingmobilePickerOpen, in addition to the desktophidden sm:blockemoji button at lines 2000-2030. So conversation mode keeps an emoji affordance on phones; roleplay mode does not.What's happening
hidden sm:blockcompiles todisplay:noneat widths below the Tailwindsmbreakpoint (640px) anddisplay:blockat >= 640px. Because the emoji button is the only emoji entry point inChatInput.tsxand it is gated entirely behindsm:block, the whole control computes todisplay:noneon phone-portrait widths (<= 639px) and reappears only at >= 640px. Nomax-md:/sm:hiddenmobile alternative is rendered, andstyles/globals.csscontains no override that re-shows it — the mobile media queries (max-width: 767px,max-width: 479px,pointer: coarse) only touch scrollbars and input font-size, never this container. So the utility is genuinely absent on mobile, not merely restyled.Suggested fix
Mirror the conversation-mode pattern, but give the mobile trigger its own visible anchor so the portal-positioned picker lands correctly across the full sub-640px range. As a sibling next to the textarea (outside the existing
hidden sm:blockwrapper, which stays untouched), add asm:hiddenSmile button with its own ref (e.g.mobileEmojiButtonRef) and the standard 44px touch-target classes (flex h-11 w-11 items-center justify-center rounded-xl ... sm:hidden) toggling the existingemojiOpenstate, immediately followed by its own<EmojiPicker open={emojiOpen} onClose={() => setEmojiOpen(false)} onSelect={handleEmojiSelect} anchorRef={mobileEmojiButtonRef} containerRef={inputBarRef} />. Keep the desktop button at lines 1504-1525 byte-for-byte unchanged. Because the desktop picker is anchored toemojiButtonRefinsidehidden sm:blockand the mobile picker is anchored to a button visible only below 640px, exactly one is reachable per breakpoint and they share the singleemojiOpenstate cleanly.Important: do NOT take the naive shortcut of just adding a second visible button that reuses the existing
<EmojiPicker anchorRef={emojiButtonRef}>(the desktop one). On mobile that desktop anchor button isdisplay:none, so itsgetBoundingClientRect()returns all zeros; the picker's positioning effect then computesright = vw - btnRect.right = vw, shoving the panel off-screen on 480-639px-wide phones. Giving the mobile button its own visible anchor avoids this entirely. (Minor consistency note, out of scope: this file's desktopEmojiPickeromits thecustomTabcustom-emoji tab thatConversationInputpasses — the new mobile instance should match the desktop instance in this file, i.e. omitcustomTab, so the two roleplay pickers stay consistent.)Regression avoided: the new trigger is
sm:hidden(display:noneat >= 640px), so desktop and >= 768px layouts and the light/dark/sillytavern themes are untouched.ChatInput.tsxis roleplay-only (used solely byChatRoleplaySurface.tsx); conversation mode usesConversationInput.tsxand game mode usesGameInput.tsx, so this change cannot affect them. The new button reuses the sameforeground/*token classes and theh-11 w-11/sm:h-8 sm:w-8touch-target convention already used by the Paperclip and Send buttons, so it slots into the flex row without reflow, andEmojiPickerrenders viacreatePortaltodocument.bodywithposition:fixed, so it isn't clipped by the input bar's rounded/overflow shell.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.