mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2793] [Issue]: Mobile navigation/panel layering — opening a sub-menu hides the top nav; nested menus stack on separate layers with separate close buttons; always slide from the side #1416
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#1416
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/2793
Summary
On mobile, Marinara Engine has no unified navigation/panel stack. Three structurally separate rendering systems are layered on top of each other at three different z-indexes (
z-10TopBar,z-50overlay sheets,z-[10000]modals), and each manages its own open/close state, its own close glyph, and its own horizontal slide animation. Because they don't coordinate:z-50sheet over thez-10TopBar, so the top navigation visually disappears and the only way out is that sheet's own close button.z-50sheet and renders the detail editor on the base<main>layer, with a different close control (a back-arrow instead of an X) and a different slide. Modals add a third dismiss control atz-[10000].This is a structural UX defect, not a one-off styling bug. Note: a logical return path does exist (see Root cause) — the problem is visual/animation discontinuity and inconsistent dismiss controls, not a dead-end.
Symptom & UX impact (mobile, viewport < 768px)
Steps to reproduce
On a mobile viewport (< 768px, or DevTools device toolbar):
z-[10000]above everything with another X. Now multiple close controls coexist and it's unclear which closes what. (Symptom 2.)Throughout, the top navigation bar is inaccessible whenever any sub-menu is open, and every surface slides from the side regardless of depth.
Root cause (exact file:line trace)
There are three parallel rendering systems with independent z-indexes, close glyphs, and slide animations, with no shared mobile navigation stack:
(1) TopBar is always mounted but gets painted over.
packages/client/src/components/layout/AppShell.tsx:835—<TopBar />is rendered once, inside<main>.packages/client/src/components/layout/TopBar.tsx:205— the header is onlyrelative z-10.packages/client/src/components/layout/AppShell.tsx:907-926— the mobile RightPanel renders<motion.aside key="mobile" … className="… !fixed inset-y-0 right-0 z-50 h-screen … !w-full …">withstyle={{ "--mari-right-panel-width": "100vw" }}(lines 918-919). Thez-50full-viewport sheet paints over thez-10TopBar. The mobile tracker overlay (AppShell.tsx:879-896,z-50 … w-screen) and overlay sidebar (AppShell.tsx:787-800,fixed inset-y-0 left-0 z-50) do the same.(2) Detail editors render one layer DOWN with a different close glyph.
packages/client/src/components/layout/RightPanel.tsx:97-102(onClick={close}, whereclose = closeRightPanel, line 69).AppShell.tsx:495-513(detailView) and rendered on the base layer atAppShell.tsx:859({detailView ?? <ChatArea/>}).packages/client/src/stores/ui.store.ts:806-813—getMobileDetailReturnStatereturnsrightPanelOpen: falseon mobile/centerCompact, invoked e.g. byopenPersonaDetailatui.store.ts:1356-1370. So thez-50sheet hard-unmounts and the editor reappears on the lower<main>layer.packages/client/src/components/personas/PersonaEditor.tsx:840-847. All editors use this same back-arrow pattern (e.g. CharacterEditor), so the mismatch is panel-X vs editor-back-arrow across the board.packages/client/src/components/ui/Modal.tsx:87(fixed inset-0 z-[10000]), dismissed viacloseModal(packages/client/src/components/layout/ModalRenderer.tsx:54).Correction to the "no back-stack" framing: a logical return-stack already exists.
closePersonaDetail/closeToolDetail/etc. callrestoreMobileDetailReturnPanel(ui.store.ts:815-820, e.g. invoked atui.store.ts:1354and1375), which re-opens the saveddetailReturnRightPanel(line 818:rightPanelOpen: true, rightPanel: panel). So hitting Back in the editor does return you to the exact panel you came from. The defect is the visual/animation discontinuity and inconsistent dismiss glyph — not a missing navigation path. This matters for the fix: the state machine is fine; only the render layer is wrong.(3) Every mobile surface slides horizontally regardless of depth.
AppShell.tsx:911-915—initial={{ x: "100%" }} animate={{ x: 0 }} exit={{ x: "100%" }}.AppShell.tsx:881-883—initial={{ x: side === "left" ? "-100%" : "100%" }}.AppShell.tsx:148-161—initial={{ opacity: 0, x: 30 }}.(persona group-vs-individual)
packages/client/src/components/panels/PersonasPanel.tsxedits a group inline (localexpandedGroupId/editingGroupIdstate, ~lines 637-768) on thez-50panel, but tapping an individual persona callsopenPersonaDetail(PersonasPanel.tsx→ui.store.ts:1356-1370), which closes the panel and shows the editor on the base layer with a back-arrow. Same feature, two layers, two controls.Mobile trigger:
shellOverlayMode = isMobile || centerSqueezedByPanels, whereisMobileis< 768(AppShell.tsx:217-223, 248).Suggested fix (concrete)
Move toward one coherent mobile navigation model. The scope below is deliberately tight — keep the existing
detailReturnRightPanelstate machine intact and change only the render layer, glyph, and transition.Recommended PR (high value, low risk)
1. Shared mobile sheet header with ONE consistent dismiss control. Extract a small header component used by every mobile overlay sheet, rendering a single ArrowLeft "Back" control (to match the 8 editors, since mobile navigation is a stack, not independent windows). Swap RightPanel's X for it:
2. Render
detailViewinside the right-panelAnimatePresenceon mobile, so the editor pushes OVER the panel as a second sheet instead of swapping to the base<main>layer. TodaydetailViewrenders atAppShell.tsx:859; onshellOverlayModeit should render within the samez-50overlay container (AppShell.tsx:907-926) as a stacked sheet.3. Give the nested detail sheet a distinct forward-push transition vs the top-level side slide. Keep the first sheet's
x: "100%"slide (AppShell.tsx:911-915) as the "enter the menu" gesture, but enter the detail sheet with a forward push (e.g. smallerxoffset + fade) so depth reads correctly:4. Route persona-group editing through the same push so group and individual behave identically (
PersonasPanel.tsx— replace the inlineexpandedGroupId/editingGroupIdediting path with the same detail-push used by individuals).Deferred / alternatives (out of scope for the first PR)
mobileNavStack: Array<{kind}>rewrite inui.storeis not recommended: the existingdetailReturnRightPanelmechanism is already a working push/pop stack, and replacing it wholesale risks regressing all 9 detail entry points. Prefer the render-layer fix above.z-[10000]modals as the next stack level) is speculative: many modals are global (toasts, approval dialogs) and not navigationally part of the panel stack.Modal.tsxalready doescreatePortal+aria-modal+ backdrop-click-close; folding everything in risks breaking focus-trap/aria-modal semantics. If pursued, limit it to the create/import modals reachable from a panel, and preserve the focus trap.Affected files
packages/client/src/components/layout/AppShell.tsx(835, 859, 495-513, 907-926, 911-915, 879-896, 787-800, 148-161, 217-223, 248)packages/client/src/components/layout/RightPanel.tsx(69, 97-102)packages/client/src/components/layout/TopBar.tsx(205)packages/client/src/components/layout/ModalRenderer.tsx(54)packages/client/src/components/ui/Modal.tsx(87)packages/client/src/components/personas/PersonaEditor.tsx(840-847)packages/client/src/components/panels/PersonasPanel.tsx(group inline vs individualopenPersonaDetail)packages/client/src/stores/ui.store.ts(806-820, 1356-1376) — render-layer change only; state machine unchangedValidation
pnpm checkpasses (TypeScript + ESLint).detailReturnRightPanelrestore still returns to the originating panel.getMobileDetailReturnState/restoreMobileDetailReturnPanelwere NOT functionally altered (no regression to the squeezed-panel teardown on desktop).AI-investigated against released 2.0.0; verify before fixing.
@SpicyMarinara commented on GitHub (Jun 22, 2026):
Addressed in PR #2790 / commit acab1fba: mobile side/detail panels now stay below the topbar, nested detail views open in the mobile sheet layer, and the right panel uses a mobile back affordance while preserving the same close behavior.