mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2794] [Issue]: Mobile: Display Size scales chrome too — topbar nav buttons overflow off-screen at Large/Huge; preset marker-row name squeezed #1418
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#1418
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 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2794
Summary
On mobile (~360-390px viewports), the Settings → Display Size control is the single most disruptive layout lever in the app. It is wired to one thing only — the root
font-sizeon<html>— and because essentially the entire UI is sized inrem/em, that one value scales text AND every padding, gap, icon, button, and container uniformly. There is no chrome-vs-prose decoupling. The result:shrink-0and the bar does not wrap or scroll, so the combined width exceeds the viewport, the middleflex-1region collapses to 0, and buttons get pushed off-screen / clipped at the edge (or trigger horizontal scroll). This is the umbrella cause of the separately-reported "top nav overflows at Huge."shrink-0group chip can steal space from it; lorebook tag chips can shrink and wrap raggedly.The underlying mechanism is real and confirmed in code. Several originally-reported symptoms are overstated (see Root cause); the honest framing is: control strips aren't robust to narrow widths, and the one font lever scales chrome too, so larger Display Sizes compound pre-existing tightness.
Symptom & UX impact (mobile)
<nav>/ left controls run off the screen edge or clip; some buttons become unreachable. High-impact because the topbar is primary navigation.min-w-0 flex-1 truncate) gets squeezed to an ellipsis or near-zero width when theMARKERbadge + group chip are present; the group chip can shrink/wrap and steal width from the name. Names ellipsize (they do not fully vanish —truncateguarantees at least an ellipsis), but readability is degraded.flex-shrink:0) and long multi-word tags wrap internally, producing ragged chip heights. (Built-in single-word category chips do not overlap — they're inflex flex-wrap gap-1, which prevents overlap by design.)Steps to reproduce
MARKERbadge + group chip crowd it.px-3bar and get clipped or pushed off-screen (not colliding — pushed out). Reproduces every time.Root cause (exact file:line trace)
One lever drives the root font size:
packages/client/src/components/panels/SettingsPanel.tsx:2197-2208— the Display Size<select>callssetFontSize(Number(...))with one of12 | 14 | 16 | 17 | 19 | 22.packages/client/src/stores/ui.store.ts:1034—fontSizedefault17.packages/client/src/App.tsx:406-408—document.documentElement.style.fontSize = ${fontSize}pxon every change.packages/client/src/styles/globals.css:4183-4186— section "22. DISPLAY SIZE SCALING" is comment-only ("All sizes now use rem so they scale with the root font-size set by App.tsx"). There is no--scale, nodata-*attribute, nohtmlrule — confirming there is no chrome-vs-prose decoupling. Text and allremchrome scale together.Topbar overflow (the real Large/Huge failure):
packages/client/src/components/layout/TopBar.tsx:205— header isflex h-12 flex-shrink-0 items-center justify-between ... px-3.:212— left controls groupflex shrink-0 items-center gap-2.:279-283— right<nav>isflex shrink-0 items-center justify-end gap-0.5 ... max-sm:gap-0 max-sm:p-0.5. Noflex-wrap, nooverflow-x-auto, no collapse. (rightNavRefat:280is used only for Spotify-fit measurement at lines 155-176, not for nav overflow relief.):62—TOPBAR_PANEL_BUTTON_CLASS = "relative rounded-lg p-2 transition-all duration-200 max-sm:p-1.5"—rempadding, no fixed dimensions.size="0.9375rem"(lines 301, 322, 346, 378). At 17px root each button is ~29px; at 22px root ~37px.shrink-0and the bar isjustify-betweenwith the middleflex-1collapsing to 0. As font size grows, the two groups' combined width exceeds the viewport, so buttons are pushed pastpx-3and clipped/scrolled off-screen. They keep their per-button spacing — they do not collide. The right nav has 8 buttons (Browser:286+ Characters:307+ 5RIGHT_PANEL_BUTTONS+ Settings:363); the left chat/home buttons live in the separate:212group. (Original "11 buttons squish/overlap" was wrong on both count and failure mode.)Preset marker row (name squeeze):
packages/client/src/components/presets/PresetEditor.tsx:1282-1386— dense row: grip + 2 arrows (1283), chevron (1324), role icon (1332), 3 right buttons (1350) are allshrink-0, around amin-w-0 flex-1 truncatename (1333-1338).:1341—MARKERbadge is alreadyshrink-0(fine).:1345—{group && <span className="mari-editor-chip px-1.5 py-0.5 text-[0.5625rem]">{group.name}</span>}— the group chip lacksshrink-0andwhitespace-nowrap, so it can shrink/wrap and steal width from theflex-1name. This is the genuinely fixable defect here. Note this chip usesmari-editor-chip(globals.css:1600, no flex-shrink) — notmari-chrome-control— so a CSS fix on.mari-chrome-controlwill NOT cover it; it needs an inline class change.:1346— the role label ishidden ... sm:inline, so it's absent on mobile (not a contributor). The name stilltruncates under pressure, which is acceptable; it does not become "invisible."Lorebook tag chips (ragged wrap):
packages/client/src/components/panels/LorebooksPanel.tsx:771and:802— both chip groups areflex flex-wrap gap-1→ overlap is impossible by design.:779,:790— PRIMARY category chips already havewhitespace-nowrap.:822— TAGGED-category chips usemari-chrome-control mari-chrome-control--compactand lackwhitespace-nowrap. But all built-in category labels are single words (CATEGORIESare All/Active/World/Character/NPC/Spellbook/Other), so the missingwhitespace-nowraphere is effectively a no-op — single words don't wrap.:842-845— user-defined tag chips usemari-chrome-control mari-chrome-control--compactand also lackwhitespace-nowrap; these can be multi-word, so they wrap mid-tag.globals.css:619-636.mari-chrome-controland:661-666--compactdefine noflex-shrinkand nomin-width, so chips can shrink in the wrap container, producing ragged heights. This (not "overlap") is the real defect.Suggested fix (concrete)
Targeted bugfix (recommended scope for this PR):
1. Pin topbar buttons + icons to fixed px (cures Large/Huge overflow). This stops the nav from growing with Display Size — the actual cure. Apply to BOTH the right nav and the left controls group (line 212) so the left group doesn't re-create overflow.
Apply the same fixed-px sizing to the left-controls buttons/icons under
:212. Math: 8 right buttons × ~30px + 2 left buttons +px-3fits ~360px even at Huge, so nooverflow-x-autois needed — and adding it to a 48px bar is poor UX. Drop the originally-proposedoverflow-x-auto(keep only as a defensive fallback if desired).2. Keep lorebook chips from shrinking + wrapping.
(Adding
whitespace-nowrapto the category chips at:822is a no-op for shipped single-word labels — harmless but don't bill it as the fix. Bumpinggap-1→gap-1.5at:802is cosmetic, not a fix for "overlap," which doesn't occur.)3. Protect the preset section name. Add
shrink-0 whitespace-nowrapto the group chip so theflex-1name keeps priority; also pin the row's control icons to px so they don't bloat at Huge.The name will still
truncate— that is acceptable. Prefer this pin-and-shrink-0approach over restructuring the header toflex-wrap(which changes the single-row design and may look worse); flex-wrap is an alternative only if the pinned approach proves insufficient.Alternatives / long-term (file as follow-up, not required here): introduce a
--ui-control-scale(or px/clamp()hit-targets) so Display Size scales prose only while chrome stays fixed. That is the correct architecture but larger than this bugfix needs.Affected files
packages/client/src/App.tsx(mechanism reference::406-408)packages/client/src/stores/ui.store.ts(mechanism reference::1034)packages/client/src/components/panels/SettingsPanel.tsx(mechanism reference::2197-2208)packages/client/src/components/layout/TopBar.tsx(fix::62,:212,:279-283, icon sizes:301/322/346/378)packages/client/src/components/presets/PresetEditor.tsx(fix::1345, row icons:1282-1386)packages/client/src/components/panels/LorebooksPanel.tsx(fix::842)packages/client/src/styles/globals.css(fix:.mari-chrome-control:619; refs:1600 .mari-editor-chip,:4183-4186comment-only section)Validation
pnpm checkpasses (TypeScript + ESLint).MARKERbadge + group chip are present, at Default and Huge.overflow-x-autoscrollbar was introduced in the 48px topbar.AI-investigated against released 2.0.0; verify before fixing.
@SpicyMarinara commented on GitHub (Jun 22, 2026):
Addressed in PR #2790 / commit acab1fba: topbar controls now keep fixed responsive dimensions, chrome controls stop shrinking, and lorebook/preset chips avoid wrapping or squeezing into adjacent controls at large display sizes.