Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(email): keep the phone New button off the full-screen composer (#8634)

gbirmana899e840d92e
diff --git a/apps/web/src/features/email-compose/views/email-compose.test.tsx b/apps/web/src/features/email-compose/views/email-compose.test.tsx
index 5f6c53c60f..bb462db262 100644
--- a/apps/web/src/features/email-compose/views/email-compose.test.tsx
+++ b/apps/web/src/features/email-compose/views/email-compose.test.tsx
@@ -1,9 +1,12 @@
+import { FloatRegion } from '@components/app/mobile/float-regions/FloatRegion';
+import { FloatRegions } from '@components/app/mobile/float-regions/float-region-state';
import {
cleanup,
fireEvent,
render,
screen,
waitFor,
+ within,
} from '@solidjs/testing-library';
import {
type ComponentProps,
@@ -84,8 +87,31 @@ vi.mock('./compose-layout', () => ({
);
},
}));
+vi.mock('@core/mobile/isTouchDevice', () => ({ isTouchDevice: () => true }));
afterEach(cleanup);
+it('keeps the page’s New button from floating over the full-screen composer', () => {
+ const slot = document.createElement('div');
+ document.body.append(slot);
+ FloatRegions.setMount('accessory', slot);
+ const page = render(() => (
+ <FloatRegion region="accessory" priority={-1}>
+ <button type="button">New</button>
+ </FloatRegion>
+ ));
+ expect(within(slot).getByRole('button', { name: 'New' })).toBeDefined();
+
+ const composer = render(() => (
+ <EmailComposeView context={createComposeContext()} />
+ ));
+ expect(within(slot).queryByRole('button', { name: 'New' })).toBeNull();
+
+ composer.unmount();
+ expect(within(slot).getByRole('button', { name: 'New' })).toBeDefined();
+ page.unmount();
+ slot.remove();
+});
+
it('keeps a draft sync failure visible without a connected inbox', () => {
const context = createComposeContext();
context.accounts.inboxes = () => [];
diff --git a/apps/web/src/features/email-compose/views/email-compose.tsx b/apps/web/src/features/email-compose/views/email-compose.tsx
index 960513c25f..96e2d7d03c 100644
--- a/apps/web/src/features/email-compose/views/email-compose.tsx
+++ b/apps/web/src/features/email-compose/views/email-compose.tsx
@@ -1,3 +1,4 @@
+import { FloatRegion } from '@components/app/mobile/float-regions/FloatRegion';
import { SplitHeaderLeft } from '@components/app/split-layout/components/SplitHeader';
import {
SplitHeaderBadge,
@@ -240,6 +241,10 @@ function LoadedEmailComposeView(
return (
<ComposeProvider value={ctxValue}>
+ {/* On touch devices the composer fills the screen and keeps its send
+ actions in the header, so it holds the bottom accessory slot empty
+ and the page's New button cannot float over the message. */}
+ <FloatRegion region="accessory" />
<Show when={!composeContext.presentation.isMobile()}>
<SplitHeaderLeft>
<StaticSplitLabel
diff --git a/docs/agent-guide/navigation.md b/docs/agent-guide/navigation.md
index 8db7d06ad8..5d3238f469 100644
--- a/docs/agent-guide/navigation.md
+++ b/docs/agent-guide/navigation.md
@@ -673,8 +673,9 @@ button and no search field. Desktop retains search and keyboard controls. Other
show **+ New** for that full menu. Only Agents has the floating AI composer,
which fills the row with no duplicate create action. Other views keep their
right-aligned New button without an AI input. The row
-hides during search, when a page supplies its own reply or compose controls, or
-when an editable field outside Ask AI is focused on a touch device. The AI draft
+hides during search, when a page supplies its own reply or compose controls
+(including the full-screen new-email composer, whose send actions sit in its
+header), or when an editable field outside Ask AI is focused on a touch device. The AI draft
is preserved when the row returns.
The New button also hides while the software keyboard is open.
After closing mobile search with the keyboard open or leaving a focused editor,