[GH-ISSUE #2797] [Issue]: Mobile: Professor Mari home chat cannot be restarted — the Restart button is missing on mobile #1421

Closed
opened 2026-10-21 05:33:33 +07:00 by bsakaguchi · 1 comment
Owner

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 hidden until the sm (≥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

  • On a phone (or DevTools device emulation < 640px), the Professor Mari home card shows the pixel avatar, "Ready to help", a Start Chatting button, and the FAQ. There is no chat header and no Restart button.
  • On desktop (≥640px), the same card shows the chat transcript with a header containing Skills and Restart.
  • Mobile users who have built up a confused/stuck Professor Mari conversation have no discoverable way to reset it. The only paths that work are undiscoverable:
    • Tap Start Chatting (enters full-screen focus mode), then the Restart icon finally appears in the header — but below 380px even that shows only an unlabeled refresh icon (the text label is hidden).
    • Type the hidden /restart command into the input after entering focus mode (intercepted at HomeProfessorMariChat.tsx:2025-2026, which calls runRestart()). This also confirms runRestart works correctly from the mobile/focus context, so the fix is purely about surfacing a control.

Steps to reproduce

  1. Open Marinara Engine v2.0.0 on a mobile viewport (< 640px CSS width — a phone, or DevTools device emulation at ~390px).
  2. Go to the home page where the Professor Mari assistant chat is shown.
  3. Observe the card: pixel avatar, "Ready to help", a Start Chatting button, and the FAQ. There is no chat header and no Restart button.
  4. Compare on desktop (≥640px): the same card shows the transcript with a header containing Skills + Restart.
  5. Workaround that proves the cause: on mobile, tap Start Chatting (or focus the input). The chat opens full-screen (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:

  • 2212–2221 — The Restart button:
    <button
      type="button"
      onClick={() => void runRestart()}
      disabled={isBusy}
      className="mari-chrome-accent-text-muted mari-accent-animated inline-flex items-center gap-1 rounded-md px-2 py-1 ... disabled:opacity-50"
      title="Restart Professor Mari chat"
    >
      <RefreshCw size="0.75rem" />
      <span className="max-[380px]:hidden">Restart</span>
    </button>
    
  • 2170–2234 — This button lives inside the chat header, which is inside the chat-pane motion.div.
  • 2161 — The chat-pane motion.div visibility class is the gate:
    className={cn("min-w-0", !mobileFocusMode && "hidden sm:block", mobileFocusMode && "h-full")}
    
    On default mobile (mobileFocusMode === false) the entire pane — header (and Restart), transcript, and input form — is hidden and only becomes visible at sm (≥640px). It becomes visible on mobile only when mobileFocusMode is true (a full-screen overlay).
  • 2084–2118 — The LEFT column that mobile users actually see. Its sm:hidden block (2093–2108) contains the avatar status and the Start Chatting button (2100–2107 → onClick={openMobileChat}). This left column is not hidden in default mobile; the mobileFocusMode && "hidden sm:flex" at 2087 only hides it while in focus mode.
  • 2109–2117 — The FAQ in the left column is hidden sm:block; the bottom FAQ (~2395) is sm:hidden, so on mobile a FAQ is shown but it is unrelated to Restart.
  • 1728 openMobileChat sets mobileFocusMode = true → pane becomes the h-full full-screen overlay where the header (and Restart) finally renders.
  • 2025–2026 — handleSubmit intercepts text === "/restart" and calls runRestart() (the hidden command path).

Supporting (all in scope for the fix):

  • 1749 handleRestart — deletes all messages, resets workspace, clears stores, toasts "Professor Mari's home chat was restarted." (1768).
  • 1771 runRestart — guards on isBusy, then calls handleRestart.
  • 1537 isBusy = sending || hasActiveGeneration || workspaceActive.
  • Imports: RefreshCw (line 19), MessageCircle (line 16).
  • CSS classes mari-chrome-control / --primary / --small exist in packages/client/src/index.css/globals.css (mari-chrome-control ~619, --primary ~654, --small ~668; :disabled opacity ~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 hidden until sm. The incidental max-[380px]:hidden at 2220 only hides the text label on the narrowest phones (within the overlay); it is not the cause.

Note on the "tool-calls" subsystem: the sidecarNativeToolCalls reference near line 2331 ("native tools" / "tools off") is the local llama.cpp sidecar runtime (enableNativeToolCalls / --jinja), an unrelated subsystem. It is not a contributing factor to the missing Restart button.

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.

Add a mobile-only Restart control to the left-column sm:hidden block, 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 reuses runRestart / isBusy / openMobileChat / RefreshCw, all already in scope — no new state.

<div className="mt-3 flex w-full items-center gap-2">
  <button
    type="button"
    onClick={openMobileChat}
    className="mari-chrome-control mari-chrome-control--primary flex-1 gap-2 text-xs"
  >
    <MessageCircle size="0.9rem" />
    Start Chatting
  </button>
  <button
    type="button"
    onClick={() => void runRestart()}
    disabled={isBusy}
    className="mari-chrome-control mari-chrome-control--small inline-flex h-8 w-8 items-center justify-center rounded-md p-0"
    aria-label="Restart Professor Mari chat"
    title="Restart Professor Mari chat"
  >
    <RefreshCw size="0.9rem" />
  </button>
</div>

Notes:

  • Use h-8 w-8 to match the existing focus-mode close button (2226) for visual consistency.
  • disabled:opacity-50 is unnecessary on the icon button — mari-chrome-control:disabled already sets opacity — so it's omitted above (harmless if added).
  • UX caveat: restarting from the home card shows no transcript, so the only feedback is the success toast (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 a title (titles aren't reliably announced as an accessible name). Add aria-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 B aria-label at 2212)

Validation

  • Run pnpm check (TypeScript + ESLint) per CLAUDE.md; there is no automated test suite.
  • Mobile viewport (< 640px, e.g. DevTools at 390px): a Restart control is visible on the default Professor Mari home card (no focus mode required).
  • Tapping Restart on mobile clears the chat, resets the workspace, and shows the "Professor Mari's home chat was restarted." toast.
  • While busy (sending / active generation / workspace active), the mobile Restart control is disabled (isBusy).
  • Desktop (≥640px) header is unchanged: Skills + Restart still render in the chat header as before.
  • Narrow phone (< 380px): in focus mode, the in-overlay Restart control is identifiable (Option B aria-label present).
  • Local llama.cpp sidecar tool-call sanity check: Professor Mari still sends/replies normally after a mobile restart (confirms restart didn't disturb the local-model tool-call path).
  • Group-chat bubbles / other chat surfaces unaffected (change is scoped to the Professor Mari home card).
  • No PR validation/test-plan checkboxes are auto-checked (per CLAUDE.md).

AI-investigated against released 2.0.0 — verify before fixing.

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 `hidden` until the `sm` (≥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 - On a phone (or DevTools device emulation < 640px), the Professor Mari home card shows the pixel avatar, "Ready to help", a **Start Chatting** button, and the FAQ. There is **no chat header and no Restart button**. - On desktop (≥640px), the same card shows the chat transcript with a header containing **Skills** and **Restart**. - Mobile users who have built up a confused/stuck Professor Mari conversation have no discoverable way to reset it. The only paths that work are undiscoverable: - Tap **Start Chatting** (enters full-screen focus mode), then the Restart icon finally appears in the header — but below 380px even that shows only an unlabeled refresh icon (the text label is hidden). - Type the hidden `/restart` command into the input after entering focus mode (intercepted at `HomeProfessorMariChat.tsx:2025-2026`, which calls `runRestart()`). This also confirms `runRestart` works correctly from the mobile/focus context, so the fix is purely about **surfacing a control**. ## Steps to reproduce 1. Open Marinara Engine v2.0.0 on a mobile viewport (< 640px CSS width — a phone, or DevTools device emulation at ~390px). 2. Go to the home page where the Professor Mari assistant chat is shown. 3. Observe the card: pixel avatar, "Ready to help", a **Start Chatting** button, and the FAQ. There is no chat header and no Restart button. 4. Compare on desktop (≥640px): the same card shows the transcript with a header containing **Skills** + **Restart**. 5. Workaround that proves the cause: on mobile, tap **Start Chatting** (or focus the input). The chat opens full-screen (`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`: - **2212–2221** — The Restart button: ```tsx <button type="button" onClick={() => void runRestart()} disabled={isBusy} className="mari-chrome-accent-text-muted mari-accent-animated inline-flex items-center gap-1 rounded-md px-2 py-1 ... disabled:opacity-50" title="Restart Professor Mari chat" > <RefreshCw size="0.75rem" /> <span className="max-[380px]:hidden">Restart</span> </button> ``` - **2170–2234** — This button lives inside the chat **header**, which is inside the chat-pane `motion.div`. - **2161** — The chat-pane `motion.div` visibility class is the gate: ```tsx className={cn("min-w-0", !mobileFocusMode && "hidden sm:block", mobileFocusMode && "h-full")} ``` On default mobile (`mobileFocusMode === false`) the entire pane — header (and Restart), transcript, and input form — is `hidden` and only becomes visible at `sm` (≥640px). It becomes visible on mobile **only** when `mobileFocusMode` is true (a full-screen overlay). - **2084–2118** — The LEFT column that mobile users actually see. Its `sm:hidden` block (**2093–2108**) contains the avatar status and the **Start Chatting** button (**2100–2107** → `onClick={openMobileChat}`). This left column is *not* hidden in default mobile; the `mobileFocusMode && "hidden sm:flex"` at **2087** only hides it while in focus mode. - **2109–2117** — The FAQ in the left column is `hidden sm:block`; the bottom FAQ (**~2395**) is `sm:hidden`, so on mobile a FAQ is shown but it is unrelated to Restart. - **1728** `openMobileChat` sets `mobileFocusMode = true` → pane becomes the `h-full` full-screen overlay where the header (and Restart) finally renders. - **2025–2026** — `handleSubmit` intercepts `text === "/restart"` and calls `runRestart()` (the hidden command path). Supporting (all in scope for the fix): - **1749** `handleRestart` — deletes all messages, resets workspace, clears stores, toasts "Professor Mari's home chat was restarted." (**1768**). - **1771** `runRestart` — guards on `isBusy`, then calls `handleRestart`. - **1537** `isBusy = sending || hasActiveGeneration || workspaceActive`. - Imports: `RefreshCw` (**line 19**), `MessageCircle` (**line 16**). - CSS classes `mari-chrome-control` / `--primary` / `--small` exist in `packages/client/src/index.css`/`globals.css` (`mari-chrome-control` ~619, `--primary` ~654, `--small` ~668; `:disabled` opacity ~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 `hidden` until `sm`. The incidental `max-[380px]:hidden` at **2220** only hides the text *label* on the narrowest phones (within the overlay); it is not the cause. > Note on the "tool-calls" subsystem: the `sidecarNativeToolCalls` reference near line 2331 ("native tools" / "tools off") is the local llama.cpp sidecar runtime (`enableNativeToolCalls` / `--jinja`), an unrelated subsystem. It is **not** a contributing factor to the missing Restart button. ## 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:hidden` block, 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 reuses `runRestart` / `isBusy` / `openMobileChat` / `RefreshCw`, all already in scope — no new state. ```tsx <div className="mt-3 flex w-full items-center gap-2"> <button type="button" onClick={openMobileChat} className="mari-chrome-control mari-chrome-control--primary flex-1 gap-2 text-xs" > <MessageCircle size="0.9rem" /> Start Chatting </button> <button type="button" onClick={() => void runRestart()} disabled={isBusy} className="mari-chrome-control mari-chrome-control--small inline-flex h-8 w-8 items-center justify-center rounded-md p-0" aria-label="Restart Professor Mari chat" title="Restart Professor Mari chat" > <RefreshCw size="0.9rem" /> </button> </div> ``` Notes: - Use `h-8 w-8` to match the existing focus-mode close button (**2226**) for visual consistency. - `disabled:opacity-50` is unnecessary on the icon button — `mari-chrome-control:disabled` already sets opacity — so it's omitted above (harmless if added). - UX caveat: restarting from the home card shows no transcript, so the only feedback is the success toast (`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 a `title` (titles aren't reliably announced as an accessible name). Add `aria-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 B `aria-label` at 2212) ## Validation - [ ] Run `pnpm check` (TypeScript + ESLint) per `CLAUDE.md`; there is no automated test suite. - [ ] Mobile viewport (< 640px, e.g. DevTools at 390px): a Restart control is visible on the **default** Professor Mari home card (no focus mode required). - [ ] Tapping Restart on mobile clears the chat, resets the workspace, and shows the "Professor Mari's home chat was restarted." toast. - [ ] While busy (sending / active generation / workspace active), the mobile Restart control is disabled (`isBusy`). - [ ] Desktop (≥640px) header is unchanged: Skills + Restart still render in the chat header as before. - [ ] Narrow phone (< 380px): in focus mode, the in-overlay Restart control is identifiable (Option B `aria-label` present). - [ ] Local llama.cpp sidecar tool-call sanity check: Professor Mari still sends/replies normally after a mobile restart (confirms restart didn't disturb the local-model tool-call path). - [ ] Group-chat bubbles / other chat surfaces unaffected (change is scoped to the Professor Mari home card). - [ ] No PR validation/test-plan checkboxes are auto-checked (per `CLAUDE.md`). > AI-investigated against released 2.0.0 — verify before fixing.
Author
Owner

@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.

<!-- gh-comment-id:4772440978 --> @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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1421
No description provided.