fix(assistant): give the phone home chat its own m-root so it is not see-through

The home chat outside a trip mounts beside MobileShell, so none of the --m-*
tokens it paints with resolved and the dashboard showed through the chat.
This commit is contained in:
Maurice
2026-10-25 15:26:47 +01:00
parent d4da05bbc9
commit 90f31d3f07
2 changed files with 17 additions and 8 deletions
@@ -50,13 +50,17 @@ export default function MAssistantHomeScreen() {
useAssistantStatus();
if (inTrip || !available || !open || minimized) return null;
// Mounted beside MobileShell, not inside it, so the --m-* tokens the screen paints
// with only resolve under an m-root of its own; without it the chat is see-through.
return (
<AssistantScreen
tripId={chat.id}
tripTitle={chat.title}
hidden={false}
hops={hops}
onOpenTripChat={journal ? undefined : home.openTripChat}
/>
<div className="m-root">
<AssistantScreen
tripId={chat.id}
tripTitle={chat.title}
hidden={false}
hops={hops}
onOpenTripChat={journal ? undefined : home.openTripChat}
/>
</div>
);
}
@@ -7,7 +7,7 @@ import MAssistantHomeScreen from '../../../src/mobile/screens/assistant/MAssista
import { chatOf, useAssistantStore } from '../../../src/store/assistantStore';
import { act, cleanup, fireEvent, render, screen } from '../../helpers/render';
// FE-MOB-ASSIST-HOME-001 to FE-MOB-ASSIST-HOME-005
// FE-MOB-ASSIST-HOME-001 to FE-MOB-ASSIST-HOME-006
//
// The phone's home chat, full screen outside a trip, around the shared chat
// surface, which is replaced here: what is tested is when it shows, its
@@ -141,4 +141,9 @@ describe('MAssistantHomeScreen', () => {
renderAt('/settings');
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
});
it('FE-MOB-ASSIST-HOME-006: brings its own m-root, so the phone tokens resolve outside the mobile shell', () => {
renderAt('/dashboard');
expect(screen.getByRole('dialog', { name: 'Assistant' }).closest('.m-root')).not.toBeNull();
});
});