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): wrap long invitation descriptions and align the guest row (#9899)

Peter Chinman81e27cbcc7e1
diff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.md
index 2f998fa599..3e57bcfe70 100644
--- a/apps/web/AGENTS.md
+++ b/apps/web/AGENTS.md
@@ -159,6 +159,13 @@ above the event whenever a late section changes its height. Keep the guest
editors' `overlap`: without it their height follows the room below the button,
so they never overflow, never flip, and squeeze the chosen people to nothing.
+Email invitation cards have a backend-free desktop/phone regression for long
+descriptions wrapping inside the card, collapsed and expanded, the guest row
+lining up with its icon, and `+N more` keeping a 44px tap target on touch:
+`bunx playwright test --config src/features/email-message/browser-test/playwright.config.ts`.
+Use `wrap-anywhere` alone on wrapping text: `break-words` is emitted later and
+overrides `[overflow-wrap:anywhere]`, which then no longer shrinks min-content.
+
The desktop app's local runtime setup (find an agent, connect, create the
agent, retry, open a session) has a backend-free browser regression over a
scripted runtime:
diff --git a/apps/web/src/features/email-message/browser-test/invitation.browser.e2e.ts b/apps/web/src/features/email-message/browser-test/invitation.browser.e2e.ts
new file mode 100644
index 0000000000..9a0d77fe10
--- /dev/null
+++ b/apps/web/src/features/email-message/browser-test/invitation.browser.e2e.ts
@@ -0,0 +1,68 @@
+import { expect, type Locator, test } from '@playwright/test';
+
+const PANES = ['google', 'forwarded', 'unbroken'] as const;
+
+async function overflow(card: Locator) {
+ return card.evaluate((element) => element.scrollWidth - element.clientWidth);
+}
+
+test.beforeEach(async ({ page }) => {
+ await page.goto('/invitation.html');
+ // A cold Vite server takes more than the default 5s to serve the app CSS.
+ await expect(page.getByTestId('pane-google').locator('section')).toBeVisible({
+ timeout: 20_000,
+ });
+});
+
+for (const pane of PANES) {
+ test(`${pane} description wraps inside the card`, async ({ page }) => {
+ const card = page.getByTestId(`pane-${pane}`).locator('section');
+ await expect.poll(() => overflow(card)).toBe(0);
+
+ await card.getByRole('button', { name: 'Show more' }).click();
+ await expect(card.getByRole('button', { name: 'Show less' })).toBeVisible();
+ await expect.poll(() => overflow(card)).toBe(0);
+ });
+}
+
+test('participants line up with their icon', async ({ page }) => {
+ const rows = page.getByTestId('pane-google').locator('section li');
+ const offsets = await rows.evaluateAll((items) =>
+ items.map((item) => {
+ const [icon, text] = Array.from(item.children);
+ const range = document.createRange();
+ range.selectNodeContents(text);
+ const line = range.getClientRects()[0];
+ const glyph = icon.getBoundingClientRect();
+ return Math.round(
+ line.top + line.height / 2 - (glyph.top + glyph.height / 2)
+ );
+ })
+ );
+ // Schedule, location, then the participants row with its "+3 more" button.
+ expect(offsets).toHaveLength(3);
+ for (const offset of offsets) expect(Math.abs(offset)).toBeLessThanOrEqual(1);
+});
+
+test('the guest toggle keeps a full tap target on touch', async ({
+ page,
+ isMobile,
+}) => {
+ test.skip(!isMobile, 'Touch devices only');
+ await expect(page.locator('html')).toHaveAttribute(
+ 'data-touch-device',
+ 'true'
+ );
+ const toggle = page
+ .getByTestId('pane-google')
+ .getByRole('button', { name: '+3 more' });
+ const hits = await toggle.evaluate((button) => {
+ const box = button.getBoundingClientRect();
+ const x = box.left + box.width / 2;
+ const y = box.top + box.height / 2;
+ return [-20, 20].map((dy) =>
+ button.contains(document.elementFromPoint(x, y + dy))
+ );
+ });
+ expect(hits).toEqual([true, true]);
+});
diff --git a/apps/web/src/features/email-message/browser-test/invitation.html b/apps/web/src/features/email-message/browser-test/invitation.html
new file mode 100644
index 0000000000..aa49e7de43
--- /dev/null
+++ b/apps/web/src/features/email-message/browser-test/invitation.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<html lang="en">
+ <head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>Invitation wrapping</title></head>
+ <body><div id="root"></div><script type="module" src="./invitation.tsx"></script></body>
+</html>
diff --git a/apps/web/src/features/email-message/browser-test/invitation.tsx b/apps/web/src/features/email-message/browser-test/invitation.tsx
new file mode 100644
index 0000000000..2201c0ac8d
--- /dev/null
+++ b/apps/web/src/features/email-message/browser-test/invitation.tsx
@@ -0,0 +1,48 @@
+import '@app/index.css';
+import { isTouchDevice } from '@core/mobile/isTouchDevice';
+import { For } from 'solid-js';
+import { render } from 'solid-js/web';
+import { CalendarInviteCard } from '../components/calendar-invite-card';
+import { invitationFixtures } from '../core/calendar-invitation-fixtures';
+
+const GOOGLE_SEPARATOR =
+ '-::~:~::~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~::~:~::-';
+
+const DESCRIPTIONS = {
+ google: `${GOOGLE_SEPARATOR}\nJoin with Google Meet: https://meet.google.com/abc-defg-hij\nLearn more about Meet at: https://support.google.com/a/users/answer/9282720?hl=en&visit_id=638000000000000000-1234567890&rd=1\n\nPlease do not edit this section.\n${GOOGLE_SEPARATOR}`,
+ forwarded:
+ '<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <strong class="gmail_sendername">Sample Sender</strong> <span>&lt;[email protected]&gt;</span><br>Date: Wed, Nov 4, 2026 at 9:12 AM<br>Subject: Planning notes for the quarterly review and the follow-up session with the wider group<br></div><br><div>Hi all,&nbsp;here&nbsp;is&nbsp;the&nbsp;agenda&nbsp;for&nbsp;the&nbsp;session&nbsp;we&nbsp;talked&nbsp;about&nbsp;on&nbsp;the&nbsp;call&nbsp;last&nbsp;week&nbsp;and&nbsp;the&nbsp;documents&nbsp;to&nbsp;read&nbsp;before.</div><div>https://docs.example.com/document/d/1AbCdEfGhIjKlMnOpQrStUvWxYz0123456789AbCdEfGhIjKlMnOp/edit?usp=sharing&amp;ouid=000000000000000000000</div></div></div>',
+ unbroken:
+ 'ThisDescriptionIsOneVeryLongUnbrokenTokenThatMustWrapInsideTheInvitationCardInsteadOfPushingTheCardWiderThanItsPane',
+} as const;
+
+const fixtures = Object.entries(DESCRIPTIONS).map(([key, description]) => ({
+ key,
+ invitation: { ...invitationFixtures.updated, description },
+}));
+
+function Fixture() {
+ return (
+ <main class="h-screen overflow-y-auto bg-page p-4 text-ink">
+ <For each={fixtures}>
+ {(fixture) => (
+ <div
+ data-testid={`pane-${fixture.key}`}
+ class="w-full overflow-hidden"
+ style={{ 'max-width': '480px' }}
+ >
+ <CalendarInviteCard
+ invitation={fixture.invitation}
+ timeZone="America/Los_Angeles"
+ />
+ </div>
+ )}
+ </For>
+ </main>
+ );
+}
+
+const root = document.getElementById('root');
+if (!root) throw new Error('Fixture root missing');
+document.documentElement.dataset.touchDevice = String(isTouchDevice());
+render(() => <Fixture />, root);
diff --git a/apps/web/src/features/email-message/browser-test/playwright.config.ts b/apps/web/src/features/email-message/browser-test/playwright.config.ts
new file mode 100644
index 0000000000..fee472e5a5
--- /dev/null
+++ b/apps/web/src/features/email-message/browser-test/playwright.config.ts
@@ -0,0 +1,35 @@
+import { fileURLToPath } from 'node:url';
+import { defineConfig, devices } from '@playwright/test';
+
+const directory = fileURLToPath(new URL('.', import.meta.url));
+const webDirectory = fileURLToPath(new URL('../../../../', import.meta.url));
+const port = Number(process.env.EMAIL_MESSAGE_BROWSER_PORT ?? 3197);
+export default defineConfig({
+ testDir: directory,
+ testMatch: '*.browser.e2e.ts',
+ outputDir: `${directory}/test-results`,
+ timeout: 30_000,
+ workers: 1,
+ reporter: 'line',
+ use: {
+ launchOptions: {
+ executablePath: process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH,
+ },
+ baseURL: `http://127.0.0.1:${port}`,
+ trace: 'retain-on-failure',
+ screenshot: 'only-on-failure',
+ },
+ webServer: {
+ command: `bunx vite --config src/features/email-message/browser-test/vite.config.ts --port ${port}`,
+ cwd: webDirectory,
+ url: `http://127.0.0.1:${port}/invitation.html`,
+ reuseExistingServer: false,
+ },
+ projects: [
+ { name: 'desktop', use: { ...devices['Desktop Chrome'] } },
+ {
+ name: 'mobile',
+ use: { ...devices['iPhone 13'], browserName: 'chromium' },
+ },
+ ],
+});
diff --git a/apps/web/src/features/email-message/browser-test/vite.config.ts b/apps/web/src/features/email-message/browser-test/vite.config.ts
new file mode 100644
index 0000000000..289549bc66
--- /dev/null
+++ b/apps/web/src/features/email-message/browser-test/vite.config.ts
@@ -0,0 +1,26 @@
+import { fileURLToPath } from 'node:url';
+import tailwindcss from '@tailwindcss/vite';
+import { defineConfig } from 'vite';
+import solid from 'vite-plugin-solid';
+import solidSvg from 'vite-plugin-solid-svg';
+import tsconfigPaths from 'vite-tsconfig-paths';
+
+const directory = fileURLToPath(new URL('.', import.meta.url));
+const webDirectory = fileURLToPath(new URL('../../../../', import.meta.url));
+export default defineConfig({
+ root: directory,
+ plugins: [
+ tailwindcss(),
+ solid(),
+ solidSvg({ defaultAsComponent: true }),
+ tsconfigPaths({ projects: [`${webDirectory}/tsconfig.json`] }),
+ ],
+ optimizeDeps: {
+ esbuildOptions: { target: 'esnext' },
+ exclude: ['loro-crdt'],
+ },
+ resolve: {
+ dedupe: ['solid-js'],
+ },
+ server: { host: '127.0.0.1', strictPort: true },
+});
diff --git a/apps/web/src/features/email-message/components/calendar-invite-card.tsx b/apps/web/src/features/email-message/components/calendar-invite-card.tsx
index 4cc4ec73e1..01f9d08a58 100644
--- a/apps/web/src/features/email-message/components/calendar-invite-card.tsx
+++ b/apps/web/src/features/email-message/components/calendar-invite-card.tsx
@@ -54,9 +54,7 @@ function MetaRow(props: { icon: JSX.Element; children: JSX.Element }) {
<span class="mt-0.5 flex shrink-0 text-ink-subtle [&>svg]:size-4">
{props.icon}
</span>
- <div class="min-w-0 break-words [overflow-wrap:anywhere]">
- {props.children}
- </div>
+ <div class="min-w-0 wrap-anywhere">{props.children}</div>
</li>
);
}
@@ -237,7 +235,7 @@ export function CalendarInviteCard(props: {
<span>{eyebrow().text}</span>
<Show when={eyebrow().suffix}> {eyebrow().suffix}</Show>
</p>
- <h3 class="break-words text-base font-semibold leading-snug [overflow-wrap:anywhere]">
+ <h3 class="text-base font-semibold leading-snug wrap-anywhere">
{title() || 'Calendar notification'}
</h3>
</header>
@@ -283,9 +281,11 @@ export function CalendarInviteCard(props: {
{visibleAttendees().map(participantName).join(', ')}
<Show when={invite().attendees.length > 3}>
{' '}
+ {/* Inline in the names, so it keeps their line height beside the
+ icon; on touch an overlay restores the 44px tap target. */}
<Button
variant="ghost"
- class="h-auto border-0 p-0 align-baseline text-sm font-medium text-accent"
+ class="h-auto min-h-0 border-0 p-0 align-baseline text-sm font-medium text-accent touch:min-h-0 touch:min-w-0 touch:before:absolute touch:before:inset-x-0 touch:before:top-1/2 touch:before:h-11 touch:before:-translate-y-1/2 touch:before:content-['']"
aria-expanded={attendeesExpanded()}
onClick={() => setAttendeesExpanded((value) => !value)}
>
@@ -300,7 +300,7 @@ export function CalendarInviteCard(props: {
<Show when={!cancelled() && invite().description}>
<div class="flex flex-col items-start gap-1.5">
<div
- class="break-words text-ink-muted [overflow-wrap:anywhere] [&_a]:text-link [&_a:hover]:text-link-hover [&_a:visited]:text-link-visited [&_a]:underline [&_ul]:list-disc [&_ul]:pl-6 [&_ol]:list-decimal [&_ol]:pl-6"
+ class="text-ink-muted wrap-anywhere [&_a]:text-link [&_a:hover]:text-link-hover [&_a:visited]:text-link-visited [&_a]:underline [&_ul]:list-disc [&_ul]:pl-6 [&_ol]:list-decimal [&_ol]:pl-6"
classList={{ 'line-clamp-2': !descriptionExpanded() }}
innerHTML={descriptionHtml()}
onClick={openDescriptionLink}
@@ -402,7 +402,7 @@ export function CalendarInviteCard(props: {
<Show when={canRespond() || props.actions?.showDay}>
<p class="flex flex-wrap items-center gap-x-1 text-xs text-ink-subtle">
<Show when={canRespond()}>
- <span class="break-words [overflow-wrap:anywhere]">
+ <span class="wrap-anywhere">
Responding as {resolved()?.respondingEmail}
</span>
</Show>
@@ -475,7 +475,7 @@ function SchedulingNotification(props: {
>
{badge(status).icon}
</span>
- <p class="min-w-0 break-words [overflow-wrap:anywhere]">
+ <p class="min-w-0 wrap-anywhere">
<span class="font-semibold">{name}</span> {verb(status)}{' '}
<span class="text-ink-subtle">{title(name)}</span>
</p>
@@ -494,7 +494,7 @@ function SchedulingNotification(props: {
<div class="flex min-w-0 flex-col items-start gap-1 pl-9.5">
<p class="text-xs text-ink-subtle">{props.when}</p>
<Show when={props.invitation.comment}>
- <p class="break-words text-ink-muted [overflow-wrap:anywhere]">
+ <p class="text-ink-muted wrap-anywhere">
“{props.invitation.comment}”
</p>
</Show>
diff --git a/docs/agent-guide/calendar.md b/docs/agent-guide/calendar.md
index 0a60d176e6..40fa08b137 100644
--- a/docs/agent-guide/calendar.md
+++ b/docs/agent-guide/calendar.md
@@ -1395,7 +1395,10 @@ been checked. A series invitation shows its current or next live occurrence.
Descriptions render sanitized rich text, including emphasis, links, and lists.
Plain-text line breaks and literal angle brackets (such as `<[email protected]>`)
remain readable. Use `Show more` / `Show less` to expand or collapse the description;
-description links use the host's normal link-opening behavior.
+description links use the host's normal link-opening behavior. Long unbroken text
+(Google's Meet separator, long links, forwarded mail) wraps inside the card in a narrow
+pane, and the guest names stay level with their icon beside `+N more`, which
+keeps a 44px tap target on touch.
A published event file (`METHOD:PUBLISH`, what `Forward by email` and, for a Google
organizer, `Forward invitation` attach) is a shared