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(mobile): fit the calendar file drawer and the task composer footer on phones (#8708)

gbirman53927c93bf09
diff --git a/apps/web/src/components/ui/components/EntityComposer.test.tsx b/apps/web/src/components/ui/components/EntityComposer.test.tsx
new file mode 100644
index 0000000000..eb2595f939
--- /dev/null
+++ b/apps/web/src/components/ui/components/EntityComposer.test.tsx
@@ -0,0 +1,49 @@
+/**
+ * @vitest-environment jsdom
+ */
+
+import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';
+import { afterEach, expect, it, vi } from 'vitest';
+import { EntityComposer } from './EntityComposer';
+
+const mocks = vi.hoisted(() => ({ touch: false }));
+vi.mock('@core/mobile/isTouchDevice', () => ({
+ isTouchDevice: () => mocks.touch,
+}));
+vi.mock('@core/constant/isMac', () => ({ IS_MAC: true }));
+
+afterEach(() => {
+ cleanup();
+ mocks.touch = false;
+});
+
+function renderSubmit() {
+ const onClick = vi.fn();
+ render(() => (
+ <EntityComposer.Footer>
+ <EntityComposer.Submit hasContent onClick={onClick}>
+ Create Task
+ </EntityComposer.Submit>
+ </EntityComposer.Footer>
+ ));
+ return onClick;
+}
+
+it('shows the keyboard shortcut on the submit button with a keyboard', () => {
+ const onClick = renderSubmit();
+ const submit = screen.getByRole('button', { name: /Create Task/ });
+
+ expect(submit.textContent).toContain('⌘');
+ fireEvent.click(submit);
+ expect(onClick).toHaveBeenCalledOnce();
+});
+
+it('leaves the keyboard shortcut off the submit button on touch', () => {
+ mocks.touch = true;
+ const onClick = renderSubmit();
+ const submit = screen.getByRole('button', { name: 'Create Task' });
+
+ expect(submit.textContent).not.toContain('⌘');
+ fireEvent.click(submit);
+ expect(onClick).toHaveBeenCalledOnce();
+});
diff --git a/apps/web/src/components/ui/components/EntityComposer.tsx b/apps/web/src/components/ui/components/EntityComposer.tsx
index 937cecbf4e..d4292b49fc 100644
--- a/apps/web/src/components/ui/components/EntityComposer.tsx
+++ b/apps/web/src/components/ui/components/EntityComposer.tsx
@@ -1,5 +1,5 @@
import { isTouchDevice } from '@core/mobile/isTouchDevice';
-import { type JSX, splitProps } from 'solid-js';
+import { type JSX, Show, splitProps } from 'solid-js';
import { cn } from '../utils/classname';
import { Button, type ButtonProps } from './Button';
import { Hotkey } from './Hotkey';
@@ -100,10 +100,12 @@ function Submit(props: ButtonProps & { hasContent: boolean }) {
)}
>
{local.children}
- <Hotkey
- shortcut="cmd+enter"
- theme={local.variant === 'outline' ? 'subtle' : 'current'}
- />
+ <Show when={!isTouchDevice()}>
+ <Hotkey
+ shortcut="cmd+enter"
+ theme={local.variant === 'outline' ? 'subtle' : 'current'}
+ />
+ </Show>
</Button>
);
}
diff --git a/apps/web/src/features/block-md/component/ComposeTask.tsx b/apps/web/src/features/block-md/component/ComposeTask.tsx
index 12e78ef900..a8325f159f 100644
--- a/apps/web/src/features/block-md/component/ComposeTask.tsx
+++ b/apps/web/src/features/block-md/component/ComposeTask.tsx
@@ -1142,7 +1142,9 @@ export function ComposeTask(props: ComposeTaskProps) {
</div>
</Show>
- <EntityComposer.Footer class="items-center">
+ {/* The team switch, Create More and Create Task need about 400px; a
+ phone is narrower, so the actions wrap to their own row. */}
+ <EntityComposer.Footer class="flex-wrap items-center">
<Show when={team()}>
{(team) => (
<Tooltip label={sharingHint()} tabIndex={0}>
diff --git a/apps/web/src/features/email-message/components/calendar-file-preview.tsx b/apps/web/src/features/email-message/components/calendar-file-preview.tsx
index 32260cdb9f..165c1e2279 100644
--- a/apps/web/src/features/email-message/components/calendar-file-preview.tsx
+++ b/apps/web/src/features/email-message/components/calendar-file-preview.tsx
@@ -27,7 +27,7 @@ export function CalendarFilePreview(props: {
if (props.restoreFocus?.() === false) event.preventDefault();
}}
position="center"
- class="w-140 max-w-full"
+ class="w-140"
>
<Panel depth={2} class="rounded-xl">
<Panel.Header class="flex items-center gap-2 px-6">
diff --git a/docs/agent-guide/tasks.md b/docs/agent-guide/tasks.md
index 0c7927c4c2..21f49bbaf8 100644
--- a/docs/agent-guide/tasks.md
+++ b/docs/agent-guide/tasks.md
@@ -530,14 +530,18 @@ Use existing PRs and do not modify hosted data.
On touch devices, task creation opens in a bottom sheet with a drag handle and
scrollable, keyboard-aware content. Its glass pane has broad screen-scaled
corners, an 8px outer inset, and a blurred backdrop, matching the create and
-filter sheets. Desktop uses the centered composer dialog.
+filter sheets. Its footer wraps when a phone is too narrow for one row: the
+`Share with <team name>` switch keeps the left corner and `Create More` and
+`Create Task` move to a right-aligned row below it. `Create Task` shows no
+keyboard shortcut on touch. Desktop uses the centered composer dialog.
1. Click the `Task` button (or `Create` → `Task T`, or keyboard `c` then `t`).
2. A dialog opens with the title contenteditable focused (placeholder `New task`), plus
`Add description...`, and property buttons: `Not Started` (status), `Priority`, assignee
chip (defaults to you), `Due Date`, `Project` (when Projects is enabled; the standard
property dropdown, listing projects), `Change or select tags`, a `Create More` switch,
- and `Create Task Ctrl ↵`. `Attach image or video` (paperclip) sits just under the
+ and `Create Task Ctrl ↵` (`Create Task` alone on touch). `Attach image or video`
+ (paperclip) sits just under the
description, above the property buttons. If the chosen project can't be
set, the task is still created and a toast says it wasn't added to the project.
The `Share with <team name>` switch in the footer's left corner (hidden when you
@@ -546,8 +550,8 @@ filter sheets. Desktop uses the centered composer dialog.
explains whether the task will be visible to your whole team or only to you and
the people you share it with. The choice also applies to Create More, continuing
in a split, and tasks created from a project.
-3. `type_text` the title, then press **Ctrl+Enter** to create (the `Create Task` button
- enables once there is a title). Dialog also offers `Continue editing in split` to open the
+3. `type_text` the title, then press **Ctrl+Enter** to create, or tap `Create Task` on
+ touch (the button enables once there is a title). Dialog also offers `Continue editing in split` to open the
task as a full document.
The property row adapts when the launching pane supplies a task-composer preset.
@@ -929,4 +933,5 @@ See [Tasks](tasks.md#reviews-view) for verification.
The desktop `Create` → `Task` modal uses the standard dialog panel, circular
icon controls, and a pill-shaped `Create Task` button with 16px outer padding.
-The mobile task drawer retains its existing layout.
+The mobile task drawer keeps its layout apart from the wrapping footer described
+above.