mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2797] [Issue]: Mobile: Professor Mari home chat cannot be restarted — the Restart button is missing on mobile #1421
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#1421
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/2797
Summary
On the home page, the Professor Mari assistant chat has a Restart button that lets users clear the conversation and reset the workspace. On mobile viewports (CSS width < 640px), that button is never visible in the default view. The Restart control lives inside the chat-pane column, which is
hiddenuntil thesm(≥640px) breakpoint, so mobile users land on a card that shows only the avatar, a "Start Chatting" button, and the FAQ — with no way to restart the chat. Desktop is unaffected.The root cause is a layout-scoping decision, not a per-button responsive class: the Restart action only ever exists inside a pane that mobile users do not see unless they enter the full-screen focus overlay.
Symptom & UX impact
/restartcommand into the input after entering focus mode (intercepted atHomeProfessorMariChat.tsx:2025-2026, which callsrunRestart()). This also confirmsrunRestartworks correctly from the mobile/focus context, so the fix is purely about surfacing a control.Steps to reproduce
mobileFocusMode) and the Restart icon appears in the top-right header — confirming Restart exists but is gated behind the desktop-only / focus-mode pane.Root cause (file:line trace)
All references in
packages/client/src/components/chat/HomeProfessorMariChat.tsx:motion.div.motion.divvisibility class is the gate: On default mobile (mobileFocusMode === false) the entire pane — header (and Restart), transcript, and input form — ishiddenand only becomes visible atsm(≥640px). It becomes visible on mobile only whenmobileFocusModeis true (a full-screen overlay).sm:hiddenblock (2093–2108) contains the avatar status and the Start Chatting button (2100–2107 →onClick={openMobileChat}). This left column is not hidden in default mobile; themobileFocusMode && "hidden sm:flex"at 2087 only hides it while in focus mode.hidden sm:block; the bottom FAQ (~2395) issm:hidden, so on mobile a FAQ is shown but it is unrelated to Restart.openMobileChatsetsmobileFocusMode = true→ pane becomes theh-fullfull-screen overlay where the header (and Restart) finally renders.handleSubmitinterceptstext === "/restart"and callsrunRestart()(the hidden command path).Supporting (all in scope for the fix):
handleRestart— deletes all messages, resets workspace, clears stores, toasts "Professor Mari's home chat was restarted." (1768).runRestart— guards onisBusy, then callshandleRestart.isBusy = sending || hasActiveGeneration || workspaceActive.RefreshCw(line 19),MessageCircle(line 16).mari-chrome-control/--primary/--smallexist inpackages/client/src/index.css/globals.css(mari-chrome-control~619,--primary~654,--small~668;:disabledopacity ~648–652).Conclusion: On mobile in the default view, only the avatar + "Start Chatting" block and the FAQ render. The Restart-bearing header at 2170–2234 sits inside the pane that is
hiddenuntilsm. The incidentalmax-[380px]:hiddenat 2220 only hides the text label on the narrowest phones (within the overlay); it is not the cause.Suggested fix
Give mobile users a reachable Restart in the default mobile view, without forcing them into the full-screen focus overlay and without touching desktop.
Option A (recommended, minimal)
Add a mobile-only Restart control to the left-column
sm:hiddenblock, beside the existing Start Chatting button (around 2100–2107). That block only renders on mobile and is always visible in the default mobile view. It reusesrunRestart/isBusy/openMobileChat/RefreshCw, all already in scope — no new state.Notes:
h-8 w-8to match the existing focus-mode close button (2226) for visual consistency.disabled:opacity-50is unnecessary on the icon button —mari-chrome-control:disabledalready sets opacity — so it's omitted above (harmless if added).handleRestart, 1768). This is acceptable.Option B (secondary polish)
Improve discoverability of the in-overlay Restart. Below 380px the label is hidden by
max-[380px]:hidden(2220), leaving only an icon with atitle(titles aren't reliably announced as an accessible name). Addaria-label="Restart Professor Mari chat"to the button at 2212 so it has a stable accessible name regardless of the label visibility. Optionally reconsider hiding the label at all.Do NOT
Do not "fix" this by removing
!mobileFocusMode && "hidden sm:block"from 2161. That would render the full desktop transcript pane inline on mobile and break the intended compact mobile layout. The correct scope is to surface the Restart action in the mobile-visible layer (Option A).Affected files
packages/client/src/components/chat/HomeProfessorMariChat.tsx(primary — add Option A control near 2100–2107; optional Option Baria-labelat 2212)Validation
pnpm check(TypeScript + ESLint) perCLAUDE.md; there is no automated test suite.isBusy).aria-labelpresent).CLAUDE.md).@SpicyMarinara commented on GitHub (Jun 22, 2026):
Addressed in PR #2790 / commit acab1fba: Professor Mari's mobile home card now has an Ask Professor Mari CTA plus a visible restart icon button, and the overlay restart control has an explicit accessibility label.