mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3066] [Issue]: Composer emoji/GIF/sticker popovers have no viewport-height clamp, so on short/landscape phones the search box and top rows clip off the top of the screen #1633
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#1633
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/3066
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
The composer emoji/GIF/sticker popovers that open from the chat input bar use a fixed pixel height with no viewport-height clamp. On a short viewport — a phone in landscape, or a small phone whose on-screen keyboard / browser chrome has shrunk the visible height — the popover is taller than the screen. Because it is pinned by its bottom edge (just above the input bar) and grows upward, the overflow spills off the top of the screen. The search input and the first rows of results sit above the top edge and are unreachable: you can't search, and you can't scroll up to them because the panel itself doesn't scroll (only its inner result grid does, and the search box is pinned above it).
This affects the GIF picker, the sticker picker, and the emoji picker's composer mode. Notably, the emoji picker's other mode (the one anchored to a message reaction button) already clamps its height correctly — only the composer/GIF/sticker paths omit the clamp.
How to reproduce (try it yourself)
You'll see: the popover is ~352–416px tall but the screen is only ~360–390px tall, so the top of the panel — including the search input and the first row of GIFs/stickers/emoji — is pushed above the top edge of the screen and cannot be reached or scrolled to.
Expected: the popover should shrink to fit the available height (like the emoji reaction popover already does), keeping the search field and all rows on-screen with the results area scrolling internally.
Where it is
packages/client/src/components/ui/GifPicker.tsx:54-55computes only abottom(const refTop = barRect ? barRect.top : btnRect.top; const bottom = window.innerHeight - refTop + pad;) with no height clamp, and the panel atGifPicker.tsx:281isclassName="fixed z-[9999] flex h-[26rem] w-96 max-w-[calc(100vw-1rem)] ..."withstyle={{ bottom: pos.bottom, ...(right/left) }}— fixedh-[26rem](416px), nomaxHeight.packages/client/src/components/chat/StickerPicker.tsx:67-68(samebottom-only positioning) and panel atStickerPicker.tsx:402className="fixed z-[9999] flex h-[22rem] w-[21rem] ..."— fixedh-[22rem](352px), nomaxHeight.packages/client/src/components/ui/EmojiPicker.tsx:1187-1199— the composer branch (if (containerRef?.current) { ... setPos({ bottom, left }) / setPos({ bottom, right }); return; }) sets only bottom + horizontal, nomaxHeight; the panel atEmojiPicker.tsx:1324is fixedh-[22rem].Done correctly (the contrasting sibling in the same file):
EmojiPicker.tsx:1204— the anchored branch computesconst maxHeight = Math.min(pickerHeight, vh - 2 * pad);and the panel applies it atEmojiPicker.tsx:1330via...(pos.maxHeight != null ? { maxHeight: pos.maxHeight } : {}). The composer/GIF/sticker paths simply never compute or apply that clamp. (For contrast, conversation mode's inline mobile sheet atConversationInput.tsx:1793caps itself withmax-h-[60vh], which is exactly the kind of clamp the portal pickers lack.)What's happening
bottom = window.innerHeight - refTop + padpins the panel's bottom just above the input bar, and the panel then occupies a fixedh-[22rem]/h-[26rem]upward from there. Whenwindow.innerHeightis smaller than that fixed height plus the input-bar offset, the panel's top edge computes to a negative coordinate (above the viewport). The panel hasoverflow-hiddenand only its inner results list scrolls; the search field is a flex sibling pinned at the panel's (now off-screen) top, so it can't be reached. No@media/max-md:rule inglobals.cssconstrains these panels' height — the mobile blocks there only touch scrollbars and input font-size — so nothing mitigates it.Suggested fix
Apply the same viewport-height clamp the anchored emoji branch already uses, to all three composer popovers. In each positioning function, after computing
bottom, also compute and store amaxHeight, then spread it into the panel style:EmojiPickeralready hasmaxHeightin itspostype and panel style (line 1330), so the composer branch only needs to set it.GifPicker/StickerPickerneedmaxHeightadded to theirposstate shape and to the panel'sstyle.Regression avoided: on tall viewports (every phone in portrait, and desktop)
window.innerHeight - 16is larger than the fixed panel height, somaxHeightresolves to the panel's own height and nothing changes — the popovers look and behave exactly as today. The clamp only takes effect when the viewport is shorter than the panel, where it shrinks the panel to fit and lets the inner results grid scroll (the panels already useflex min-h-0 ... overflow-hiddeninternally, and the inner content lists already scroll, so the search field stays pinned at a now-on-screen top — identical to how the anchored emoji reaction popover already behaves). No z-index, horizontal position, or desktop layout is touched, and the change is confined to these three picker components (they portal todocument.bodywithposition: fixed, so no parent is affected).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.