Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix(marketing): smooth page loads and simplify mobile navigation (#8437)
Chaitanya Agarwal25aaa3a06fc5
diff --git a/apps/marketing/README.md b/apps/marketing/README.mdindex 2ae9930684..ecbda04d53 100644--- a/apps/marketing/README.md+++ b/apps/marketing/README.md@@ -294,14 +294,18 @@ Keep cards at the three-column width with equal gaps, centering rows with oneor two cards. Wrap at narrow widths without stretching the final row; stackfull-width cards on phones. Allow height to grow when text needs more room.-`SiteHeader` keeps the top-left mark as a normal `href="/"` link with+`SiteHeader` keeps the desktop top-left mark as a normal `href="/"` link with`target="_self"`, so clicking returns to the landing page instead of signup.Mouse hover opens the navigation and preserves the existing logo morph; keep thehover path connected across the gap to the dropdown. Delay hover dismissal by350ms and cancel it on re-entry; keep navigation open while its links have focus.Outside clicks and Escape dismiss immediately. ArrowDown opens and focuses-navigation from the home link. Touch and narrow layouts have a separate menu-toggle, so tapping the mark still goes home. Escape returns focus to the opener.+navigation from the home link. Touch and narrow layouts show a single hamburger+button that opens navigation, without a separate caret. Escape and keyboard+wrapping return focus to that button. Home remains available inside the menu.++The product entry preloads the requested lazy route and its CSS before replacing+prerendered HTML, avoiding a header-only flash on first load.Feature chapters rely on their heading, description, and working demo. Do notreintroduce unused feature-card guides or duplicate explanatory drawers.@@ -376,6 +380,8 @@ sharing, draft edits, keyboard scope, reduced motion, and timer cleanup.`/crm` follows the same reading width, left-aligned slab headings, glass edges,and homepage closing animation. `WorkspaceDesktopDemo` supplies the sharedhero dimensions, wallpaper, padding, and shadows on CRM as on the other product pages.+Cream heroes reuse the dark Monterey wallpaper with a static ivory/stone filter+and a softer warm window shadow; the surrounding cream page remains unchanged.CRM passes `windowChrome={false}` to omit the simulated browser bar; the contentuses that space so the outer frame stays the same height. Do not add CRM-specifichero background or sizing overrides. CRM demonstrates message-drivendiff --git a/apps/marketing/src/app/main/App.tsx b/apps/marketing/src/app/main/App.tsxindex 2aca2dd826..8d6c14b102 100644--- a/apps/marketing/src/app/main/App.tsx+++ b/apps/marketing/src/app/main/App.tsx@@ -121,6 +121,22 @@ const RouteGithub = lazy(() =>})));+// Resolve the requested product module (including its CSS) before replacing+// prerendered HTML. Otherwise the root paints only the header on a cold visit.+export function preloadProductRoute(pathname: string) {+ const routes = new Map([+ ['/tasks', RouteTasks],+ ['/email', RouteEmail],+ ['/documents', RouteDocuments],+ ['/channels', RouteChannels],+ ['/calls', RouteCalls],+ ['/crm', RouteCrm],+ ['/agents', RouteAgents],+ ['/github', RouteGithub],+ ]);+ return routes.get(pathname.replace(/\/$/, ''))?.preload();+}+const RoutePricing = lazy(() =>import('../routes/RoutePricing').then((module) => ({default: module.RoutePricing,diff --git a/apps/marketing/src/app/main/index.test.tsx b/apps/marketing/src/app/main/index.test.tsxnew file mode 100644index 0000000000..65b23f339e--- /dev/null+++ b/apps/marketing/src/app/main/index.test.tsx@@ -0,0 +1,34 @@+import { waitFor } from '@solidjs/testing-library';+import { afterEach, expect, it, vi } from 'vitest';++vi.mock('../utils/utilHeroEntrance', () => ({+ preserveHeroEntrance: () => () => {},+}));++afterEach(() => {+ document.body.textContent = '';+ vi.doUnmock('./App');+ vi.resetModules();+});++it('keeps the prerendered page until the cold product route is ready', async () => {+ const root = document.createElement('div');+ root.id = 'root';+ root.innerHTML = '<h1>Existing product page</h1>';+ document.body.append(root);+ let finish!: () => void;+ const pending = new Promise<void>((resolve) => {+ finish = resolve;+ });+ const preload = vi.fn(() => pending);+ vi.doMock('./App', () => ({+ preloadProductRoute: preload,+ App: () => <h1>Ready product page</h1>,+ }));+ const boot = import('./index');+ await waitFor(() => expect(preload).toHaveBeenCalled());+ expect(root.textContent).toBe('Existing product page');+ finish();+ await boot;+ expect(root.textContent).toBe('Ready product page');+});diff --git a/apps/marketing/src/app/main/index.tsx b/apps/marketing/src/app/main/index.tsxindex 1690e18010..13831ce284 100644--- a/apps/marketing/src/app/main/index.tsx+++ b/apps/marketing/src/app/main/index.tsx@@ -3,7 +3,7 @@ import { render } from 'solid-js/web';import './index.css';import { preserveHeroEntrance } from '../utils/utilHeroEntrance';-import { App } from './App';+import { App, preloadProductRoute } from './App';const root = document.getElementById('root');@@ -13,6 +13,9 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) {);}+// Keep the existing first paint until the requested page and its styles exist.+await preloadProductRoute(window.location.pathname);+// Prerendered builds ship static HTML inside #root for crawlers and first// paint; Solid's render() appends rather than hydrates, so drop it first.const finishHeroHandoff = preserveHeroEntrance(root!);diff --git a/apps/marketing/src/features/marketing/components/SiteHeader.test.tsx b/apps/marketing/src/features/marketing/components/SiteHeader.test.tsxindex ec4b6f95a8..5ade6e37b4 100644--- a/apps/marketing/src/features/marketing/components/SiteHeader.test.tsx+++ b/apps/marketing/src/features/marketing/components/SiteHeader.test.tsx@@ -70,7 +70,7 @@ it('opens with Down Arrow, keeps focused links available, and returns focus withexpect(document.activeElement).toBe(home);});-it('uses a separate touch toggle and closes when leaving navigation', () => {+it('uses a single hamburger touch toggle and closes when leaving navigation', () => {render(() => <SiteHeader />);const home = screen.getByRole('link', { name: 'Macro home' });const touch = new Event('pointerenter', { bubbles: true });@@ -78,6 +78,8 @@ it('uses a separate touch toggle and closes when leaving navigation', () => {fireEvent(home.parentElement!, touch);expect(screen.queryByRole('navigation')).toBeNull();const toggle = screen.getByRole('button', { name: 'Open navigation' });+ expect(toggle.querySelector('.site-menu-mark')).toBeTruthy();+ expect(toggle.querySelector('svg')).toBeNull();fireEvent.click(toggle);expect(screen.getByRole('navigation')).toBeTruthy();fireEvent.keyDown(toggle, { key: 'Escape' });@@ -112,11 +114,12 @@ it('keeps narrow-screen keyboard navigation inside the open menu', () => {const last = within(screen.getByRole('navigation')).getByRole('link', {name: 'Book a demo',});- home.focus();- fireEvent.keyDown(home, { key: 'Tab', shiftKey: true });+ const toggle = screen.getByRole('button', { name: 'Close navigation' });+ toggle.focus();+ fireEvent.keyDown(toggle, { key: 'Tab', shiftKey: true });expect(document.activeElement).toBe(last);fireEvent.keyDown(last, { key: 'Tab' });- expect(document.activeElement).toBe(home);+ expect(document.activeElement).toBe(toggle);});it('allows crossing the gap and cancels dismissal while over the dropdown', () => {diff --git a/apps/marketing/src/features/marketing/components/SiteHeader.tsx b/apps/marketing/src/features/marketing/components/SiteHeader.tsxindex b29b14da01..e0766b9d58 100644--- a/apps/marketing/src/features/marketing/components/SiteHeader.tsx+++ b/apps/marketing/src/features/marketing/components/SiteHeader.tsx@@ -1,4 +1,3 @@-import CaretDown from '@phosphor/caret-down.svg';import { createSignal, For, onCleanup, onMount, Show } from 'solid-js';import {DEMO_BOOKING_URL,@@ -115,12 +114,15 @@ export function SiteHeader(props: { hideOpenApp?: boolean }) {) {const links = menu.querySelectorAll<HTMLAnchorElement>('nav a');const last = links[links.length - 1];- if (event.shiftKey && document.activeElement === trigger) {+ if (+ event.shiftKey &&+ document.activeElement === (menuOpener ?? trigger)+ ) {event.preventDefault();last?.focus();} else if (!event.shiftKey && document.activeElement === last) {event.preventDefault();- trigger.focus();+ (menuOpener ?? trigger).focus();}}}}@@ -129,7 +131,7 @@ export function SiteHeader(props: { hideOpenApp?: boolean }) {ref={trigger}href="/"target="_self"- class="site-menu-trigger"+ class="site-menu-trigger site-menu-home"aria-label="Macro home"aria-expanded={open()}aria-controls="site-main-navigation"@@ -151,7 +153,7 @@ export function SiteHeader(props: { hideOpenApp?: boolean }) {</a><buttontype="button"- class="site-menu-toggle"+ class="site-menu-trigger site-menu-toggle"aria-label={open() ? 'Close navigation' : 'Open navigation'}aria-expanded={open()}aria-controls="site-main-navigation"@@ -161,7 +163,11 @@ export function SiteHeader(props: { hideOpenApp?: boolean }) {else openMenu();}}>- <CaretDown aria-hidden="true" />+ <span class="site-menu-mark" aria-hidden="true">+ <span />+ <span />+ <span />+ </span></button><navid="site-main-navigation"diff --git a/apps/marketing/src/features/marketing/components/site-navigation.css b/apps/marketing/src/features/marketing/components/site-navigation.cssindex b0d965a8c7..b2c15e2f97 100644--- a/apps/marketing/src/features/marketing/components/site-navigation.css+++ b/apps/marketing/src/features/marketing/components/site-navigation.css@@ -20,12 +20,14 @@.site-menu { position: relative; display: flex; align-items: center; pointer-events: auto; }/* Keep the hover path connected across the gap to the dropdown. */.site-header[data-menu-open=true] .site-menu::after { content: ''; position: absolute; top: 100%; left: 0; width: min(560px, calc(100vw - 64px)); height: 12px; }-.site-menu-toggle { display: none; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--nav-ink); cursor: pointer; }-.site-menu-toggle svg { width: 18px; height: 18px; }-.site-menu-toggle[aria-expanded=true] svg { transform: rotate(180deg); }-@media (hover: none), (max-width: 767px) { .site-menu-toggle { display: grid; } }.site-menu-trigger { display: grid; place-items: center; width: 68px; height: 68px; margin-inline: -10px; padding: 0; border: 0; background: transparent; color: var(--nav-ink); border-radius: 50%; transition: background-color 180ms ease; }+/* One hamburger on touch/narrow screens; desktop keeps its home/hover link. */+.site-menu-toggle { display: none; cursor: pointer; }+@media (hover: none), (max-width: 767px) {+ .site-menu-home { display: none; }+ .site-menu-toggle { display: grid; }+}.site-menu-trigger:is(:hover, :focus-visible, [aria-expanded=true]) { background: color-mix(in srgb, var(--nav-ink) 8%, transparent); }.site-menu-mark { position: relative; display: block; width: 36px; height: 36px; }.site-menu-mark > span { position: absolute; inset: 0; background: currentColor; transition: clip-path 440ms cubic-bezier(.22,1,.36,1); }@@ -129,11 +131,11 @@.site-menu-panel { animation: none; }}.site-menu-mark > span:nth-child(1) { clip-path: polygon(12.500% 20.833%, 50.000% 20.833%, 87.500% 20.833%, 87.500% 25.000%, 87.500% 29.167%, 50.000% 29.167%, 12.500% 29.167%, 12.500% 25.000%, 12.500% 20.833%); }-.site-menu-trigger:is(:hover, :focus-visible, [aria-expanded=true]) .site-menu-mark > span:nth-child(1) { clip-path: polygon(0.000% 41.725%, 8.333% 38.392%, 20.704% 50.304%, 20.704% 79.883%, 12.363% 83.217%, 0.938% 72.200%, 0.000% 70.062%, 0.000% 50.000%, 0.000% 41.725%); }+.site-menu-home:is(:hover, :focus-visible, [aria-expanded=true]) .site-menu-mark > span:nth-child(1) { clip-path: polygon(0.000% 41.725%, 8.333% 38.392%, 20.704% 50.304%, 20.704% 79.883%, 12.363% 83.217%, 0.938% 72.200%, 0.000% 70.062%, 0.000% 50.000%, 0.000% 41.725%); }.site-menu-mark > span:nth-child(2) { clip-path: polygon(12.500% 45.833%, 50.000% 45.833%, 87.500% 45.833%, 87.500% 50.000%, 87.500% 54.167%, 50.000% 54.167%, 12.500% 54.167%, 12.500% 50.000%, 12.500% 45.833%); }-.site-menu-trigger:is(:hover, :focus-visible, [aria-expanded=true]) .site-menu-mark > span:nth-child(2) { clip-path: polygon(16.992% 20.000%, 25.325% 16.667%, 60.342% 50.417%, 60.346% 80.000%, 52.004% 83.333%, 22.658% 55.033%, 22.658% 49.562%, 16.992% 44.108%, 16.992% 20.000%); }+.site-menu-home:is(:hover, :focus-visible, [aria-expanded=true]) .site-menu-mark > span:nth-child(2) { clip-path: polygon(16.992% 20.000%, 25.325% 16.667%, 60.342% 50.417%, 60.346% 80.000%, 52.004% 83.333%, 22.658% 55.033%, 22.658% 49.562%, 16.992% 44.108%, 16.992% 20.000%); }.site-menu-mark > span:nth-child(3) { clip-path: polygon(12.500% 70.833%, 50.000% 70.833%, 87.500% 70.833%, 87.500% 75.000%, 87.500% 79.167%, 50.000% 79.167%, 12.500% 79.167%, 12.500% 75.000%, 12.500% 70.833%); }-.site-menu-trigger:is(:hover, :focus-visible, [aria-expanded=true]) .site-menu-mark > span:nth-child(3) { clip-path: polygon(56.642% 20.000%, 64.979% 16.667%, 99.062% 49.529%, 100.000% 51.750%, 100.000% 80.000%, 91.667% 83.333%, 62.254% 54.987%, 62.308% 49.571%, 56.642% 44.108%); }+.site-menu-home:is(:hover, :focus-visible, [aria-expanded=true]) .site-menu-mark > span:nth-child(3) { clip-path: polygon(56.642% 20.000%, 64.979% 16.667%, 99.062% 49.529%, 100.000% 51.750%, 100.000% 80.000%, 91.667% 83.333%, 62.254% 54.987%, 62.308% 49.571%, 56.642% 44.108%); }.site-menu-panel[hidden] { display: none; }diff --git a/apps/marketing/src/features/setup/cream-preview.css b/apps/marketing/src/features/setup/cream-preview.cssindex 0308d608c8..ac180fdfb2 100644--- a/apps/marketing/src/features/setup/cream-preview.css+++ b/apps/marketing/src/features/setup/cream-preview.css@@ -304,9 +304,8 @@ html[data-palette='cream'] .email-desktop-demo[data-hero-frame=true] .email-deskbackground: #ebe6dc;}html[data-palette='cream'] .email-desktop-demo[data-hero-frame=true] .email-desktop-wallpaper::before {- background: radial-gradient(ellipse at 8% 20%, #e7dfd2, transparent 53%),- radial-gradient(ellipse at 72% 0%, #dde3da, transparent 55%), #ebe6dc;- filter: none;+ background: url('../../assets/desktop/monterey-dark.jpg') center / cover;+ filter: grayscale(1) invert(1) sepia(.18) saturate(.6) brightness(.96) contrast(.82);}html[data-palette='cream'] .sales-calc-tools button[aria-pressed=true] .sales-calc-check {color: var(--color-surface-0);@@ -385,9 +384,12 @@ html[data-palette='cream'] body .feature-page .email-desktop-demo[data-hero-frambackground: #ebe6dc;}html[data-palette='cream'] body .feature-page .email-desktop-demo[data-hero-frame=true] .email-desktop-wallpaper::before {- background: radial-gradient(ellipse at 8% 20%, #e7dfd2, transparent 53%),- radial-gradient(ellipse at 72% 0%, #dde3da, transparent 55%), #ebe6dc;- filter: none;+ background: url('../../assets/desktop/monterey-dark.jpg') center / cover;+ filter: grayscale(1) invert(1) sepia(.18) saturate(.6) brightness(.96) contrast(.82);+}+html[data-palette='cream'] body .feature-page .email-desktop-demo[data-hero-frame=true] .email-desktop-window {+ border-color: #1d1c1a1a;+ box-shadow: 0 24px 60px #403a302b, 0 3px 12px #403a3014;}html[data-palette='cream'] :is(.agents-connection-path p, .agents-connection-path a, .calls-page .product-prose a, .calls-scene-picker button) {color: var(--color-ink-muted);diff --git a/docs/agent-guide/README.md b/docs/agent-guide/README.mdindex c4bf11e7eb..f5ca6ed614 100644--- a/docs/agent-guide/README.md+++ b/docs/agent-guide/README.md@@ -54,3 +54,8 @@ hosted Google/SSO redirect allowlist does not include arbitrary hostnames.Email magic links retain the page's HTTP or HTTPS scheme and port.On allowed OAuth origins such as `https://localhost`, standalone Vite uses thesession-code handoff to establish cookies on the local hostname after SSO.++For the standalone marketing site, verify cold product-page navigation with the+route module delayed: prerendered content must remain until the page is ready.+On mobile, the single hamburger opens and closes navigation; there is no separate+caret. Check Escape focus return and keyboard wrapping inside the open menu.