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
Expand marketing demos: calls, reviews, agents, and company records (#7441)
Jacob Beckerman22c6286ae7d0
diff --git a/apps/marketing/README.md b/apps/marketing/README.mdindex 84cdfaa5c4..1053823cc0 100644--- a/apps/marketing/README.md+++ b/apps/marketing/README.md@@ -34,6 +34,18 @@ channel-based sharing. Verify claims against the implementation. Avoid vague“context,” “move work forward,” and “all in one place” headlines, demo narrationas feature prose, and unqualified superiority claims. Explain technical termsonce in plain language; keep demo disclosures in captions and relevant FAQs.+Write it the way the founder talks to another founder: plain words, “we,” the+competitor by name when the comparison is specific, and why we built it.++Demos are faithful to the signed-in app: its labels, layout, icons, and+hover-only controls (the message toolbar appears on hover, as in the app).+Don't invent chrome such as step chips or explanatory labels inside a mock, and+don't show features the app doesn't have. Every animated cursor is+`DemoCursor`, the homepage CRM pipeline's pointer and name tag: label it+“Claude” when an agent acts and with the person's first name otherwise. Size+each `ProductDemo` to its scene with `height`/`mobileHeight` so a window is+never mostly empty, and seed enough content that the first frame already+reads as a real workspace.Product stories live in their feature's `components/*/*Stories.tsx` files.They reuse frozen product presentation and local workspace data. Call recordsdiff --git a/apps/marketing/src/app/routes/RouteCrm.tsx b/apps/marketing/src/app/routes/RouteCrm.tsxindex 1b850c4d9a..0147b6a314 100644--- a/apps/marketing/src/app/routes/RouteCrm.tsx+++ b/apps/marketing/src/app/routes/RouteCrm.tsx@@ -1,13 +1,12 @@-import MacroLogo from '@icon/macro-logo.svg';import { lazy } from 'solid-js';import { CrmCaptureDemo } from '../../features/marketing/components/crm/CrmCaptureDemo';import { CrmComparison } from '../../features/marketing/components/crm/CrmComparison';-import { CrmConnectedWorkDemo } from '../../features/marketing/components/crm/CrmConnectedWorkDemo';import { CrmEnrichmentDemo } from '../../features/marketing/components/crm/CrmEnrichmentDemo';import {AgentIllustration,CaptureIllustration,ContextIllustration,+ EnrichmentIllustration,} from '../../features/marketing/components/crm/CrmFeatureIllustrations';import { CrmRecordDemo } from '../../features/marketing/components/crm/CrmRecordDemo';import {@@ -15,13 +14,16 @@ import {DemoPlaceholder,} from '../../features/marketing/components/DeferredDemo';import {- FeaturePage,- FeaturePageCta,FeaturePageFaq,FeaturePageSection,} from '../../features/marketing/components/FeaturePage';import { HomepageClosing } from '../../features/marketing/components/HomepageClosing';import { HomepageConversation } from '../../features/marketing/components/HomepageConversation';+import {+ ProductHero,+ ProductPage,+ ProductProse,+} from '../../features/marketing/components/product/ProductPage';import { WorkspaceDesktopDemo } from '../../features/marketing/components/WorkspaceDesktopDemo';import { setPageSeo } from '../utils/utilSeo';import '../../features/marketing/components/crm/crm-page.css';@@ -33,31 +35,31 @@ const PipelineDemo = lazy(loadPipeline);const faqItems = [{q: 'How are companies and contacts created?',- a: 'Macro creates contacts from external email conversations and groups them into companies by email domain. Contacts from the same company stay together, with their first and latest interactions.',+ a: 'From your email. When someone on your team emails a person at a new domain, Macro creates the contact and the company, and groups everyone from that domain under it. Personal addresses like Gmail don’t become companies. You can also add companies by hand or import a CSV.',},{q: 'What is automatic enrichment?',- a: 'Macro adds public company information such as its website, description, industry, location, and size. Your team can add the details specific to your relationship.',+ a: 'When Macro creates a company, it looks up the domain and adds a short description from public sources, so you know who they are without opening another tab. Stage, owner, revenue, and everything else you know about the deal are yours to fill in.',},{q: 'Can I update records myself?',- a: 'Yes. Change properties such as the deal stage and owner, and add notes directly to the company record.',+ a: 'Yes. Drag a company to a new stage on the board, or open it and change Stage, Owner, Revenue, or any custom property you’ve added. Agents edit the same properties, so their changes and yours end up in the same place.',},{q: 'Where does the team discuss a customer?',- a: 'Every company and contact has its own discussion thread. Add notes, reply to teammates, and link relevant documents and tasks so the conversation stays with the record.',+ a: 'On the company. Every company has a Discussion that works like a thread in a channel: reply, react, and @mention people, docs, or tasks. The pricing conversation stays with the customer instead of scrolling away in #sales.',},{q: 'Can I mention a company in a document or channel?',- a: 'Yes. Mention a company or contact to create a link to its record. Sharing follows the record’s access rules and your permission to share it.',+ a: 'Yes. Type @ and pick it from Companies. The mention links to the company’s record, and opening it follows the record’s normal access rules.',},{q: 'What can agents do with the CRM?',- a: 'Agents can use the customer record and available emails, calls, documents, and tasks to answer questions and update properties. Give the agent a specific request, such as updating the pipeline from your latest sales sync.',+ a: 'Agents can list companies, read a record with its contacts and properties, and set Stage, Owner, Revenue, or your custom properties. @mention Claude in a company’s Discussion, or ask in a channel after your sales sync. The same tools are on our MCP server, so Claude, ChatGPT, and Cursor can use them too.',},{q: 'Is CRM available for my account?',- a: 'CRM is rolling out. If the Companies view is not visible in your workspace, it may not have reached your account yet. Macro is open source under AGPLv3; the application code being public does not make your customer records public.',+ a: 'We’re rolling it out. If you don’t see Customers in your sidebar yet, it hasn’t reached your account. And being open source doesn’t make your data public: Macro’s code is AGPLv3, but your companies, contacts, and emails stay private to your team.',},];@@ -65,192 +67,171 @@ export function RouteCrm() {setPageSeo({title: 'Macro CRM — The Self-Building CRM',description:- 'Build your CRM from email, enrich company records, and keep customer conversations connected to your team’s work. Let agents help update the pipeline.',+ 'Companies and contacts built from your email, enriched automatically, and kept current by agents. Right in your workspace, so there’s no separate tool to check.',path: '/crm',});return (- <FeaturePage>- <div class="crm-feature-page">- <header class="crm-page-hero">- <p class="crm-page-label">- <MacroLogo aria-hidden="true" />- <span>Macro CRM</span>+ <ProductPage>+ <ProductHero+ product="CRM"+ title={['The CRM that', 'updates itself.']}+ description={[+ 'Built from your email and calls, kept current by agents.',+ 'Right in your workspace, so there’s no separate tool to check.',+ ]}+ cta="crm_hero_get_started"+ />+ <WorkspaceDesktopDemo+ view="crm"+ label="Explore Macro CRM"+ caption="A sample pipeline. Drag a company to a new stage or open its record."+ />+ <nav+ class="feature-page-jump-links crm-feature-links"+ aria-label="On this page"+ >+ <a href="#crm-from-email">+ <span class="crm-feature-illustration">+ <CaptureIllustration />+ </span>+ <span>Updated by agents</span>+ </a>+ <a href="#crm-enrichment">+ <span class="crm-feature-illustration">+ <EnrichmentIllustration />+ </span>+ <span>Auto-enriched</span>+ </a>+ <a href="#crm-context">+ <span class="crm-feature-illustration">+ <ContextIllustration />+ </span>+ <span>The whole relationship</span>+ </a>+ <a href="#crm-agents">+ <span class="crm-feature-illustration">+ <AgentIllustration />+ </span>+ <span>Agents and MCP</span>+ </a>+ </nav>+ <FeaturePageSection+ id="crm-from-email"+ title="Nobody has to update the CRM."+ description={+ 'Tell @Claude what happened on the call and it updates the stage, owner, and notes.\nOr let it read the email thread and work it out.'+ }+ >+ <div class="feature-page-visual">+ <CrmCaptureDemo />+ </div>+ <ProductProse>+ <p>+ Every CRM is useful when it’s up to date, and every keystroke it+ takes to get there is a chore. That’s why most of them go stale.+ Auto-updating CRMs like Attio and Lightfield help, but they’re still+ another tool someone has to check. Macro’s CRM lives in the same+ workspace as your email, calls, and chat, and agents keep it current+ from those conversations.</p>- <h1>- <span>CRM that makes money</span>- <span>and updates itself.</span>- </h1>- <p class="crm-page-description">- <span>Companies and contacts created from your email.</span>{' '}- <span>Enriched automatically. Updated by agents.</span>+ </ProductProse>+ </FeaturePageSection>+ <FeaturePageSection+ id="crm-enrichment"+ title="Every company, already researched."+ description={+ 'New companies show up from your email with a description from public sources.\nYour team adds what only you know.'+ }+ >+ <div class="feature-page-visual">+ <CrmEnrichmentDemo />+ </div>+ <ProductProse>+ <p>+ When you email someone new, Macro creates the contact and the+ company from their domain and fills in what’s publicly known about+ them. You don’t start from a blank record, and you don’t need a+ separate enrichment tool to do it.</p>- <FeaturePageCta name="crm_hero_get_started" />- </header>- <WorkspaceDesktopDemo- view="crm"- label="Try Macro CRM"- caption="Explore the pipeline. Open a company, update its stage, or add a note."- />- <nav class="crm-feature-links" aria-label="On this page">- <a href="#crm-from-email">- <span class="crm-feature-illustration">- <CaptureIllustration />- </span>- <span>Updates from conversation</span>- </a>- <a href="#crm-context">- <span class="crm-feature-illustration">- <ContextIllustration />- </span>- <span>Emails and customer records</span>- </a>- <a href="#crm-agents">- <span class="crm-feature-illustration">- <AgentIllustration />- </span>- <span>Agents keep it current</span>- </a>- </nav>- <FeaturePageSection- id="crm-from-email"- title="Agents update your customer records."- description={- 'Tell an agent what changed in a customer conversation.\nIt can update the owner, deal stage, and notes directly.'- }- >- <div class="feature-page-visual crm-scene">- <CrmCaptureDemo />- </div>- <div class="crm-feature-prose">- <p>- CRM tools let agents read company records and update their- properties. Ask Claude to assign an owner, save rollout notes, or- move a deal to the next stage. The changes appear in the customer- record and pipeline board. Open the record to review the values or- edit them yourself.- </p>- </div>- </FeaturePageSection>- <FeaturePageSection- id="crm-enrichment"- title="Company enrichment, automatically."- description={- 'Email domains become company records.\nMacro adds available company information from public sources.'- }- >- <div class="feature-page-visual crm-scene">- <CrmEnrichmentDemo />- </div>- <div class="crm-feature-prose">- <p>- Macro creates contacts and companies from your email. The sender’s- domain identifies the company, and enrichment adds available- details such as its website, industry, location, and size. Your- team can add its own properties, including deal stage, owner, and- revenue. Those fields are available in the customer view and to- agents through CRM tools.- </p>- </div>- </FeaturePageSection>- <FeaturePageSection- id="crm-context"- title="Customer emails in the customer record."- description={- 'Open the company to see its contacts, emails, and team discussion.\nRead the original conversation before replying or joining a call.'- }- >- <div class="feature-page-visual crm-scene">- <CrmRecordDemo />- </div>- <div class="crm-feature-prose">- <p>- Customer records link the company’s contacts and email- conversations. Each record has a discussion where your team can- leave notes and @mention related work. An agent can read the- record and available conversations before answering a question or- updating a property. People can follow the same links to check its- sources.- </p>- </div>- </FeaturePageSection>- <FeaturePageSection- id="crm-connected-work"- title="@mention customers in docs and chat."- description={- 'A customer’s name becomes a link to its record.\nReference the company in a proposal, task, or channel message.'- }- >- <div class="feature-page-visual crm-scene">- <CrmConnectedWorkDemo />- </div>- <div class="crm-feature-prose">- <p>- Companies and contacts are workspace items you can @mention. Link- the customer record in a rollout plan, a support request, or a- team conversation. Opening the reference shows the customer’s- details and related work. Your team can navigate from the request- to the relationship it concerns.- </p>- </div>- </FeaturePageSection>- <FeaturePageSection- id="crm-agents"- title="Update the pipeline with a message."- description={- 'Ask an agent to change deal stages from your latest sales conversation.\nThe updates appear directly in the pipeline board.'- }- >- <div class="feature-page-visual crm-scene crm-agent-scene">- <HomepageConversation- messages={[- {- person: 'valentina',- text: (- <>- <span class="homepage-person-mention">@Claude</span>,- update the pipeline from our sales sync. Northwind asked- for a proposal, and Lumen signed.- </>- ),- },- ]}- />- <div class="crm-pipeline-frame glass-input">- <DeferredDemo- preload={loadPipeline}- fallback={- <DemoPlaceholder label="Agent updates the customer pipeline" />- }- >- <PipelineDemo playbackControls={false} />- </DeferredDemo>- </div>- </div>- <div class="crm-feature-prose">- <p>- Tell the agent which customer asked for a proposal and which- signed. Its CRM tools can read the records and set their stage- properties. Macro’s MCP tools also expose company records and- property updates to external agents. The pipeline and customer- views read those same values.- </p>+ </ProductProse>+ </FeaturePageSection>+ <FeaturePageSection+ id="crm-context"+ title="The whole relationship in one record."+ description={+ 'Emails, calls, files, and tasks for every company, one tab away.\nComments are threaded like chat, so notes don’t get lost in Slack.'+ }+ >+ <div class="feature-page-visual">+ <CrmRecordDemo />+ </div>+ <ProductProse>+ <p>+ Open a company and it’s all there: the people you talk to, every+ email thread, every call, the files you’ve sent, and the tasks in+ flight. The discussion on each record works like a channel thread,+ so the note about pricing lives on the customer instead of somewhere+ in #sales. Mention the company in a doc or channel and it links+ straight back here.+ </p>+ </ProductProse>+ </FeaturePageSection>+ <FeaturePageSection+ id="crm-agents"+ title="Your agents get the same CRM."+ description={+ 'Agents can read companies and their contacts and update company properties with the same tools you see in the app.\nUse them for outbound, research, or keeping the pipeline current.'+ }+ >+ <div class="feature-page-visual crm-agent-scene">+ <HomepageConversation+ messages={[+ {+ person: 'valentina',+ text: (+ <>+ <span class="homepage-person-mention">@Claude</span>, update+ the pipeline from our sales sync. Northwind asked for a+ proposal, and Lumen signed.+ </>+ ),+ },+ ]}+ />+ <div class="crm-pipeline-frame glass-input">+ <DeferredDemo+ preload={loadPipeline}+ fallback={+ <DemoPlaceholder label="Agent updates the customer pipeline" />+ }+ >+ <PipelineDemo playbackControls={false} />+ </DeferredDemo></div>- </FeaturePageSection>- <FeaturePageFaq- id="crm-faq-title"- eyebrow="Email, enrichment, and agent tools"- title="How Macro CRM works."- introduction={- <p>- Company records built from email, enriched from public- information, and editable by your team and agents.- </p>- }- items={faqItems}- />- <CrmComparison />- <HomepageClosing />- </div>- </FeaturePage>+ </div>+ <ProductProse>+ <p>+ We treat Macro’s MCP server as seriously as the interface. Agents+ can list companies, read a record, and update its properties,+ whether they’re running in Macro or in Claude, ChatGPT, or Cursor.+ Tell one which deals moved after your sales sync and the pipeline+ updates while you get on with your day.+ </p>+ </ProductProse>+ </FeaturePageSection>+ <FeaturePageFaq+ id="crm-faq-title"+ title="Questions about Macro CRM"+ introduction={+ <p>+ If you’re coming from HubSpot, Attio, or a spreadsheet, here’s+ what’s different.+ </p>+ }+ items={faqItems}+ />+ <CrmComparison />+ <HomepageClosing />+ </ProductPage>);}diff --git a/apps/marketing/src/app/routes/RouteTasks.tsx b/apps/marketing/src/app/routes/RouteTasks.tsxindex 97651a8e9e..322825fd3a 100644--- a/apps/marketing/src/app/routes/RouteTasks.tsx+++ b/apps/marketing/src/app/routes/RouteTasks.tsx@@ -9,11 +9,10 @@ import {ProductProse,} from '../../features/marketing/components/product/ProductPage';import {- TaskAgentDemo,- TaskAttentionDemo,- TaskContextDemo,- TaskFromChannelDemo,+ TaskAgentChannelDemo,+ TaskFromChecklistDemo,TaskFromMessageDemo,+ TaskGithubDemo,} from '../../features/marketing/components/tasks/TaskStories';import { WorkspaceDesktopDemo } from '../../features/marketing/components/WorkspaceDesktopDemo';import { setPageSeo } from '../utils/utilSeo';@@ -23,63 +22,58 @@ const tasksFaq = [q: 'How is Macro Tasks different from Linear?',a: (<>- Macro keeps status, priority, assignees, and a keyboard-first workflow- alongside email, chat, and documents. Tasks stay connected to the- conversations behind them. Read the{' '}- <a href="/posts/linear-alternative">Macro and Linear comparison</a>.+ We used Linear before we built this, so the basics will feel familiar:+ keyboard shortcuts, statuses, priorities, and fast lists. The difference+ is that tasks live next to your email, chat, and docs. You make them+ from the conversation they came from, and they stay linked to it. Read+ our <a href="/posts/linear-alternative">Macro vs. Linear comparison</a>.</>),},{q: 'Can I turn a message or email into a task?',- a: 'Yes. Create a task from a chat message or email and keep it linked to the original conversation. You can also mention the task in documents and channels.',+ a: 'Yes. Hover a message and click Task, or open an email and click Create task in the top right. The task links back to the original so whoever picks it up can read the whole thing.',},{- q: 'How do I organize my tasks?',- a: 'Use My Tasks, All Tasks, and Created by me to find the work you need. Set status, priority, and assignees, add tags, and search the task list.',+ q: 'How do I keep track of my tasks?',+ a: 'My Tasks shows what’s assigned to you, All Tasks shows everything your team can see, and Created by me shows what you’ve asked other people for. New assignments also land in Home next to your email and messages, so you don’t have to go looking.',},{q: 'Can agents work on tasks?',a: (<>- Assign work to an agent in a conversation. Agents can use the available- workspace context, update the task, and report back. Coding agents can- work on a fix and open a pull request. See{' '}+ Yes. Ask @Macro in a channel to create or update tasks, or hand a task+ to a coding agent like Claude Code or Cursor. When a pull request+ references the task, the status updates on its own. See{' '}<a href="/agents">agents in Macro</a>.</>),},{- q: 'Does Macro integrate with GitHub?',+ q: 'How does the GitHub integration work?',a: (<>- Yes. Link tasks to branches and pull requests to track the code- alongside the work. Opening a linked pull request moves the task to In- Review; merging it completes the task. See the{' '}- <a href="/github">GitHub integration</a>.+ Install the GitHub app and put the task ID in a branch name, PR title,+ or PR description. Opening the PR moves the task to In Review, merging+ it marks it Completed, and closing it without merging moves it back to+ Not Started. More on <a href="/github">GitHub in Macro</a>.</>),},{- q: 'Can people outside engineering use it?',- a: 'Yes. Tasks work for launch plans, customer follow-ups, and other team work. Teammates can follow progress alongside their email, chat, and documents.',+ q: 'Is it only for engineering teams?',+ a: 'No. We run launches, customer follow-ups, and plenty of non-engineering work out of it. Anything with an owner and a due date works.',},{q: 'Is our workspace public because Macro is open source?',- a: (- <>- No. Open source makes the application code available to inspect. It does- not make your tasks, messages, or documents public. Access to workspace- content follows its sharing permissions.- </>- ),+ a: 'No. Our code is public. Your tasks, messages, and docs are not, and they follow your sharing settings.',},{q: 'Is there a free plan?',a: (<>- Yes. Tasks are included alongside email, chat, documents, and AI. See{' '}- <a href="/pricing">pricing</a> for current usage limits.+ Yes. Tasks come with email, chat, docs, and agents. See{' '}+ <a href="/pricing">pricing</a> for the current limits.</>),},@@ -89,24 +83,24 @@ export function RouteTasks() {setPageSeo({title: 'Macro Tasks — Task management that keeps up with your team',description:- 'Track tasks alongside your email, chat, and documents. Create work from conversations, assign people and agents, and follow progress through to a pull request.',+ 'Make tasks from messages, emails, and doc checklists in one click. Assign people or agents, and let GitHub pull requests update the status for you.',path: '/tasks',});return (<ProductPage><ProductHeroproduct="Tasks"- title={['Tasks for your team', 'and your agents.']}+ title={['Task tracking without', 'the busywork.']}description={[- 'Create tasks from messages and email.',- 'Assign an owner. Let agents update the work.',+ 'Turn any message, email, or to-do into a task in one click.',+ 'It stays linked to the conversation it came from.',]}cta="tasks_hero_get_started"/><WorkspaceDesktopDemoview="tasks"label="Explore Macro Tasks"- caption="Open a task, change its owner, or add a comment. This sample stays local."+ caption="A sample workspace. Open a task, change the owner, leave a comment."/><sectionclass="tasks-founder-letter"@@ -124,18 +118,18 @@ export function RouteTasks() {</p><p>Macro Tasks fixes this by tightly co-locating tasks with your team- chat. Tickets are so easy to create from task messages, and their- status gets updated automatically so they'll actually get closed.- After two years of dogfooding it's finally working for us. We hope you- like it too!+ chat. Tickets are so easy to create from messages, and their status+ gets updated automatically so they'll actually get closed. After two+ years of dogfooding it's finally working for us. We hope you like it+ too!</p><footer>— Jacob Beckerman, CEO and founder of Macro</footer></section><FeaturePageSection- id="from-conversation"- title="Turn a message into a task."+ id="from-a-message"+ title="Any message can become a task."description={- 'Create a task from a message or email.\nIts source stays linked in both directions.'+ 'Hover a message in any channel and click Task.\nThe task links back to the thread, so nobody has to ask what happened.'}><div class="feature-page-visual">@@ -143,101 +137,86 @@ export function RouteTasks() {</div><ProductProse><p>- A task can start from a chat message, email, or document checklist.- References connect it to the original request, and backlinks let you- navigate back. For a new task, press C then T. Add a title,- description, and assignee from the keyboard.- </p>- </ProductProse>- </FeaturePageSection>- <FeaturePageSection- id="tasks-in-channels"- title="Send a task right in the channel."- description={- 'Write the request, switch on Send as task, and pick an assignee.\nThe task appears in the conversation where your team is working.'- }- >- <div class="feature-page-visual">- <TaskFromChannelDemo />- </div>- <ProductProse>- <p>- Send a channel message as a task to create the brief and share it in- one action. Choose an assignee before sending. Teammates can open- the task from its message to change the status, add a checklist, or- discuss the request. The task links back to the channel, and the- assignee receives it in their inbox.+ This is the one we use the most. Someone flags a bug in a channel,+ you hover the message and click Task. Macro fills in the title from+ the message, assigns whoever was @mentioned, and links the task to+ the thread. Whoever picks it up can read the replies instead of+ pinging you for the backstory. To start one from scratch, press C+ then T from anywhere in Macro.</p></ProductProse></FeaturePageSection><FeaturePageSection- id="task-context"- title="An editable brief with real references."+ id="ask-macro"+ title="Or just ask @Macro."description={- 'Write a Markdown brief and checklist.\n@mention the specification, email, or call that explains the request.'+ 'Mention the Macro agent and say who’s doing what.\nOne message turns into as many assigned tasks as you need.'}><div class="feature-page-visual">- <TaskContextDemo />+ <TaskAgentChannelDemo /></div><ProductProse><p>- Task descriptions support Markdown and references to workspace- items. Link the specification, source email, or meeting recording- directly in the brief. Each task has a discussion for questions and- updates. Agents can read the brief, follow its references, and- update the description.+ When a conversation ends with three action items, nobody wants to+ file three tickets. Tag @Macro, tell it who owns what, and it+ creates the tasks and replies with links. Each link shows the task’s+ status, priority, and owner right in the channel, so you can see+ where things stand without opening a task tracker.</p></ProductProse></FeaturePageSection><FeaturePageSection- id="task-agents"- title="Agents can update the task."+ id="from-docs-and-email"+ title="Turn to-dos into tasks."description={- 'Ask an agent to revise the brief or turn meeting notes into a checklist.\nIts edits appear in the task your team uses.'+ 'Select a checklist in any doc and click Tasks. Every line becomes a real task.\nEmails get a Create task button too.'}><div class="feature-page-visual">- <TaskAgentDemo />+ <TaskFromChecklistDemo /></div><ProductProse><p>- Task tools let agents create work and update descriptions, status,- priority, and assignees. Ask for a specific change and review it in- the task. Coding agents can implement a task and open a linked pull- request. GitHub events move the task into review and mark it- complete when the code is merged.+ Meeting notes are where action items go to die. In Macro, select the+ checkboxes in a doc and click Tasks. Each line becomes a task you+ can assign, and the doc keeps a live link to it, so you can see+ what’s done without leaving the notes. Email works the same way:+ open a thread, click Create task, and the task links back to the+ email.</p></ProductProse></FeaturePageSection><FeaturePageSection- id="task-list"- title="My Tasks. All Tasks. Created by me."+ id="github"+ title="Closes itself when the PR merges."description={- 'Find your assigned work, browse the team’s tasks, or follow your requests.\nSearch by title and open the brief from the list.'+ 'Put the task ID in a branch or pull request.\nOpening the PR moves the task to In Review. Merging it marks it done.'}><div class="feature-page-visual">- <TaskAttentionDemo />+ <TaskGithubDemo /></div><ProductProse><p>- My Tasks shows your assignments. All Tasks shows the work you can- access, and Created by me tracks the requests you made. Task- assignments also arrive in the unified inbox, alongside emails,- messages, and agent responses. Open one to read the brief or update- its properties.+ Nobody on our team updates ticket status by hand anymore. When a+ pull request references a task, Macro links the two and shows the PR+ on the task. Opening it moves the task to In Review, merging it+ marks the task Completed, and closing it without merging puts it+ back in Not Started. It works the same when Claude Code or Cursor+ opens the PR, so the board stays accurate even when an agent did the+ work.</p></ProductProse></FeaturePageSection><FeaturePageFaqid="tasks-faq-title"- eyebrow="Creation, ownership, and automation"- title="How Macro Tasks work."+ title="Questions about Macro Tasks"introduction={<p>- Keyboard-first tasks, bidirectional references, agent tools, and- GitHub status updates.+ If you’re coming from Linear, Jira, or Notion, most of what you know+ carries over. The difference is where tasks come from and how they+ stay up to date.</p>}items={tasksFaq}diff --git a/apps/marketing/src/assets/people/macro-agent.svg b/apps/marketing/src/assets/people/macro-agent.svgnew file mode 100644index 0000000000..9d2645e099--- /dev/null+++ b/apps/marketing/src/assets/people/macro-agent.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="16" fill="#2a2b2e"/><g transform="translate(6.5 6.6) scale(0.79)" fill="#f2f2f0"><path d="M0 10.014v6.801a.75.75 0 0 0 .225.513l2.742 2.644 2.002-.8v-7.099l-2.97-2.859z"/><path d="M4.078 4.8v5.786l1.36 1.309v1.313L12.481 20l2.002-.8-.001-7.1L6.078 4z"/><path d="M13.594 4.8v5.786l1.36 1.311-.013 1.3L22 20 24 19.2V12.42a.75.75 0 0 0-.225-.533L15.595 4z"/></g></svg>diff --git a/apps/marketing/src/features/marketing/components/DemoCursor.tsx b/apps/marketing/src/features/marketing/components/DemoCursor.tsxnew file mode 100644index 0000000000..ab8ea135af--- /dev/null+++ b/apps/marketing/src/features/marketing/components/DemoCursor.tsx@@ -0,0 +1,34 @@+import type { JSX } from 'solid-js';+import './demo-cursor.css';++// Macro's rounded pointer, the same shape the homepage CRM demo uses.+const POINTER_PATH =+ 'M3.902 8.546L5.012 5.511L5.512 5.011L8.547 3.902L8.562 3.896C8.7 3.834 8.817 3.733 8.896 3.604C8.976 3.475 9.014 3.326 9.007 3.175C9 3.024 8.947 2.878 8.856 2.758C8.765 2.637 8.639 2.547 8.496 2.499L0.992 0.049C0.861 0.006 0.72 0 0.586 0.032C0.452 0.064 0.329 0.133 0.231 0.231C0.133 0.328 0.065 0.451 0.032 0.585C0 0.72 0.006 0.86 0.049 0.992L2.499 8.496C2.545 8.64 2.635 8.768 2.756 8.86C2.877 8.952 3.023 9.005 3.175 9.011H3.211C3.357 9.012 3.5 8.969 3.621 8.889C3.743 8.809 3.839 8.695 3.896 8.562L3.902 8.546Z';++/**+ * The one animated cursor for every website demo: Macro's pointer with a+ * name tag. Agents are labelled "Claude"; people use their first name.+ * Callers position it with `class` or `style`; the tip sits at (0, 0).+ */+export function DemoCursor(props: {+ label?: string;+ class?: string;+ style?: JSX.CSSProperties;+ clicking?: boolean;+ ref?: (element: HTMLDivElement) => void;+}) {+ return (+ <div+ ref={props.ref}+ class={`demo-cursor${props.class ? ` ${props.class}` : ''}`}+ style={props.style}+ data-clicking={props.clicking ? 'true' : undefined}+ aria-hidden="true"+ >+ <svg viewBox="0 0 9.014 9.012">+ <path d={POINTER_PATH} />+ </svg>+ <span>{props.label ?? 'Claude'}</span>+ </div>+ );+}diff --git a/apps/marketing/src/features/marketing/components/DemoMentionMenu.test.tsx b/apps/marketing/src/features/marketing/components/DemoMentionMenu.test.tsxindex 59255a51cf..ef4effa800 100644--- a/apps/marketing/src/features/marketing/components/DemoMentionMenu.test.tsx+++ b/apps/marketing/src/features/marketing/components/DemoMentionMenu.test.tsx@@ -186,7 +186,7 @@ it('uses the real menu category drilldown and return behavior', () => {fireEvent.click(screen.getByRole('button', { name: '← Back to everything' }));expect(screen.getByText('People')).toBeTruthy();fireEvent.keyDown(editor, { key: 'ArrowRight' });- expect(screen.getAllByRole('option')).toHaveLength(5);+ expect(screen.getAllByRole('option')).toHaveLength(6);fireEvent.keyDown(editor, { key: 'ArrowLeft' });expect(screen.getByText('Channels')).toBeTruthy();});diff --git a/apps/marketing/src/features/marketing/components/HomepageCrm.tsx b/apps/marketing/src/features/marketing/components/HomepageCrm.tsxindex e2b1215862..e73ed9a69d 100644--- a/apps/marketing/src/features/marketing/components/HomepageCrm.tsx+++ b/apps/marketing/src/features/marketing/components/HomepageCrm.tsx@@ -8,10 +8,7 @@ import {onMount,Show,} from 'solid-js';-import {- DocsDemoPointer,- DocsGraphicFrame,-} from '../../../app/components/featureGraphics/DocsMarkdownScene';+import { DocsGraphicFrame } from '../../../app/components/featureGraphics/DocsMarkdownScene';import {CRM_DEMO_COMPANIES,CRM_DEMO_DURATION,@@ -22,6 +19,7 @@ import {CompanyKanbanCardSurface,CompanyKanbanColumn,} from './DemoCompanyKanban';+import { DemoCursor } from './DemoCursor';import { CrmStageIcon } from './DemoStageIcon';import './homepage-crm.css';@@ -184,16 +182,13 @@ export default function HomepageCrm(<DemoCard company={moving()} /></div></Show>- <div+ <DemoCursorclass="homepage-crm-cursor"style={{transform: `translate(${frame().x}px, ${frame().y}px)`,opacity: frame().opacity,}}- >- <DocsDemoPointer />- <span>Claude</span>- </div>+ /></div></div><div class="homepage-crm-footer">diff --git a/apps/marketing/src/features/marketing/components/WorkspaceDesktopDemo.tsx b/apps/marketing/src/features/marketing/components/WorkspaceDesktopDemo.tsxindex 61fe939c20..aa67b933f3 100644--- a/apps/marketing/src/features/marketing/components/WorkspaceDesktopDemo.tsx+++ b/apps/marketing/src/features/marketing/components/WorkspaceDesktopDemo.tsx@@ -12,6 +12,8 @@ export function WorkspaceDesktopDemo(props: {label: string;caption: string;initialDocument?: string;+ /** Open this sample agent conversation instead of a new one. */+ initialAgent?: string;children?: JSX.Element;}) {return (@@ -49,6 +51,7 @@ export function WorkspaceDesktopDemo(props: {<WorkspaceinitialView={props.view}initialDocument={props.initialDocument}+ initialAgent={props.initialAgent}embedded/></DeferredDemo>diff --git a/apps/marketing/src/features/marketing/components/agents/AgentStories.test.tsx b/apps/marketing/src/features/marketing/components/agents/AgentStories.test.tsxnew file mode 100644index 0000000000..8c94bf7c12--- /dev/null+++ b/apps/marketing/src/features/marketing/components/agents/AgentStories.test.tsx@@ -0,0 +1,194 @@+import { cleanup, fireEvent, render, within } from '@solidjs/testing-library';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import DummyWorkspace from '../workspace/DummyWorkspace';+import {+ AgentMcpDemo,+ AgentMemoryDemo,+ AgentModelsDemo,+ AgentSearchDemo,+} from './AgentStories';++let intersections: IntersectionObserverCallback[];+let reduced = false;+beforeEach(() => {+ intersections = [];+ reduced = false;+ vi.useFakeTimers();+ vi.stubGlobal('fetch', vi.fn());+ vi.spyOn(document, 'hidden', 'get').mockImplementation(() => false);+ vi.stubGlobal('matchMedia', () => ({+ get matches() {+ return reduced;+ },+ addEventListener: vi.fn(),+ removeEventListener: vi.fn(),+ }));+ vi.stubGlobal(+ 'IntersectionObserver',+ class {+ constructor(callback: IntersectionObserverCallback) {+ intersections.push(callback);+ }+ observe() {}+ disconnect() {}+ }+ );+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+});+afterEach(() => {+ cleanup();+ vi.advanceTimersByTime(100);+ expect(fetch).not.toHaveBeenCalled();+ expect(vi.getTimerCount()).toBe(0);+ vi.useRealTimers();+ vi.restoreAllMocks();+ vi.unstubAllGlobals();+});+function visible() {+ for (const callback of intersections)+ callback(+ [{ isIntersecting: true } as IntersectionObserverEntry],+ {} as IntersectionObserver+ );+}++it('opens the hero on a cited conversation whose tasks open in place', () => {+ vi.spyOn(window, 'scrollTo').mockImplementation(() => {});+ const view = render(() => (+ <DummyWorkspace+ initialView="agents"+ initialAgent="launch-status"+ embedded+ />+ ));+ const log = within(view.getByRole('log', { name: 'Launch workspace' }));+ expect(log.getByText('What’s left before Thursday’s launch?')).toBeTruthy();+ expect(log.getByRole('button', { name: 'Called 3 tools' })).toBeTruthy();+ expect(log.getByText('20 messages')).toBeTruthy();+ fireEvent.click(+ log.getByRole('button', { name: 'Fix the team invite handoff' })+ );+ expect(view.getByRole('textbox', { name: 'Task title' }).textContent).toBe(+ 'Fix the team invite handoff'+ );+});++it('calls tools one by one, then streams an answer that cites its sources', () => {+ const view = render(() => <AgentMemoryDemo />);+ const transcript = view.getByRole('log', { name: 'Northwind follow-up' });+ const log = within(transcript);+ expect(log.getByText('Thinking')).toBeTruthy();+ expect(log.queryByText('Read call transcript')).toBeNull();+ visible();+ vi.advanceTimersByTime(1000);+ expect(log.getByRole('button', { name: 'Calling 1 tool' })).toBeTruthy();+ expect(log.getByText('Northwind', { selector: 'span' })).toBeTruthy();+ vi.advanceTimersByTime(1500);+ expect(log.getByRole('button', { name: 'Calling 3 tools' })).toBeTruthy();+ expect(log.getByText('call transcript')).toBeTruthy();+ vi.advanceTimersByTime(800);+ expect(log.getByRole('button', { name: 'Called 3 tools' })).toBeTruthy();+ expect(log.queryByText(/assign it to her/)).toBeNull();+ vi.advanceTimersByTime(280 * 5);+ expect(log.getByText(/assign it to her/)).toBeTruthy();+ const citations = Array.from(+ transcript.querySelectorAll('[data-agent-mention]'),+ (element) => element.textContent+ );+ expect(citations).toContain('@Valentina');+ expect(citations).toContain('Re: Northwind pilot pricing');+ expect(citations).toContain('Northwind demo Tuesday at 2:00 PM');+});++it('opens the Search call’s hits across email, docs, channels, and calls', () => {+ reduced = true;+ const view = render(() => <AgentSearchDemo />);+ const toggle = view.getByRole('button', { name: '4 hits' });+ expect(toggle.getAttribute('aria-expanded')).toBe('true');+ const kinds = Array.from(+ view.container.querySelectorAll('[data-search-hit]'),+ (hit) => hit.getAttribute('data-search-hit')+ );+ expect(kinds).toEqual(['email', 'document', 'channel', 'call']);+ fireEvent.click(toggle);+ expect(view.container.querySelector('[data-search-hit]')).toBeNull();+});++it('opens a cited email beside the session and closes it again', () => {+ const view = render(() => <AgentSearchDemo />);+ fireEvent.click(+ view.getByRole('button', { name: 'Next steps for our team' })+ );+ const opened = within(view.getByRole('region', { name: 'Opened item' }));+ expect(+ opened.getByRole('heading', { name: 'Next steps for our team' })+ ).toBeTruthy();+ expect(opened.getByText(/Could you share the rollout plan/)).toBeTruthy();+ fireEvent.click(view.getByRole('button', { name: 'Close' }));+ expect(view.queryByRole('region', { name: 'Opened item' })).toBeNull();+ expect(+ view.getByRole('log', { name: 'Meadow before Thursday' })+ ).toBeTruthy();+});++it('switches to GPT-5.6 in the composer and answers from the same memory', () => {+ const view = render(() => <AgentModelsDemo />);+ expect(view.getByRole('button', { name: 'Model' }).textContent).toContain(+ 'Sonnet 5.5'+ );+ visible();+ vi.advanceTimersByTime(1600);+ const menu = view.container.querySelector('.agent-model-menu');+ expect(+ Array.from(menu?.querySelectorAll('[data-model-option]') ?? [], (row) =>+ row.getAttribute('data-model-option')+ )+ ).toEqual([+ 'claude-sonnet-5-5',+ 'claude-opus-5-5',+ 'gpt-5.6',+ 'gemini-3.8-flash',+ ]);+ vi.advanceTimersByTime(1500);+ expect(view.container.querySelector('.agent-model-menu')).toBeNull();+ expect(view.getByRole('button', { name: 'Model' }).textContent).toContain(+ 'GPT-5.6'+ );+ expect(view.getByText('Model set to GPT-5.6')).toBeTruthy();+ vi.advanceTimersByTime(2300);+ const log = view.getByRole('log', { name: 'Northwind follow-up' });+ expect(+ within(log).getAllByText('Who should own the Northwind follow-up?')+ ).toHaveLength(2);+ expect(within(log).getByText(/40-seat pricing herself/)).toBeTruthy();+});++it('shows the finished model switch for reduced motion', () => {+ reduced = true;+ const view = render(() => <AgentModelsDemo />);+ expect(view.getByText('Model set to GPT-5.6')).toBeTruthy();+ expect(view.getByText(/40-seat pricing herself/)).toBeTruthy();+ expect(view.container.querySelector('.agent-model-menu')).toBeNull();+});++it('lists the MCP server’s real setup commands', () => {+ const view = render(() => <AgentMcpDemo />);+ expect(+ view.getByText(+ 'claude mcp add --transport http macro https://mcp-server.macro.com/mcp'+ )+ ).toBeTruthy();+ fireEvent.click(view.getByRole('button', { name: 'ChatGPT' }));+ expect(+ view.getByText(+ 'Settings → Apps → Advanced settings → enable Developer mode, then Create App'+ )+ ).toBeTruthy();+});diff --git a/apps/marketing/src/features/marketing/components/agents/AgentStories.tsx b/apps/marketing/src/features/marketing/components/agents/AgentStories.tsxindex e6762b50f6..0d189d8859 100644--- a/apps/marketing/src/features/marketing/components/agents/AgentStories.tsx+++ b/apps/marketing/src/features/marketing/components/agents/AgentStories.tsx@@ -1,307 +1,797 @@-import FileText from '@phosphor/file-text.svg';-import ListChecks from '@phosphor/list-checks.svg';+import CaretRight from '@phosphor/caret-right.svg';+import Check from '@phosphor/check.svg';+import Clipboard from '@phosphor/clipboard.svg';+import MagnifyingGlass from '@phosphor/magnifying-glass.svg';import Plus from '@phosphor/plus.svg';-import { createSignal, For, type JSX, Show } from 'solid-js';-import type { DemoAgentMessage } from '../../core/deploy-agent-demo';+import X from '@phosphor/x.svg';+import { Button, cn, Surface } from '@ui';+import {+ createEffect,+ createSignal,+ For,+ type JSX,+ on,+ onCleanup,+ Show,+} from 'solid-js';+import type { WorkspaceView } from '../../core/dummy-workspace';import { createDummyWorkspace } from '../../primitives/createDummyWorkspace';import { createProductWalkthrough } from '../../primitives/createProductWalkthrough';-import { AgentMessage } from '../DemoAgentMessage';+import { DemoCursor } from '../DemoCursor';import { ViewShell } from '../DemoWorkspaceChrome';-import { DocumentAgentDemo } from '../documents/DocumentStories';import { InputActionButton } from '../email/frozen/ActionButton';import { ChannelComposer } from '../email/frozen/ChannelComposer';-import { HomepageConversation } from '../HomepageConversation';-import HomepageEmailCompose from '../HomepageEmailCompose';import { ProductDemo } from '../product/ProductPage';import { ProductWorkspace } from '../product/ProductWorkspace';import { ModelCatalogPicker } from '../workspace/frozen/model-picker/ModelCatalogPicker';-import { WorkspaceEmail } from '../workspace/WorkspaceEmail';+import { modelFamilyHint } from '../workspace/frozen/model-picker/modelCatalog';+import { ModelIcon } from '../workspace/frozen/model-picker/ProviderIcon';+import {+ AgentActionLine,+ AgentAnswer,+ type AgentMention,+ AgentPrompt,+ AgentThought,+ AgentToolGroup,+ AgentTurn,+} from './AgentTranscript';+import {+ AGENT_MODELS,+ AGENT_PLACEHOLDER,+ meadow,+ northwind,+} from './agentDemoData';+import { createDemoPointer } from './createDemoPointer';import '../workspace/dummy-workspace.css';+import './agent-stories.css';-function message(text: string, user = false): DemoAgentMessage {- return {- agentSessionId: 'product-agent-example',- turn: 0,- requestId: null,- pending: false,- author: user ? { kind: 'user', userId: 'demo-jacob' } : { kind: 'agent' },- stop: { kind: 'end_turn' },- parts: [{ kind: 'text', text }],- };+/** The production model trigger from agents-view's ModelSelector. */+const MODEL_TRIGGER =+ 'h-[33.75px] min-w-0 max-w-full gap-[5.625px] rounded-full border-0 bg-transparent hover:bg-hover px-[7.5px] text-base font-normal text-ink-muted [&_svg]:size-[15px]';++const modelLabel = (id: string) =>+ AGENT_MODELS.find((model) => model.id === id)?.label ?? id;++/** Keep the newest turn in view, as the session transcript does. */+function followLatest(+ log: () => HTMLElement | undefined,+ track: () => unknown+) {+ createEffect(+ on(track, () => {+ const frame = requestAnimationFrame(() => {+ const element = log();+ if (!element) return;+ const instant = matchMedia('(prefers-reduced-motion: reduce)').matches;+ element.scrollTo?.({+ top: element.scrollHeight,+ behavior: instant ? 'auto' : 'smooth',+ });+ });+ onCleanup(() => cancelAnimationFrame(frame));+ })+ );}-/** Frozen agent conversation, composer, and model picker; no tools or network. */+/** Topbar, transcript, and ChatComposer of a running agent session. */function AgentSession(props: {- question: string;- answer: string;- result?: JSX.Element;- onAnswer?: () => void;- onContext?: () => void;+ title: string;+ model: string;+ onModel: (id: string) => void;+ onSend: (prompt: string) => void;+ log?: (element: HTMLDivElement) => void;+ children: JSX.Element;+}) {+ return (+ <>+ <ViewShell.TopBar>+ <span class="min-w-0 truncate text-sm font-semibold tracking-[-0.03em] text-ink">+ {props.title}+ </span>+ </ViewShell.TopBar>+ <div+ ref={props.log}+ class="dummy-scroll agent-transcript"+ role="log"+ aria-label={props.title}+ >+ {props.children}+ </div>+ <div class="dummy-composer sample-chat-composer agent-session-composer agent-composer">+ <ChannelComposer+ agent+ label="Message the agent"+ placeholder={AGENT_PLACEHOLDER}+ leadingAction={+ <InputActionButton label="Attach files">+ <Plus />+ </InputActionButton>+ }+ accessory={+ <ModelCatalogPicker+ value={props.model}+ options={AGENT_MODELS}+ onSelect={props.onModel}+ ariaLabel="Model"+ placement="top-end"+ triggerClass={MODEL_TRIGGER}+ />+ }+ onSend={props.onSend}+ />+ </div>+ </>+ );+}++/** Prompts a visitor sends get the scripted reply for that conversation. */+function VisitorTurns(props: {+ turns: string[];+ reply: string;+ mentions: Record<string, AgentMention>;}) {+ return (+ <For each={props.turns}>+ {(prompt) => (+ <>+ <AgentTurn>+ <AgentPrompt text={prompt} />+ </AgentTurn>+ <AgentTurn>+ <AgentAnswer text={props.reply} mentions={props.mentions} />+ </AgentTurn>+ </>+ )}+ </For>+ );+}++const northwindMentions: Record<string, AgentMention> = {+ valentina: { kind: 'person', person: 'valentina' },+ pricing: { kind: 'email' },+ demo: { kind: 'call', time: 'Tuesday at 2:00 PM' },+};++/** The earlier exchange that opens the Northwind session. */+function NorthwindEarlier() {+ return (+ <>+ <AgentTurn>+ <AgentPrompt text={northwind.earlier.prompt} />+ </AgentTurn>+ <AgentTurn>+ <AgentToolGroup calls={northwind.earlier.calls} />+ <AgentAnswer+ text={northwind.earlier.answer}+ mentions={northwindMentions}+ />+ </AgentTurn>+ </>+ );+}++const MEMORY_STEPS = 9;++/**+ * Who should own a follow-up: the agent thinks, its calls arrive one by one,+ * and the answer streams in with the person, thread, and call it used.+ * Phases: 0 thinking, 1–3 calls, 4 settled, 5–9 the reply streaming.+ */+export function AgentMemoryDemo() {let root!: HTMLDivElement;- const contextWorkspace = createDummyWorkspace('documents');- contextWorkspace.open('documents', 'plan');- const [contextOpen, setContextOpen] = createSignal(false);- const [stage, setStage] = createSignal(1);- const [model, setModel] = createSignal('auto');- const [followups, setFollowups] = createSignal<- { question: string; answer: string }[]- >([]);- const finish = () => {- props.onAnswer?.();- setStage(2);- };+ let log: HTMLDivElement | undefined;+ const [phase, setPhase] = createSignal(0);+ const [model, setModel] = createSignal(AGENT_MODELS[0].id);+ const [toolsOpen, setToolsOpen] = createSignal(true);+ const [turns, setTurns] = createSignal<string[]>([]);+ const finish = () => setPhase(MEMORY_STEPS);const playback = createProductWalkthrough({root: () => root,- steps: 3,+ steps: MEMORY_STEPS,reset: () => {},reduced: finish,- advance: (step) => {- if (step === 1) setStage(1);- if (step === 2) finish();- },+ delay: (step) =>+ step === 1 ? 1000 : step <= 3 ? 750 : step === 4 ? 800 : 280,+ advance: setPhase,});+ const calls = () =>+ phase() >= 4 ? northwind.calls : northwind.calls.slice(0, phase() + 1);+ const answer = () =>+ northwind.answer.slice(0, Math.max(0, phase() - 3)).join('');+ followLatest(+ () => log,+ () => [phase(), turns().length]+ );return (<ProductDemo- ref={(el) => (root = el)}- label="A specific request in the agent conversation"+ ref={(element) => (root = element)}+ label="Ask an agent who should own a customer follow-up"onInteract={playback.pause}+ height={520}+ mobileHeight={620}>- <Show- when={contextOpen()}- fallback={- <>- <ViewShell.TopBar>- <span class="text-sm font-medium">Launch preparation</span>- <span class="ml-auto text-xs text-ink-extra-muted">- Sample workspace- </span>- </ViewShell.TopBar>- <div class="dummy-scroll product-agent-log">- <Show when={stage() > 0}>- <AgentMessage- message={message(props.question, true)}- inFlight={false}- />- </Show>- <Show when={stage() === 2}>- <AgentMessage- message={message(props.answer)}- inFlight={false}- />- {props.result}- </Show>- <For each={followups()}>- {(item) => (- <div class="mt-8">- <AgentMessage- message={message(item.question, true)}- inFlight={false}- />- <AgentMessage- message={message(item.answer)}- inFlight={false}- />- </div>- )}- </For>- </div>- <div class="dummy-composer sample-chat-composer">- <ChannelComposer- agent- label="Ask sample agent"- placeholder="Ask about the launch…"- leadingAction={- <InputActionButton- label="Open the launch plan"- onClick={() => {- playback.pause();- if (props.onContext) props.onContext();- else setContextOpen(true);- }}- >- <Plus />- </InputActionButton>- }- accessory={- <ModelCatalogPicker- value={model()}- options={[- { id: 'auto', label: 'Auto' },- { id: 'claude-opus-5', label: 'Opus 5' },- { id: 'gpt-5', label: 'GPT-5' },- ]}- onSelect={setModel}- ariaLabel="Choose sample model"- placement="top-end"- />- }- onSend={(question) => {- playback.pause();- finish();- setFollowups((items) => [- ...items,- {- question,- answer:- 'In this local example, Teo owns the invite check, Julia owns the announcement, and Jacob owns the final launch checklist. Open the linked work to make changes.',- },- ]);- }}- />- </div>- </>- }+ <AgentSession+ title={northwind.title}+ model={model()}+ onModel={setModel}+ log={(element) => (log = element)}+ onSend={(prompt) => {+ playback.pause();+ finish();+ setTurns((items) => [...items, prompt]);+ }}>- <button- type="button"- class="px-4 py-2 text-xs text-ink-muted text-left"- onClick={() => setContextOpen(false)}- >- Back to agent conversation- </button>- <ProductWorkspace workspace={contextWorkspace} />- </Show>+ <NorthwindEarlier />+ <AgentTurn>+ <AgentPrompt text={northwind.prompt} />+ </AgentTurn>+ <AgentTurn>+ <Show+ when={phase() > 0}+ fallback={<AgentThought text={northwind.thought} active />}+ >+ <AgentToolGroup+ calls={calls()}+ active={phase() < 4}+ open={toolsOpen()}+ onOpenChange={setToolsOpen}+ />+ </Show>+ <Show when={answer()}>+ <AgentAnswer text={answer()} mentions={northwindMentions} />+ </Show>+ </AgentTurn>+ <VisitorTurns+ turns={turns()}+ reply={northwind.switchedAnswer}+ mentions={northwindMentions}+ />+ </AgentSession></ProductDemo>);}-export function AgentRequestDemo() {- return (- <AgentSession- question="Which launch tasks still need attention, and who owns each one?"- answer="Teo is checking the invite handoff. Julia is reviewing the announcement. Jacob’s launch checklist has not started. Check those three items before publishing on Thursday."- />- );-}+const SEARCH_STEPS = 5;-export function AgentContextDemo() {+/**+ * One search across the workspace: Jacob opens the Search call's hits (an+ * email, a document, a channel message, and a call), then clicks the cited+ * email, which opens beside the session as a mention does in the app.+ * Phases: 1 point at "4 hits", 2 open them, 3 point at the email, 4 click,+ * 5 the email opens in a split.+ */+export function AgentSearchDemo() {+ let root!: HTMLDivElement;+ let frame!: HTMLDivElement;+ let log: HTMLDivElement | undefined;const w = createDummyWorkspace('agents');w.setData('documents',- (d) => d.id === 'plan',+ (doc) => doc.id === 'notes','body',- '## Thursday’s launch\n\n- Teo: verify the invite flow.\n- Julia: review the announcement.\n- Jacob: confirm the final checklist.'+ '## The Meadow\n\nDana’s team wants email, tasks, and documents in one workspace.\n\n## Open questions\n\n- Seats for the whole team\n- Shared email access\n- Importing their existing docs\n\n## Follow-up\n\nShare the rollout plan. Julia will help with setup. Thursday at 9 works for the follow-up.'+ );+ const [phase, setPhase] = createSignal(0);+ const [automatic, setAutomatic] = createSignal(true);+ const [hitsOpen, setHitsOpen] = createSignal(false);+ const [item, setItem] = createSignal<WorkspaceView>();+ const [model, setModel] = createSignal(AGENT_MODELS[0].id);+ const [turns, setTurns] = createSignal<string[]>([]);+ const show = (view: WorkspaceView, id: string) => {+ if (view === 'messages') w.setChannel(id);+ w.open(view, id);+ setItem(view);+ };+ const open = (view: WorkspaceView, id: string) => {+ pause();+ show(view, id);+ };+ const mentions: Record<string, AgentMention> = {+ email: { kind: 'email', onOpen: () => open('email', 'dana') },+ rollout: { kind: 'document', onOpen: () => open('documents', 'rollout') },+ notes: { kind: 'document', onOpen: () => open('documents', 'notes') },+ customers: {+ kind: 'channel',+ onOpen: () => open('messages', 'customers'),+ },+ };+ // The cited email opens beside the session where there's room for a split.+ const openSource = () => {+ if (frame.clientWidth >= 640) show('email', 'dana');+ };+ const finish = () => {+ setHitsOpen(true);+ setPhase(SEARCH_STEPS);+ setAutomatic(false);+ openSource();+ };+ const playback = createProductWalkthrough({+ root: () => root,+ steps: SEARCH_STEPS,+ reset: () => {},+ reduced: finish,+ delay: (step) => [0, 900, 750, 1300, 800, 350][step] ?? 1000,+ advance: (step) => {+ if (step === 2) setHitsOpen(true);+ if (step === SEARCH_STEPS) finish();+ else setPhase(step);+ },+ });+ function pause() {+ setAutomatic(false);+ playback.pause();+ }+ followLatest(+ () => log,+ () => turns().length);- const [opened, setOpened] = createSignal(false);+ const pointer = createDemoPointer({+ frame: () => frame,+ target: () =>+ automatic()+ ? [+ undefined,+ '[data-search-toggle]',+ '[data-search-toggle]',+ '[data-agent-mention="email"]',+ '[data-agent-mention="email"]',+ ][phase()]+ : undefined,+ });return (- <Show- when={opened()}- fallback={- <AgentSession- question="Read the Q3 launch plan. What needs to happen before Thursday?"- answer="The plan calls for three checks: Teo verifies the invite flow, Julia reviews the announcement, and Jacob confirms the final checklist. The announcement is the shared draft; keep changes there."- result={- <button- class="dummy-entity-link mt-6"- type="button"- onClick={() => {- w.open('documents', 'plan');- setOpened(true);- }}- >- <FileText class="size-4 text-document" />- Q3 launch plan- </button>- }- />- }- >- <ProductDemo label="Read the document used by the agent">- <ProductWorkspace workspace={w} />- </ProductDemo>- </Show>+ <div ref={root} class="agent-demo-flow">+ <div ref={frame} class="agent-demo-frame" onFocusIn={pause}>+ <ProductDemo+ label="One search across email, documents, channels, and calls"+ onInteract={pause}+ height={680}+ mobileHeight={760}+ >+ <div class="agent-split" data-item-open={item() ? 'true' : undefined}>+ <div class="agent-split-pane">+ <AgentSession+ title={meadow.title}+ model={model()}+ onModel={setModel}+ log={(element) => (log = element)}+ onSend={(prompt) => {+ pause();+ setTurns((items) => [...items, prompt]);+ }}+ >+ <AgentTurn>+ <AgentPrompt text={meadow.prompt} />+ </AgentTurn>+ <AgentTurn>+ <AgentToolGroup+ calls={meadow.calls}+ defaultOpen+ searchOpen={hitsOpen()}+ onSearchOpenChange={(value) => {+ pause();+ setHitsOpen(value);+ }}+ />+ <AgentAnswer text={meadow.answer} mentions={mentions} />+ </AgentTurn>+ <VisitorTurns+ turns={turns()}+ reply={meadow.followUp}+ mentions={mentions}+ />+ </AgentSession>+ </div>+ <Show when={item()}>+ <section+ class="agent-split-pane agent-split-item"+ aria-label="Opened item"+ >+ <ProductWorkspace workspace={w} />+ <Button+ variant="plain"+ size="icon-sm"+ class="agent-split-close"+ label="Close"+ onClick={() => setItem(undefined)}+ >+ <X class="size-4" />+ </Button>+ </section>+ </Show>+ </div>+ </ProductDemo>+ <Show when={pointer()}>+ {(p) => (+ <DemoCursor+ label="Jacob"+ class="agent-demo-pointer"+ clicking={phase() === 2 || phase() === 4}+ style={{ transform: `translate(${p().x}px, ${p().y}px)` }}+ />+ )}+ </Show>+ </div>+ </div>);}-export { DocumentAgentDemo as AgentArtifactDemo };+const ROW =+ 'group rounded-lg w-full flex items-center gap-1.5 p-1.5 px-2 text-left font-normal cursor-default outline-none data-highlighted:bg-ink/5';-export function AgentEmailReviewDemo() {- const [sent, setSent] = createSignal(false);- const w = createDummyWorkspace('email');+/**+ * The open ModelCatalogPicker as the walkthrough shows it. A still frame of+ * the menu, so the scripted click never moves focus or locks page scroll;+ * the real picker in the composer stays fully interactive.+ */+function ModelMenuFrame(props: {+ value: string;+ highlighted?: string;+ style: JSX.CSSProperties;+}) {return (- <>- <div class="product-demo-request">- <HomepageConversation- messages={[- {- person: 'jacob',- text: '@Claude, draft a follow-up to Dana. Confirm Thursday at 9 and let her know Julia will help with the rollout.',- },- ]}- />- </div>- <ProductDemo label="Review and edit an agent’s email draft before sending">- <ViewShell.TopBar>- <span class="text-sm font-medium">- {sent() ? 'Sent to Dana · sample' : 'Draft: Thursday’s rollout'}- </span>- </ViewShell.TopBar>- <div class="dummy-scroll product-email-review">- <Show- when={!sent()}- fallback={<WorkspaceEmail workspace={w} tab="sent" account="all" />}+ <div class="agent-model-menu" style={props.style} aria-hidden="true">+ <Surface+ depth={2}+ hideBorder+ class="menu-surface rounded-xl size-auto text-sm w-full menu-open-animation"+ >+ <div class="flex flex-col divide-y divide-edge-divider size-full">+ <div class="bg-menu p-1.5">+ <div class="flex items-center gap-2 px-2">+ <MagnifyingGlass class="size-4 shrink-0 text-ink-extra-muted" />+ <span class="min-w-0 w-full py-2 text-sm text-ink-extra-muted">+ Search models+ </span>+ </div>+ </div>+ <div class="flex flex-col p-1.5 bg-menu">+ <div class="px-2 h-7 flex items-center text-xs text-ink-extra-muted">+ Recommended+ </div>+ <For each={AGENT_MODELS}>+ {(option) => (+ <div+ data-model-option={option.id}+ data-highlighted={+ props.highlighted === option.id ? '' : undefined+ }+ class={cn(+ ROW,+ 'h-8 gap-2',+ option.id === props.value && 'bg-ink/5 text-ink font-medium'+ )}+ >+ <ModelIcon model={option.id} />+ <span class="min-w-0 flex-1 truncate text-sm">+ {option.label}+ </span>+ <Show when={modelFamilyHint(option)}>+ {(hint) => (+ <span class="shrink-0 text-xs text-ink-extra-muted">+ {hint()}+ </span>+ )}+ </Show>+ <Show when={option.id === props.value}>+ <Check class="size-3.5 shrink-0 text-accent" />+ </Show>+ </div>+ )}+ </For>+ </div>+ </div>+ </Surface>+ </div>+ );+}++const MODEL_STEPS = 7;+const SWITCH_TO = 'gpt-5.6';++/**+ * The same session after a model switch: Jacob picks GPT-5.6 in the+ * composer and asks again; the answer comes from the same memory and tools.+ * Phases: 1 point at the picker, 2 open it, 3 point at GPT-5.6, 4 select,+ * 5 the prompt, 6 the calls, 7 the answer.+ */+export function AgentModelsDemo() {+ let root!: HTMLDivElement;+ let frame!: HTMLDivElement;+ let log: HTMLDivElement | undefined;+ const [phase, setPhase] = createSignal(0);+ const [automatic, setAutomatic] = createSignal(true);+ const [model, setModel] = createSignal(AGENT_MODELS[0].id);+ const [switched, setSwitched] = createSignal<string>();+ const [menu, setMenu] = createSignal<JSX.CSSProperties>();+ const [turns, setTurns] = createSignal<string[]>([]);+ const select = (id: string) => {+ if (id === model()) return;+ setModel(id);+ setSwitched(id);+ };+ const finish = () => {+ select(SWITCH_TO);+ setPhase(MODEL_STEPS);+ setAutomatic(false);+ };+ const playback = createProductWalkthrough({+ root: () => root,+ steps: MODEL_STEPS,+ reset: () => {},+ reduced: finish,+ delay: (step) => [0, 900, 700, 800, 700, 700, 700, 900][step] ?? 800,+ advance: (step) => {+ if (step === 4) {+ select(SWITCH_TO);+ setAutomatic(false);+ }+ setPhase(step);+ },+ });+ const pause = () => {+ setAutomatic(false);+ playback.pause();+ };+ const pointer = createDemoPointer({+ frame: () => frame,+ target: () =>+ automatic()+ ? [+ undefined,+ '[aria-label="Model"]',+ '[aria-label="Model"]',+ `[data-model-option="${SWITCH_TO}"]`,+ ][phase()]+ : undefined,+ });+ // Anchor the menu frame where Kobalte places the picker: top-end, 4px gutter.+ createEffect(() => {+ if (!automatic() || phase() < 2 || phase() > 3) {+ setMenu(undefined);+ return;+ }+ const trigger = frame.querySelector<HTMLElement>('[aria-label="Model"]');+ const stage = trigger?.closest<HTMLElement>('.dummy-main');+ if (!trigger || !stage) return;+ const anchor = trigger.getBoundingClientRect();+ const bounds = stage.getBoundingClientRect();+ // Kobalte shifts the menu to stay inside the viewport on narrow screens.+ const width = Math.min(288, bounds.width - 16);+ const left = Math.max(+ 8,+ Math.min(anchor.right - bounds.left - width, bounds.width - width - 8)+ );+ setMenu({+ left: `${left}px`,+ width: `${width}px`,+ bottom: `${bounds.bottom - anchor.top + 4}px`,+ });+ });+ followLatest(+ () => log,+ () => [phase(), turns().length]+ );+ return (+ <div ref={root} class="agent-demo-flow">+ <div ref={frame} class="agent-demo-frame" onFocusIn={pause}>+ <ProductDemo+ label="Switch models in the same agent session"+ onInteract={pause}+ height={540}+ mobileHeight={640}+ >+ <AgentSession+ title={northwind.title}+ model={model()}+ onModel={(id) => {+ pause();+ select(id);+ }}+ log={(element) => (log = element)}+ onSend={(prompt) => {+ pause();+ setTurns((items) => [...items, prompt]);+ }}>- <HomepageEmailCompose- appChrome- draft={{- subject: 'Thursday’s rollout',- to: 'Dana Whitfield <[email protected]>',- body: 'Hi Dana,\n\nThursday at 9 works for our follow-up. Julia will join us to help your team get started with the rollout.\n\nSee you then,\nJacob',- }}- onSend={(draft) => {- w.sendEmail(draft.subject, draft.body, draft.to);- w.open('email', w.data.emails[0].id);- setSent(true);- }}+ <NorthwindEarlier />+ <AgentTurn>+ <AgentPrompt text={northwind.prompt} />+ </AgentTurn>+ <AgentTurn>+ <AgentToolGroup calls={northwind.calls} />+ <AgentAnswer+ text={northwind.answer.join('')}+ mentions={northwindMentions}+ />+ </AgentTurn>+ <Show when={switched()}>+ {(id) => (+ <AgentTurn>+ <AgentActionLine label={`Model set to ${modelLabel(id())}`} />+ </AgentTurn>+ )}+ </Show>+ <Show when={phase() >= 5}>+ <AgentTurn>+ <AgentPrompt text={northwind.prompt} />+ </AgentTurn>+ <AgentTurn>+ <Show when={phase() >= 6}>+ <AgentToolGroup+ calls={northwind.switchedCalls}+ active={phase() < 7}+ open={phase() < 7 ? true : undefined}+ />+ </Show>+ <Show when={phase() >= 7}>+ <AgentAnswer+ text={northwind.switchedAnswer}+ mentions={northwindMentions}+ />+ </Show>+ </AgentTurn>+ </Show>+ <VisitorTurns+ turns={turns()}+ reply={northwind.switchedAnswer}+ mentions={northwindMentions}/>+ </AgentSession>+ <Show when={menu()}>+ {(style) => (+ <ModelMenuFrame+ value={model()}+ highlighted={phase() === 3 ? SWITCH_TO : undefined}+ style={style()}+ />+ )}</Show>- </div>- </ProductDemo>- </>+ </ProductDemo>+ <Show when={pointer()}>+ {(p) => (+ <DemoCursor+ label="Jacob"+ class="agent-demo-pointer"+ clicking={phase() === 2}+ style={{ transform: `translate(${p().x}px, ${p().y}px)` }}+ />+ )}+ </Show>+ </div>+ </div>);}-export function AgentTaskResultDemo() {- const w = createDummyWorkspace('agents');- const [taskId, setTaskId] = createSignal('');- const [opened, setOpened] = createSignal(false);- const create = () => {- if (taskId()) return;- const task = w.createTask(- 'Review Thursday’s launch checks',- 'Confirm the invite flow, announcement, and final checklist before publishing.'- );- setTaskId(task);- w.open('agents', 'launch-status');+const MCP_URL = 'https://mcp-server.macro.com/mcp';+const MCP_CONFIG = JSON.stringify(+ { mcpServers: { macro: { type: 'http', url: MCP_URL } } },+ null,+ 2+);+/** mcpConstants: the same cards, labels, and commands as Settings. */+const MCP_CARDS = [+ {+ key: 'claude-cli',+ label: 'Claude Code',+ value: `claude mcp add --transport http macro ${MCP_URL}`,+ },+ {+ key: 'codex-cli',+ label: 'Codex CLI',+ value: `codex mcp add macro --url ${MCP_URL}`,+ },+ {+ key: 'claude-web',+ label: 'Claude.ai',+ hint: 'Settings → Connectors → Add custom connector',+ value: MCP_URL,+ },+ {+ key: 'chatgpt-web',+ label: 'ChatGPT',+ hint: 'Settings → Apps → Advanced settings → enable Developer mode, then Create App',+ value: MCP_URL,+ },+ { key: 'json', label: 'IDE', value: MCP_CONFIG },+];++/** Settings → "Macro MCP server" with McpSetupCards; Claude Code open. */+export function AgentMcpDemo() {+ const [open, setOpen] = createSignal(new Set(['claude-cli']));+ const [copied, setCopied] = createSignal<string>();+ let timer: ReturnType<typeof setTimeout> | undefined;+ onCleanup(() => clearTimeout(timer));+ const copy = (key: string, value: string) => {+ navigator.clipboard?.writeText(value).catch(() => {});+ setCopied(key);+ clearTimeout(timer);+ timer = setTimeout(() => setCopied(undefined), 2000);};return (- <Show- when={opened()}- fallback={- <AgentSession- question="Create a task to review Thursday’s launch checks. Include the invite flow, announcement, and final checklist."- answer="I created Review Thursday’s launch checks. Open it to assign an owner, set the priority, and add your final checks."- onAnswer={create}- result={- <button- class="dummy-entity-link mt-6"- type="button"- onClick={() => {- w.open('tasks', taskId());- setOpened(true);- }}- >- <ListChecks class="size-4 text-task" />- Review Thursday’s launch checks- </button>- }- />- }+ <ProductDemo+ label="Connect an MCP client to Macro"+ height={420}+ mobileHeight={500}>- <ProductDemo label="Continue with the task in its ordinary task view">- <ProductWorkspace workspace={w} />- </ProductDemo>- </Show>+ <div class="dummy-scroll">+ <div class="agent-mcp-page">+ <header class="agent-mcp-header">+ <span class="text-2xl/tight font-semibold text-ink">+ Macro MCP server+ </span>+ <p class="text-sm text-ink-muted">+ Connect other agents and tools to your Macro workspace.+ </p>+ </header>+ <div class="agent-mcp-cards">+ <For each={MCP_CARDS}>+ {(card) => {+ const expanded = () => open().has(card.key);+ return (+ <div class="overflow-hidden rounded-md border border-edge-muted bg-surface/70">+ <button+ type="button"+ class="flex items-center gap-2 w-full px-4 py-2 text-left"+ aria-expanded={expanded()}+ onClick={() =>+ setOpen((keys) => {+ const next = new Set(keys);+ if (next.has(card.key)) next.delete(card.key);+ else next.add(card.key);+ return next;+ })+ }+ >+ <CaretRight+ aria-hidden="true"+ class={`size-3 shrink-0 text-ink-muted transition-transform ${expanded() ? 'rotate-90' : ''}`}+ />+ <span class="text-sm text-ink-muted truncate">+ {card.label}+ </span>+ </button>+ <Show when={expanded()}>+ <div class="border-t border-edge-muted flex flex-col">+ <Show when={card.hint}>+ <div class="px-4 pt-3 text-xs text-ink-extra-muted">+ {card.hint}+ </div>+ </Show>+ <div class="flex items-start justify-between gap-3 px-4 py-3">+ <pre class="flex-1 min-w-0 overflow-x-auto text-[12px]/5 text-ink select-text cursor-text whitespace-pre-wrap break-all">+ <code>{card.value}</code>+ </pre>+ <Button+ variant={+ copied() === card.key ? 'outline' : 'plain'+ }+ size="sm"+ class="shrink-0"+ onClick={() => copy(card.key, card.value)}+ >+ <Show+ when={copied() === card.key}+ fallback={+ <>+ <Clipboard class="size-3.5" />+ Copy+ </>+ }+ >+ <Check class="size-3.5" />+ Copied+ </Show>+ </Button>+ </div>+ </div>+ </Show>+ </div>+ );+ }}+ </For>+ </div>+ </div>+ </div>+ </ProductDemo>);}diff --git a/apps/marketing/src/features/marketing/components/agents/AgentTranscript.tsx b/apps/marketing/src/features/marketing/components/agents/AgentTranscript.tsxnew file mode 100644index 0000000000..9647522983--- /dev/null+++ b/apps/marketing/src/features/marketing/components/agents/AgentTranscript.tsx@@ -0,0 +1,547 @@+import CaretRight from '@phosphor/caret-right.svg';+import Envelope from '@phosphor/envelope.svg';+import EnvelopeOpen from '@phosphor/envelope-open.svg';+import Eye from '@phosphor/eye.svg';+import File from '@phosphor/file.svg';+import HashStraight from '@phosphor/hash-straight.svg';+import ListChecks from '@phosphor/list-checks.svg';+import MagnifyingGlass from '@phosphor/magnifying-glass.svg';+import Newspaper from '@phosphor/newspaper.svg';+import PhoneCall from '@phosphor/phone-call.svg';+import { Button, UserMessageBubble } from '@ui';+import {+ type Component,+ createSignal,+ For,+ type JSX,+ Match,+ Show,+ Switch,+} from 'solid-js';+import { Dynamic } from 'solid-js/web';+import type { TaskPriority, TaskStatus } from '../../core/dummy-workspace';+import {+ type HomepagePersonId,+ homepagePeople,+} from '../../core/homepage-demo-people';+import { PropertyValueIcon } from '../workspace/frozen/PropertyValueIcon';+import {+ PersonIcon,+ PRIORITY_IDS,+ STATUS_IDS,+} from '../workspace/frozen/TaskProperties';+import '../demo-markdown.css';+import '../demo-mentions.css';+import './agent-transcript.css';++/**+ * Frozen presentation of a Macro agent session (block-agent's Message,+ * ToolGroup, Thought, and the chat block's grouped tool renderers). Website+ * fixtures only: no sessions, tools, providers, or network.+ */++type Icon = Component<JSX.SvgSVGAttributes<SVGSVGElement>>;++export type SearchHit = {+ kind: 'email' | 'document' | 'channel' | 'call' | 'task';+ title: string;+ sender?: string;+ snippet: string;+ time: string;+};++export type AgentToolCall =+ | { kind: 'thought'; text: string }+ | { kind: 'search'; query: string; hits: SearchHit[] }+ | { kind: 'read-channel'; channel: string; count: number }+ | { kind: 'read-call' }+ | { kind: 'read-document'; title: string }+ | { kind: 'read-thread' };++export type AgentMention = {+ kind: 'person' | 'task' | 'email' | 'document' | 'channel' | 'call';+ person?: HomepagePersonId;+ /** A call mention shows its start time beside the name. */+ time?: string;+ task?: {+ status: TaskStatus;+ priority: TaskPriority;+ owner: HomepagePersonId;+ };+ onOpen?: () => void;+};++const HIT_ICONS: Record<SearchHit['kind'], Icon> = {+ email: Envelope,+ document: File,+ channel: HashStraight,+ call: PhoneCall,+ task: ListChecks,+};++const MENTION_ICONS: Record<+ Exclude<AgentMention['kind'], 'person' | 'task'>,+ Icon+> = {+ email: Envelope,+ document: File,+ channel: HashStraight,+ call: PhoneCall,+};++/** The "Thinking"/"Calling" sweep; plain text once the work settles. */+function Shimmer(props: { text: string; active?: boolean }) {+ return (+ <span classList={{ 'magic-chip-shimmer': !!props.active }}>+ {props.text}+ </span>+ );+}++/** A prompt in the chat block's user bubble. */+export function AgentPrompt(props: { text: string }) {+ return (+ <div class="flex w-full flex-col items-end gap-0.5">+ <UserMessageBubble>+ <div class="chat-markdown-container whitespace-pre-wrap wrap-break-word max-w-full text-base">+ {props.text}+ </div>+ </UserMessageBubble>+ </div>+ );+}++/** block-agent's Thought: a bare caret row that opens to the reasoning. */+export function AgentThought(props: { text: string; active?: boolean }) {+ const [expanded, setExpanded] = createSignal(false);+ return (+ <div class="relative text-xs leading-5 text-ink-extra-muted">+ <button+ type="button"+ aria-expanded={expanded()}+ class="flex min-h-7 items-center gap-1 py-1 text-left text-ink-extra-muted hover:text-ink-muted"+ onClick={() => setExpanded(!expanded())}+ >+ <CaretRight+ class={`size-4 shrink-0 ${expanded() ? 'rotate-90' : ''}`}+ />+ <Shimmer+ text={props.active ? 'Thinking' : 'Thought'}+ active={props.active}+ />+ </button>+ <Show when={expanded()}>+ <div class="pl-5 text-ink-muted whitespace-pre-wrap wrap-break-word select-text">+ {props.text}+ </div>+ </Show>+ </div>+ );+}++/** Tool.Row in its grouped form: no surface, one 32px line. */+function ToolRow(props: {+ icon: Icon;+ align?: 'start';+ children: JSX.Element;+ response?: JSX.Element;+}) {+ return (+ <div+ class="relative overflow-hidden text-xs leading-5 text-ink-extra-muted"+ data-tool-row+ >+ <div+ class={`flex w-full gap-2 min-h-8 py-1 text-sm leading-6 ${props.align === 'start' ? 'items-start' : 'items-center'}`}+ >+ <Dynamic+ component={props.icon}+ class={`size-4 shrink-0 text-ink-extra-muted ${props.align === 'start' ? 'mt-0.5' : ''}`}+ />+ <div class="min-w-0 flex-1 overflow-hidden">{props.children}</div>+ </div>+ <Show when={props.response}>+ <div class="px-3 pb-2">{props.response}</div>+ </Show>+ </div>+ );+}++/** Search.tsx: scope in the row, "N hits" toggles the matched items. */+function SearchRow(props: {+ call: Extract<AgentToolCall, { kind: 'search' }>;+ open?: boolean;+ onOpenChange?: (open: boolean) => void;+}) {+ const [inner, setInner] = createSignal(false);+ const open = () => props.open ?? inner();+ const toggle = () => {+ setInner(!open());+ props.onOpenChange?.(!open());+ };+ const count = () => props.call.hits.length;+ return (+ <ToolRow+ icon={MagnifyingGlass}+ response={+ <Show when={open()}>+ <div class="max-h-120 overflow-y-auto">+ <div class="-mx-3 -my-2">+ <For each={props.call.hits}>+ {(hit) => (+ <button+ type="button"+ class="block w-full text-left hover:bg-hover"+ data-search-hit={hit.kind}+ >+ <div class="flex min-h-8 items-center gap-2 px-3 py-1.5 text-xs leading-4">+ <div+ class="flex size-4 shrink-0 items-center justify-center"+ classList={{+ 'text-note': hit.kind === 'document',+ 'text-task': hit.kind === 'task',+ 'text-default':+ hit.kind !== 'document' && hit.kind !== 'task',+ }}+ >+ <Dynamic+ component={HIT_ICONS[hit.kind]}+ class="size-4"+ />+ </div>+ <div class="min-w-0 flex-1">+ <div class="flex min-w-0 items-center gap-2">+ <div class="min-w-0 flex flex-1 items-center gap-1.5 overflow-hidden">+ <span class="min-w-0 max-w-40 shrink-0 truncate text-ink">+ {hit.title}+ </span>+ <span class="text-ink-placeholder">·</span>+ <Show when={hit.sender}>+ <span class="shrink-0 text-ink-placeholder">+ {hit.sender}+ </span>+ </Show>+ <span class="min-w-0 flex-1 truncate text-ink-placeholder">+ {hit.snippet}+ </span>+ </div>+ <span class="shrink-0 text-ink-placeholder">+ {hit.time}+ </span>+ </div>+ </div>+ </div>+ </button>+ )}+ </For>+ </div>+ </div>+ </Show>+ }+ >+ <div class="flex min-w-0 flex-1 items-center justify-between gap-3 overflow-hidden">+ <div class="flex min-w-0 flex-1 items-center gap-2 overflow-hidden">+ <span class="min-w-0 truncate">+ Search <span class="text-ink"> {props.call.query} </span>+ </span>+ </div>+ <Button+ type="button"+ variant="plain"+ size="sm"+ noTouchResize+ aria-expanded={open()}+ class="shrink-0 whitespace-nowrap px-1 text-ink-extra-muted hover:text-ink-muted"+ data-search-toggle+ onClick={toggle}+ >+ <span>{count() === 1 ? '1 hit' : `${count()} hits`}</span>+ <CaretRight aria-hidden="true" class={open() ? 'rotate-90' : ''} />+ </Button>+ </div>+ </ToolRow>+ );+}++function ToolCallRow(props: {+ call: AgentToolCall;+ searchOpen?: boolean;+ onSearchOpenChange?: (open: boolean) => void;+}) {+ return (+ <Switch>+ <Match when={props.call.kind === 'thought' && props.call}>+ {(call) => <AgentThought text={call().text} />}+ </Match>+ <Match when={props.call.kind === 'search' && props.call}>+ {(call) => (+ <SearchRow+ call={call()}+ open={props.searchOpen}+ onOpenChange={props.onSearchOpenChange}+ />+ )}+ </Match>+ <Match when={props.call.kind === 'read-channel' && props.call}>+ {(call) => (+ <ToolRow icon={Eye} align="start">+ <div class="flex min-w-0 flex-1 flex-col gap-1">+ <div class="flex min-w-0 items-center justify-between gap-3 overflow-hidden">+ <span class="min-w-0 truncate">+ Read messages in{' '}+ <span class="text-ink">{call().channel}</span>+ </span>+ <span class="shrink-0 whitespace-nowrap text-xs text-ink-extra-muted">+ {call().count} messages+ </span>+ </div>+ <div class="truncate text-xs text-ink-placeholder">latest</div>+ </div>+ </ToolRow>+ )}+ </Match>+ <Match when={props.call.kind === 'read-call'}>+ <ToolRow icon={Newspaper}>+ Read <span class="text-ink">call transcript</span>+ </ToolRow>+ </Match>+ <Match when={props.call.kind === 'read-document' && props.call}>+ {(call) => (+ <ToolRow icon={Newspaper}>+ <div class="min-w-0 flex-1 truncate">+ Read <span class="text-ink">document</span>{' '}+ <span class="text-ink-placeholder">·</span>{' '}+ <span class="inline-flex items-center gap-1 align-middle text-ink">+ <File class="size-4 text-note" />+ {call().title}+ </span>+ </div>+ </ToolRow>+ )}+ </Match>+ <Match when={props.call.kind === 'read-thread'}>+ <ToolRow icon={EnvelopeOpen}>Read thread</ToolRow>+ </Match>+ </Switch>+ );+}++/**+ * block-agent's ToolGroup: "Calling N tools" shimmers while a call is in+ * flight, "Called N tools" once the run settles, and opens to the calls.+ */+export function AgentToolGroup(props: {+ calls: AgentToolCall[];+ active?: boolean;+ open?: boolean;+ defaultOpen?: boolean;+ onOpenChange?: (open: boolean) => void;+ searchOpen?: boolean;+ onSearchOpenChange?: (open: boolean) => void;+}) {+ const [inner, setInner] = createSignal(props.defaultOpen ?? false);+ const open = () => props.open ?? inner();+ const count = () =>+ props.calls.filter((call) => call.kind !== 'thought').length;+ const title = () =>+ `${props.active ? 'Calling' : 'Called'} ${count()} ${count() === 1 ? 'tool' : 'tools'}`;+ return (+ <div class="min-w-0 text-sm leading-6 text-ink-extra-muted">+ <button+ type="button"+ aria-expanded={open()}+ class="group flex min-h-8 items-center gap-2 py-1 text-left text-ink-extra-muted hover:text-ink-muted"+ data-tool-group+ onClick={() => {+ setInner(!open());+ props.onOpenChange?.(!open());+ }}+ >+ <Shimmer text={title()} active={props.active} />+ <CaretRight+ aria-hidden="true"+ class={`size-4 shrink-0 opacity-0 transition-transform group-hover:opacity-100 group-focus-visible:opacity-100 motion-reduce:transition-none ${open() ? 'rotate-90' : ''}`}+ />+ </button>+ <Show when={open()}>+ <div role="region" aria-label="Tool calls">+ <div class="flex min-w-0 flex-col pl-6">+ <For each={props.calls}>+ {(call) => (+ <div class="min-h-8 shrink-0 agent-tool-enter">+ <ToolCallRow+ call={call}+ searchOpen={props.searchOpen}+ onSearchOpenChange={props.onSearchOpenChange}+ />+ </div>+ )}+ </For>+ </div>+ </div>+ </Show>+ </div>+ );+}++/** ActionLine: a model switch reads as punctuation between turns. */+export function AgentActionLine(props: { label: string }) {+ return (+ <div class="flex w-full items-center gap-4 px-4 py-1 text-xs text-ink-extra-muted">+ <span aria-hidden="true" class="h-px flex-1 bg-edge-muted" />+ <span class="flex min-w-0 items-center gap-1.5">+ <span class="min-w-0 truncate">{props.label}</span>+ </span>+ <span aria-hidden="true" class="h-px flex-1 bg-edge-muted" />+ </div>+ );+}++/** DocumentMention's MentionContainer (icon + underlined name) and UserMention. */+function MentionChip(props: { label: string; mention?: AgentMention }) {+ const mention = () => props.mention;+ const content = () => {+ const value = mention();+ if (!value) return props.label;+ if (value.kind === 'person' && value.person)+ return `@${homepagePeople[value.person].shortName}`;+ return (+ <>+ <span+ aria-hidden="true"+ class={`demo-mention-icon mention-${value.kind}`}+ >+ <Dynamic+ component={+ value.kind === 'task'+ ? ListChecks+ : MENTION_ICONS[value.kind as keyof typeof MENTION_ICONS]+ }+ />+ </span>+ <span class="demo-mention-name">+ {props.label}+ <Show when={value.time}>+ <span class="agent-mention-time"> {value.time}</span>+ </Show>+ <Show when={value.task}>+ {(task) => (+ <span class="agent-mention-task" aria-hidden="true">+ <PropertyValueIcon+ optionId={STATUS_IDS[task().status]}+ class="size-3"+ />+ <PropertyValueIcon+ optionId={PRIORITY_IDS[task().priority]}+ class="size-3"+ />+ <span class="agent-mention-avatar">+ <PersonIcon person={task().owner} />+ </span>+ </span>+ )}+ </Show>+ </span>+ </>+ );+ };+ return (+ <Show+ when={mention()?.onOpen}+ fallback={+ <span+ class={`demo-inline-mention agent-mention mention-${mention()?.kind ?? 'document'}`}+ data-agent-mention={mention()?.kind}+ >+ {content()}+ </span>+ }+ >+ {(open) => (+ <button+ type="button"+ class={`demo-inline-mention agent-mention mention-${mention()?.kind}`}+ data-agent-mention={mention()?.kind}+ onClick={() => open()()}+ >+ {content()}+ </button>+ )}+ </Show>+ );+}++const TOKEN = /(\*\*[^*]+\*\*|@\[[^\]]*\]\(agent:[\w-]+\))/g;++function Inline(props: {+ text: string;+ mentions: Record<string, AgentMention>;+}) {+ return (+ <For each={props.text.split(TOKEN)}>+ {(part) => {+ const mention = /^@\[([^\]]*)\]\(agent:([\w-]+)\)$/.exec(part);+ if (mention)+ return (+ <MentionChip+ label={mention[1]}+ mention={props.mentions[mention[2]]}+ />+ );+ if (part.startsWith('**') && part.endsWith('**') && part.length > 4)+ return <strong class="font-bold">{part.slice(2, -2)}</strong>;+ return part;+ }}+ </For>+ );+}++/**+ * The agent's reply as StaticMarkdown renders it in a session: paragraphs,+ * bullet lists, bold, and inline mentions that open their item.+ */+export function AgentAnswer(props: {+ text: string;+ mentions: Record<string, AgentMention>;+}) {+ return (+ <div class="agent-answer chat-markdown-container whitespace-pre-wrap wrap-break-word max-w-full text-base">+ <div class="website-demo-markdown md max-w-full min-w-0 channel-markdown">+ <For each={props.text.split(/\n\s*\n/).filter(Boolean)}>+ {(block) => (+ <Show+ when={block.startsWith('- ')}+ fallback={+ <p class="my-4 first:mt-1.5 last:mb-1.5 md-p text-[1em] whitespace-pre-wrap">+ <Inline text={block} mentions={props.mentions} />+ </p>+ }+ >+ <ul class="my-4 first:mt-1.5 last:mb-1.5 list-none md-list md-bullet">+ <For each={block.split('\n')}>+ {(line) => (+ <li class="my-[0.25em]">+ <Inline+ text={line.replace(/^- /, '')}+ mentions={props.mentions}+ />+ </li>+ )}+ </For>+ </ul>+ </Show>+ )}+ </For>+ </div>+ </div>+ );+}++/** Transcript.tsx spacing: each message is one centered, padded column. */+export function AgentTurn(props: { children: JSX.Element }) {+ return (+ <div class="agent-turn">+ <div class="flex flex-col gap-1 min-w-0">{props.children}</div>+ </div>+ );+}diff --git a/apps/marketing/src/features/marketing/components/agents/LaunchConversation.tsx b/apps/marketing/src/features/marketing/components/agents/LaunchConversation.tsxnew file mode 100644index 0000000000..2f03d3bdc5--- /dev/null+++ b/apps/marketing/src/features/marketing/components/agents/LaunchConversation.tsx@@ -0,0 +1,98 @@+import type { DummyWorkspace } from '../../primitives/createDummyWorkspace';+import {+ AgentAnswer,+ type AgentMention,+ AgentPrompt,+ type AgentToolCall,+ AgentToolGroup,+ AgentTurn,+} from './AgentTranscript';++const LAUNCH_CALLS: AgentToolCall[] = [+ {+ kind: 'search',+ query: 'Thursday launch',+ hits: [+ {+ kind: 'task',+ title: 'Fix the team invite handoff',+ snippet: 'Keep the invited team selected through sign-up.',+ time: '9:16 AM',+ },+ {+ kind: 'task',+ title: 'Write the launch announcement',+ snippet: 'Prepare the announcement for Thursday’s launch.',+ time: '9:32 AM',+ },+ {+ kind: 'document',+ title: 'Q3 launch plan',+ snippet: 'Send the customer email. Publish the changelog.',+ time: 'Sep 28',+ },+ {+ kind: 'email',+ title: 'Ready for Thursday',+ sender: 'Teo Nys',+ snippet: 'The invite flow is ready. Let’s run through the checklist.',+ time: '9:18 AM',+ },+ {+ kind: 'channel',+ title: 'launch',+ sender: 'Julia Westphal',+ snippet: 'Last pass before Thursday.',+ time: '9:20 AM',+ },+ ],+ },+ { kind: 'read-document', title: 'Q3 launch plan' },+ { kind: 'read-channel', channel: 'launch', count: 20 },+];++const LAUNCH_ANSWER =+ 'Five launch tasks are still open:\n\n- @[Fix the team invite handoff](agent:invite) is urgent, and Teo is on it.\n- @[Write the launch announcement](agent:announcement) is in review. Julia’s first draft is ready.\n- @[Fix the deploy pipeline](agent:deploy) has a pull request up for Teo to review.\n- @[Prepare the launch checklist](agent:checklist) hasn’t started. It’s yours.\n- @[Send Dana the rollout plan](agent:follow-up) is yours too.\n\nThe @[Q3 launch plan](agent:plan) also still lists the customer email and the changelog.';++export const LAUNCH_PROMPT = 'What’s left before Thursday’s launch?';++/**+ * The hero's open Macro session. Task citations read live sample-workspace+ * state and open the task, just as a mention opens its item in the app.+ */+export function LaunchConversation(props: { workspace: DummyWorkspace }) {+ const w = props.workspace;+ const task = (id: string): AgentMention => ({+ kind: 'task',+ get task() {+ const item = w.data.tasks.find((entry) => entry.id === id);+ return (+ item && {+ status: item.status,+ priority: item.priority,+ owner: item.owner,+ }+ );+ },+ onOpen: () => w.openItem('tasks', id),+ });+ const mentions: Record<string, AgentMention> = {+ invite: task('invite'),+ announcement: task('announcement'),+ deploy: task('deploy'),+ checklist: task('checklist'),+ 'follow-up': task('follow-up'),+ plan: { kind: 'document', onOpen: () => w.openItem('documents', 'plan') },+ };+ return (+ <>+ <AgentTurn>+ <AgentPrompt text={LAUNCH_PROMPT} />+ </AgentTurn>+ <AgentTurn>+ <AgentToolGroup calls={LAUNCH_CALLS} defaultOpen />+ <AgentAnswer text={LAUNCH_ANSWER} mentions={mentions} />+ </AgentTurn>+ </>+ );+}diff --git a/apps/marketing/src/features/marketing/components/agents/agent-stories.css b/apps/marketing/src/features/marketing/components/agents/agent-stories.cssnew file mode 100644index 0000000000..43bb166dc9--- /dev/null+++ b/apps/marketing/src/features/marketing/components/agents/agent-stories.css@@ -0,0 +1,33 @@+/* Agents page demos. Window chrome comes from ProductDemo. */+.agent-demo-frame { position: relative; }+.agent-demo-pointer { position: absolute; top: 0; left: 0; z-index: 9; pointer-events: none; transition: transform 650ms cubic-bezier(.2, .8, .2, 1); }+.agent-session-composer { width: 100%; max-width: 952px; margin-inline: auto; padding: 4px 16px 12px; }++/* A mention opened from the answer lands in a split beside the session. */+.agent-split { display: flex; flex: 1; min-height: 0; min-width: 0; position: relative; }+.agent-split-pane { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; min-height: 0; position: relative; }+.agent-split-item { flex-grow: 1.2; border-left: 1px solid var(--color-edge-muted); background: var(--color-panel); animation: agent-split-in 220ms ease-out both; }+.agent-split-item [data-view-shell-top-bar] { padding-right: 44px; }+.agent-split-close { position: absolute; top: 12px; right: 10px; z-index: 6; }+@keyframes agent-split-in { from { opacity: 0; transform: translateX(12px); } }++/* ModelMenuFrame sits where Kobalte anchors the picker's content. */+.agent-model-menu { position: absolute; z-index: 20; pointer-events: none; text-align: left; }++/* SettingsPage: max-w-[710px] px-10 pt-14, header inset px-6, cards mt-9. */+.agent-mcp-page { width: 100%; max-width: 710px; margin-inline: auto; padding: 44px 40px 24px; text-align: left; }+.agent-mcp-header { display: flex; flex-direction: column; gap: 6px; padding-inline: 24px; }+.agent-mcp-cards { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }++@media (max-width: 699px) {+ .agent-session-composer { padding: 4px 8px 8px; }+ .agent-split-item { position: absolute; inset: 0; z-index: 5; border-left: 0; }+ .agent-mcp-page { padding: 24px 16px; }+ .agent-mcp-header { padding-inline: 16px; }+ .agent-mcp-cards { margin-top: 24px; }+}++@media (prefers-reduced-motion: reduce) {+ .agent-split-item { animation: none; }+ .agent-demo-pointer { display: none; }+}diff --git a/apps/marketing/src/features/marketing/components/agents/agent-transcript.css b/apps/marketing/src/features/marketing/components/agents/agent-transcript.cssnew file mode 100644index 0000000000..c1c87a9c62--- /dev/null+++ b/apps/marketing/src/features/marketing/components/agents/agent-transcript.css@@ -0,0 +1,46 @@+/* block-agent Transcript: macro-message-width columns with px-4 pb-4. */+.agent-transcript { display: flex; flex-direction: column; padding-top: 16px; }+.agent-turn { width: 100%; max-width: 920px; margin-inline: auto; padding: 0 16px 16px; min-width: 0; }+.agent-tool-enter { animation: agent-tool-enter 260ms ease-out both; }+@keyframes agent-tool-enter { from { opacity: 0; transform: translateY(3px); } }++/* StaticMarkdown's VERTICAL_GAP (my-4 first:mt-1.5 last:mb-1.5) plus channel-markdown's 2px+ paragraph edges; feature pages reset p margins, so restate them here. */+.workspace-demo .agent-answer .md > .md-p,+.workspace-demo .agent-answer .md > .md-list { margin-block: 16px; }+.workspace-demo .agent-answer .md > .md-list:first-child { margin-top: 6px; }+.workspace-demo .agent-answer .md > .md-list:last-child { margin-bottom: 6px; }+.workspace-demo .agent-answer .md > .md-p:first-child { margin-top: 2px; }+.workspace-demo .agent-answer .md > .md-p:last-child { margin-bottom: 2px; }++/* Agent citations: DocumentMention / UserMention as buttons that open the item. */+.workspace-demo button.agent-mention { display: inline; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: inherit; cursor: pointer; }+.workspace-demo button.agent-mention.mention-person { padding: 2px; }+.workspace-demo button.agent-mention:hover .demo-mention-name { text-decoration-color: color-mix(in srgb, currentColor 60%, transparent); }+.workspace-demo .agent-mention .demo-mention-icon.mention-email,+.workspace-demo .agent-mention .demo-mention-icon.mention-call,+.workspace-demo .agent-mention .demo-mention-icon.mention-channel { color: var(--color-default); }+.workspace-demo .agent-mention-time { font-size: .8em; color: color-mix(in srgb, currentColor 50%, transparent); }+.workspace-demo .agent-mention-task { display: inline-flex; align-items: center; gap: 4px; margin-inline: 4px; vertical-align: middle; position: relative; top: -0.05em; }+.workspace-demo .agent-mention-avatar { display: inline-flex; width: 13px; height: 13px; margin-left: 2px; }+.workspace-demo .agent-mention-avatar > * { width: 100%; height: 100%; }++/* ChatComposer measures whether text and controls share a row; in a narrow+ pane the editor takes its own row above them, with the placeholder truncated. */+.agent-composer { container-type: inline-size; }+.agent-composer .mail-channel-input:placeholder-shown,+.agent-composer .mail-channel-input::placeholder,+.workspace-demo .agent-composer .demo-mention-editor:empty::before { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+@container (max-width: 560px) {+ .agent-composer [data-input-layout][data-agent-composer][data-composer-compact] {+ grid-template-areas: 'body body body' 'left . right';+ align-items: center;+ row-gap: 3.75px;+ padding: 7.5px;+ --input-editor-padding: 4.6875px 9.375px;+ }+}++@media (prefers-reduced-motion: reduce) {+ .agent-tool-enter { animation: none; }+}diff --git a/apps/marketing/src/features/marketing/components/agents/agentDemoData.ts b/apps/marketing/src/features/marketing/components/agents/agentDemoData.tsnew file mode 100644index 0000000000..934c75edc3--- /dev/null+++ b/apps/marketing/src/features/marketing/components/agents/agentDemoData.ts@@ -0,0 +1,150 @@+import type { AgentToolCall, SearchHit } from './AgentTranscript';++const calls = (items: AgentToolCall[]) => items;++/** Fictional fixtures for the Agents page. Model names match the app's picker. */+export const AGENT_MODELS = [+ { id: 'claude-sonnet-5-5', label: 'Sonnet 5.5' },+ { id: 'claude-opus-5-5', label: 'Opus 5.5' },+ { id: 'gpt-5.6', label: 'GPT-5.6' },+ { id: 'gemini-3.8-flash', label: 'Gemini 3.8 Flash' },+];++export const AGENT_PLACEHOLDER = 'Message the agent, @mention anything';++const northwindHits: SearchHit[] = [+ {+ kind: 'email',+ title: 'Re: Northwind pilot pricing',+ sender: 'Valentina',+ snippet: 'I’ll send pricing for 40 seats myself by Friday.',+ time: 'Tue',+ },+ {+ kind: 'call',+ title: 'Northwind demo',+ sender: 'Marcus Lee',+ snippet: 'Before this goes to the ops team we need SSO.',+ time: 'Tue',+ },+ {+ kind: 'channel',+ title: 'sales',+ sender: 'Valentina',+ snippet: 'Demo went well. Marcus wants SSO before the ops rollout.',+ time: 'Tue',+ },+ {+ kind: 'document',+ title: 'Northwind pilot plan',+ snippet: 'Two-week pilot with the ops team, 40 seats.',+ time: 'Mon',+ },+ {+ kind: 'email',+ title: 'Northwind pilot kickoff',+ sender: 'Marcus Lee',+ snippet: 'Looking forward to getting the team set up.',+ time: 'Sep 22',+ },+ {+ kind: 'channel',+ title: 'sales',+ sender: 'Jacob Beckerman',+ snippet: 'who’s following up with Northwind?',+ time: 'Wed',+ },+];++const NORTHWIND_THOUGHT =+ 'Marcus is waiting on pricing and SSO. I’ll check who promised what, and who was on the demo call.';++/** One Northwind conversation, shared by the memory and model demos. */+export const northwind = {+ title: 'Northwind follow-up',+ earlier: {+ prompt: 'Where are we with Northwind?',+ calls: calls([+ {+ kind: 'search',+ query: 'Northwind pilot',+ hits: northwindHits.slice(0, 4),+ },+ { kind: 'read-thread' },+ ]),+ answer:+ 'They’re two weeks into a pilot with their ops team. Marcus is waiting on two things from us: pricing for 40 seats and an answer on SSO.',+ },+ prompt: 'Who should own the Northwind follow-up?',+ thought: NORTHWIND_THOUGHT,+ calls: calls([+ { kind: 'thought', text: NORTHWIND_THOUGHT },+ { kind: 'search', query: 'Northwind', hits: northwindHits },+ { kind: 'read-channel', channel: 'sales', count: 14 },+ { kind: 'read-call' },+ ]),+ /** Streamed in order; chunk edges never split a mention or emphasis. */+ answer: [+ '@[Valentina](agent:valentina). ',+ 'She ran the demo and told Marcus she’d send the pricing herself in ',+ '@[Re: Northwind pilot pricing](agent:pricing). ',+ 'She also took his SSO question during @[Northwind demo](agent:demo), ',+ 'so she has the context on both.',+ '\n\nWant me to create the task and assign it to her?',+ ],+ /** The same question, answered again after switching models. */+ switchedCalls: calls([+ { kind: 'search', query: 'Northwind', hits: northwindHits },+ { kind: 'read-call' },+ ]),+ switchedAnswer:+ '@[Valentina](agent:valentina). She told Marcus she’d send the 40-seat pricing herself in @[Re: Northwind pilot pricing](agent:pricing), and she answered his SSO question during @[Northwind demo](agent:demo).',+};++/** The Meadow rollout, cited from items that exist in the sample workspace. */+export const meadow = {+ title: 'Meadow before Thursday',+ prompt: 'What does Meadow still need from us before Thursday?',+ calls: calls([+ {+ kind: 'search',+ query: 'Meadow',+ hits: [+ {+ kind: 'email',+ title: 'Next steps for our team',+ sender: 'Dana Whitfield',+ snippet: 'Thursday at 9 works. Could you share the rollout plan?',+ time: '9:41 AM',+ },+ {+ kind: 'document',+ title: 'Demo call notes',+ snippet: 'Dana’s team wants email, tasks, and documents together.',+ time: 'Sep 28',+ },+ {+ kind: 'channel',+ title: 'customers',+ sender: 'Jacob Beckerman',+ snippet: 'Thursday agenda: connect inbox, invite team, share one…',+ time: '9:18 AM',+ },+ {+ kind: 'call',+ title: 'Meadow onboarding',+ sender: 'Dana Whitfield',+ snippet: 'Can we bring over the docs we already have?',+ time: 'Sep 26',+ },+ ],+ },+ { kind: 'read-thread' },+ { kind: 'read-channel', channel: 'customers', count: 18 },+ { kind: 'read-call' },+ ]),+ answer:+ 'Three things before Thursday:\n\n- **The rollout plan.** Dana asked for it in @[Next steps for our team](agent:email). Julia’s draft reply links @[Team rollout plan](agent:rollout).\n- **Answers to their questions** on seats, shared email access, and importing docs. They’re in @[Demo call notes](agent:notes).\n- **The agenda.** Jacob posted it in @[customers](agent:customers): connect the inbox, invite the team, share one email, make one task.',+ followUp:+ 'Dana is waiting on the @[Team rollout plan](agent:rollout), and Julia is sending the setup steps before the call. The open questions are in @[Demo call notes](agent:notes).',+};diff --git a/apps/marketing/src/features/marketing/components/agents/createDemoPointer.ts b/apps/marketing/src/features/marketing/components/agents/createDemoPointer.tsnew file mode 100644index 0000000000..d8d2a4cfe7--- /dev/null+++ b/apps/marketing/src/features/marketing/components/agents/createDemoPointer.ts@@ -0,0 +1,40 @@+import { createEffect, createSignal, onCleanup, onMount } from 'solid-js';++/**+ * Where DemoCursor should point: the measured center-left of the element+ * `target()` selects inside `frame()`, or nothing when it's hidden.+ */+export function createDemoPointer(options: {+ frame: () => HTMLElement;+ target: () => string | undefined;+}) {+ const [pointer, setPointer] = createSignal<{ x: number; y: number }>();+ onMount(() => {+ const position = () => {+ const frame = options.frame();+ const selector = options.target();+ const target = selector+ ? frame.querySelector<HTMLElement>(selector)+ : undefined;+ if (!target) {+ setPointer(undefined);+ return;+ }+ const bounds = target.getBoundingClientRect();+ const parent = frame.getBoundingClientRect();+ setPointer({+ x: bounds.left - parent.left + Math.min(bounds.width / 2, 36),+ y: bounds.top - parent.top + bounds.height / 2,+ });+ };+ createEffect(() => {+ options.target();+ const timer = requestAnimationFrame(position);+ onCleanup(() => cancelAnimationFrame(timer));+ });+ const resize = new ResizeObserver(position);+ resize.observe(options.frame());+ onCleanup(() => resize.disconnect());+ });+ return pointer;+}diff --git a/apps/marketing/src/features/marketing/components/calls/CallChannel.tsx b/apps/marketing/src/features/marketing/components/calls/CallChannel.tsxnew file mode 100644index 0000000000..575a25b16a--- /dev/null+++ b/apps/marketing/src/features/marketing/components/calls/CallChannel.tsx@@ -0,0 +1,420 @@+import ChatText from '@phosphor/chat-text.svg';+import FileIcon from '@phosphor/file.svg';+import Hash from '@phosphor/hash.svg';+import Paperclip from '@phosphor/paperclip.svg';+import Phone from '@phosphor/phone.svg';+import PhoneCall from '@phosphor/phone-call.svg';+import Sparkle from '@phosphor/sparkle.svg';+import UserPlus from '@phosphor/user-plus.svg';+import Users from '@phosphor/users.svg';+import { Button } from '@ui';+import { TabsInset } from '@ui/components/TabsInset';+import {+ type Component,+ createEffect,+ For,+ type JSX,+ on,+ onCleanup,+ onMount,+ Show,+} from 'solid-js';+import type { WorkspaceComment } from '../../core/dummy-workspace';+import { homepagePeople } from '../../core/homepage-demo-people';+import { ViewShell } from '../DemoWorkspaceChrome';+import { ChannelComposer } from '../email/frozen/ChannelComposer';+import { SearchBar } from '../email/frozen/SearchBar';+import { MessageRow } from '../workspace/frozen/MessageRow';+import type { CallPerson } from './call-fixtures';++export type ChannelTab =+ | 'messages'+ | 'attachments'+ | 'calls'+ | 'participants'+ | 'call';++const TABS: {+ value: ChannelTab;+ label: string;+ icon: Component<JSX.SvgSVGAttributes<SVGSVGElement>>;+}[] = [+ { value: 'messages', label: 'Messages', icon: ChatText },+ { value: 'attachments', label: 'Attachments', icon: Paperclip },+ { value: 'calls', label: 'Calls', icon: Phone },+ { value: 'participants', label: 'Participants', icon: Users },+ { value: 'call', label: 'Call', icon: PhoneCall },+];++/**+ * ChannelDetailTopBar: title, inset tabs (icons when the bar runs out of+ * room), then Invite, Call or Join, and Ask Macro. The live Call tab shows+ * while a call runs in the channel.+ */+export function ChannelTopBar(props: {+ tab: ChannelTab;+ onTab: (tab: ChannelTab) => void;+ live: boolean;+ /** Hidden while you are in this channel's call. */+ callButton?: 'call' | 'join';+ onCall?: () => void;+}) {+ const tabs = () =>+ TABS.filter((tab) => tab.value !== 'call' || props.live).map((tab) => ({+ value: tab.value,+ label: (+ <span class="call-tab" data-channel-tab={tab.value}>+ <tab.icon class="call-tab-icon size-4" aria-hidden="true" />+ <span class="call-tab-text">+ <Show when={tab.value === 'call'}>+ <span class="size-1.5 animate-pulse rounded-full bg-success" />+ </Show>+ {tab.label}+ </span>+ </span>+ ),+ }));+ return (+ <ViewShell.TopBar class="call-bar call-channel-bar gap-3 py-0">+ <div class="flex min-w-0 shrink items-center gap-2">+ <Hash class="size-4 shrink-0" />+ <span class="truncate text-sm font-semibold">launch</span>+ </div>+ <TabsInset+ class="call-channel-tabs shrink-0"+ aria-label="Channel view"+ list={tabs()}+ value={props.tab}+ onChange={(value) => props.onTab(value as ChannelTab)}+ />+ <div class="ml-auto flex shrink-0 items-center gap-1">+ <Button+ variant="plain"+ size="md"+ tooltip="Invite people"+ class="call-bar-action call-bar-invite"+ >+ <UserPlus />+ <span class="call-bar-label">Invite</span>+ </Button>+ <Show when={props.callButton}>+ {(kind) => (+ <Button+ variant="plain"+ size="md"+ aria-label={kind() === 'join' ? 'Join' : 'Call'}+ tooltip={kind() === 'join' ? 'Join Call' : 'Start Call'}+ class={+ kind() === 'join'+ ? 'call-bar-action text-success'+ : 'call-bar-action'+ }+ data-channel-call+ onClick={() => props.onCall?.()}+ >+ <PhoneCall />+ <span class="call-bar-label">+ {kind() === 'join' ? 'Join' : 'Call'}+ </span>+ </Button>+ )}+ </Show>+ <Button+ variant="plain"+ size="md"+ tooltip="Ask Macro"+ class="call-bar-action"+ >+ <Sparkle />+ <span class="call-bar-label">Ask Macro</span>+ </Button>+ </div>+ </ViewShell.TopBar>+ );+}++/** ActiveCallMessage, above the composer while you are not in the call. */+export function ActiveCallBanner(props: {+ duration: string;+ onJoin?: () => void;+}) {+ return (+ <div class="call-banner" data-active-call>+ <div class="call-banner-grid">+ <div class="flex size-8 shrink-0 items-center justify-center rounded-full bg-success/15 text-success">+ <PhoneCall class="size-5" />+ </div>+ <div class="min-w-0 rounded-md border border-edge-muted bg-surface px-3 py-2 text-sm text-ink">+ <div class="flex min-w-0 items-center gap-2">+ <div class="min-w-0 flex-1">+ <div class="font-medium">A call is active in this channel</div>+ <div class="text-xs text-ink-extra-muted">+ Active for{' '}+ <span class="font-mono tabular-nums">{props.duration}</span>+ </div>+ </div>+ <Button+ variant="success"+ size="sm"+ class="shrink-0"+ onClick={() => props.onJoin?.()}+ >+ <PhoneCall class="size-3.5" />+ Join+ </Button>+ </div>+ </div>+ </div>+ </div>+ );+}++/** Channel timeline anchored to the composer, as ThreadList is. */+export function ChannelMessages(props: {+ messages: WorkspaceComment[];+ banner?: JSX.Element;+ onSend: (body: string) => void;+}) {+ let log!: HTMLDivElement;+ // ThreadList keeps the newest message above the composer until you scroll up.+ let pinned = true;+ const pin = () => {+ if (pinned) log.scrollTop = log.scrollHeight;+ };+ onMount(() => {+ pin();+ const resize = new ResizeObserver(pin);+ resize.observe(log);+ onCleanup(() => resize.disconnect());+ });+ createEffect(+ on(+ () => props.messages.length,+ () => {+ pinned = true;+ queueMicrotask(pin);+ },+ { defer: true }+ )+ );+ return (+ <>+ <div+ ref={log}+ class="dummy-scroll call-channel-log"+ role="log"+ aria-label="Channel launch"+ onScroll={() => {+ pinned = log.scrollHeight - log.scrollTop - log.clientHeight < 24;+ }}+ >+ <div class="sample-chat-log">+ <div class="sample-date-divider">+ <span>Today</span>+ </div>+ <For each={props.messages}>+ {(message) => (+ <MessageRow message={message}>+ <Show when={message.documentId}>+ <span class="dummy-entity-link">+ <FileIcon class="size-4 text-note" />+ Q3 launch plan+ </span>+ </Show>+ </MessageRow>+ )}+ </For>+ </div>+ </div>+ {props.banner}+ <div class="dummy-composer sample-chat-composer">+ <ChannelComposer+ richMentions+ label="Message #launch"+ placeholder="Type @ to share with #launch"+ onSend={props.onSend}+ />+ </div>+ </>+ );+}++export type CallListRow = {+ id: string;+ title: string;+ summary: string;+ status: 'attended' | 'missed';+ duration: string;+ people: CallPerson[];+ time: string;+};++function Badge(props: { class?: string; children: JSX.Element }) {+ return (+ <span+ class={`flex select-none items-center gap-1 rounded-full border border-edge-muted p-0.5 px-2 font-mono text-xxs font-medium ${props.class ?? ''}`}+ >+ {props.children}+ </span>+ );+}++/** ChannelCallsTab: "Search calls" and ListEntity wide call rows. */+export function ChannelCallsList(props: {+ rows: CallListRow[];+ fresh?: string;+ search: string;+ onSearch: (value: string) => void;+ onOpen: (id: string) => void;+}) {+ const rows = () => {+ const query = props.search.trim().toLowerCase();+ return query.length < 3+ ? props.rows+ : props.rows.filter((row) =>+ `${row.title} ${row.summary}`.toLowerCase().includes(query)+ );+ };+ return (+ <div class="call-calls-tab">+ <div class="call-calls-width">+ <div class="shrink-0 pb-2">+ <SearchBar+ label="Search calls"+ placeholder="Search calls"+ value={props.search}+ onValueChange={props.onSearch}+ />+ </div>+ <div role="grid" aria-label="Calls" class="call-calls-grid">+ <For each={rows()}>+ {(row) => (+ <div role="row">+ <button+ type="button"+ role="gridcell"+ class="call-list-row"+ data-call-row={row.id}+ data-fresh={props.fresh === row.id ? 'true' : undefined}+ onClick={() => props.onOpen(row.id)}+ >+ <PhoneCall class="call-list-icon size-4 shrink-0" />+ <span class="call-list-title truncate font-medium">+ {row.title}+ </span>+ <Badge class="call-list-channel normal-case font-sans text-ink-extra-muted">+ <Hash class="size-3 shrink-0" />+ launch+ </Badge>+ <span class="call-list-summary">{row.summary}</span>+ <span class="call-list-meta">+ <Badge+ class={+ row.status === 'missed'+ ? 'call-list-status uppercase text-warning'+ : 'call-list-status uppercase text-ink-extra-muted'+ }+ >+ {row.status}+ </Badge>+ <Badge class="normal-case text-ink-extra-muted">+ {row.duration}+ </Badge>+ <span class="call-list-people">+ <For each={row.people.slice(0, 2)}>+ {(person) => (+ <img+ src={homepagePeople[person].photo}+ alt={homepagePeople[person].name}+ />+ )}+ </For>+ <Show when={row.people.length > 2}>+ <span>+{row.people.length - 2}</span>+ </Show>+ </span>+ </span>+ <span class="call-list-time">{row.time}</span>+ </button>+ </div>+ )}+ </For>+ <Show when={!rows().length}>+ <p class="py-10 text-center text-sm text-ink-muted">+ No results for "{props.search.trim()}"+ </p>+ </Show>+ </div>+ </div>+ </div>+ );+}++const firstNames = (people: CallPerson[]) => {+ const names = people.map((person) => homepagePeople[person].shortName);+ if (names.length === 1) return `${names[0]} is in this call.`;+ if (names.length === 2)+ return `${names[0]} and ${names[1]} are in this call.`;+ const rest = names.length - 2;+ return `${names[0]}, ${names[1]}, and ${rest} other${rest === 1 ? '' : 's'} are in this call.`;+};++/** ChannelCallTab's JoinCallEmptyState. */+export function JoinCallEmptyState(props: {+ people: CallPerson[];+ onJoin: () => void;+}) {+ return (+ <div class="flex size-full flex-col items-center justify-center gap-5 px-6 text-center text-ink">+ <div class="flex flex-col items-center gap-3">+ <div class="call-avatar-group">+ <For each={props.people}>+ {(person) => <img src={homepagePeople[person].photo} alt="" />}+ </For>+ </div>+ <div class="flex flex-col items-center gap-1">+ <h2 class="text-lg font-semibold">Call in progress</h2>+ <p class="max-w-sm text-sm text-ink-muted">+ {firstNames(props.people)}+ </p>+ </div>+ </div>+ <Button+ variant="cta"+ size="lg"+ class="px-5"+ onClick={() => props.onJoin()}+ >+ <PhoneCall class="size-5" />+ Join call+ </Button>+ </div>+ );+}++/** ChannelParticipantsTab rows. */+export function ChannelParticipants(props: { people: CallPerson[] }) {+ return (+ <div class="dummy-scroll call-participants">+ <For each={props.people}>+ {(person) => (+ <div class="flex items-center gap-3 py-2.5 text-sm">+ <img+ class="size-8 rounded-full object-cover"+ src={homepagePeople[person].photo}+ alt=""+ />+ <span class="flex min-w-0 flex-col">+ <span class="truncate font-medium">+ {homepagePeople[person].name}+ </span>+ <span class="truncate text-xs text-ink-muted">+ {person}@macro.com+ </span>+ </span>+ </div>+ )}+ </For>+ </div>+ );+}diff --git a/apps/marketing/src/features/marketing/components/calls/CallOverlay.tsx b/apps/marketing/src/features/marketing/components/calls/CallOverlay.tsxnew file mode 100644index 0000000000..d8be93ec94--- /dev/null+++ b/apps/marketing/src/features/marketing/components/calls/CallOverlay.tsx@@ -0,0 +1,384 @@+import CaretUp from '@phosphor/caret-up.svg';+import ChatCircle from '@phosphor/chat-circle.svg';+import ImageIcon from '@phosphor/image.svg';+import Microphone from '@phosphor/microphone.svg';+import MicrophoneSlash from '@phosphor/microphone-slash.svg';+import PhoneDisconnect from '@phosphor/phone-disconnect.svg';+import Screencast from '@phosphor/screencast.svg';+import VideoCamera from '@phosphor/video-camera.svg';+import VideoCameraSlash from '@phosphor/video-camera-slash.svg';+import { Button } from '@ui';+import { For, type JSX, Show } from 'solid-js';+import type { WorkspaceComment } from '../../core/dummy-workspace';+import { homepagePeople } from '../../core/homepage-demo-people';+import { ChannelComposer } from '../email/frozen/ChannelComposer';+import { MessageRow } from '../workspace/frozen/MessageRow';+import { cameraPhoto } from './CallRecord';+import type { CallPerson } from './call-fixtures';++export type RemoteTile = {+ person: CallPerson;+ video: boolean;+ muted?: boolean;+ speaking?: boolean;+};++/** VideoTag */+function VideoTag(props: { children: JSX.Element; muted?: boolean }) {+ return (+ <div+ class="absolute bottom-1 left-1 max-w-[80%] truncate rounded bg-surface/70 px-1.5 py-0.5 text-xs"+ classList={{ 'text-ink': !props.muted, 'text-ink-muted': props.muted }}+ >+ {props.children}+ </div>+ );+}++/** MutedMicrophoneBadge */+function MutedBadge(props: { label: string }) {+ return (+ <div+ role="status"+ aria-label={props.label}+ class="pointer-events-none absolute top-2 right-2 z-10 flex size-7 items-center justify-center rounded-full border border-edge bg-surface/90 text-failure"+ >+ <MicrophoneSlash aria-hidden="true" class="size-5" />+ </div>+ );+}++/** ParticipantTileWrapper: the inset accent ring marks who is speaking. */+function Tile(props: {+ speaking?: boolean;+ connecting?: boolean;+ class?: string;+ children: JSX.Element;+}) {+ return (+ <div+ class={`call-tile relative flex min-h-30 items-center justify-center overflow-hidden rounded-lg border border-edge-muted bg-panel ${props.class ?? ''}`}+ classList={{ 'animate-pulse': props.connecting }}+ data-speaking={props.speaking ? 'true' : undefined}+ >+ {props.children}+ </div>+ );+}++/** ParticipantAvatar, shown when a camera is off. */+function Avatar(props: { person: CallPerson; small?: boolean }) {+ return (+ <div class="flex size-full items-center justify-center p-4">+ <div+ class="overflow-hidden rounded-full"+ classList={{+ 'size-12': props.small,+ 'size-20 sm:size-24': !props.small,+ }}+ >+ <img+ class="size-full object-cover"+ src={homepagePeople[props.person].photo}+ alt=""+ />+ </div>+ </div>+ );+}++function Camera(props: { person: CallPerson; mirror?: boolean }) {+ return (+ <img+ class="call-camera"+ classList={{ 'call-camera-mirror': props.mirror }}+ src={cameraPhoto[props.person]}+ alt=""+ />+ );+}++function ControlButton(props: {+ label: string;+ pressed?: boolean;+ danger?: boolean;+ onClick?: () => void;+ children: JSX.Element;+}) {+ return (+ <Button+ size="icon-lg"+ variant={props.danger ? 'danger' : 'ghost'}+ label={props.label}+ tooltipPlacement="top"+ aria-pressed={props.pressed}+ onClick={() => props.onClick?.()}+ class={`call-control size-10 @sm:size-12 ${props.danger ? 'call-control-danger' : ''}`}+ >+ {props.children}+ </Button>+ );+}++function MediaGroup(props: {+ label: string;+ settings: string;+ toggleLabel: string;+ active: boolean;+ onToggle: () => void;+ children: JSX.Element;+}) {+ return (+ <div+ role="group"+ aria-label={props.label}+ class="flex items-center gap-0.5"+ >+ <ControlButton+ label={props.toggleLabel}+ pressed={props.active}+ onClick={props.onToggle}+ >+ {props.children}+ </ControlButton>+ <Button+ size="icon-md"+ variant="ghost"+ tooltipDisabled+ aria-label={props.settings}+ aria-expanded={false}+ class="call-control-caret h-10 w-5 @sm:h-12 @sm:w-8"+ >+ <CaretUp class="size-4" />+ </Button>+ </div>+ );+}++/**+ * CallOverlay inside the channel's Call tab: remote tiles in a grid, your+ * picture-in-picture, CallControlBar, the chat toggle, and Share with team.+ */+export function CallOverlayView(props: {+ remote: RemoteTile[];+ you: CallPerson;+ connecting: boolean;+ muted: boolean;+ cameraOff: boolean;+ background: boolean;+ sharing: boolean;+ sharedWithTeam: boolean;+ chatOpen: boolean;+ chat: WorkspaceComment[];+ onMute: () => void;+ onCamera: () => void;+ onBackground: () => void;+ onShareScreen: () => void;+ onShareWithTeam: () => void;+ onChat: () => void;+ onSendChat: (body: string) => void;+ onLeave: () => void;+}) {+ const columns = () =>+ props.remote.length <= 1 ? 1 : props.remote.length <= 4 ? 2 : 3;+ const local = (pip: boolean) => (+ <Tile+ class={pip ? 'size-full min-h-0' : 'size-full'}+ connecting={props.connecting}+ >+ <Show+ when={!props.connecting && !props.cameraOff}+ fallback={<Avatar person={props.you} small={pip} />}+ >+ <Camera person={props.you} mirror />+ </Show>+ <Show when={props.muted}>+ <MutedBadge label="You are muted" />+ </Show>+ <Show when={props.connecting} fallback={<VideoTag>You</VideoTag>}>+ <VideoTag muted>Connecting...</VideoTag>+ </Show>+ </Tile>+ );+ return (+ <div class="call-overlay flex h-full min-h-0 flex-col @container/call">+ <div class="relative flex min-h-0 flex-1 overflow-hidden">+ <div class="flex min-w-0 flex-1 flex-col">+ <Show when={props.sharing}>+ <div class="min-h-0 flex-1 pt-2">+ <div class="relative flex h-full items-center justify-center overflow-hidden rounded-lg bg-surface-2">+ <div class="call-screen-share" aria-hidden="true">+ <span />+ <span />+ <span />+ </div>+ <VideoTag>Your screen</VideoTag>+ </div>+ </div>+ </Show>+ <div+ class="relative pt-2"+ classList={{+ 'h-45 shrink-0': props.sharing,+ 'min-h-0 flex-1': !props.sharing,+ }}+ >+ <Show when={props.remote.length > 0} fallback={local(false)}>+ <div+ class="call-grid grid size-full auto-rows-fr gap-2 overflow-hidden"+ style={{+ 'grid-template-columns': `repeat(${columns()}, minmax(0, 1fr))`,+ }}+ >+ <For each={props.remote}>+ {(tile) => (+ <Tile speaking={tile.speaking}>+ <Show+ when={tile.video}+ fallback={<Avatar person={tile.person} />}+ >+ <Camera person={tile.person} />+ </Show>+ <Show when={tile.muted}>+ <MutedBadge+ label={`${homepagePeople[tile.person].name} is muted`}+ />+ </Show>+ <VideoTag>{homepagePeople[tile.person].name}</VideoTag>+ </Tile>+ )}+ </For>+ </div>+ <div class="call-pip absolute right-4 bottom-4 z-10 aspect-video w-40 shadow-lg sm:w-48">+ {local(true)}+ </div>+ </Show>+ </div>+ </div>+ <Show when={props.chatOpen}>+ <aside aria-label="Call chat" class="call-chat-panel">+ <div class="min-h-0 flex-1 overflow-y-auto overscroll-contain px-3 py-4">+ <Show+ when={props.chat.length}+ fallback={+ <p class="px-1 text-sm text-ink-muted">+ Start the conversation. Messages stay with this call.+ </p>+ }+ >+ <For each={props.chat}>+ {(message) => <MessageRow message={message} />}+ </For>+ </Show>+ </div>+ <div class="shrink-0 p-3">+ <ChannelComposer+ label="Message this call"+ placeholder="Message this call…"+ onSend={props.onSendChat}+ />+ </div>+ </aside>+ </Show>+ </div>+ <div class="relative flex shrink-0 flex-col items-center gap-2 py-3">+ <button+ type="button"+ role="checkbox"+ aria-checked={props.sharedWithTeam}+ title={+ props.sharedWithTeam+ ? "The creator's team can view the chat, transcript, and AI summary once the call ends"+ : "Let the creator's team view the chat, transcript, and AI summary once the call ends"+ }+ class="call-team-share order-1"+ onClick={() => props.onShareWithTeam()}+ >+ <span class="call-checkbox" data-checked={props.sharedWithTeam}>+ <svg viewBox="0 0 12 12" aria-hidden="true">+ <path d="m2.5 6.2 2.3 2.3 4.7-5" />+ </svg>+ </span>+ <span class="whitespace-nowrap">Share with team</span>+ </button>+ <div class="call-controls-row">+ <div class="call-controls-center">+ <div+ data-call-controls+ class="@container relative z-20 w-full max-w-xl"+ >+ <div class="mx-auto flex w-fit max-w-full flex-wrap items-center justify-center gap-1 rounded-xl bg-menu-glass p-1.5 text-ink glass @sm:gap-2">+ <MediaGroup+ label="Microphone controls"+ settings="Audio settings"+ toggleLabel={+ props.muted ? 'Unmute microphone' : 'Mute microphone'+ }+ active={!props.muted}+ onToggle={props.onMute}+ >+ <Show when={props.muted} fallback={<Microphone />}>+ <MicrophoneSlash />+ </Show>+ </MediaGroup>+ <MediaGroup+ label="Camera controls"+ settings="Camera settings"+ toggleLabel={+ props.cameraOff ? 'Turn on camera' : 'Turn off camera'+ }+ active={!props.cameraOff}+ onToggle={props.onCamera}+ >+ <Show when={props.cameraOff} fallback={<VideoCamera />}>+ <VideoCameraSlash />+ </Show>+ </MediaGroup>+ <MediaGroup+ label="Background controls"+ settings="Background settings"+ toggleLabel={+ props.background+ ? 'Turn off background'+ : 'Turn on background'+ }+ active={props.background}+ onToggle={props.onBackground}+ >+ <ImageIcon />+ </MediaGroup>+ <ControlButton+ label={props.sharing ? 'Stop sharing screen' : 'Share screen'}+ pressed={props.sharing}+ onClick={props.onShareScreen}+ >+ <Screencast />+ </ControlButton>+ <ControlButton+ label="Leave call"+ danger+ onClick={props.onLeave}+ >+ <PhoneDisconnect />+ </ControlButton>+ </div>+ </div>+ </div>+ <div class="call-chat-toggle justify-self-end rounded-xl border border-edge-muted bg-panel p-1.5 shadow-sm">+ <button+ type="button"+ aria-label={props.chatOpen ? 'Close chat' : 'Open chat'}+ aria-expanded={props.chatOpen}+ title={props.chatOpen ? 'Close chat' : 'Open chat'}+ onClick={() => props.onChat()}+ class="flex size-10 items-center justify-center rounded-lg hover:bg-hover @min-[500px]/call:size-12"+ classList={{ 'bg-hover text-accent': props.chatOpen }}+ >+ <ChatCircle class="size-5" />+ </button>+ </div>+ </div>+ </div>+ </div>+ );+}diff --git a/apps/marketing/src/features/marketing/components/calls/CallRecord.tsx b/apps/marketing/src/features/marketing/components/calls/CallRecord.tsxnew file mode 100644index 0000000000..05d1ec896c--- /dev/null+++ b/apps/marketing/src/features/marketing/components/calls/CallRecord.tsx@@ -0,0 +1,549 @@+import ArrowLeft from '@phosphor/arrow-left.svg';+import CornersOut from '@phosphor/corners-out.svg';+import DotsThreeVertical from '@phosphor/dots-three-vertical.svg';+import FileIcon from '@phosphor/file.svg';+import LinkIcon from '@phosphor/link.svg';+import PhoneCall from '@phosphor/phone-call.svg';+import Sparkle from '@phosphor/sparkle.svg';+import SpeakerHigh from '@phosphor/speaker-high.svg';+import Pause from '@phosphor-fill/pause-fill.svg';+import Play from '@phosphor-fill/play-fill.svg';+import { Button } from '@ui';+import {+ createEffect,+ createMemo,+ createSignal,+ For,+ type JSX,+ on,+ onCleanup,+ Show,+} from 'solid-js';+import gabrielVideo from '../../../../assets/people/gabriel.webp';+import jacobVideo from '../../../../assets/people/jacob.webp';+import juliaVideo from '../../../../assets/people/julia.webp';+import teoVideo from '../../../../assets/people/teo.webp';+import { homepagePeople } from '../../core/homepage-demo-people';+import { DemoMarkdown } from '../DemoMarkdown';+import { ViewShell } from '../DemoWorkspaceChrome';+import { MessageRow } from '../workspace/frozen/MessageRow';+import {+ type CallPerson,+ type CallPosterTile,+ type CallSegment,+ callEmail,+ formatCallDuration,+ formatVideoTimestamp,+ type SampleCall,+} from './call-fixtures';++/** The largest local photo for each person, used where a camera feed shows. */+export const cameraPhoto: Record<CallPerson, string> = {+ jacob: jacobVideo,+ julia: juliaVideo,+ gabriel: gabrielVideo,+ teo: teoVideo,+ valentina: homepagePeople.valentina.photo,+};++/** Local stand-in for the recording's <video>: seeks and plays a clock only. */+export function createCallPlayback(duration: number) {+ const [seconds, setSeconds] = createSignal(0);+ const [playing, setPlaying] = createSignal(false);+ const [seekGeneration, setSeekGeneration] = createSignal(0);+ let timer: ReturnType<typeof setInterval> | undefined;+ const stop = () => {+ clearInterval(timer);+ timer = undefined;+ setPlaying(false);+ };+ const play = () => {+ if (timer) return;+ setPlaying(true);+ timer = setInterval(() => {+ const next = Math.min(duration, seconds() + 1);+ setSeconds(next);+ if (next >= duration) stop();+ }, 1000);+ };+ onCleanup(stop);+ return {+ duration,+ seconds,+ playing,+ seekGeneration,+ toggle: () => (playing() ? stop() : play()),+ seek: (value: number) => {+ setSeconds(Math.max(0, Math.min(duration, value)));+ setSeekGeneration((n) => n + 1);+ },+ };+}+export type CallPlayback = ReturnType<typeof createCallPlayback>;++/** components/icon/share.svg */+export function ShareIcon(props: { class?: string }) {+ return (+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.75"+ stroke-linecap="round"+ stroke-linejoin="round"+ class={props.class}+ aria-hidden="true"+ >+ <path d="M4 13v4a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-4M12 14V4m-4 4 4-4 4 4" />+ </svg>+ );+}++/** CallRecordingSplitHeader: label, Call Again, Ask Macro, Share. */+export function CallRecordTopBar(props: {+ title: string;+ onBack?: () => void;+}) {+ return (+ <ViewShell.TopBar class="call-bar">+ <Show when={props.onBack}>+ <Button+ variant="plain"+ size="icon-sm"+ label="Back to channel"+ onClick={props.onBack}+ >+ <ArrowLeft />+ </Button>+ </Show>+ <PhoneCall class="size-4 shrink-0 text-ink-muted" />+ <span class="truncate text-sm font-medium">{props.title}</span>+ <div class="ml-auto flex shrink-0 items-center gap-1">+ <Button variant="plain" size="icon-md" label="Call Again">+ <PhoneCall class="size-4" />+ </Button>+ <Button+ variant="plain"+ size="md"+ tooltip="Ask Macro"+ class="call-bar-action"+ >+ <Sparkle />+ <span class="call-bar-label">Ask Macro</span>+ </Button>+ <Button+ variant="plain"+ size="md"+ tooltip="Share call"+ class="call-bar-action"+ >+ <ShareIcon class="size-3.5" />+ <span class="call-bar-label">Share</span>+ </Button>+ <Button+ variant="plain"+ size="icon-md"+ label="Copy Share Link"+ class="call-bar-copy"+ >+ <LinkIcon class="size-3.5" />+ </Button>+ </div>+ </ViewShell.TopBar>+ );+}++/** A frame of the room composite, standing in for the recording's poster. */+export function RecordingPoster(props: {+ tiles: CallPosterTile[];+ speaking?: CallPerson;+}) {+ return (+ <div class="call-poster" data-count={props.tiles.length} aria-hidden="true">+ <For each={props.tiles}>+ {(tile) => (+ <div+ class="call-poster-tile"+ data-speaking={props.speaking === tile.person ? 'true' : undefined}+ >+ <Show+ when={tile.video}+ fallback={+ <span class="call-poster-avatar">+ <img src={homepagePeople[tile.person].photo} alt="" />+ </span>+ }+ >+ <img+ class="call-poster-video"+ src={cameraPhoto[tile.person]}+ alt=""+ />+ </Show>+ <span class="call-poster-name">+ {homepagePeople[tile.person].name}+ </span>+ </div>+ )}+ </For>+ </div>+ );+}++/** CallRecordingVideo: the browser's own video controls over the poster. */+export function RecordingPlayer(props: {+ call: SampleCall;+ playback: CallPlayback;+}) {+ const p = () => props.playback;+ const progress = () => (p().seconds() / p().duration) * 100;+ return (+ <div class="flex flex-col items-center justify-center gap-3 overflow-hidden p-4">+ <div class="call-player" role="group" aria-label="Call recording">+ <RecordingPoster+ tiles={props.call.poster}+ speaking={props.call.speaking}+ />+ <div class="call-player-controls" data-playing={p().playing()}>+ <div+ class="call-player-timeline"+ role="slider"+ tabIndex={0}+ aria-label="Video time"+ aria-valuemin={0}+ aria-valuemax={p().duration}+ aria-valuenow={Math.floor(p().seconds())}+ aria-valuetext={formatVideoTimestamp(p().seconds())}+ onClick={(event) => {+ const bounds = event.currentTarget.getBoundingClientRect();+ if (!bounds.width) return;+ p().seek(+ ((event.clientX - bounds.left) / bounds.width) * p().duration+ );+ }}+ onKeyDown={(event) => {+ if (event.key === 'ArrowRight') p().seek(p().seconds() + 5);+ if (event.key === 'ArrowLeft') p().seek(p().seconds() - 5);+ }}+ >+ <span class="call-player-track">+ <span+ class="call-player-fill"+ style={{ width: `${progress()}%` }}+ />+ <span+ class="call-player-thumb"+ style={{ left: `${progress()}%` }}+ />+ </span>+ </div>+ <div class="call-player-row">+ <button+ type="button"+ class="call-player-button"+ aria-label={p().playing() ? 'Pause' : 'Play'}+ onClick={() => p().toggle()}+ >+ <Show when={p().playing()} fallback={<Play />}>+ <Pause />+ </Show>+ </button>+ <span class="call-player-time" data-call-time>+ {formatVideoTimestamp(p().seconds())} /{' '}+ {formatVideoTimestamp(p().duration)}+ </span>+ <span class="call-player-icons" aria-hidden="true">+ <SpeakerHigh />+ <CornersOut />+ <DotsThreeVertical />+ </span>+ </div>+ </div>+ </div>+ </div>+ );+}++/** Lets a walkthrough scroll the transcript the way a visitor's wheel does. */+export type TranscriptControls = {+ wheelAway: () => void;+ resync: () => void;+};++function scrollBox(element: HTMLElement, top: number) {+ if (typeof element.scrollTo === 'function')+ element.scrollTo({+ top,+ behavior: matchMedia('(prefers-reduced-motion: reduce)').matches+ ? 'instant'+ : 'smooth',+ });+ else element.scrollTop = top;+}++/** CallTranscript with channel-message rows, seek on click, and follow mode. */+export function CallTranscriptBox(props: {+ segments: CallSegment[];+ playback: CallPlayback;+ maxHeight?: number;+ controls?: (controls: TranscriptControls) => void;+}) {+ let scroller!: HTMLDivElement;+ const rows = new Map<string, HTMLElement>();+ const [sync, setSync] = createSignal(true);+ const [inView, setInView] = createSignal(true);+ let ignoreScrollUntil = 0;+ const active = createMemo(() => {+ let id: string | undefined;+ for (const segment of props.segments) {+ if (segment.at <= props.playback.seconds()) id = segment.id;+ else break;+ }+ return id;+ });+ const updateInView = () => {+ const row = active() ? rows.get(active()!) : undefined;+ if (!row) {+ setInView(true);+ return;+ }+ const box = scroller.getBoundingClientRect();+ const bounds = row.getBoundingClientRect();+ setInView(bounds.bottom > box.top && bounds.top < box.bottom);+ };+ const scrollToActive = (force: boolean) => {+ const row = active() ? rows.get(active()!) : undefined;+ if (!row) return;+ const box = scroller.getBoundingClientRect();+ const bounds = row.getBoundingClientRect();+ if (!force && bounds.top >= box.top && bounds.bottom <= box.bottom) return;+ ignoreScrollUntil = performance.now() + 350;+ scrollBox(+ scroller,+ Math.max(+ 0,+ scroller.scrollTop ++ (bounds.top - box.top) -+ scroller.clientHeight / 2 ++ row.clientHeight / 2+ )+ );+ };+ // A seek always re-enters follow mode and centers the line, as in the app.+ createEffect(+ on(+ () => props.playback.seekGeneration(),+ () => {+ setSync(true);+ scrollToActive(true);+ setInView(true);+ },+ { defer: true }+ )+ );+ createEffect(+ on(+ active,+ () => {+ if (sync()) scrollToActive(false);+ else updateInView();+ },+ { defer: true }+ )+ );+ props.controls?.({+ wheelAway: () => {+ setSync(false);+ scrollBox(scroller, scroller.scrollHeight);+ updateInView();+ },+ resync: () => {+ setSync(true);+ scrollToActive(true);+ setInView(true);+ },+ });+ const grouped = (index: number) => {+ const previous = props.segments[index - 1];+ const segment = props.segments[index];+ return (+ !!previous &&+ previous.person === segment.person &&+ segment.at - previous.at <= 300+ );+ };+ return (+ <div+ class="call-transcript relative flex flex-col overflow-hidden rounded border border-edge-muted/50"+ style={{ 'max-height': `${props.maxHeight ?? 600}px` }}+ >+ <div+ ref={scroller}+ class="call-transcript-scroll min-h-0 flex-1 overflow-y-auto"+ role="list"+ aria-label="Transcript"+ onWheel={() => setSync(false)}+ onTouchMove={() => setSync(false)}+ onScroll={() => {+ if (performance.now() < ignoreScrollUntil) return;+ updateInView();+ }}+ >+ <div class="flex flex-col p-4 pt-0">+ <For each={props.segments}>+ {(segment, index) => (+ <div ref={(el) => rows.set(segment.id, el)} role="listitem">+ <button+ type="button"+ class="call-transcript-row"+ data-grouped={grouped(index()) ? 'true' : undefined}+ data-selected={active() === segment.id ? '' : undefined}+ data-segment={segment.id}+ aria-pressed={active() === segment.id}+ aria-label={`Go to ${formatVideoTimestamp(segment.at)}: ${homepagePeople[segment.person].name}`}+ onClick={() => props.playback.seek(segment.at)}+ >+ <Show when={!grouped(index())}>+ <img+ class="call-transcript-avatar"+ src={homepagePeople[segment.person].photo}+ alt=""+ />+ <span class="flex min-w-0 items-center gap-1">+ <span class="truncate text-sm font-medium">+ {homepagePeople[segment.person].name}+ </span>+ <span class="ml-auto shrink-0 text-xs text-ink-muted tabular-nums">+ {formatVideoTimestamp(segment.at)}+ </span>+ </span>+ </Show>+ <span class="call-transcript-text">{segment.text}</span>+ </button>+ </div>+ )}+ </For>+ </div>+ </div>+ <Show when={!sync() && !inView() && active()}>+ <div class="call-transcript-sync">+ <button+ type="button"+ data-sync-video+ onClick={() => {+ setSync(true);+ scrollToActive(true);+ setInView(true);+ }}+ >+ <span>Sync to video time</span>+ </button>+ </div>+ </Show>+ </div>+ );+}++/** CallRecordingBody: header, participants, summary, recording, transcript, chat. */+export function CallRecordBody(props: {+ call: SampleCall;+ playback: CallPlayback;+ transcriptHeight?: number;+ scrollRef?: (element: HTMLDivElement) => void;+ transcriptControls?: (controls: TranscriptControls) => void;+ class?: string;+ after?: JSX.Element;+}) {+ return (+ <div+ ref={props.scrollRef}+ class={`dummy-scroll call-record-scroll ${props.class ?? ''}`}+ >+ <div class="call-record-column">+ <div class="flex flex-col gap-10">+ <header>+ <h1 class="text-2xl font-semibold text-balance text-ink">+ {props.call.title}+ </h1>+ <div class="mt-3 flex flex-wrap items-center gap-x-2 text-sm text-ink-muted">+ <span>{props.call.ended}</span>+ <span class="text-ink-extra-muted">·</span>+ <span>{formatCallDuration(props.call.duration)}</span>+ </div>+ </header>+ <section class="flex flex-col gap-3" data-call-section="participants">+ <h3 class="text-sm font-semibold text-ink">+ Participants+ <span class="ml-1.5 font-normal text-ink-muted tabular-nums">+ {props.call.people.length}+ </span>+ </h3>+ <div class="flex flex-wrap gap-2" role="list">+ <For each={props.call.people}>+ {(person) => (+ <span+ role="listitem"+ class="inline-flex items-center gap-1.5 rounded-full border border-edge-muted/50 py-1 pr-2.5 pl-1 text-sm text-ink"+ >+ <img+ class="size-5 shrink-0 rounded-full object-cover"+ src={homepagePeople[person].photo}+ alt=""+ />+ <span class="max-w-48 truncate">{callEmail(person)}</span>+ </span>+ )}+ </For>+ </div>+ </section>+ <section class="flex flex-col gap-3" data-call-section="summary">+ <h3 class="text-sm font-semibold text-ink">Summary</h3>+ <div class="call-summary text-sm/6 text-pretty text-ink">+ <DemoMarkdown markdown={props.call.summary} />+ </div>+ </section>+ <section class="flex flex-col gap-3" data-call-section="recording">+ <h3 class="text-sm font-semibold text-ink">Recording</h3>+ <div class="overflow-hidden rounded border border-edge-muted/50">+ <RecordingPlayer call={props.call} playback={props.playback} />+ </div>+ </section>+ <section class="flex flex-col gap-3" data-call-section="transcript">+ <h3 class="text-sm font-semibold text-ink">Transcript</h3>+ <CallTranscriptBox+ segments={props.call.segments}+ playback={props.playback}+ maxHeight={props.transcriptHeight}+ controls={props.transcriptControls}+ />+ </section>+ <Show when={props.call.chat}>+ {(chat) => (+ <section+ class="flex min-w-0 flex-col gap-3"+ aria-label="Call chat"+ >+ <h3 class="text-sm font-semibold text-ink">Call chat</h3>+ <div class="call-chat-history min-w-0 rounded border border-edge-muted/50 py-2">+ <For each={chat()}>+ {(message) => (+ <MessageRow message={message}>+ <Show when={message.documentId}>+ <span class="dummy-entity-link">+ <FileIcon class="size-4 text-note" />+ Q3 launch plan+ </span>+ </Show>+ </MessageRow>+ )}+ </For>+ </div>+ </section>+ )}+ </Show>+ {props.after}+ </div>+ </div>+ </div>+ );+}diff --git a/apps/marketing/src/features/marketing/components/calls/CallStories.test.tsx b/apps/marketing/src/features/marketing/components/calls/CallStories.test.tsxnew file mode 100644index 0000000000..a40461f1d2--- /dev/null+++ b/apps/marketing/src/features/marketing/components/calls/CallStories.test.tsx@@ -0,0 +1,177 @@+import { cleanup, fireEvent, render, within } from '@solidjs/testing-library';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import {+ CallDefaultDemo,+ CallFollowupDemo,+ CallHeroDemo,+ CallStartDemo,+ CallTranscriptDemo,+} from './CallStories';++let intersections: IntersectionObserverCallback[];+let motionListeners: (() => void)[];+let reduced = false;+let hidden = false;+beforeEach(() => {+ intersections = [];+ motionListeners = [];+ reduced = false;+ hidden = false;+ vi.useFakeTimers();+ vi.stubGlobal('fetch', vi.fn());+ vi.spyOn(document, 'hidden', 'get').mockImplementation(() => hidden);+ vi.stubGlobal('matchMedia', () => ({+ get matches() {+ return reduced;+ },+ addEventListener: (_: string, callback: () => void) =>+ motionListeners.push(callback),+ removeEventListener: vi.fn(),+ }));+ vi.stubGlobal(+ 'IntersectionObserver',+ class {+ constructor(callback: IntersectionObserverCallback) {+ intersections.push(callback);+ }+ observe() {}+ disconnect() {}+ }+ );+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+});+afterEach(() => {+ cleanup();+ vi.advanceTimersByTime(100);+ expect(fetch).not.toHaveBeenCalled();+ expect(vi.getTimerCount()).toBe(0);+ vi.useRealTimers();+ vi.restoreAllMocks();+ vi.unstubAllGlobals();+});+function visible(value: boolean) {+ for (const callback of intersections)+ callback(+ [{ isIntersecting: value } as IntersectionObserverEntry],+ {} as IntersectionObserver+ );+}+function reduce() {+ reduced = true;+ for (const callback of motionListeners) callback();+}+const playerTime = (container: HTMLElement) =>+ container+ .querySelector('[data-call-time]')+ ?.textContent?.replace(/\s+/g, ' ');++it('shows the full call record and seeks when a transcript line is clicked', () => {+ const view = render(() => <CallHeroDemo />);+ expect(view.getByText('[email protected]')).toBeTruthy();+ expect(view.getByText('Summary')).toBeTruthy();+ expect(view.getByText('Recording')).toBeTruthy();+ expect(playerTime(view.container)).toBe('0:00 / 18:22');+ const line = view.getByRole('button', { name: 'Go to 1:12: Julia Westphal' });+ fireEvent.click(line);+ expect(line.getAttribute('aria-pressed')).toBe('true');+ expect(playerTime(view.container)).toBe('1:12 / 18:22');+ fireEvent.click(view.getByRole('button', { name: 'Play' }));+ vi.advanceTimersByTime(3000);+ expect(playerTime(view.container)).toBe('1:15 / 18:22');+});++it('ends the live call and opens its new record from the Calls tab', () => {+ const view = render(() => <CallDefaultDemo />);+ expect(view.getByText('A call is active in this channel')).toBeTruthy();+ expect(view.getByText('12:03')).toBeTruthy();+ visible(true);+ vi.advanceTimersByTime(1000);+ expect(view.getByText('12:04')).toBeTruthy();+ vi.advanceTimersByTime(1000);+ expect(view.queryByText('A call is active in this channel')).toBeNull();+ vi.advanceTimersByTime(1400);+ const calls = within(view.getByRole('grid', { name: 'Calls' }));+ expect(calls.getByText('Invite bug triage')).toBeTruthy();+ expect(calls.getByText('12m 4s')).toBeTruthy();+ vi.advanceTimersByTime(1500);+ expect(view.getByRole('heading', { name: 'Invite bug triage' })).toBeTruthy();+ expect(view.getByText('[email protected]')).toBeTruthy();+ expect(+ view.getByRole('button', { name: 'Go to 0:03: Gabriel Birman' })+ ).toBeTruthy();+ vi.advanceTimersByTime(30000);+ expect(view.container.querySelector('.demo-cursor')).toBeNull();+});++it('shows the finished record without a cursor for reduced motion', () => {+ reduced = true;+ const view = render(() => <CallDefaultDemo />);+ expect(view.getByRole('heading', { name: 'Invite bug triage' })).toBeTruthy();+ expect(view.container.querySelector('.demo-cursor')).toBeNull();+});++it('jumps to the clicked line, then offers Sync to video time after scrolling away', () => {+ const view = render(() => <CallTranscriptDemo />);+ visible(true);+ vi.advanceTimersByTime(2100);+ const line = view.getByRole('button', { name: 'Go to 1:38: Teo' });+ expect(line.getAttribute('aria-pressed')).toBe('true');+ expect(playerTime(view.container)).toBe('1:38 / 18:22');+ vi.advanceTimersByTime(1300);+ const sync = view.getByRole('button', { name: 'Sync to video time' });+ vi.advanceTimersByTime(2100);+ expect(sync.isConnected).toBe(false);+ expect(line.getAttribute('aria-pressed')).toBe('true');+});++it('lets a visitor choose a transcript line without being moved back by motion', () => {+ const view = render(() => <CallTranscriptDemo />);+ visible(true);+ const line = view.getByRole('button', { name: 'Go to 1:12: Julia Westphal' });+ fireEvent.pointerDown(line);+ fireEvent.click(line);+ reduce();+ vi.advanceTimersByTime(20000);+ expect(line.getAttribute('aria-pressed')).toBe('true');+ expect(playerTime(view.container)).toBe('1:12 / 18:22');+});++it('has @Macro read the call and write what was decided into the task', () => {+ const view = render(() => <CallFollowupDemo />);+ expect(view.getByText(/Calling 1 tool/)).toBeTruthy();+ visible(true);+ vi.advanceTimersByTime(4000);+ expect(view.getByText(/Called 4 tools/)).toBeTruthy();+ expect(view.getByText('call transcript')).toBeTruthy();+ const task = within(view.getByRole('region', { name: 'Task' }));+ expect(+ task.getByRole('textbox', { name: 'Task description' }).textContent+ ).toContain('From this morning’s launch check-in');+ expect(+ task.getByRole('checkbox', { name: 'Existing accounts switch teams' })+ ).toBeTruthy();+});++it('starts a call from the channel header and shows everyone who joins', () => {+ const view = render(() => <CallStartDemo />);+ expect(view.getByRole('button', { name: 'Call' })).toBeTruthy();+ visible(true);+ vi.advanceTimersByTime(4300);+ expect(view.queryByRole('button', { name: 'Call' })).toBeNull();+ expect(view.getByText('Julia Westphal')).toBeTruthy();+ expect(view.getByText('Gabriel Birman')).toBeTruthy();+ expect(view.getByRole('status', { name: 'Teo is muted' })).toBeTruthy();+ expect(view.getByText('You')).toBeTruthy();+ fireEvent.click(view.getByRole('button', { name: 'Mute microphone' }));+ expect(view.getByRole('status', { name: 'You are muted' })).toBeTruthy();+ fireEvent.click(view.getByRole('button', { name: 'Leave call' }));+ expect(view.getByText('A call is active in this channel')).toBeTruthy();+ expect(view.getAllByRole('button', { name: 'Join' }).length).toBe(2);+});diff --git a/apps/marketing/src/features/marketing/components/calls/CallStories.tsx b/apps/marketing/src/features/marketing/components/calls/CallStories.tsxindex c263462fd3..a9d573716c 100644--- a/apps/marketing/src/features/marketing/components/calls/CallStories.tsx+++ b/apps/marketing/src/features/marketing/components/calls/CallStories.tsx@@ -1,285 +1,995 @@-import ArrowLeft from '@phosphor/arrow-left.svg';-import PhoneCall from '@phosphor/phone-call.svg';-import Share from '@phosphor/share.svg';-import { Button } from '@ui';-import { createSignal, For, Show } from 'solid-js';-import type { HomepagePersonId } from '../../core/homepage-demo-people';+import CaretRight from '@phosphor/caret-right.svg';+import ListIcon from '@phosphor/list.svg';+import ListChecks from '@phosphor/list-checks.svg';+import Newspaper from '@phosphor/newspaper.svg';+import PencilSimple from '@phosphor/pencil-simple.svg';+import Sparkle from '@phosphor/sparkle.svg';+import { UserMessageBubble } from '@ui/components/UserMessageBubble';+import {+ type Accessor,+ createSignal,+ For,+ type JSX,+ Match,+ onCleanup,+ onMount,+ Show,+ Switch,+} from 'solid-js';+import type { WorkspaceComment } from '../../core/dummy-workspace';import { createDummyWorkspace } from '../../primitives/createDummyWorkspace';import { createProductWalkthrough } from '../../primitives/createProductWalkthrough';+import { DemoCursor } from '../DemoCursor';+import { DemoMention, DemoMentionText } from '../DemoMention';import { ViewShell } from '../DemoWorkspaceChrome';-import { HomepageConversation } from '../HomepageConversation';+import { ChannelComposer } from '../email/frozen/ChannelComposer';import { ProductDemo } from '../product/ProductPage';-import { ProductShareDialog } from '../product/ProductShareDialog';import { ProductWorkspace } from '../product/ProductWorkspace';-import { PersonIcon } from '../workspace/frozen/TaskProperties';+import { TaskNotebook } from '../workspace/frozen/TaskNotebook';+import {+ ActiveCallBanner,+ type CallListRow,+ ChannelCallsList,+ ChannelMessages,+ ChannelParticipants,+ type ChannelTab,+ ChannelTopBar,+ JoinCallEmptyState,+} from './CallChannel';+import { CallOverlayView, type RemoteTile } from './CallOverlay';+import {+ CallRecordBody,+ CallRecordTopBar,+ createCallPlayback,+ type TranscriptControls,+} from './CallRecord';+import {+ announcementReview,+ type CallPerson,+ helpCenterReview,+ inviteDesignReview,+ inviteTriage,+ launchCheckIn,+ onboardingWalkthrough,+ pricingFeedback,+ type SampleCall,+ weeklyPlanning,+} from './call-fixtures';+import { createDemoPointer } from './demo-pointer';import '../workspace/dummy-workspace.css';+import '../demo-markdown.css';+import './call-stories.css';-const transcript: {- person: HomepagePersonId;- name: string;- time: string;- text: string;-}[] = [+function FlowPointer(props: {+ pointer: Accessor<{ x: number; y: number } | undefined>;+ clicking: boolean;+}) {+ return (+ <Show when={props.pointer()}>+ {(p) => (+ <DemoCursor+ label="Jacob"+ class="call-flow-pointer"+ clicking={props.clicking}+ style={{ transform: `translate(${p().x}px, ${p().y}px)` }}+ />+ )}+ </Show>+ );+}++/** Hero: the full call record from CallBlockAdapter, local and interactive. */+export function CallHeroDemo() {+ const playback = createCallPlayback(launchCheckIn.duration);+ return (+ <ProductDemo label="Launch check-in call record">+ <CallRecordTopBar title={launchCheckIn.title} />+ <CallRecordBody+ call={launchCheckIn}+ playback={playback}+ transcriptHeight={420}+ />+ </ProductDemo>+ );+}++const callsByRow: Record<string, SampleCall> = {+ triage: inviteTriage,+ 'check-in': launchCheckIn,+ announcement: announcementReview,+ pricing: pricingFeedback,+ weekly: weeklyPlanning,+ onboarding: onboardingWalkthrough,+ 'help-center': helpCenterReview,+ design: inviteDesignReview,+};++const earlierCalls: CallListRow[] = [{- person: 'jacob',- name: 'Jacob Beckerman',- time: '0:12',- text: 'Let’s confirm the last checks for Thursday’s launch.',+ id: 'check-in',+ title: 'Launch check-in',+ summary:+ 'Launch stays on Thursday. Teo checks both invite paths by Wednesday night.',+ status: 'attended',+ duration: '18m 22s',+ people: ['jacob', 'teo', 'julia'],+ time: '9:48 AM',},{- person: 'teo',- name: 'Teo Nys',- time: '0:48',- text: 'I’ll verify the invite flow before we publish. The handoff needs one final check.',+ id: 'announcement',+ title: 'Announcement review',+ summary: 'Julia walked through the draft. The pricing paragraph comes out.',+ status: 'attended',+ duration: '9m 41s',+ people: ['julia', 'jacob'],+ time: 'Yesterday',},{- person: 'julia',- name: 'Julia Westphal',- time: '1:24',- text: 'I’ll finish the announcement after Teo confirms the invite flow.',+ id: 'pricing',+ title: 'Pricing page feedback',+ summary: 'Keep the free plan above the fold. Gabriel tests the table.',+ status: 'attended',+ duration: '24m 10s',+ people: ['jacob', 'gabriel', 'julia'],+ time: 'Monday',+ },+ {+ id: 'weekly',+ title: 'Weekly planning',+ summary: 'Launch week. Teo pauses onboarding until the invite fix ships.',+ status: 'attended',+ duration: '31m 5s',+ people: ['jacob', 'julia', 'teo', 'gabriel'],+ time: 'Monday',+ },+ {+ id: 'onboarding',+ title: 'Onboarding walkthrough',+ summary: 'Teo showed the new invite screen. Gabriel wants one fewer step.',+ status: 'missed',+ duration: '16m 48s',+ people: ['teo', 'gabriel'],+ time: '09/18/26',+ },+ {+ id: 'help-center',+ title: 'Help center review',+ summary:+ 'Valentina drafted three articles. Julia links them from the post.',+ status: 'missed',+ duration: '14m 2s',+ people: ['valentina', 'julia'],+ time: '09/17/26',+ },+ {+ id: 'design',+ title: 'Invite screen design review',+ summary: 'Keep the team picker first. Teo removes the workspace name step.',+ status: 'attended',+ duration: '22m 40s',+ people: ['jacob', 'teo', 'julia'],+ time: '09/16/26',},];-/** Presentation from CallRecordingBody and CallTranscript; fictional local data. */-export function ProductCallRecord(props: {- transcriptOnly?: boolean;- selected?: string;- onSelect?: (time: string) => void;- onBack?: () => void;- onShare?: () => void;-}) {- const [localTime, setLocalTime] = createSignal('');+const triageRow: CallListRow = {+ id: 'triage',+ title: 'Invite bug triage',+ summary:+ 'Gabriel reproduced the invite bug on staging. Teo ships the fix today.',+ status: 'missed',+ duration: '12m 4s',+ people: ['teo', 'gabriel'],+ time: '11:02 AM',+};++const channelPeople: CallPerson[] = [+ 'jacob',+ 'julia',+ 'teo',+ 'gabriel',+ 'valentina',+];++/** The local side of one live call: devices, chat, and who has joined. */+function createCallSession(initial: RemoteTile[]) {+ const [joined, setJoined] = createSignal(false);+ const [connecting, setConnecting] = createSignal(false);+ const [remote, setRemote] = createSignal(initial);+ const [muted, setMuted] = createSignal(false);+ const [cameraOff, setCameraOff] = createSignal(false);+ const [background, setBackground] = createSignal(false);const [sharing, setSharing] = createSignal(false);- const selected = () => props.selected ?? localTime();- return (- <>- <ViewShell.TopBar>- <Show when={props.onBack}>- <Button- variant="plain"- size="icon-sm"- label="Back to channel calls"- onClick={props.onBack}- >- <ArrowLeft />- </Button>- </Show>- <PhoneCall class="size-4 text-ink-muted" />- <span class="text-sm font-medium">Launch check-in</span>- <Button- variant="plain"- size="sm"- class="ml-auto"- onClick={() => {- props.onShare?.();- setSharing(true);+ const [teamShare, setTeamShare] = createSignal(true);+ const [chatOpen, setChatOpen] = createSignal(false);+ const [chat, setChat] = createSignal<WorkspaceComment[]>([]);+ return {+ joined,+ setJoined: (value: boolean) => {+ setJoined(value);+ },+ connecting,+ setConnecting: (value: boolean) => {+ setConnecting(value);+ },+ remote,+ setRemote: (value: RemoteTile[]) => {+ setRemote(value);+ },+ view: (props: { onLeave: () => void; time: string }) => (+ <div class="call-tab-body">+ <CallOverlayView+ remote={remote()}+ you="jacob"+ connecting={connecting()}+ muted={muted()}+ cameraOff={cameraOff()}+ background={background()}+ sharing={sharing()}+ sharedWithTeam={teamShare()}+ chatOpen={chatOpen()}+ chat={chat()}+ onMute={() => setMuted(!muted())}+ onCamera={() => setCameraOff(!cameraOff())}+ onBackground={() => setBackground(!background())}+ onShareScreen={() => setSharing(!sharing())}+ onShareWithTeam={() => setTeamShare(!teamShare())}+ onChat={() => setChatOpen(!chatOpen())}+ onSendChat={(body) =>+ setChat((list) => [+ ...list,+ {+ id: `chat-${list.length}`,+ person: 'jacob',+ body,+ time: props.time,+ },+ ])+ }+ onLeave={() => {+ setJoined(false);+ setChatOpen(false);+ setSharing(false);+ props.onLeave();}}- >- <Share class="size-4" />- Share- </Button>- </ViewShell.TopBar>- <div class="dummy-scroll product-call-body">- <header>- <h1>Launch check-in</h1>- <p>- Sep 24, 2026 · 9:30 AM <span>·</span> 12m 18s- </p>- </header>- <Show when={!props.transcriptOnly}>- <section>- <h3>- Participants <span>3</span>- </h3>- <div class="product-call-participants">- <For each={['jacob', 'teo', 'julia'] as const}>- {(person) => (- <span>- <PersonIcon person={person} />- {person}@launch.example- </span>- )}- </For>- </div>- </section>- <section>- <h3>Summary</h3>- <p>- The team confirmed Thursday’s launch. Teo will verify the invite- flow; Julia will finish the announcement after that check. Jacob- will review the final checklist before publishing.- </p>- </section>- </Show>- <section>- <h3>Transcript</h3>- <div class="product-call-transcript">- <For each={transcript}>- {(segment) => (- <button- type="button"- class="product-call-segment"- aria-label={`Go to ${segment.time}: ${segment.name}`}- aria-pressed={selected() === segment.time}- onClick={() => {- setLocalTime(segment.time);- props.onSelect?.(segment.time);+ />+ </div>+ ),+ };+}++/**+ * ChannelDetail for #launch: the tab strip, the live call, its Calls tab,+ * and the call records it opens. Walkthroughs drive it through `state`.+ */+function LaunchChannel(props: {+ tab: Accessor<ChannelTab>;+ setTab: (tab: ChannelTab) => void;+ live: Accessor<boolean>;+ session: ReturnType<typeof createCallSession>;+ messages: Accessor<WorkspaceComment[]>;+ onSend: (body: string) => void;+ activeFor: Accessor<string>;+ rows: Accessor<CallListRow[]>;+ fresh?: Accessor<string | undefined>;+ opened: Accessor<string | undefined>;+ setOpened: (id: string | undefined) => void;+ time: string;+ interact: () => void;+}) {+ const [search, setSearch] = createSignal('');+ const s = props.session;+ const join = () => {+ props.interact();+ s.setConnecting(false);+ s.setJoined(true);+ props.setTab('call');+ };+ const record = () => {+ const id = props.opened();+ return id ? callsByRow[id] : undefined;+ };+ return (+ <Show+ when={record()}+ keyed+ fallback={+ <>+ <ChannelTopBar+ tab={props.tab()}+ onTab={(next) => {+ props.interact();+ props.setTab(next);+ }}+ live={props.live()}+ callButton={s.joined() ? undefined : props.live() ? 'join' : 'call'}+ onCall={join}+ />+ <div class="call-channel-body">+ <Switch+ fallback={+ <ChannelMessages+ messages={props.messages()}+ banner={+ <Show when={props.live() && !s.joined()}>+ <ActiveCallBanner+ duration={props.activeFor()}+ onJoin={join}+ />+ </Show>+ }+ onSend={props.onSend}+ />+ }+ >+ <Match when={props.tab() === 'call' && s.joined()}>+ {s.view({+ time: props.time,+ onLeave: () => props.setTab('messages'),+ })}+ </Match>+ <Match when={props.tab() === 'call'}>+ <JoinCallEmptyState+ people={s.remote().map((tile) => tile.person)}+ onJoin={join}+ />+ </Match>+ <Match when={props.tab() === 'calls'}>+ <ChannelCallsList+ rows={props.rows()}+ fresh={props.fresh?.()}+ search={search()}+ onSearch={setSearch}+ onOpen={(id) => {+ props.interact();+ props.setOpened(id);}}- >- <PersonIcon person={segment.person} />- <span>- <span class="product-call-speaker">- {segment.name}- <span>{segment.time}</span>- </span>- <span class="product-call-words">{segment.text}</span>- </span>- </button>- )}- </For>+ />+ </Match>+ <Match when={props.tab() === 'participants'}>+ <ChannelParticipants people={channelPeople} />+ </Match>+ <Match when={props.tab() === 'attachments'}>+ <p class="call-empty">No attachments yet.</p>+ </Match>+ </Switch></div>- </section>- </div>- <ProductShareDialog- open={sharing()}- title="Launch check-in"- kind="call"- onClose={() => setSharing(false)}+ </>+ }+ >+ {(call) => (+ <RecordPane+ call={call}+ onBack={() => {+ props.interact();+ props.setOpened(undefined);+ }}+ />+ )}+ </Show>+ );+}++function RecordPane(props: { call: SampleCall; onBack: () => void }) {+ const playback = createCallPlayback(props.call.duration);+ return (+ <>+ <CallRecordTopBar title={props.call.title} onBack={props.onBack} />+ <CallRecordBody+ call={props.call}+ playback={playback}+ transcriptHeight={360}+ class="call-record-compact"/></>);}-export function CallArchiveDemo(props: { animate?: boolean } = {}) {+const duringCall: WorkspaceComment[] = [+ {+ id: 'thursday',+ person: 'jacob',+ body: 'Launch is still Thursday at 9. If anything blocks it, say so in here.',+ time: '10:12 AM',+ },+ {+ id: 'help',+ person: 'valentina',+ body: 'Help center articles are drafted and linked in the launch plan.',+ time: '10:20 AM',+ },+ {+ id: 'draft',+ person: 'julia',+ body: 'Announcement draft is in the launch plan. Comments welcome.',+ time: '10:31 AM',+ },+ {+ id: 'repro',+ person: 'gabriel',+ body: 'I can reproduce the invite bug on staging. New accounts only.',+ time: '10:46 AM',+ },+ {+ id: 'hop-on',+ person: 'teo',+ body: '@[Gabriel Birman](demo-mention:gabriel) hop on a call? I want to see it before I touch sign-up.',+ time: '10:49 AM',+ },+];++const appendMessage =+ (+ set: (update: (list: WorkspaceComment[]) => WorkspaceComment[]) => void,+ time: string+ ) =>+ (body: string) =>+ set((list) => [+ ...list,+ { id: `sent-${list.length}`, person: 'jacob', body, time },+ ]);++/** Section 1: a live call ends and its record appears in the channel's Calls tab. */+export function CallDefaultDemo() {let root!: HTMLDivElement;- const [opened, setOpened] = createSignal(false);+ let frame!: HTMLDivElement;+ const [automatic, setAutomatic] = createSignal(true);+ const [phase, setPhase] = createSignal(0);+ const [live, setLive] = createSignal(true);+ const [activeFor, setActiveFor] = createSignal('12:03');+ const [tab, setTab] = createSignal<ChannelTab>('messages');+ const [opened, setOpened] = createSignal<string>();+ const [messages, setMessages] = createSignal(duringCall);+ const session = createCallSession([+ { person: 'gabriel', video: true, speaking: true },+ { person: 'teo', video: false },+ ]);+ const end = () => {+ setLive(false);+ if (tab() === 'call') setTab('messages');+ };+ const finish = () => {+ setAutomatic(false);+ end();+ setTab('calls');+ setOpened('triage');+ };const playback = createProductWalkthrough({root: () => root,- steps: 3,+ steps: 6,reset: () => {},- reduced: () => {- if (props.animate) setOpened(true);- },- advance: (s) => {- if (props.animate && s === 2) setOpened(true);+ reduced: finish,+ delay: (step) => [0, 1000, 1000, 1000, 400, 1100, 400][step] ?? 1000,+ advance: (step) => {+ setPhase(step);+ if (step === 1) setActiveFor('12:04');+ if (step === 2) end();+ if (step === 4) setTab('calls');+ if (step === 6) finish();},});+ const interact = () => {+ setAutomatic(false);+ playback.pause();+ };+ const pointer = createDemoPointer({+ frame: () => frame,+ active: automatic,+ target: () =>+ [+ undefined,+ undefined,+ '[data-channel-tab="calls"]',+ '[data-channel-tab="calls"]',+ '[data-call-row="triage"]',+ '[data-call-row="triage"]',+ ][phase()],+ });return (- <ProductDemo- ref={(el) => (root = el)}- label="Open a call from the channel’s Calls tab"- onInteract={playback.pause}- >- <Show- when={opened()}- fallback={- <>- <ViewShell.TopBar>- <span class="text-sm font-medium"># launch</span>- <span class="ml-4 text-xs text-ink-muted">Messages</span>- <span class="ml-3 text-xs text-ink-muted">Attachments</span>- <span class="ml-3 text-xs">Calls</span>- </ViewShell.TopBar>- <div class="dummy-scroll product-call-list">- <p>Channel calls</p>- <button type="button" onClick={() => setOpened(true)}>- <PhoneCall class="size-4 text-ink-muted" />- <span>- Launch check-in- <span class="text-xs text-ink-muted">launch · 12m 18s</span>- </span>- <span class="product-call-list-people">- <PersonIcon person="jacob" />- <PersonIcon person="teo" />- <PersonIcon person="julia" />- </span>- <span>Sep 24</span>- </button>- </div>- </>- }- >- <ProductCallRecord onBack={() => setOpened(false)} />- </Show>- </ProductDemo>+ <div ref={root} class="call-flow">+ <div ref={frame} class="call-flow-frame" onFocusIn={interact}>+ <ProductDemo+ label="A call ends and its recording appears in the channel"+ onInteract={interact}+ height={480}+ mobileHeight={620}+ >+ <LaunchChannel+ tab={tab}+ setTab={setTab}+ live={live}+ session={session}+ messages={messages}+ onSend={appendMessage(setMessages, '11:03 AM')}+ activeFor={activeFor}+ rows={() => (live() ? earlierCalls : [triageRow, ...earlierCalls])}+ fresh={() => (phase() >= 4 ? 'triage' : undefined)}+ opened={opened}+ setOpened={setOpened}+ time="10:58 AM"+ interact={interact}+ />+ </ProductDemo>+ <FlowPointer+ pointer={pointer}+ clicking={phase() === 3 || phase() === 5}+ />+ </div>+ </div>);}+/** Section 2: click a transcript line, the recording seeks, follow mode returns. */export function CallTranscriptDemo() {let root!: HTMLDivElement;- const [selected, setSelected] = createSignal('');+ let frame!: HTMLDivElement;+ let scroller!: HTMLDivElement;+ const [automatic, setAutomatic] = createSignal(true);+ const [phase, setPhase] = createSignal(0);+ const call = launchCheckIn;+ const player = createCallPlayback(call.duration);+ let transcript: TranscriptControls | undefined;+ let visitorScrolled = false;+ const decision = call.segments.find((segment) => segment.id === 'verify')!;+ const finish = () => {+ setAutomatic(false);+ if (player.seconds() !== decision.at) player.seek(decision.at);+ };const playback = createProductWalkthrough({root: () => root,- steps: 3,+ steps: 7,reset: () => {},- reduced: () => setSelected('0:48'),- advance: (s) => {- if (s === 2) setSelected('0:48');+ reduced: finish,+ delay: (step) => [0, 1000, 700, 350, 1300, 1100, 600, 350][step] ?? 1000,+ advance: (step) => {+ setPhase(step);+ if (step === 3) player.seek(decision.at);+ if (step === 4) transcript?.wheelAway();+ if (step === 7) {+ transcript?.resync();+ setAutomatic(false);+ }},});+ const interact = () => {+ setAutomatic(false);+ playback.pause();+ };+ const pointer = createDemoPointer({+ frame: () => frame,+ active: automatic,+ target: () =>+ [+ undefined,+ '[data-segment="verify"]',+ '[data-segment="verify"]',+ '[data-segment="verify"]',+ '.call-transcript-scroll',+ '[data-sync-video]',+ '[data-sync-video]',+ ][phase()],+ });+ // Opens scrolled to the recording's controls and the transcript.+ onMount(() => {+ const align = () => {+ if (visitorScrolled) return;+ const section = scroller.querySelector<HTMLElement>(+ '[data-call-section="transcript"]'+ );+ if (!section) return;+ const box = scroller.getBoundingClientRect();+ const bounds = section.getBoundingClientRect();+ scroller.scrollTop = Math.max(+ 0,+ scroller.scrollTop + bounds.bottom - box.bottom + 28+ );+ };+ const frameId = requestAnimationFrame(align);+ const resize = new ResizeObserver(align);+ resize.observe(scroller);+ const stop = () => {+ visitorScrolled = true;+ };+ scroller.addEventListener('wheel', stop);+ scroller.addEventListener('touchmove', stop);+ onCleanup(() => {+ cancelAnimationFrame(frameId);+ resize.disconnect();+ scroller.removeEventListener('wheel', stop);+ scroller.removeEventListener('touchmove', stop);+ });+ });return (- <ProductDemo- ref={(el) => (root = el)}- label="Return to the invite decision in the transcript"- onInteract={playback.pause}- >- <ProductCallRecord- transcriptOnly- selected={selected()}- onSelect={setSelected}- />- </ProductDemo>+ <div ref={root} class="call-flow">+ <div ref={frame} class="call-flow-frame" onFocusIn={interact}>+ <ProductDemo+ label="Jump to a moment from its transcript line"+ onInteract={interact}+ height={600}+ mobileHeight={660}+ >+ <CallRecordTopBar title={call.title} />+ <CallRecordBody+ call={call}+ playback={player}+ transcriptHeight={300}+ class="call-record-compact"+ scrollRef={(element) => {+ scroller = element;+ }}+ transcriptControls={(controls) => {+ transcript = controls;+ }}+ />+ </ProductDemo>+ <FlowPointer+ pointer={pointer}+ clicking={phase() === 2 || phase() === 6}+ />+ </div>+ </div>+ );+}++const inviteMention = {+ id: 'invite',+ label: 'Fix the team invite handoff',+ kind: 'task' as const,+ status: 'In Progress' as const,+};++/** ItemPreview inline in a tool row. */+function TaskChip() {+ return (+ <span class="call-item-chip">+ <ListChecks class="size-4 shrink-0 text-task" />+ <span class="truncate">Fix the team invite handoff</span>+ </span>);}+/** BaseTool in a tool group: icon, description, optional result toggle. */+function ToolRow(props: {+ icon: (props: JSX.SvgSVGAttributes<SVGSVGElement>) => JSX.Element;+ children: JSX.Element;+ status?: string;+}) {+ return (+ <div class="call-tool-row" data-tool-row>+ <props.icon class="size-4 shrink-0 text-ink-extra-muted" />+ <div class="call-tool-text">{props.children}</div>+ <Show when={props.status}>+ <span class="flex shrink-0 items-center gap-1 text-xs text-ink-extra-muted">+ {props.status}+ <CaretRight class="size-3" />+ </span>+ </Show>+ </div>+ );+}++const toolRows = [+ () => (+ <ToolRow icon={ListIcon} status="4 items">+ <span class="min-w-0 truncate">+ Filter for <span class="text-ink">call</span> ordered by{' '}+ <span class="text-ink">recently updated</span>+ </span>+ </ToolRow>+ ),+ () => (+ <ToolRow icon={Newspaper}>+ <span class="min-w-0 truncate">+ Read <span class="text-ink">call transcript</span>+ </span>+ </ToolRow>+ ),+ () => (+ <ToolRow icon={Newspaper}>+ <span class="shrink-0">+ Read <span class="text-ink">document</span>+ </span>+ <span class="shrink-0 text-ink-placeholder">·</span>+ <TaskChip />+ </ToolRow>+ ),+ () => (+ <ToolRow icon={PencilSimple}>+ <span class="shrink-0">Edit</span>+ <TaskChip />+ </ToolRow>+ ),+];++const callNote =+ 'From this morning’s launch check-in: Teo checks both invite paths on staging by Wednesday night. Julia holds the announcement until he confirms, then sends it Thursday morning.';++/** Section 3: @Macro reads the call and updates the task it was about. */export function CallFollowupDemo() {let root!: HTMLDivElement;const w = createDummyWorkspace('tasks');w.open('tasks', 'invite');- w.updateTask('invite', { owner: 'teo', status: 'Not Started' });- const finish = () =>+ const original = w.data.tasks.find((task) => task.id === 'invite')!;+ const description = original.description;+ w.updateTask('invite', { steps: [], comments: [] });+ const [tools, setTools] = createSignal(1);+ const [done, setDone] = createSignal(false);+ const [updated, setUpdated] = createSignal(false);+ const [open, setOpen] = createSignal(true);+ const [followups, setFollowups] = createSignal<string[]>([]);+ const update = () => {+ if (updated()) return;+ setUpdated(true);w.updateTask('invite', {- description:- 'From the launch check-in at 0:48: verify the invite flow before Thursday’s launch. Confirm the handoff before Julia finishes the announcement.',- owner: 'teo',- priority: 'High',- status: 'Not Started',+ description: `${description}\n\n${callNote}`,+ steps: [+ {+ id: 'new',+ text: 'New accounts land in the invited team',+ done: false,+ },+ { id: 'existing', text: 'Existing accounts switch teams', done: false },+ { id: 'post', text: 'Post in #launch when both pass', done: false },+ ],});+ };+ const finish = () => {+ setTools(4);+ update();+ setDone(true);+ };const playback = createProductWalkthrough({root: () => root,- steps: 3,+ steps: 4,reset: () => {},reduced: finish,- advance: (s) => {- if (s === 2) finish();+ delay: (step) => [0, 800, 800, 800, 1000][step] ?? 800,+ advance: (step) => {+ if (step <= 3) setTools(step + 1);+ if (step === 3) update();+ if (step === 4) finish();},});+ const task = () => w.data.tasks.find((item) => item.id === 'invite');return (- <div ref={root} onPointerDown={playback.pause} onKeyDown={playback.pause}>- <div class="product-demo-request">- <HomepageConversation- messages={[- {- person: 'jacob',- text: '@Claude, use the launch check-in to update Teo’s invite task with the agreement and the next step.',- },- ]}- />- </div>+ <div ref={root}><ProductDemo- label="Use the call agreement in a task"+ label="Ask @Macro to update a task from a call"onInteract={playback.pause}+ height={560}+ mobileHeight={880}>- <ProductWorkspace workspace={w} />+ <div class="call-split">+ <section class="call-pane call-agent-pane" aria-label="Agent session">+ <ViewShell.TopBar class="call-bar">+ <Sparkle class="size-4 shrink-0 text-ink-muted" />+ <span class="truncate text-sm font-medium">+ Update Teo’s invite task+ </span>+ </ViewShell.TopBar>+ <div class="dummy-scroll call-agent-log">+ <div class="flex w-full flex-col items-end gap-0.5">+ <UserMessageBubble>+ <span class="text-base">+ <DemoMentionText text="@[Macro](demo-mention:macro), use this morning’s launch check-in to update Teo’s invite task." />+ </span>+ </UserMessageBubble>+ </div>+ <div class="call-agent-reply">+ <Show when={tools() > 0}>+ <div class="min-w-0 text-sm leading-6 text-ink-extra-muted">+ <button+ type="button"+ aria-expanded={open()}+ class="call-tool-group group"+ onClick={() => {+ playback.pause();+ setOpen(!open());+ }}+ >+ <span+ classList={{ 'call-shimmer': !done() }}+ data-tool-title+ >+ {done() ? 'Called' : 'Calling'} {tools()}{' '}+ {tools() === 1 ? 'tool' : 'tools'}+ </span>+ <CaretRight+ aria-hidden="true"+ class="size-4 shrink-0 opacity-0 transition-transform group-hover:opacity-100"+ classList={{ 'rotate-90': open() }}+ />+ </button>+ <Show when={open()}>+ <div class="flex min-w-0 flex-col pl-6">+ <For each={toolRows.slice(0, tools())}>+ {(row) => row()}+ </For>+ </div>+ </Show>+ </div>+ </Show>+ <Show when={done()}>+ <div class="call-agent-text">+ Updated <DemoMention item={inviteMention} /> from the launch+ check-in. Teo checks both invite paths on staging by+ Wednesday night, and Julia holds the announcement until he+ confirms. I added both paths to the checklist.+ </div>+ </Show>+ </div>+ <For each={followups()}>+ {(text) => (+ <div class="mt-6 flex w-full flex-col items-end">+ <UserMessageBubble>{text}</UserMessageBubble>+ </div>+ )}+ </For>+ </div>+ <div class="dummy-composer call-agent-composer">+ <ChannelComposer+ agent+ richMentions+ label="Message the agent"+ placeholder="Message the agent, @mention anything"+ onSend={(text) => {+ playback.pause();+ finish();+ setFollowups((items) => [...items, text]);+ }}+ />+ </div>+ </section>+ <section+ class="call-pane call-task-pane"+ aria-label="Task"+ data-updated={updated() ? 'true' : undefined}+ >+ <Show+ when={+ w.contentView() === 'tasks' && w.selected() === 'invite'+ ? task()+ : undefined+ }+ fallback={<ProductWorkspace workspace={w} />}+ >+ {(item) => <TaskNotebook workspace={w} task={item()} />}+ </Show>+ </section>+ </div></ProductDemo></div>);}-export function CallSharingDemo() {+const joiners: RemoteTile[] = [+ { person: 'julia', video: true, speaking: true },+ { person: 'teo', video: false, muted: true },+ { person: 'gabriel', video: true },+];++const beforeCall: WorkspaceComment[] = [+ {+ id: 'help',+ person: 'valentina',+ body: 'Help center articles for the new invite flow are drafted.',+ time: '8:52 AM',+ },+ {+ id: 'thursday',+ person: 'jacob',+ body: 'Two days to launch. Anything still open?',+ time: '9:05 AM',+ },+ {+ id: 'staging',+ person: 'gabriel',+ body: 'Staging is green again. The invite flow still needs a second look.',+ time: '9:12 AM',+ },+ {+ id: 'draft',+ person: 'julia',+ body: 'Announcement draft is ready. Can we talk through the invite timing before I schedule it?',+ time: '9:20 AM',+ documentId: 'plan',+ },+ {+ id: 'around',+ person: 'teo',+ body: 'Yes, I’m around for the next half hour.',+ time: '9:24 AM',+ },+];++/** Section 4: Call in the channel header opens the call in the channel's Call tab. */+export function CallStartDemo() {+ let root!: HTMLDivElement;+ let frame!: HTMLDivElement;+ const [automatic, setAutomatic] = createSignal(true);+ const [phase, setPhase] = createSignal(0);+ const [tab, setTab] = createSignal<ChannelTab>('messages');+ const [live, setLive] = createSignal(false);+ const [opened, setOpened] = createSignal<string>();+ const [messages, setMessages] = createSignal(beforeCall);+ const session = createCallSession([]);+ const start = () => {+ setLive(true);+ session.setJoined(true);+ setTab('call');+ };+ const finish = () => {+ setAutomatic(false);+ start();+ session.setConnecting(false);+ session.setRemote(joiners);+ };+ const playback = createProductWalkthrough({+ root: () => root,+ steps: 5,+ reset: () => {},+ reduced: finish,+ delay: (step) => [0, 900, 700, 350, 1100, 1100][step] ?? 1000,+ advance: (step) => {+ setPhase(step);+ if (step === 3) {+ setAutomatic(false);+ session.setConnecting(true);+ start();+ }+ if (step === 4) {+ session.setConnecting(false);+ session.setRemote(joiners.slice(0, 2));+ }+ if (step === 5) finish();+ },+ });+ const interact = () => {+ setAutomatic(false);+ playback.pause();+ };+ const pointer = createDemoPointer({+ frame: () => frame,+ active: automatic,+ target: () =>+ [undefined, '[data-channel-call]', '[data-channel-call]'][phase()],+ });return (- <ProductDemo label="Give a teammate access to the call context">- <ProductCallRecord />- </ProductDemo>+ <div ref={root} class="call-flow">+ <div ref={frame} class="call-flow-frame" onFocusIn={interact}>+ <ProductDemo+ label="Start a call from the channel header"+ onInteract={interact}+ height={530}+ mobileHeight={600}+ >+ <LaunchChannel+ tab={tab}+ setTab={setTab}+ live={live}+ session={{+ ...session,+ // Starting the call from the header: everyone else joins after.+ setJoined: (value: boolean) => {+ if (value) {+ setLive(true);+ if (!session.remote().length) session.setRemote(joiners);+ }+ session.setJoined(value);+ },+ }}+ messages={messages}+ onSend={appendMessage(setMessages, '9:31 AM')}+ activeFor={() => '0:42'}+ rows={() => earlierCalls}+ opened={opened}+ setOpened={setOpened}+ time="9:31 AM"+ interact={interact}+ />+ </ProductDemo>+ <FlowPointer pointer={pointer} clicking={phase() === 2} />+ </div>+ </div>);}diff --git a/apps/marketing/src/features/marketing/components/calls/call-fixtures.ts b/apps/marketing/src/features/marketing/components/calls/call-fixtures.tsnew file mode 100644index 0000000000..82339e2dd2--- /dev/null+++ b/apps/marketing/src/features/marketing/components/calls/call-fixtures.ts@@ -0,0 +1,368 @@+import type { WorkspaceComment } from '../../core/dummy-workspace';++/** People who appear in the sample calls. */+export type CallPerson = 'jacob' | 'teo' | 'julia' | 'gabriel' | 'valentina';++/** Participant pills show `idToEmail(userId)` in the app. */+export const callEmail = (person: CallPerson) => `${person}@macro.com`;++export type CallSegment = {+ id: string;+ person: CallPerson;+ /** Seconds from the start of the recording. */+ at: number;+ text: string;+};++/** A tile in the recording's composite frame; `video: false` shows the avatar. */+export type CallPosterTile = { person: CallPerson; video: boolean };++export type SampleCall = {+ title: string;+ /** `MMM d, yyyy · h:mm a` of the call's end, as CallRecordingBody formats it. */+ ended: string;+ /** Duration in seconds. */+ duration: number;+ people: CallPerson[];+ summary: string;+ segments: CallSegment[];+ poster: CallPosterTile[];+ speaking?: CallPerson;+ chat?: WorkspaceComment[];+};++export const launchCheckIn: SampleCall = {+ title: 'Launch check-in',+ ended: 'Sep 24, 2026 · 9:48 AM',+ duration: 18 * 60 + 22,+ people: ['jacob', 'teo', 'julia'],+ summary: [+ '- **Launch stays on Thursday.** The invite handoff is the only open risk.',+ '- **Teo** checks both invite paths on staging by Wednesday night: new accounts, and existing accounts switching teams.',+ '- **Julia** holds the announcement until Teo confirms, then sends it Thursday morning.',+ '- **Jacob** owns the launch checklist and a five-minute check on Wednesday at 5.',+ ].join('\n'),+ segments: [+ {+ id: 'thursday',+ person: 'jacob',+ at: 4,+ text: 'Quick one. Are we still good for Thursday?',+ },+ {+ id: 'invite-risk',+ person: 'teo',+ at: 41,+ text: 'Almost. The invite fix is merged, but new accounts were still landing in their personal workspace yesterday.',+ },+ {+ id: 'hold',+ person: 'julia',+ at: 72,+ text: 'Then I’ll hold the announcement. It goes out Thursday morning once Teo says it works.',+ },+ {+ id: 'verify',+ person: 'teo',+ at: 98,+ text: 'I’ll check both invite paths on staging by Wednesday night and post in #launch when it’s done.',+ },+ {+ id: 'owners',+ person: 'jacob',+ at: 125,+ text: 'Good. Teo has the invite check, Julia has the announcement, and I’ll do the checklist.',+ },+ {+ id: 'help-doc',+ person: 'julia',+ at: 151,+ text: 'Can we add the new invite steps to the help doc too?',+ },+ {+ id: 'with-fix',+ person: 'teo',+ at: 164,+ text: 'Yes, I’ll update it with the fix.',+ },+ {+ id: 'wednesday',+ person: 'jacob',+ at: 190,+ text: 'Then we’re set. Five-minute check on Wednesday at 5.',+ },+ {+ id: 'final-draft',+ person: 'julia',+ at: 198,+ text: 'Works for me. I’ll bring the final draft.',+ },+ {+ id: 'staging-results',+ person: 'teo',+ at: 204,+ text: 'I’ll have the staging results by then.',+ },+ ],+ poster: [+ { person: 'jacob', video: true },+ { person: 'julia', video: true },+ { person: 'teo', video: false },+ ],+ speaking: 'julia',+ chat: [+ {+ id: 'draft-link',+ person: 'julia',+ body: 'The announcement draft is in the launch plan.',+ time: '9:37 AM',+ documentId: 'plan',+ },+ ],+};++export const inviteTriage: SampleCall = {+ title: 'Invite bug triage',+ ended: 'Sep 24, 2026 · 11:02 AM',+ duration: 12 * 60 + 4,+ people: ['teo', 'gabriel'],+ summary: [+ '- **Gabriel reproduced it on staging.** New accounts land in their personal workspace after accepting an invite. Existing accounts are fine.',+ '- **Cause:** sign-up drops the invited team when it creates the personal workspace.',+ '- **Teo** keeps the invited team selected through sign-up and ships the fix today. **Gabriel** re-tests both paths before Thursday.',+ ].join('\n'),+ segments: [+ {+ id: 'repro',+ person: 'gabriel',+ at: 3,+ text: 'I can reproduce it every time. New account, accept the invite, and you land in your personal workspace.',+ },+ {+ id: 'existing',+ person: 'teo',+ at: 29,+ text: 'Existing accounts too, or just new ones?',+ },+ {+ id: 'new-only',+ person: 'gabriel',+ at: 35,+ text: 'Just new ones. Existing accounts switch teams fine.',+ },+ {+ id: 'cause',+ person: 'teo',+ at: 62,+ text: 'Then sign-up is dropping the invited team. I’ll keep it selected through sign-up and ship it today.',+ },+ ],+ poster: [+ { person: 'gabriel', video: true },+ { person: 'teo', video: false },+ ],+ speaking: 'gabriel',+};++export function formatVideoTimestamp(totalSeconds: number) {+ const clamped = Math.max(0, Math.floor(totalSeconds));+ const hours = Math.floor(clamped / 3600);+ const minutes = Math.floor((clamped % 3600) / 60);+ const seconds = clamped % 60;+ if (hours > 0)+ return `${hours}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;+ return `${minutes}:${String(seconds).padStart(2, '0')}`;+}++/** `formatCallDuration` from block-call/utils. */+export function formatCallDuration(totalSeconds: number) {+ const hours = Math.floor(totalSeconds / 3600);+ const minutes = Math.floor((totalSeconds % 3600) / 60);+ const seconds = totalSeconds % 60;+ if (hours > 0) return `${hours}h ${minutes}m`;+ if (minutes > 0) return `${minutes}m ${seconds}s`;+ return `${seconds}s`;+}++export const announcementReview: SampleCall = {+ title: 'Announcement review',+ ended: 'Sep 23, 2026 · 4:12 PM',+ duration: 9 * 60 + 41,+ people: ['julia', 'jacob'],+ summary: [+ '- **Julia** walked through the draft. The pricing paragraph comes out; the product demo video stays.',+ '- **Jacob** reads the final version Wednesday night.',+ ].join('\n'),+ segments: [+ {+ id: 'draft',+ person: 'julia',+ at: 6,+ text: 'The draft is in the launch plan. I think the pricing paragraph is too much for day one.',+ },+ {+ id: 'cut',+ person: 'jacob',+ at: 31,+ text: 'Agreed, cut it. Keep the demo video at the top.',+ },+ ],+ poster: [+ { person: 'julia', video: true },+ { person: 'jacob', video: true },+ ],+ speaking: 'julia',+};++export const pricingFeedback: SampleCall = {+ title: 'Pricing page feedback',+ ended: 'Sep 21, 2026 · 2:30 PM',+ duration: 24 * 60 + 10,+ people: ['jacob', 'gabriel', 'julia'],+ summary: [+ '- Keep the free plan above the fold.',+ '- **Gabriel** tests the new comparison table with five customers this week.',+ ].join('\n'),+ segments: [+ {+ id: 'free',+ person: 'jacob',+ at: 12,+ text: 'People keep asking if there’s a free plan. It should be the first thing they see.',+ },+ {+ id: 'table',+ person: 'gabriel',+ at: 48,+ text: 'I’ll put the comparison table in front of five customers this week.',+ },+ ],+ poster: [+ { person: 'jacob', video: true },+ { person: 'gabriel', video: true },+ { person: 'julia', video: true },+ ],+ speaking: 'gabriel',+};++export const weeklyPlanning: SampleCall = {+ title: 'Weekly planning',+ ended: 'Sep 21, 2026 · 10:34 AM',+ duration: 31 * 60 + 5,+ people: ['jacob', 'julia', 'teo', 'gabriel'],+ summary: [+ '- Launch week. Invite handoff, announcement, and help docs are the only open items.',+ '- **Teo** pauses the onboarding work until the invite fix ships.',+ ].join('\n'),+ segments: [+ {+ id: 'week',+ person: 'jacob',+ at: 9,+ text: 'This week is the launch. Anything that isn’t the launch can wait.',+ },+ {+ id: 'pause',+ person: 'teo',+ at: 40,+ text: 'Then I’ll pause onboarding until the invite fix is out.',+ },+ ],+ poster: [+ { person: 'jacob', video: true },+ { person: 'julia', video: true },+ { person: 'gabriel', video: true },+ ],+ speaking: 'jacob',+};++export const onboardingWalkthrough: SampleCall = {+ title: 'Onboarding walkthrough',+ ended: 'Sep 18, 2026 · 3:15 PM',+ duration: 16 * 60 + 48,+ people: ['teo', 'gabriel'],+ summary: [+ '- **Teo** showed the new invite screen.',+ '- **Gabriel** wants one fewer step before someone opens their first doc.',+ ].join('\n'),+ segments: [+ {+ id: 'screen',+ person: 'teo',+ at: 5,+ text: 'This is the new invite screen. Pick a team, then you’re in.',+ },+ {+ id: 'steps',+ person: 'gabriel',+ at: 37,+ text: 'Can we drop the workspace name step? Most people skip it.',+ },+ ],+ poster: [+ { person: 'gabriel', video: true },+ { person: 'teo', video: false },+ ],+ speaking: 'teo',+};++export const helpCenterReview: SampleCall = {+ title: 'Help center review',+ ended: 'Sep 17, 2026 · 1:20 PM',+ duration: 14 * 60 + 2,+ people: ['valentina', 'julia'],+ summary: [+ '- **Valentina** drafted three articles for the new invite flow.',+ '- **Julia** links them from the announcement.',+ ].join('\n'),+ segments: [+ {+ id: 'articles',+ person: 'valentina',+ at: 8,+ text: 'There are three articles: inviting your team, switching teams, and fixing a wrong workspace.',+ },+ {+ id: 'link',+ person: 'julia',+ at: 33,+ text: 'I’ll link all three from the announcement.',+ },+ ],+ poster: [+ { person: 'julia', video: true },+ { person: 'valentina', video: false },+ ],+ speaking: 'valentina',+};++export const inviteDesignReview: SampleCall = {+ title: 'Invite screen design review',+ ended: 'Sep 16, 2026 · 11:45 AM',+ duration: 22 * 60 + 40,+ people: ['jacob', 'teo', 'julia'],+ summary: [+ '- Keep the team picker on the first screen.',+ '- **Teo** removes the workspace name step.',+ ].join('\n'),+ segments: [+ {+ id: 'picker',+ person: 'jacob',+ at: 14,+ text: 'The team picker should be the first thing you see after accepting.',+ },+ {+ id: 'remove',+ person: 'teo',+ at: 41,+ text: 'Agreed. I’ll take out the workspace name step.',+ },+ ],+ poster: [+ { person: 'jacob', video: true },+ { person: 'julia', video: true },+ { person: 'teo', video: false },+ ],+ speaking: 'jacob',+};diff --git a/apps/marketing/src/features/marketing/components/calls/call-stories.css b/apps/marketing/src/features/marketing/components/calls/call-stories.cssnew file mode 100644index 0000000000..8ded6d44ef--- /dev/null+++ b/apps/marketing/src/features/marketing/components/calls/call-stories.css@@ -0,0 +1,201 @@+/* Calls page: frozen call record, channel call states, and CallOverlay. */+.call-flow-frame { position: relative; }+.call-flow-pointer { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 9; transition: transform 600ms cubic-bezier(.2, .8, .2, 1); }++/* Top bars: labels drop to icons when the split header runs out of room. */+.call-bar { container-type: inline-size; }+.call-bar-action { gap: 8px; padding-inline: 8px; }+.call-tab { display: inline-flex; align-items: center; }+.call-tab-icon { display: none; }+.call-tab-text { display: inline-flex; align-items: center; gap: 6px; }+@container (max-width: 760px) {+ .call-tab-icon { display: block; }+ .call-tab-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }+ .call-channel-tabs label { padding-inline: 8px; }+}+@container (max-width: 480px) {+ .call-channel-bar { gap: 8px; }+ .call-channel-tabs label { padding-inline: 6px; }+ .call-bar-invite { display: none; }+}+@container (max-width: 600px) {+ .call-bar-label { display: none; }+ .call-bar-action { width: 32px; padding: 0; }+ .call-bar-copy { display: none; }+}++/* ChannelDetail content area (px-2) and its message timeline. */+.call-channel-body { display: flex; flex: 1; flex-direction: column; min-height: 0; padding-inline: 8px; }+.call-channel-log { display: flex; flex-direction: column; }+.call-channel-log > .sample-chat-log { margin: auto auto 0; }+.product-demo .call-channel-log > .sample-chat-log { padding-bottom: 8px; }+.call-channel-body .sample-chat-composer { margin-inline: auto; }+.call-banner { width: 100%; max-width: 944px; margin-inline: auto; padding-inline: 32px; }+.call-banner-grid { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; column-gap: 8px; padding: 8px 8px 0; }+.call-empty { padding: 56px 0; text-align: center; font-size: 14px; color: var(--color-ink-muted); }+.call-participants { padding: 16px 32px; }+.call-avatar-group { display: flex; padding-left: 8px; }+.call-avatar-group > img { width: 40px; height: 40px; margin-left: -8px; border-radius: 999px; object-fit: cover; box-shadow: 0 0 0 2px var(--color-panel); }++/* ChannelCallsTab with ListEntity's wide call rows. */+.call-calls-tab { display: flex; flex: 1; justify-content: center; min-height: 0; padding: 8px; }+.call-calls-width { display: flex; flex-direction: column; width: 100%; max-width: 944px; min-height: 0; container-type: inline-size; }+.call-calls-grid { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; }+.call-list-row { display: grid; grid-template-columns: 16px minmax(0, max-content) auto minmax(0, 1fr) auto 8ch; grid-template-areas: 'icon title channel summary meta time'; align-items: center; column-gap: 8px; width: calc(100% - 8px); min-height: 40px; margin-inline: 4px; padding: 2px 8px 2px 12px; border-radius: 12px; font-size: 14px; text-align: left; color: var(--color-ink); }+.call-list-row:hover { background: var(--color-hover); }+.call-list-row[data-fresh='true'] { animation: call-row-in 1600ms ease both; }+.call-list-icon { grid-area: icon; color: var(--color-ink-muted); }+.call-list-title { grid-area: title; }+.call-list-channel { grid-area: channel; }+.call-list-summary { grid-area: summary; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: color-mix(in oklch, var(--color-ink) 50%, transparent); }+.call-list-meta { grid-area: meta; display: flex; align-items: center; gap: 8px; margin-left: 4px; }+.call-list-people { display: flex; justify-content: flex-end; align-items: center; width: 44px; }+.call-list-people > img { width: 18px; height: 18px; margin-left: -5px; border-radius: 999px; object-fit: cover; box-shadow: 0 0 0 1.5px var(--color-panel); }+.call-list-people > span { margin-left: 3px; font-size: 11px; color: var(--color-ink-muted); }+.call-list-time { grid-area: time; text-align: right; font-size: 12px; color: var(--color-ink-extra-muted); white-space: nowrap; }+@keyframes call-row-in { 0% { background: color-mix(in oklch, var(--color-accent) 22%, transparent); } 100% { background: transparent; } }+/* CallNarrowBody: title and time, then duration and status, then the summary. */+@container (max-width: 560px) {+ .call-list-row { grid-template-columns: 16px minmax(0, 1fr) auto; grid-template-areas: 'icon title time' '. meta meta' '. summary summary'; row-gap: 2px; padding: 8px 10px; }+ .call-list-channel, .call-list-people { display: none; }+ .call-list-meta { margin-left: 0; }+ .call-list-summary { font-size: 12px; font-weight: 400; }+}++/* CallRecordingBody */+.call-record-scroll { position: relative; scrollbar-width: none; }+.call-record-column { max-width: 768px; min-width: 0; margin-inline: auto; padding: 48px 24px 64px; }+.call-record-compact .call-record-column { padding-top: 36px; }+.call-summary .md { font-size: 14px; line-height: 24px; }+.call-summary .md-list { margin-block: 0; }+.call-chat-history .sample-message-row { margin-bottom: 0; padding: 6px 12px; }+.call-chat-history .sample-message-row p { font-size: 14px; line-height: 22px; }++/* A frame of the room composite as the poster, with the browser's controls. */+.call-player { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 4px; background: #000; color: #fff; container-type: inline-size; }+.call-poster { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 6px; padding: 6px; background: #0c0d0e; }+.call-poster[data-count='3'] > :nth-child(3) { grid-column: 1 / span 2; justify-self: center; width: calc(50% - 3px); }+.call-poster-tile { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 4px; background: #1c1d20; }+.call-poster-tile[data-speaking='true']::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px #5b8def; }+.call-poster-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }+.call-poster-avatar { display: block; height: 42%; aspect-ratio: 1; }+.call-poster-avatar > img { width: 100%; height: 100%; border-radius: 999px; object-fit: cover; }+.call-poster-name { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: 3px; background: rgb(0 0 0 / .55); font: 500 11px/18px Inter, sans-serif; }+.call-player-controls { position: absolute; inset: auto 0 0; padding: 28px 12px 4px; background: linear-gradient(transparent, rgb(0 0 0 / .7)); }+.call-player-timeline { padding: 6px 0; cursor: pointer; outline: none; }+.call-player-timeline:focus-visible .call-player-track { box-shadow: 0 0 0 2px rgb(255 255 255 / .5); }+.call-player-track { position: relative; display: block; height: 4px; border-radius: 2px; background: rgb(255 255 255 / .32); }+.call-player-fill { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: #fff; transition: width 250ms ease; }+.call-player-thumb { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 999px; background: #fff; transform: translate(-50%, -50%); transition: left 250ms ease; }+.call-player-row { display: flex; align-items: center; gap: 8px; height: 34px; }+.call-player-button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; }+.call-player-button:hover { background: rgb(255 255 255 / .12); }+.call-player-button > svg { width: 18px; height: 18px; }+.call-player-time { font: 400 13px/1 Inter, sans-serif; font-variant-numeric: tabular-nums; }+.call-player-icons { display: flex; align-items: center; gap: 16px; margin-left: auto; padding-right: 6px; }+.call-player-icons > svg { width: 18px; height: 18px; }++@container (max-width: 420px) {+ .call-player-controls { padding: 14px 4px 0; }+ .call-player-timeline { padding: 3px 4px; }+ .call-player-thumb { width: 9px; height: 9px; }+ .call-player-row { height: 26px; gap: 4px; }+ .call-player-button { width: 24px; height: 24px; }+ .call-player-button > svg, .call-player-icons > svg { width: 14px; height: 14px; }+ .call-player-time { font-size: 11px; }+ .call-player-icons { gap: 10px; padding-right: 4px; }+ .call-player-icons > svg:not(:first-child) { display: none; }+ .call-poster-name { left: 4px; bottom: 4px; font-size: 9px; line-height: 14px; }+}++/* CallTranscript rows are channel messages: avatar, name, timestamp. */+.call-transcript-scroll { scrollbar-width: none; }+.call-transcript-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; column-gap: 8px; row-gap: 4px; width: 100%; padding: 10px 8px 6px; border-radius: 6px; text-align: left; color: var(--color-ink); }+.call-transcript-row:not([data-selected]):hover { background: var(--color-hover); }+.call-transcript-row[data-selected] { background: var(--color-active); }+.call-transcript-row[data-grouped='true'] { padding-top: 2px; }+.call-transcript-avatar { grid-row: span 2; width: 32px; height: 32px; border-radius: 999px; object-fit: cover; }+.call-transcript-text { grid-column: 2; font-size: 14px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }+.call-transcript-sync { position: absolute; inset: auto 1px 0; z-index: 20; display: flex; justify-content: center; padding: 16px 8px 8px; pointer-events: none; background-image: linear-gradient(transparent, var(--color-surface) 85%); }+.call-transcript-sync > button { position: relative; isolation: isolate; display: flex; align-items: center; height: 32px; padding: 0 8px; overflow: hidden; border: 1px solid color-mix(in oklch, var(--color-accent) 30%, transparent); background: var(--color-surface); color: var(--color-accent); font: 500 12px/20px ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; white-space: nowrap; pointer-events: auto; }+.call-transcript-sync > button::before { content: ''; position: absolute; inset: 0; z-index: -1; background: color-mix(in oklch, var(--color-accent) 10%, transparent); transition: background 150ms; }+.call-transcript-sync > button:hover::before { background: color-mix(in oklch, var(--color-accent) 20%, transparent); }++/* CallOverlay in the channel's Call tab. */+.call-tab-body { display: flex; flex: 1; flex-direction: column; min-height: 0; }+.call-camera { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }+.call-camera-mirror { transform: scaleX(-1); }+.call-tile[data-speaking='true']::after { content: ''; position: absolute; inset: 0; z-index: 5; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--color-accent); pointer-events: none; }+.call-tile > [role='status'], .call-tile > div:last-child { z-index: 6; }+.call-pip .call-tile { min-height: 0; }+.call-controls-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; padding-inline: 8px; }+.call-controls-center { display: flex; justify-content: center; min-width: 0; }+.call-control { border-radius: 999px; }+.call-control-danger { border: 1px solid var(--color-edge-button); }+.call-chat-panel { position: absolute; inset: 0 0 0 auto; z-index: 20; display: flex; flex-direction: column; width: 100%; max-width: 360px; min-height: 0; background: var(--color-surface); }+.call-chat-panel .sample-message-row { margin-bottom: 4px; }+@container call (min-width: 500px) {+ .call-controls-row { gap: 12px; padding-inline: 12px; }+}+@container call (min-width: 800px) {+ .call-controls-row { grid-template-columns: minmax(0, 1fr) minmax(0, 36rem) minmax(0, 1fr); }+ .call-controls-center { grid-column-start: 2; }+ .call-chat-panel { position: static; width: 360px; flex-shrink: 0; }+}+.call-team-share { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border: 1px solid color-mix(in oklch, var(--color-ink-muted) 8%, transparent); border-radius: 6px; background: color-mix(in oklch, var(--color-ink-muted) 2.5%, transparent); color: color-mix(in oklch, var(--color-ink-muted) 70%, transparent); font-size: 12px; user-select: none; }+.call-team-share:hover { color: var(--color-ink); background: color-mix(in oklch, var(--color-ink-muted) 6%, transparent); }+.call-team-share[aria-checked='true'] { color: var(--color-ink); }+.call-checkbox { display: grid; place-items: center; width: 14px; height: 14px; border: 1px solid var(--color-edge); border-radius: 4px; }+.call-checkbox > svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }+.call-checkbox[data-checked='true'] { border-color: var(--color-ink); background: var(--color-ink); color: var(--color-panel); }+.call-checkbox[data-checked='true'] > svg { opacity: 1; }+.call-screen-share { display: grid; gap: 10px; width: 52%; padding: 20px; border-radius: 6px; background: var(--color-panel); }+.call-screen-share > span { height: 8px; border-radius: 4px; background: var(--color-edge-muted); }+.call-screen-share > span:first-child { width: 40%; height: 12px; background: var(--color-edge); }+.call-screen-share > span:last-child { width: 70%; }++/* Agent session split beside the task it edits. */+.call-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); height: 100%; min-height: 0; }+.call-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }+.call-task-pane { border-left: 1px solid var(--color-edge-muted); }+.call-task-pane [data-view-shell-top-bar] > span { white-space: nowrap; }+.call-agent-log { display: flex; flex-direction: column; gap: 12px; padding: 24px 20px 12px; }+.call-agent-reply { display: flex; flex-direction: column; gap: 4px; min-width: 0; }+.call-agent-text { font-size: 15px; line-height: 24px; color: var(--color-ink); }+.call-agent-composer { padding: 8px 16px 16px; }+.call-tool-group { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 0; text-align: left; color: var(--color-ink-extra-muted); }+.call-tool-group:hover { color: var(--color-ink-muted); }+.call-tool-row { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 0; font-size: 14px; line-height: 24px; color: var(--color-ink-extra-muted); animation: call-tool-in 260ms ease both; }+.call-tool-text { display: flex; flex: 1; align-items: center; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; }+.call-item-chip { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; vertical-align: middle; color: var(--color-ink); }+.call-shimmer { background: linear-gradient(90deg, var(--color-ink-extra-muted) 30%, var(--color-ink) 50%, var(--color-ink-extra-muted) 70%) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: call-shimmer 1.6s linear infinite; }+.call-task-pane[data-updated='true'] [aria-label='Task description'], .call-task-pane[data-updated='true'] .md-check { animation: call-updated 2s ease both; border-radius: 4px; }+@keyframes call-shimmer { to { background-position: -200% 0; } }+@keyframes call-tool-in { from { opacity: 0; transform: translateY(3px); } }+@keyframes call-updated { 0%, 30% { background: color-mix(in oklch, var(--color-accent) 16%, transparent); } 100% { background: transparent; } }++@media (max-width: 699px) {+ .call-banner { padding-inline: 12px; }+ .call-participants { padding: 12px 16px; }+ .call-record-column, .call-record-compact .call-record-column { padding: 24px 14px 40px; }+ .call-record-column > .flex { gap: 32px; }+ .call-split { display: flex; flex-direction: column; }+ .call-agent-pane { flex: none; }+ .call-agent-composer { display: none; }+ .call-agent-log { padding: 18px 14px 14px; }+ .call-task-pane { flex: 1; border-top: 1px solid var(--color-edge-muted); border-left: 0; }+ .call-task-pane [data-view-shell-top-bar] { display: none; }+ .call-task-pane .pt-12 { padding-top: 20px; }+ .call-task-pane .px-6 { padding-inline: 16px; }+}+@media (prefers-reduced-motion: reduce) {+ .call-flow-pointer { display: none; }+ .call-list-row[data-fresh='true'], .call-tool-row, .call-task-pane[data-updated='true'] [aria-label='Task description'], .call-task-pane[data-updated='true'] .md-check { animation: none; }+ .call-shimmer { animation: none; color: var(--color-ink-extra-muted); background: none; }+ .call-player-fill, .call-player-thumb { transition: none; }+}++/* The hero's first description line is longer than Email's; keep it on one line. */+@media (min-width: 700px) {+ .product-page:has(#call-default) .email-page-hero > .email-page-hero-description { max-width: 640px; }+}diff --git a/apps/marketing/src/features/marketing/components/calls/demo-pointer.ts b/apps/marketing/src/features/marketing/components/calls/demo-pointer.tsnew file mode 100644index 0000000000..38653d90f3--- /dev/null+++ b/apps/marketing/src/features/marketing/components/calls/demo-pointer.ts@@ -0,0 +1,42 @@+import { createEffect, createSignal, onCleanup, onMount } from 'solid-js';++/**+ * Positions a DemoCursor over the element a walkthrough step targets,+ * measured relative to `frame` (the TaskCreationFlow approach).+ */+export function createDemoPointer(options: {+ frame: () => HTMLElement;+ target: () => string | undefined;+ active: () => boolean;+}) {+ const [pointer, setPointer] = createSignal<{ x: number; y: number }>();+ onMount(() => {+ const position = () => {+ const selector = options.target();+ const frame = options.frame();+ const target = selector+ ? frame.querySelector<HTMLElement>(selector)+ : undefined;+ if (!options.active() || !target) {+ setPointer(undefined);+ return;+ }+ const bounds = target.getBoundingClientRect();+ const parent = frame.getBoundingClientRect();+ setPointer({+ x: bounds.left - parent.left + Math.min(bounds.width / 2, 40),+ y: bounds.top - parent.top + bounds.height / 2,+ });+ };+ createEffect(() => {+ options.target();+ options.active();+ const frame = requestAnimationFrame(position);+ onCleanup(() => cancelAnimationFrame(frame));+ });+ const resize = new ResizeObserver(position);+ resize.observe(options.frame());+ onCleanup(() => resize.disconnect());+ });+ return pointer;+}diff --git a/apps/marketing/src/features/marketing/components/channels/ChannelStories.test.tsx b/apps/marketing/src/features/marketing/components/channels/ChannelStories.test.tsxnew file mode 100644index 0000000000..b016bf2176--- /dev/null+++ b/apps/marketing/src/features/marketing/components/channels/ChannelStories.test.tsx@@ -0,0 +1,148 @@+import { cleanup, fireEvent, render, within } from '@solidjs/testing-library';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import {+ ChannelAgentDemo,+ ChannelSharedWorkDemo,+ ChannelThreadDemo,+ ChatInboxDemo,+} from './ChannelStories';++let intersections: IntersectionObserverCallback[];+let motionListeners: (() => void)[];+let reduced = false;+let hidden = false;+beforeEach(() => {+ intersections = [];+ motionListeners = [];+ reduced = false;+ hidden = false;+ vi.useFakeTimers();+ vi.stubGlobal('fetch', vi.fn());+ vi.spyOn(document, 'hidden', 'get').mockImplementation(() => hidden);+ vi.stubGlobal('matchMedia', () => ({+ get matches() {+ return reduced;+ },+ addEventListener: (_: string, callback: () => void) =>+ motionListeners.push(callback),+ removeEventListener: vi.fn(),+ }));+ vi.stubGlobal(+ 'IntersectionObserver',+ class {+ constructor(callback: IntersectionObserverCallback) {+ intersections.push(callback);+ }+ observe() {}+ disconnect() {}+ }+ );+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+});+afterEach(() => {+ cleanup();+ vi.advanceTimersByTime(100);+ expect(fetch).not.toHaveBeenCalled();+ expect(vi.getTimerCount()).toBe(0);+ vi.useRealTimers();+ vi.restoreAllMocks();+ vi.unstubAllGlobals();+});+function visible(value: boolean) {+ for (const callback of intersections)+ callback(+ [{ isIntersecting: value } as IntersectionObserverEntry],+ {} as IntersectionObserver+ );+}+function reduce() {+ reduced = true;+ for (const callback of motionListeners) callback();+}+it('shows the first replies inline and expands the rest from the pill', () => {+ const view = render(() => <ChannelThreadDemo />);+ const thread = view.container.querySelector(+ '[data-thread-id="root"]'+ ) as HTMLElement;+ expect(within(thread).getByText(/Lead with the invite flow/)).toBeTruthy();+ expect(within(thread).queryByText(/publishing at 9/)).toBeNull();+ fireEvent.click(within(thread).getByText('2 more replies'));+ expect(within(thread).getByText(/publishing at 9/)).toBeTruthy();+});++it('adds a reply to its original thread rather than a new channel message', () => {+ const view = render(() => <ChannelThreadDemo />);+ const thread = () =>+ view.container.querySelector('[data-thread-id="root"]') as HTMLElement;+ fireEvent.click(within(thread()).getByText('2 more replies'));+ fireEvent.click(+ within(thread()).getByRole('button', { name: 'Reply in thread' })+ );+ const input = within(thread()).getByRole('textbox', {+ name: 'Thread reply',+ });+ input.textContent = 'Confirmed. Keep the invite flow first.';+ fireEvent.input(input);+ fireEvent.click(+ within(thread()).getByRole('button', { name: 'Send demo message' })+ );+ expect(+ within(thread()).getByText('Confirmed. Keep the invite flow first.')+ ).toBeTruthy();+ expect(+ view.container.querySelectorAll('.sample-channel-thread')+ ).toHaveLength(2);+});++it('clears Home items with E and keeps the rest for later', () => {+ const view = render(() => <ChatInboxDemo />);+ visible(true);+ vi.advanceTimersByTime(900);+ expect(+ view.container.querySelector('[data-home-item="launch-thread"]')+ ).toBeTruthy();+ vi.advanceTimersByTime(3200);+ expect(+ view.container.querySelector('[data-home-item="launch-thread"]')+ ).toBeNull();+ expect(view.container.querySelector('[data-home-item="dm-teo"]')).toBeNull();+ expect(+ view.container.querySelector('[data-home-item="invite-task"]')+ ).toBeTruthy();+ fireEvent.click(view.getByRole('button', { name: 'Mark unread (U)' }));+ expect(+ view.container.querySelector(+ '[data-home-item="dana"] [aria-label="Unread"]'+ )+ ).toBeTruthy();+});++it('opens the mentioned doc from the channel', () => {+ reduced = true;+ const view = render(() => <ChannelSharedWorkDemo />);+ expect(view.getByRole('textbox', { name: 'Document body' })).toBeTruthy();+});++it('answers in the channel with the tasks it is talking about', () => {+ const view = render(() => <ChannelAgentDemo />);+ const log = within(view.getByRole('log', { name: 'Channel launch' }));+ expect(log.queryByText(/Nothing else is blocked/)).toBeNull();+ visible(true);+ vi.advanceTimersByTime(1400);+ expect(log.getByText(/Nothing else is blocked/)).toBeTruthy();+ expect(log.getByText('Fix the team invite handoff')).toBeTruthy();+ expect(log.getByText('Prepare the launch checklist')).toBeTruthy();+});++it('shows the agent answer for reduced motion', () => {+ reduce();+ const view = render(() => <ChannelAgentDemo />);+ expect(view.getByText(/Nothing else is blocked/)).toBeTruthy();+});diff --git a/apps/marketing/src/features/marketing/components/channels/ChannelStories.tsx b/apps/marketing/src/features/marketing/components/channels/ChannelStories.tsxindex 7aa97bca3b..ec5f375bb1 100644--- a/apps/marketing/src/features/marketing/components/channels/ChannelStories.tsx+++ b/apps/marketing/src/features/marketing/components/channels/ChannelStories.tsx@@ -1,177 +1,600 @@-import Sidebar from '@phosphor/sidebar-simple.svg';-import { createMediaQuery } from '@solid-primitives/media';-import { createSignal, Show } from 'solid-js';+import Reply from '@phosphor/arrow-bend-up-left.svg';+import ChatTeardrop from '@phosphor/chat-teardrop.svg';+import Envelope from '@phosphor/envelope.svg';+import Hash from '@phosphor/hash.svg';+import ListChecks from '@phosphor/list-checks.svg';+import Plus from '@phosphor/plus.svg';+import {+ type Component,+ createEffect,+ createSignal,+ For,+ type JSX,+ onCleanup,+ onMount,+ Show,+} from 'solid-js';+import { Dynamic } from 'solid-js/web';+import type { WorkspaceView } from '../../core/dummy-workspace';+import { homepagePeople } from '../../core/homepage-demo-people';import { createDummyWorkspace } from '../../primitives/createDummyWorkspace';import { createProductWalkthrough } from '../../primitives/createProductWalkthrough';+import { DemoCursor } from '../DemoCursor';+import { ViewSidebar } from '../DemoViewSidebar';import { ProductDemo } from '../product/ProductPage';import { ProductWorkspace } from '../product/ProductWorkspace';-import { TaskFromMessageDemo } from '../tasks/TaskStories';-import { WorkspaceSidebar } from '../workspace/WorkspaceSidebar';import '../workspace/dummy-workspace.css';+import './channel-stories.css';-export { TaskFromMessageDemo as ChannelTaskDemo };+/** Measures `selector` inside `frame` and returns the cursor's tip position. */+function createCursorTarget(+ frame: () => HTMLElement | undefined,+ selector: () => string | undefined+) {+ const [point, setPoint] = createSignal<{ x: number; y: number }>();+ onMount(() => {+ const measure = () => {+ const root = frame();+ const query = selector();+ const target = query+ ? root?.querySelector<HTMLElement>(query)+ : undefined;+ if (!root || !target) return setPoint(undefined);+ const bounds = target.getBoundingClientRect();+ const parent = root.getBoundingClientRect();+ setPoint({+ x: bounds.left - parent.left + Math.min(bounds.width / 2, 48),+ y: bounds.top - parent.top + bounds.height / 2,+ });+ };+ createEffect(() => {+ selector();+ const id = requestAnimationFrame(measure);+ onCleanup(() => cancelAnimationFrame(id));+ });+ const observer = new ResizeObserver(measure);+ const root = frame();+ if (root) observer.observe(root);+ onCleanup(() => observer.disconnect());+ });+ return point;+}+/** @mention a doc in a channel; a new member opens it with no access request. */export function ChannelSharedWorkDemo() {let root!: HTMLDivElement;+ let frame: HTMLDivElement | undefined;const w = createDummyWorkspace('messages');w.setData('channels', (c) => c.id === 'launch', 'messages', [+ {+ id: 'staging',+ person: 'gabriel',+ body: 'Staging is green. Invite flow and email replies both pass.',+ time: '9:02 AM',+ },{id: 'plan-request',person: 'julia',- body: 'Here’s the Thursday launch plan. Can you check the owners before we share it?',+ body: 'Here’s the plan for Thursday. Everyone check your part before we share it with the team.',time: '9:15 AM',documentId: 'plan',},{- id: 'plan-reply',- person: 'teo',- body: 'I’ll check the invite flow and add the last details there.',- time: '9:17 AM',+ id: 'welcome',+ person: 'jacob',+ body: 'Welcome to #launch @[Teo](demo-mention:teo). Everything we’ve linked here is yours to open.',+ time: '9:21 AM',},]);- const open = () => w.open('documents', 'plan');+ w.open('messages', 'launch');+ const [step, setStep] = createSignal(0);+ const [automatic, setAutomatic] = createSignal(true);+ const open = () => {+ setStep(2);+ setAutomatic(false);+ w.open('documents', 'plan');+ };const playback = createProductWalkthrough({root: () => root,- steps: 3,+ steps: 2,reset: () => {},reduced: open,+ delay: (next) => (next === 1 ? 1200 : 1500),+ advance: (next) => {+ if (next === 2) open();+ else setStep(next);+ },+ });+ const pointer = createCursorTarget(+ () => frame,+ () =>+ automatic() && step() === 1+ ? '[data-thread-id="plan-request"] .dummy-entity-link'+ : undefined+ );+ return (+ <div ref={frame} class="channel-demo-frame">+ <ProductDemo+ ref={(el) => (root = el)}+ label="Open a document someone mentioned in the channel"+ onInteract={() => {+ setAutomatic(false);+ playback.pause();+ }}+ height={500}+ mobileHeight={600}+ >+ <ProductWorkspace workspace={w} />+ </ProductDemo>+ <Show when={pointer()}>+ {(p) => (+ <DemoCursor+ label="Teo"+ class="channel-demo-cursor"+ style={{ transform: `translate(${p().x}px, ${p().y}px)` }}+ />+ )}+ </Show>+ </div>+ );+}++type InboxRow = {+ id: string;+ group: 'Today' | 'Yesterday';+ icon?: Component<JSX.SvgSVGAttributes<SVGSVGElement>>;+ person?: keyof typeof homepagePeople;+ title: JSX.Element;+ time: string;+ unread?: boolean;+ view: WorkspaceView;+ item: string;+ thread?: string;+};++const inboxRows: InboxRow[] = [+ {+ id: 'launch-thread',+ group: 'Today',+ icon: Reply,+ title: (+ <>+ <span class="shrink-0">Julia</span>+ <span class="shrink-0 whitespace-pre"> in </span>+ <span class="truncate">#launch</span>+ </>+ ),+ time: '9:41 AM',+ unread: true,+ view: 'messages',+ item: 'launch',+ thread: 'm1',+ },+ {+ id: 'dm-teo',+ group: 'Today',+ person: 'teo',+ title: 'Teo',+ time: '9:32 AM',+ unread: true,+ view: 'messages',+ item: 'dm-teo',+ },+ {+ id: 'dana',+ group: 'Today',+ icon: Envelope,+ title: 'Next steps for our team',+ time: '9:20 AM',+ unread: true,+ view: 'email',+ item: 'dana',+ },+ {+ id: 'invite-task',+ group: 'Today',+ icon: ListChecks,+ title: 'Fix the team invite handoff',+ time: '9:05 AM',+ view: 'tasks',+ item: 'invite',+ },+ {+ id: 'engineers',+ group: 'Yesterday',+ icon: Hash,+ title: 'engineers',+ time: 'Sep 28',+ view: 'messages',+ item: 'engineers',+ },+ {+ id: 'plan-comment',+ group: 'Yesterday',+ icon: ChatTeardrop,+ title: (+ <>+ <span class="shrink-0">Gabriel</span>+ <span class="shrink-0 whitespace-pre"> commented on </span>+ <span class="truncate">Q3 launch plan</span>+ </>+ ),+ time: 'Sep 28',+ view: 'documents',+ item: 'plan',+ },+ {+ id: 'design',+ group: 'Yesterday',+ icon: Hash,+ title: 'design',+ time: 'Sep 28',+ view: 'messages',+ item: 'design',+ },+];++/** features/home on desktop: Home header, New chat, date groups, E = Mark done. */+export function ChatInboxDemo() {+ let root!: HTMLDivElement;+ const w = createDummyWorkspace('messages');+ const [rows, setRows] = createSignal(inboxRows);+ const [selected, setSelected] = createSignal<string>();+ const [key, setKey] = createSignal<string>();+ const select = (id: string | undefined) => {+ setSelected(id);+ const row = rows().find((r) => r.id === id);+ if (!row) return;+ w.open(row.view, row.item);+ if (row.view === 'messages') {+ w.setChannel(row.item);+ w.setChannelThread(row.thread);+ }+ setRows((list) =>+ list.map((r) => (r.id === id ? { ...r, unread: false } : r))+ );+ };+ const done = () => {+ const list = rows();+ const index = list.findIndex((r) => r.id === selected());+ if (index < 0) return;+ const next = list[index + 1] ?? list[index - 1];+ setRows(list.filter((r) => r.id !== selected()));+ select(next?.id);+ };+ const press = (next: string) => {+ setKey(next);+ if (next === 'e') done();+ if (next === 'u')+ setRows((list) =>+ list.map((r) => (r.id === selected() ? { ...r, unread: true } : r))+ );+ if (next === 'j' || next === 'k') {+ const list = rows();+ const index = list.findIndex((r) => r.id === selected());+ const target = list[index + (next === 'j' ? 1 : -1)] ?? list[index];+ select(target?.id);+ }+ };+ const playback = createProductWalkthrough({+ root: () => root,+ steps: 4,+ reset: () => {},+ reduced: () => {+ setRows(inboxRows.slice(2));+ select('dana');+ },+ delay: (step) => [0, 900, 1600, 1500, 1500][step] ?? 1400,advance: (step) => {- if (step === 2) open();+ if (step === 1) {+ setKey(undefined);+ select('launch-thread');+ }+ if (step === 2 || step === 3) press('e');+ if (step === 4) setKey(undefined);},});+ const pause = () => playback.pause();return (- <ProductDemo- ref={(el) => (root = el)}- label="Open a document shared in a channel"- onInteract={playback.pause}- >- <ProductWorkspace workspace={w} />- </ProductDemo>+ <div class="chat-inbox-demo">+ <ProductDemo+ ref={(el) => (root = el)}+ label="Messages wait in Home until you mark them done"+ onInteract={pause}+ height={520}+ mobileHeight={600}+ >+ <div+ class="product-sidebared-scene chat-inbox-scene"+ tabIndex={0}+ role="group"+ aria-label="Home"+ onKeyDown={(event) => {+ const next = event.key.toLowerCase();+ if (['e', 'u', 'j', 'k'].includes(next)) {+ event.preventDefault();+ pause();+ press(next);+ }+ }}+ >+ <ViewSidebar.Root aria-label="Home" class="chat-inbox-list">+ <ViewSidebar.Header>+ <ViewSidebar.Title>Home</ViewSidebar.Title>+ </ViewSidebar.Header>+ <ViewSidebar.Primary>+ <ViewSidebar.Action onClick={() => pause()}>+ <ViewSidebar.Icon>+ <Plus />+ </ViewSidebar.Icon>+ New chat+ </ViewSidebar.Action>+ </ViewSidebar.Primary>+ <ViewSidebar.Content>+ <For each={['Today', 'Yesterday'] as const}>+ {(group) => (+ <Show when={rows().some((r) => r.group === group)}>+ <p class="chat-inbox-group">{group}</p>+ <ViewSidebar.Nav>+ <For each={rows().filter((r) => r.group === group)}>+ {(row) => (+ <ViewSidebar.Item+ class="group/home-item chat-inbox-row"+ active={selected() === row.id}+ data-home-item={row.id}+ onClick={() => {+ pause();+ select(row.id);+ }}+ >+ <Show+ when={row.person}+ fallback={+ <ViewSidebar.Icon>+ <Dynamic component={row.icon} />+ </ViewSidebar.Icon>+ }+ >+ {(person) => (+ <img+ class="size-5 shrink-0 rounded-full"+ src={homepagePeople[person()].photo}+ alt=""+ />+ )}+ </Show>+ <span+ class="flex min-w-0 flex-1 items-center truncate"+ classList={{ 'text-ink': row.unread }}+ >+ {row.title}+ </span>+ <span class="chat-inbox-time">{row.time}</span>+ <Show when={row.unread}>+ <span+ aria-label="Unread"+ class="size-1.5 shrink-0 rounded-full bg-accent"+ />+ </Show>+ </ViewSidebar.Item>+ )}+ </For>+ </ViewSidebar.Nav>+ </Show>+ )}+ </For>+ </ViewSidebar.Content>+ </ViewSidebar.Root>+ <div class="dummy-main chat-inbox-preview">+ <Show+ when={selected()}+ fallback={+ <p class="chat-inbox-empty">Select something to read it.</p>+ }+ >+ <ProductWorkspace workspace={w} />+ </Show>+ </div>+ </div>+ </ProductDemo>+ <div class="chat-shortcut-dock" aria-label="Home shortcuts">+ <For+ each={+ [+ { key: 'j', label: 'Next' },+ { key: 'k', label: 'Previous' },+ { key: 'e', label: 'Mark done' },+ { key: 'u', label: 'Mark unread' },+ ] as const+ }+ >+ {(shortcut) => (+ <button+ type="button"+ data-active={key() === shortcut.key}+ onClick={() => {+ pause();+ if (!selected()) select(rows()[0]?.id);+ else press(shortcut.key);+ }}+ aria-label={`${shortcut.label} (${shortcut.key.toUpperCase()})`}+ >+ <kbd>{shortcut.key.toUpperCase()}</kbd>+ {shortcut.label}+ </button>+ )}+ </For>+ </div>+ </div>+ );+}++const threadReplies = [+ {+ id: 'reply-1',+ person: 'teo' as const,+ body: 'Yes. Lead with the invite flow, that’s what changes for existing teams.',+ time: '9:32 AM',+ },+ {+ id: 'reply-2',+ person: 'jacob' as const,+ body: 'Agreed. And link the rollout doc for anyone moving a whole team over.',+ time: '9:34 AM',+ },+ {+ id: 'reply-3',+ person: 'gabriel' as const,+ body: 'I’ll grab screenshots of the new invite screen this afternoon.',+ time: '9:36 AM',+ },+ {+ id: 'reply-4',+ person: 'teo' as const,+ body: 'Screenshot of the existing-account path is in the doc now.',+ time: '9:51 AM',+ },+ {+ id: 'reply-5',+ person: 'julia' as const,+ body: 'Perfect, publishing at 9 on Thursday.',+ time: '9:55 AM',+ },+];++/** Inline replies with the curved rail and the "N more replies" pill. */+export function ChannelThreadDemo() {+ let root!: HTMLDivElement;+ let frame: HTMLDivElement | undefined;+ const w = createDummyWorkspace('messages');+ w.setData('channels', (c) => c.id === 'launch', 'messages', [+ {+ id: 'root',+ person: 'julia',+ body: 'Can we confirm the announcement wording before Thursday?',+ time: '9:30 AM',+ documentId: 'plan',+ },+ ...threadReplies.map((reply) => ({ ...reply, replyTo: 'root' })),+ {+ id: 'next',+ person: 'valentina',+ body: 'Northwind wants a demo of the team workspace next week. Who can take it?',+ time: '10:02 AM',+ },+ ]);+ w.open('messages', 'launch');+ const [aim, setAim] = createSignal(false);+ const expand = () => {+ setAim(false);+ frame+ ?.querySelector<HTMLButtonElement>(+ '[data-thread-id="root"] .sample-thread-expand'+ )+ ?.click();+ };+ const playback = createProductWalkthrough({+ root: () => root,+ steps: 2,+ reset: () => {},+ reduced: () => {},+ delay: (step) => (step === 1 ? 1000 : 1500),+ advance: (step) => {+ if (step === 1) setAim(true);+ if (step === 2) expand();+ },+ });+ const pointer = createCursorTarget(+ () => frame,+ () => (aim() ? '[data-thread-id="root"] .sample-thread-expand' : undefined)+ );+ return (+ <div ref={frame} class="channel-demo-frame">+ <ProductDemo+ ref={(el) => (root = el)}+ label="Read a thread inline and expand the rest"+ onInteract={() => {+ setAim(false);+ playback.pause();+ }}+ height={600}+ mobileHeight={700}+ >+ <ProductWorkspace workspace={w} />+ </ProductDemo>+ <Show when={pointer()}>+ {(p) => (+ <DemoCursor+ label="Jacob"+ class="channel-demo-cursor"+ style={{ transform: `translate(${p().x}px, ${p().y}px)` }}+ />+ )}+ </Show>+ </div>);}+/** @Macro answers in the channel from what the team has said and linked. */export function ChannelAgentDemo() {let root!: HTMLDivElement;const w = createDummyWorkspace('messages');const initial = [{- id: 'decision',+ id: 'invite',person: 'teo' as const,- body: 'The invite fix is in progress. I’m taking it; Julia has the announcement. The launch is Thursday.',+ body: 'Invite fix is up for review. New and existing accounts both land in the right team now.',time: '9:20 AM',},+ {+ id: 'announcement',+ person: 'julia' as const,+ body: 'Announcement is drafted. I’ll send it as soon as the invite fix merges.',+ time: '9:24 AM',+ },{id: 'catchup',person: 'jacob' as const,- body: '@Claude, catch me up on the launch decisions and who owns the work.',+ body: '@[Macro](demo-mention:macro) I was out yesterday. Catch me up on the launch: who owns what, and is anything blocked?',time: '9:28 AM',},];w.setData('channels', (c) => c.id === 'launch', 'messages', initial);- const finish = () =>+ w.open('messages', 'launch');+ const finish = () => {w.setData('channels', (c) => c.id === 'launch', 'messages', [...initial,{id: 'agent-summary',- person: 'claude',- body: 'Thursday’s launch is the target. Teo owns the invite fix; Julia owns the announcement. The invite task is still in progress.',- time: '9:29 AM',- taskId: 'invite',+ person: 'macro',+ body: 'Launch is Thursday at 9. Teo’s invite fix is in review, Julia’s announcement is ready and waiting on that fix, and the launch checklist is yours. Nothing else is blocked.',+ time: '9:28 AM',+ taskIds: ['invite', 'announcement', 'checklist'],},]);+ // Like a new message arriving, keep the latest reply in view.+ requestAnimationFrame(() => {+ const log = root?.querySelector<HTMLElement>('[role="log"]');+ if (log) log.scrollTop = log.scrollHeight;+ });+ };const playback = createProductWalkthrough({root: () => root,- steps: 3,+ steps: 1,reset: () => {},reduced: finish,- advance: (s) => {- if (s === 2) finish();- },+ delay: () => 1300,+ advance: finish,});return (<ProductDemoref={(el) => (root = el)}- label="Catch up with an agent using the channel context"+ label="Ask the Macro agent to catch you up in the channel"onInteract={playback.pause}+ height={600}+ mobileHeight={720}><ProductWorkspace workspace={w} /></ProductDemo>);}--export function ChannelThreadDemo() {- const w = createDummyWorkspace('messages');- w.setData('channels', (c) => c.id === 'launch', 'messages', [- {- id: 'root',- person: 'julia',- body: 'Can we confirm the announcement wording here before publishing?',- time: '9:30 AM',- documentId: 'plan',- },- {- id: 'reply-1',- person: 'teo',- body: 'Yes. Keep the invite flow in the first paragraph.',- time: '9:32 AM',- replyTo: 'root',- },- {- id: 'reply-2',- person: 'jacob',- body: 'Agreed. The team should see what changes for them.',- time: '9:34 AM',- replyTo: 'root',- },- {- id: 'next',- person: 'julia',- body: 'The product demo is ready too. I’ll add it to the launch plan.',- time: '9:38 AM',- },- ]);- return (- <ProductDemo label="Expand a thread and reply in place">- <ProductWorkspace workspace={w} />- </ProductDemo>- );-}--export function ChannelNavigationDemo() {- const [collapsed, setCollapsed] = createSignal(false);- const mobile = createMediaQuery('(max-width: 699px)');- const w = createDummyWorkspace('messages');- return (- <ProductDemo label="Find channels and direct messages">- <div class="product-sidebared-scene">- <Show when={!collapsed()}>- <WorkspaceSidebar- workspace={w}- title="Chat"- collapse={() => setCollapsed(true)}- create={() => {}}- navigate={(view, id) => {- w.open(view, id);- if (mobile()) setCollapsed(true);- }}- taskFilter="all"- setTaskFilter={() => {}}- />- </Show>- <div class="dummy-main">- <Show when={collapsed()}>- <button- type="button"- aria-label="Show chat navigation"- class="px-4 py-2 text-left"- onClick={() => setCollapsed(false)}- >- <Sidebar class="size-4" />- </button>- </Show>- <ProductWorkspace workspace={w} />- </div>- </div>- </ProductDemo>- );-}diff --git a/apps/marketing/src/features/marketing/components/channels/channel-stories.css b/apps/marketing/src/features/marketing/components/channels/channel-stories.cssnew file mode 100644index 0000000000..bdd73dee91--- /dev/null+++ b/apps/marketing/src/features/marketing/components/channels/channel-stories.css@@ -0,0 +1,33 @@+.channel-demo-frame { position: relative; }+.channel-demo-cursor { z-index: 9; transition: transform 600ms cubic-bezier(.2,.8,.2,1); }++/* features/home on desktop: a ViewSidebar with a Home header, New chat, and date groups. */+.chat-inbox-scene { outline: none; }+.chat-inbox-list { flex: 0 0 300px; width: 300px; min-width: 0; border-right: 1px solid var(--color-edge-muted); background: var(--color-panel); overflow: hidden; }+.chat-inbox-group { padding: 2px 16px 2px 8px; font-size: 12px; font-weight: 600; letter-spacing: -0.01em; color: color-mix(in srgb, var(--color-ink-extra-muted) 80%, transparent); }+.chat-inbox-list [data-view-sidebar-content] { gap: 4px; }+.chat-inbox-row { animation: chat-inbox-in 240ms ease both; }+.chat-inbox-time { display: none; flex-shrink: 0; font-size: 12px; color: var(--color-ink-extra-muted); }+.chat-inbox-row:hover .chat-inbox-time { display: block; }+.chat-inbox-preview { flex: 1; min-width: 0; }+.chat-inbox-empty { margin: auto; color: var(--color-ink-muted); font-size: 13px; }+@keyframes chat-inbox-in { from { opacity: 0; } }++/* The email page's shortcut legend, reused for Home. */+.chat-shortcut-dock { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; padding: 8px 0 0; color: #a3a3a3; }+.chat-shortcut-dock > button { display: flex; align-items: center; gap: 8px; padding: 6px; font: 400 12px/1.5 'Inter Variable', Inter, sans-serif; color: #a3a3a3; transition: color 160ms ease; }+.chat-shortcut-dock > button:hover, .chat-shortcut-dock > button[data-active='true'] { color: #f0f0f0; }+.chat-shortcut-dock kbd { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 6px; border-radius: 8px; background: linear-gradient(#242528, #191a1c); box-shadow: inset 0 1px #ffffff24, inset 0 0 0 1px #ffffff09, 0 3px 0 #080809; color: #b9bbc0; font: 400 12px Inter, sans-serif; transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease; }+.chat-shortcut-dock > button[data-active='true'] kbd { background: #d8e0da; color: #151916; box-shadow: inset 0 1px #ffffff66, 0 1px 0 #080809; }++@media (max-width: 699px) {+ .chat-inbox-list { flex-basis: 100%; width: 100%; border-right: 0; }+ .chat-inbox-preview { display: none; }+ .chat-shortcut-dock { gap: 4px; }+ .chat-shortcut-dock > button { flex-direction: column; font-size: 10px; }+}+@media (prefers-reduced-motion: reduce) {+ .chat-inbox-row { animation: none; }+ .channel-demo-cursor, .chat-shortcut-dock > button, .chat-shortcut-dock kbd { transition: none; }+}+.chat-inbox-group:not(:first-child) { margin-top: 16px; }diff --git a/apps/marketing/src/features/marketing/components/crm/CrmCaptureDemo.test.tsx b/apps/marketing/src/features/marketing/components/crm/CrmCaptureDemo.test.tsxindex a1814abc0f..6135fc1113 100644--- a/apps/marketing/src/features/marketing/components/crm/CrmCaptureDemo.test.tsx+++ b/apps/marketing/src/features/marketing/components/crm/CrmCaptureDemo.test.tsx@@ -1,23 +1,19 @@-import { cleanup, fireEvent, render } from '@solidjs/testing-library';+import { cleanup, fireEvent, render, within } from '@solidjs/testing-library';import { afterEach, beforeEach, expect, it, vi } from 'vitest';import { CrmCaptureDemo } from './CrmCaptureDemo';-let visible: IntersectionObserverCallback;+let intersections: IntersectionObserverCallback[];let reduced = false;beforeEach(() => {- vi.useFakeTimers();+ intersections = [];reduced = false;+ vi.useFakeTimers();vi.stubGlobal('fetch', vi.fn());- vi.stubGlobal(- 'ResizeObserver',- class {- observe() {}- disconnect() {}- }- );vi.spyOn(document, 'hidden', 'get').mockReturnValue(false);vi.stubGlobal('matchMedia', () => ({- matches: reduced,+ get matches() {+ return reduced;+ },addEventListener: vi.fn(),removeEventListener: vi.fn(),}));@@ -25,112 +21,110 @@ beforeEach(() => {'IntersectionObserver',class {constructor(callback: IntersectionObserverCallback) {- visible = callback;+ intersections.push(callback);}observe() {}disconnect() {}});+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );});afterEach(() => {cleanup();+ vi.advanceTimersByTime(100);expect(fetch).not.toHaveBeenCalled();- vi.clearAllTimers();+ expect(vi.getTimerCount()).toBe(0);vi.useRealTimers();vi.restoreAllMocks();vi.unstubAllGlobals();});-function setVisible(isIntersecting: boolean) {- visible(- [{ isIntersecting } as IntersectionObserverEntry],- {} as IntersectionObserver- );+function visible(value: boolean) {+ for (const callback of intersections)+ callback(+ [{ isIntersecting: value } as IntersectionObserverEntry],+ {} as IntersectionObserver+ );}+const stage = (view: ReturnType<typeof render>) =>+ view.getByRole('button', { name: 'Change Stage' }).textContent;+const owner = (view: ReturnType<typeof render>) =>+ view.getByRole('button', { name: 'Change Owner' }).textContent;-it('updates the shared company fields from the message and pauses offscreen', () => {+it('lets Claude set the stage and owner, then answer in the Discussion thread', () => {const view = render(() => <CrmCaptureDemo />);- const stage = view.getByLabelText('Deal stage') as HTMLSelectElement;- const owner = view.getByLabelText('Company owner') as HTMLSelectElement;- const notes = view.getByLabelText(- 'Company description'- ) as HTMLTextAreaElement;+ expect(view.getByText(/just got off a call with Dana/)).toBeTruthy();+ expect(stage(view)).toContain('Lead');+ expect(owner(view)).toContain('Empty');vi.advanceTimersByTime(10000);- expect(stage.value).toBe('Lead');- expect(owner.value).toBe('');- setVisible(true);- vi.advanceTimersByTime(2800);- expect(stage.value).toBe('Demo');- setVisible(false);+ expect(stage(view)).toContain('Lead');+ visible(true);+ vi.advanceTimersByTime(1900);+ expect(stage(view)).toContain('Demo');+ expect(owner(view)).toContain('Empty');+ visible(false);vi.advanceTimersByTime(10000);- expect(owner.value).toBe('');- setVisible(true);- vi.advanceTimersByTime(1400);- expect(owner.value).toBe('jacob');- vi.advanceTimersByTime(5600);- expect(notes.value).toBe(- 'Demo on Thursday. Alex is leading the rollout for The Meadow.'+ expect(owner(view)).toContain('Empty');+ visible(true);+ vi.advanceTimersByTime(1900);+ expect(owner(view)).toContain('Jacob');+ expect(view.queryByText(/The Meadow is in Demo/)).toBeNull();+ vi.advanceTimersByTime(1900);+ const thread = view.container.querySelector<HTMLElement>(+ '[data-thread-id="capture-request"]');expect(- view.getByText(- 'Updated The Meadow: demo stage, assigned to you, and Alex’s role saved in the company notes.'- )+ within(thread!).getByText(/The Meadow is in Demo and you’re the owner/)).toBeTruthy();- expect(- view.queryByRole('button', { name: /replay|pause|play crm/i })- ).toBeNull();- expect(vi.getTimerCount()).toBe(0);+ expect(within(thread!).getByText('Agent')).toBeTruthy();+ expect(view.container.querySelector('.demo-cursor')).toBeNull();});-it('keeps user edits instead of overwriting them with the walkthrough', () => {+it('stops the walkthrough when a visitor takes over the record', () => {const view = render(() => <CrmCaptureDemo />);- setVisible(true);- vi.advanceTimersByTime(2800);- const notes = view.getByLabelText(- 'Company description'- ) as HTMLTextAreaElement;- fireEvent.focusIn(notes);- fireEvent.input(notes, { target: { value: 'My own next steps.' } });+ visible(true);+ vi.advanceTimersByTime(900);+ fireEvent.pointerDown(+ view.getByRole('group', {+ name: 'Claude updates The Meadow from a comment in its Discussion',+ })+ );vi.advanceTimersByTime(20000);- expect(notes.value).toBe('My own next steps.');- expect(- (view.getByLabelText('Company owner') as HTMLSelectElement).value- ).toBe('');+ expect(stage(view)).toContain('Lead');+ expect(owner(view)).toContain('Empty');+ expect(view.queryByText(/The Meadow is in Demo/)).toBeNull();+ expect(view.container.querySelector('.demo-cursor')).toBeNull();});-it('shows the completed record immediately with reduced motion', () => {+it('shows the updated record and the reply at once with reduced motion', () => {reduced = true;const view = render(() => <CrmCaptureDemo />);- setVisible(true);- expect((view.getByLabelText('Deal stage') as HTMLSelectElement).value).toBe(- 'Demo'- );- expect(- (view.getByLabelText('Company owner') as HTMLSelectElement).value- ).toBe('jacob');- expect(- (view.getByLabelText('Company description') as HTMLTextAreaElement).value- ).toBe('Demo on Thursday. Alex is leading the rollout for The Meadow.');- vi.advanceTimersByTime(10000);- expect(vi.getTimerCount()).toBe(0);+ expect(stage(view)).toContain('Demo');+ expect(owner(view)).toContain('Jacob');+ expect(view.getByText(/The Meadow is in Demo/)).toBeTruthy();+ expect(view.container.querySelector('.demo-cursor')).toBeNull();});-it('opens the linked email and returns to the same customer record', () => {+it('posts a visitor’s comment and thread reply in the company Discussion', () => {const view = render(() => <CrmCaptureDemo />);- fireEvent.click(- view.getByRole('button', {- name: 'Dana Whitfield Next steps for our team 9:41 AM',- })- );- expect(- view.getByRole('button', { name: 'Back to customer record' })- ).toBeTruthy();- expect(- view.getByRole('heading', { name: 'Next steps for our team' })- ).toBeTruthy();- fireEvent.click(- view.getByRole('button', { name: 'Back to customer record' })- );- expect((view.getByLabelText('Company name') as HTMLInputElement).value).toBe(- 'The Meadow'+ const comment = view.getByRole('textbox', { name: 'Comment on company' });+ expect(comment.getAttribute('placeholder')).toBe('Leave a comment...');+ fireEvent.input(comment, { target: { value: 'Dana confirmed 12 seats.' } });+ fireEvent.keyDown(comment, { key: 'Enter' });+ expect(view.getByText('Dana confirmed 12 seats.')).toBeTruthy();+ const thread = view.container.querySelector<HTMLElement>(+ '[data-thread-id="capture-request"]');+ fireEvent.click(within(thread!).getByRole('button', { name: 'Reply' }));+ const reply = view.getByRole('textbox', { name: 'Thread reply' });+ expect(reply.getAttribute('placeholder')).toBe('Send a reply');+ fireEvent.input(reply, { target: { value: 'On it.' } });+ fireEvent.keyDown(reply, { key: 'Enter' });+ expect(within(thread!).getByText('On it.')).toBeTruthy();});diff --git a/apps/marketing/src/features/marketing/components/crm/CrmCaptureDemo.tsx b/apps/marketing/src/features/marketing/components/crm/CrmCaptureDemo.tsxindex e102cad2a6..ad04e4dabe 100644--- a/apps/marketing/src/features/marketing/components/crm/CrmCaptureDemo.tsx+++ b/apps/marketing/src/features/marketing/components/crm/CrmCaptureDemo.tsx@@ -1,183 +1,138 @@-import ArrowLeft from '@phosphor/arrow-left.svg';-import Cursor from '@phosphor/cursor.svg';-import { Button } from '@ui';-import { createSignal, onCleanup, onMount, Show } from 'solid-js';+import { createEffect, createSignal, onCleanup, onMount, Show } from 'solid-js';+import type { WorkspaceComment } from '../../core/dummy-workspace';+import type { SampleCompany } from '../../core/workspace-fixtures';import { createDummyWorkspace } from '../../primitives/createDummyWorkspace';-import { createEmailWalkthrough } from '../../primitives/createEmailWalkthrough';-import { HomepageConversation } from '../HomepageConversation';-import { WorkspaceEmail } from '../workspace/WorkspaceEmail';-import '../email/email-demos.css';-import { WorkspaceCompanies } from '../workspace/WorkspaceCompanies';-import '../workspace/dummy-workspace.css';+import { createProductWalkthrough } from '../../primitives/createProductWalkthrough';+import { DemoCursor } from '../DemoCursor';+import { ProductDemo } from '../product/ProductPage';+import { CrmRecordWorkspace } from './CrmRecordWorkspace';-const description =- 'Demo on Thursday. Alex is leading the rollout for The Meadow.';+const request: WorkspaceComment = {+ id: 'capture-request',+ person: 'jacob',+ body: '@[Claude](demo-mention:claude) just got off a call with Dana. They want a demo Thursday at 9 for the studio team. Move The Meadow to Demo, make me the owner, and note that Alex Chen is running the rollout on their side.',+ time: '9:51 AM',+};+const reply: WorkspaceComment = {+ id: 'capture-reply',+ person: 'claude',+ body: 'Done. The Meadow is in Demo and you’re the owner. From the call: demo Thursday at 9 with the studio team, and Alex Chen ([email protected]) is running the rollout on their side.',+ time: '9:52 AM',+ replyTo: 'capture-request',+};-/** The shared /demo company UI, with a local message-driven walkthrough. */+/**+ * @Claude in a company's Discussion: the agent sets Stage and Owner through+ * the property tools and answers in the thread. Phases: 0 request, 1 Stage,+ * 2 Stage set, 3 Owner, 4 Owner set, 5 thread, 6 reply.+ */export function CrmCaptureDemo() {- let root!: HTMLDivElement;- let record!: HTMLDivElement;- const workspace = createDummyWorkspace('crm');- workspace.open('crm', 'meadow');- workspace.setData('companies', (company) => company.id === 'meadow', {- stage: 'Lead',- owner: '',- description: '',- revenue: '',- comments: [],- });- const [step, setStep] = createSignal(0);+ let frame!: HTMLDivElement;+ const w = createDummyWorkspace('crm');+ const meadow = (patch: Partial<SampleCompany>) =>+ w.setData('companies', (company) => company.id === 'meadow', patch);+ meadow({ stage: 'Lead', owner: '', comments: [request] });+ w.open('crm', 'meadow');+ const [phase, setPhase] = createSignal(0);+ const [automatic, setAutomatic] = createSignal(true);const [pointer, setPointer] = createSignal<{ x: number; y: number }>();- const target = () =>- step() < 3- ? 'Deal stage'- : step() < 4- ? 'Company owner'- : 'Company description';- function positionPointer() {- const field = record?.querySelector<HTMLElement>(- `[aria-label="${target()}"]`- );- if (- !playback.playing() ||- !field ||- !field.getClientRects().length ||- step() === 0 ||- step() >= 7- ) {- setPointer(undefined);- return;- }- const bounds = field.getBoundingClientRect();- const frame = record.getBoundingClientRect();- setPointer({- x: bounds.left - frame.left + Math.min(bounds.width - 12, 110),- y: bounds.top - frame.top + bounds.height / 2,- });- }- function advance(next: number) {- setStep(next);- const patch =- next === 2- ? { stage: 'Demo' as const }- : next === 3- ? { owner: 'jacob' as const }- : next >= 4- ? {- description: description.slice(- 0,- next === 4 ? 17 : next === 5 ? 43 : description.length- ),- }- : {};- workspace.setData('companies', (company) => company.id === 'meadow', patch);- positionPointer();- }- const playback = createEmailWalkthrough({- root: () => root,- steps: 7,- advance,- reset: () => setStep(0),+ const finish = () => {+ meadow({ stage: 'Demo', owner: 'jacob', comments: [request, reply] });+ setPhase(6);+ };+ const playback = createProductWalkthrough({+ root: () => frame,+ steps: 6,+ reset: () => {},reduced: () => {- workspace.setData('companies', (company) => company.id === 'meadow', {- stage: 'Demo',- owner: 'jacob',- description,- });- setStep(7);+ setAutomatic(false);+ finish();+ },+ delay: (step) => [0, 900, 900, 1000, 900, 1000, 900][step] ?? 1000,+ advance: (step) => {+ if (step === 2) meadow({ stage: 'Demo' });+ if (step === 4) meadow({ owner: 'jacob' });+ if (step === 6) {+ finish();+ setAutomatic(false);+ // Like a chat, the record scrolls to the new reply when it lands+ // below the fold (or under the phone's details sheet).+ requestAnimationFrame(() => {+ const scroll = frame.querySelector('.sample-company-scroll');+ scroll?.scrollTo?.({ top: scroll.scrollHeight, behavior: 'smooth' });+ });+ } else setPhase(step);},});- const takeOver = () => {+ const pause = () => {+ setAutomatic(false);playback.pause();- setPointer(undefined);};+ const action = () =>+ phase() === 1 || phase() === 2+ ? 'stage'+ : phase() === 3 || phase() === 4+ ? 'owner'+ : undefined;onMount(() => {- const observer = new ResizeObserver(positionPointer);- observer.observe(record);- onCleanup(() => observer.disconnect());+ const position = () => {+ const selector = [+ undefined,+ '[data-company-property="stage"]',+ '[data-company-property="stage"]',+ '[data-company-property="owner"]',+ '[data-company-property="owner"]',+ '[data-thread-id="capture-request"] .sample-message-row',+ ][phase()];+ const target = selector+ ? frame.querySelector<HTMLElement>(selector)+ : undefined;+ if (!automatic() || !target) {+ setPointer(undefined);+ return;+ }+ const bounds = target.getBoundingClientRect();+ const parent = frame.getBoundingClientRect();+ const thread = phase() === 5;+ setPointer({+ x: bounds.left - parent.left + (thread ? 56 : bounds.width * 0.6),+ y:+ bounds.top -+ parent.top ++ (thread ? bounds.height + 18 : bounds.height / 2),+ });+ };+ createEffect(() => {+ phase();+ automatic();+ const timer = requestAnimationFrame(position);+ onCleanup(() => cancelAnimationFrame(timer));+ });+ const resize = new ResizeObserver(position);+ resize.observe(frame);+ onCleanup(() => resize.disconnect());});return (- <div- ref={root}- class="crm-capture-demo"- role="group"- aria-label="Claude updates a customer record from a message"- >- <HomepageConversation- messages={[- {- person: 'jacob',- text: 'Just spoke to Dana at The Meadow. They’re ready for a demo on Thursday. Assign the company to me and note that Alex is leading the rollout.',- },- {- person: 'claude',- text:- step() >= 7- ? 'Updated The Meadow: demo stage, assigned to you, and Alex’s role saved in the company notes.'- : 'I’ll update the stage, owner, and notes on The Meadow.',- },- ]}- />- <div- ref={record}- class="crm-capture-record crm-record-demo glass-input"- data-step={step()}- onPointerDown={takeOver}- onFocusIn={takeOver}+ <div ref={frame} class="crm-demo-frame" onFocusIn={pause}>+ <ProductDemo+ label="Claude updates The Meadow from a comment in its Discussion"+ onInteract={pause}+ action={action()}+ height={600}+ mobileHeight={700}>- <div- class="dummy-workspace workspace-demo portal-scope"- data-theme="dark"- data-embedded="true"- >- <div class="dummy-main">- <Show- when={workspace.view() === 'crm'}- fallback={- <>- <div class="px-3 pt-2">- <Button- variant="plain"- size="sm"- onClick={() => workspace.open('crm', 'meadow')}- >- <ArrowLeft />- Back to customer record- </Button>- </div>- <WorkspaceEmail- workspace={workspace}- tab="all"- account="all"- />- </>- }- >- <WorkspaceCompanies- workspace={workspace}- initialPanelOpen={- typeof window !== 'undefined' &&- window.matchMedia('(min-width: 700px)').matches- }- />- </Show>- </div>- </div>- <Show when={pointer()}>- {(position) => (- <div- class="crm-capture-pointer"- aria-hidden="true"- style={{- transform: `translate(${position().x}px, ${position().y}px)`,- }}- >- <Cursor />- <span>Claude</span>- </div>- )}- </Show>- </div>+ <CrmRecordWorkspace workspace={w} initialPanelOpen />+ </ProductDemo>+ <Show when={automatic() && pointer()}>+ {(p) => (+ <DemoCursor+ label="Claude"+ class="crm-demo-pointer"+ clicking={phase() === 2 || phase() === 4}+ style={{ transform: `translate(${p().x}px, ${p().y}px)` }}+ />+ )}+ </Show></div>);}diff --git a/apps/marketing/src/features/marketing/components/crm/CrmComparison.tsx b/apps/marketing/src/features/marketing/components/crm/CrmComparison.tsxindex c3058a2c47..ba67528867 100644--- a/apps/marketing/src/features/marketing/components/crm/CrmComparison.tsx+++ b/apps/marketing/src/features/marketing/components/crm/CrmComparison.tsx@@ -7,35 +7,35 @@ import {const comparisonRows: ComparisonRow[] = [{- feature: 'Builds itself from your email (no data entry)',+ feature: 'Companies and contacts created from your email',cells: [true, false, 'partial', 'partial'],},{- feature: 'Automatic company enrichment',+ feature: 'Company descriptions filled in automatically',cells: [true, 'partial', true, true],},{- feature: 'Discussion threads on every record',+ feature: 'Threaded discussion on every company',cells: [true, 'partial', 'partial', false],},{- feature: '@mention records in docs, tasks & chat',+ feature: '@mention companies in docs, tasks, and chat',cells: [true, false, false, false],},{- feature: 'One customer view across email, calls, docs & tasks',+ feature: 'Emails, calls, files, and tasks on the record',cells: [true, 'partial', 'partial', false],},{- feature: 'Built-in email, calls, docs & tasks',+ feature: 'Email, calls, docs, and tasks in the same app',cells: [true, 'partial', 'partial', false],},{- feature: 'Agents with full-workspace context',+ feature: 'Agents can also read your email, calls, and docs',cells: [true, 'partial', 'partial', 'partial'],},{- feature: 'Unified search across everything',+ feature: 'One search across email, chat, docs, and customers',cells: [true, false, false, false],},{ feature: 'Open source (AGPLv3)', cells: [true, false, false, false] },diff --git a/apps/marketing/src/features/marketing/components/crm/CrmConnectedWorkDemo.tsx b/apps/marketing/src/features/marketing/components/crm/CrmConnectedWorkDemo.tsxdeleted file mode 100644index 134decd2ea..0000000000--- a/apps/marketing/src/features/marketing/components/crm/CrmConnectedWorkDemo.tsx+++ /dev/null@@ -1,188 +0,0 @@-import ArrowUpRight from '@phosphor/arrow-up-right.svg';-import Buildings from '@phosphor/buildings.svg';-import File from '@phosphor/file-text.svg';-import Hash from '@phosphor/hash.svg';-import { createSignal, Show } from 'solid-js';-import { homepagePeople } from '../../core/homepage-demo-people';-import { createEmailWalkthrough } from '../../primitives/createEmailWalkthrough';--/** A company mention opens the same sample record from a plan or a conversation. */-export function CrmConnectedWorkDemo() {- let root!: HTMLDivElement;- const [context, setContext] = createSignal<'plan' | 'chat'>('plan');- const [opened, setOpened] = createSignal(false);- const [highlighted, setHighlighted] = createSignal(false);- const playback = createEmailWalkthrough({- root: () => root,- steps: 3,- advance: (step) => {- setHighlighted(step === 1);- if (step >= 2) setOpened(true);- },- reset: () => {- setHighlighted(false);- setOpened(false);- },- reduced: () => setOpened(true),- });- const changeContext = (value: 'plan' | 'chat') => {- playback.pause();- setContext(value);- setHighlighted(false);- };- const openRecord = () => {- playback.pause();- setOpened(true);- setHighlighted(false);- };- const mention = () => (- <button- type="button"- class="crm-company-mention"- data-highlighted={highlighted()}- aria-label="Open The Meadow customer record"- aria-controls="crm-linked-record"- aria-expanded={opened()}- onClick={openRecord}- >- <Buildings />- The Meadow- <ArrowUpRight />- </button>- );- return (- <div- ref={root}- class="crm-connected-demo crm-editorial-window glass-input"- role="group"- aria-label="A customer record linked from documents and team chat"- >- <div- class="crm-editorial-toolbar crm-context-picker"- role="group"- aria-label="Choose a sample context"- >- <button- type="button"- aria-pressed={context() === 'plan'}- onClick={() => changeContext('plan')}- >- <File />- Rollout plan- </button>- <button- type="button"- aria-pressed={context() === 'chat'}- onClick={() => changeContext('chat')}- >- <Hash />- Customer team- </button>- </div>- <div class="crm-connected-body">- <div class="crm-linked-context">- <Show- when={context() === 'plan'}- fallback={- <div class="crm-linked-chat">- <div class="crm-chat-author">- <img src={homepagePeople.julia.photo} alt="" />- <strong>Julia Westphal</strong>- <span>9:45 AM</span>- </div>- <p>- The rollout plan for {mention()} is ready. Dana will bring- Alex to Thursday’s walkthrough.- </p>- <p>- Jacob, can you send them the onboarding guide before the call?- </p>- <div class="crm-linked-document">- <File />- <div>- <strong>Customer rollout plan</strong>- <span>Agenda, owners, and next steps</span>- </div>- </div>- </div>- }- >- <span class="crm-document-eyebrow">- <File />- Team documents- </span>- <h3>Customer rollout plan</h3>- <p class="crm-plan-company">Customer {mention()}</p>- <h4>Thursday’s walkthrough</h4>- <p>- Dana and Alex are bringing their team into Macro. Start with their- shared inbox, then walk through the launch workspace.- </p>- <h4>Before the call</h4>- <ul>- <li>Send the onboarding guide</li>- <li>Confirm who owns the rollout</li>- <li>Agree on the first team workflow</li>- </ul>- </Show>- </div>- <aside- id="crm-linked-record"- class="crm-linked-record"- aria-label="Linked customer record"- data-open={opened()}- >- <Show- when={opened()}- fallback={- <div class="crm-record-invitation">- <Buildings />- <p>- Open the company mention to see the relationship behind the- work.- </p>- </div>- }- >- <div class="crm-linked-record-label">- <Buildings />- Customer record- </div>- <span class="crm-company-monogram" aria-hidden="true">- m.- </span>- <h3>The Meadow</h3>- <p class="crm-linked-domain">meadow.example</p>- <dl>- <div>- <dt>Stage</dt>- <dd>- <span class="crm-linked-stage-dot" />- Customer- </dd>- </div>- <div>- <dt>Owner</dt>- <dd>- <img src={homepagePeople.jacob.photo} alt="" />- Jacob- </dd>- </div>- <div>- <dt>Last interaction</dt>- <dd>Today, 9:41 AM</dd>- </div>- </dl>- <h4>People</h4>- <p>Dana Whitfield</p>- <p>Alex Chen</p>- <div class="crm-linked-note">- <span>Latest team note</span>- <p>Dana will introduce the rest of the team on Thursday.</p>- </div>- </Show>- </aside>- </div>- </div>- );-}diff --git a/apps/marketing/src/features/marketing/components/crm/CrmContextDemos.test.tsx b/apps/marketing/src/features/marketing/components/crm/CrmContextDemos.test.tsxindex 8700a6a172..8c47076156 100644--- a/apps/marketing/src/features/marketing/components/crm/CrmContextDemos.test.tsx+++ b/apps/marketing/src/features/marketing/components/crm/CrmContextDemos.test.tsx@@ -1,17 +1,20 @@import { cleanup, fireEvent, render, within } from '@solidjs/testing-library';import { afterEach, beforeEach, expect, it, vi } from 'vitest';-import { CrmConnectedWorkDemo } from './CrmConnectedWorkDemo';import { CrmEnrichmentDemo } from './CrmEnrichmentDemo';+import { CrmRecordDemo } from './CrmRecordDemo';-let visible: IntersectionObserverCallback;+let intersections: IntersectionObserverCallback[];let reduced = false;beforeEach(() => {- vi.useFakeTimers();+ intersections = [];reduced = false;+ vi.useFakeTimers();vi.stubGlobal('fetch', vi.fn());vi.spyOn(document, 'hidden', 'get').mockReturnValue(false);vi.stubGlobal('matchMedia', () => ({- matches: reduced,+ get matches() {+ return reduced;+ },addEventListener: vi.fn(),removeEventListener: vi.fn(),}));@@ -19,75 +22,144 @@ beforeEach(() => {'IntersectionObserver',class {constructor(callback: IntersectionObserverCallback) {- visible = callback;+ intersections.push(callback);}observe() {}disconnect() {}});+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );});afterEach(() => {cleanup();+ vi.advanceTimersByTime(100);expect(fetch).not.toHaveBeenCalled();- vi.clearAllTimers();+ expect(vi.getTimerCount()).toBe(0);vi.useRealTimers();vi.restoreAllMocks();vi.unstubAllGlobals();});-function setVisible(isIntersecting: boolean) {- visible(- [{ isIntersecting } as IntersectionObserverEntry],- {} as IntersectionObserver- );+function visible(value: boolean) {+ for (const callback of intersections)+ callback(+ [{ isIntersecting: value } as IntersectionObserverEntry],+ {} as IntersectionObserver+ );}+const section = (view: ReturnType<typeof render>) =>+ view.container.querySelector('.sample-record-section h2')?.textContent ??+ 'Overview';-it('adds enrichment while visible and leaves the completed company information readable', () => {+it('adds a company from email that is already described, then the team’s note', () => {const view = render(() => <CrmEnrichmentDemo />);- vi.advanceTimersByTime(10000);- expect(view.queryByText('Design services')).toBeNull();- setVisible(true);- vi.advanceTimersByTime(2800);- expect(view.getByText('Design services')).toBeTruthy();- setVisible(false);- vi.advanceTimersByTime(10000);- expect(view.queryByText('24 employees')).toBeNull();- setVisible(true);- vi.advanceTimersByTime(2800);- expect(view.getByText('24 employees')).toBeTruthy();- expect(view.getByRole('status').textContent).toBe(- 'Company information added'+ expect(view.getByText('Last Interaction')).toBeTruthy();+ expect(view.queryByText('Kestrel Robotics')).toBeNull();+ visible(true);+ vi.advanceTimersByTime(800);+ const row = view.container.querySelector<HTMLElement>(+ '[data-company-row="kestrel"]');- expect(vi.getTimerCount()).toBe(0);+ expect(row?.dataset.unread).toBe('true');+ expect(within(row!).getByText('10:08 AM')).toBeTruthy();+ visible(false);+ vi.advanceTimersByTime(10000);+ expect(view.queryByRole('textbox', { name: 'Company name' })).toBeNull();+ visible(true);+ vi.advanceTimersByTime(1700);+ expect(+ (view.getByRole('textbox', { name: 'Company name' }) as HTMLInputElement)+ .value+ ).toBe('Kestrel Robotics');+ expect(view.getByText(/autonomous inventory robots/)).toBeTruthy();+ expect(view.getByText('Last interacted 2 minutes ago')).toBeTruthy();+ expect(view.queryByText(/Priya runs ops/)).toBeNull();+ vi.advanceTimersByTime(2100);+ expect(view.getByText(/Priya runs ops/)).toBeTruthy();+ expect(view.container.querySelector('.demo-cursor')).toBeNull();});-it('lets a visitor open the same company from a document and chat without playback taking over', () => {- const view = render(() => <CrmConnectedWorkDemo />);- setVisible(true);- fireEvent.click(view.getByRole('button', { name: 'Customer team' }));- const record = within(- view.getByRole('complementary', { name: 'Linked customer record' })- );- expect(record.queryByRole('heading', { name: 'The Meadow' })).toBeNull();- vi.advanceTimersByTime(10000);- expect(record.queryByRole('heading', { name: 'The Meadow' })).toBeNull();- fireEvent.click(- view.getByRole('button', { name: 'Open The Meadow customer record' })- );- expect(record.getByRole('heading', { name: 'The Meadow' })).toBeTruthy();- expect(record.getByText('Dana Whitfield')).toBeTruthy();- fireEvent.click(view.getByRole('button', { name: 'Rollout plan' }));+it('shows the described company and note at once with reduced motion', () => {+ reduced = true;+ const view = render(() => <CrmEnrichmentDemo />);+ expect(view.getByText(/autonomous inventory robots/)).toBeTruthy();+ expect(view.getByText(/Priya runs ops/)).toBeTruthy();+ expect(view.container.querySelector('.demo-cursor')).toBeNull();+});++it('tours The Meadow’s emails and calls, then returns to its Discussion', () => {+ const view = render(() => <CrmRecordDemo />);+ expect(view.getByText(/Dana asked about pricing/)).toBeTruthy();+ visible(true);+ vi.advanceTimersByTime(1400);+ expect(section(view)).toBe('Emails');+ const emails = within(view.getByLabelText('Company emails'));+ expect(emails.getByText('Seats for the studio team')).toBeTruthy();+ expect(emails.getByText('Intro from Sam')).toBeTruthy();+ vi.advanceTimersByTime(2000);+ expect(section(view)).toBe('Calls');expect(- view.getByRole('heading', { name: 'Thursday’s walkthrough' })+ within(view.getByLabelText('Company calls')).getByText(+ 'Rollout check-in with The Meadow'+ )).toBeTruthy();- expect(record.getByRole('heading', { name: 'The Meadow' })).toBeTruthy();- expect(vi.getTimerCount()).toBe(0);+ vi.advanceTimersByTime(2000);+ expect(section(view)).toBe('Overview');+ expect(view.getByText('Sent. Order form is in Files.')).toBeTruthy();+ expect(view.container.querySelector('.demo-cursor')).toBeNull();});-it('shows both completed examples immediately for reduced motion', () => {- reduced = true;- const enrichment = render(() => <CrmEnrichmentDemo />);- expect(enrichment.getByText('24 employees')).toBeTruthy();- const linked = render(() => <CrmConnectedWorkDemo />);- expect(linked.getByRole('heading', { name: 'The Meadow' })).toBeTruthy();- expect(vi.getTimerCount()).toBe(0);+it('filters the Emails tab by Signal and by your own threads', () => {+ const view = render(() => <CrmRecordDemo />);+ fireEvent.pointerDown(+ view.getByRole('group', {+ name: 'The Meadow’s emails, calls, and team discussion in one record',+ })+ );+ fireEvent.click(view.getByRole('radio', { name: 'Emails' }));+ const list = () => within(view.getByLabelText('Company emails'));+ expect(list().getByText('Invitation: The Meadow · Demo')).toBeTruthy();+ fireEvent.click(view.getByRole('radio', { name: 'Signal' }));+ expect(list().queryByText('Invitation: The Meadow · Demo')).toBeNull();+ expect(list().getByText('Seats for the studio team')).toBeTruthy();+ fireEvent.click(view.getByRole('radio', { name: 'Me' }));+ expect(list().queryByText('Seats for the studio team')).toBeNull();+ expect(list().getByText('Recap from today')).toBeTruthy();+ fireEvent.click(view.getByRole('radio', { name: 'All' }));+ expect(list().getByText('Invitation: The Meadow · Demo')).toBeTruthy();+ vi.advanceTimersByTime(20000);+ expect(section(view)).toBe('Emails');+});++it('lists the record’s team, files, and tasks', () => {+ const view = render(() => <CrmRecordDemo />);+ fireEvent.pointerDown(+ view.getByRole('group', {+ name: 'The Meadow’s emails, calls, and team discussion in one record',+ })+ );+ fireEvent.click(view.getByRole('radio', { name: 'Team' }));+ const contacts = within(view.getByLabelText('Contacts'));+ expect(contacts.getByText('[email protected]')).toBeTruthy();+ fireEvent.input(view.getByRole('textbox', { name: 'Search contacts' }), {+ target: { value: 'priya' },+ });+ expect(contacts.queryByText('Dana Whitfield')).toBeNull();+ fireEvent.click(view.getByRole('radio', { name: 'Files' }));+ expect(+ view.getByRole('button', { name: 'Team rollout plan 9:30 AM' })+ ).toBeTruthy();+ expect(view.getByText('The Meadow order form.pdf')).toBeTruthy();+ fireEvent.click(view.getByRole('radio', { name: 'Tasks' }));+ expect(+ within(view.getByLabelText('Company tasks')).getByText(+ 'Get the order form signed'+ )+ ).toBeTruthy();});diff --git a/apps/marketing/src/features/marketing/components/crm/CrmEnrichmentDemo.tsx b/apps/marketing/src/features/marketing/components/crm/CrmEnrichmentDemo.tsxindex 5f389a675c..ce2474b006 100644--- a/apps/marketing/src/features/marketing/components/crm/CrmEnrichmentDemo.tsx+++ b/apps/marketing/src/features/marketing/components/crm/CrmEnrichmentDemo.tsx@@ -1,101 +1,152 @@-import Buildings from '@phosphor/buildings.svg';-import Check from '@phosphor/check.svg';-import Globe from '@phosphor/globe.svg';-import MapPin from '@phosphor/map-pin.svg';-import Users from '@phosphor/users-three.svg';-import { createSignal, For, Show } from 'solid-js';-import { createEmailWalkthrough } from '../../primitives/createEmailWalkthrough';+import { createEffect, createSignal, onCleanup, onMount, Show } from 'solid-js';+import type { WorkspaceComment } from '../../core/dummy-workspace';+import type { SampleCompany } from '../../core/workspace-fixtures';+import { createDummyWorkspace } from '../../primitives/createDummyWorkspace';+import { createProductWalkthrough } from '../../primitives/createProductWalkthrough';+import { DemoCursor } from '../DemoCursor';+import { ProductDemo } from '../product/ProductPage';+import { CrmRecordWorkspace } from './CrmRecordWorkspace';-const companyFacts = [- { label: 'Website', value: 'meadow.example', icon: Globe },- { label: 'Industry', value: 'Design services', icon: Buildings },- { label: 'Headquarters', value: 'Brooklyn, New York', icon: MapPin },- { label: 'Company size', value: '24 employees', icon: Users },-];+const kestrel: SampleCompany = {+ id: 'kestrel',+ name: 'Kestrel Robotics',+ domain: 'kestrel.example',+ description:+ 'Kestrel Robotics designs autonomous inventory robots for mid-size warehouses and third-party logistics providers. The company is based in Pittsburgh and sells to operators across the US and Canada.',+ stage: 'No stage',+ owner: '',+ revenue: '',+ updated: '10:08 AM',+ lastInteracted: '2 minutes ago',+ unread: true,+ contacts: [{ name: 'Priya Shah', email: '[email protected]' }],+ comments: [],+ emailIds: [],+ emails: [+ {+ id: 'kestrel-pricing',+ sender: 'Jacob Beckerman',+ subject: 'Re: Pricing for a 30-person team',+ snippet: 'Happy to walk you through it. Does Friday at 2 work?',+ time: '10:08 AM',+ signal: true,+ mine: true,+ },+ ],+};+const note: WorkspaceComment = {+ id: 'kestrel-note',+ person: 'jacob',+ body: 'Priya runs ops. They want 30 seats and need to be off HubSpot before January.',+ time: '10:11 AM',+};-/** Fictional enrichment values arrive on the record, without a live lookup. */+/**+ * Jacob replies to someone new and the company appears in the list, already+ * described from public sources. He opens it and adds what only he knows.+ * Phases: 0 list, 1 new row, 2 pointer, 3 click, 4 record, 5 composer, 6 note.+ */export function CrmEnrichmentDemo() {- let root!: HTMLDivElement;- const [revealed, setRevealed] = createSignal(0);- createEmailWalkthrough({- root: () => root,- steps: companyFacts.length,- advance: setRevealed,- reset: () => setRevealed(0),- reduced: () => setRevealed(companyFacts.length),+ let frame!: HTMLDivElement;+ const w = createDummyWorkspace('crm');+ w.setCompanyLayout('List');+ const [phase, setPhase] = createSignal(0);+ const [automatic, setAutomatic] = createSignal(true);+ const [pointer, setPointer] = createSignal<{ x: number; y: number }>();+ const arrive = () => {+ if (!w.data.companies.some((company) => company.id === 'kestrel'))+ w.setData('companies', (companies) => [...companies, { ...kestrel }]);+ };+ const open = () => {+ arrive();+ w.setData('companies', (company) => company.id === 'kestrel', {+ unread: false,+ });+ w.open('crm', 'kestrel');+ };+ const finish = () => {+ open();+ w.setData('companies', (company) => company.id === 'kestrel', {+ comments: [note],+ });+ };+ const playback = createProductWalkthrough({+ root: () => frame,+ steps: 6,+ reset: () => {},+ reduced: () => {+ setAutomatic(false);+ finish();+ },+ delay: (step) => [0, 800, 1000, 400, 300, 1300, 800][step] ?? 1000,+ advance: (step) => {+ setPhase(step);+ if (step === 1) arrive();+ if (step === 4) open();+ if (step === 6) {+ finish();+ setAutomatic(false);+ }+ },+ });+ const pause = () => {+ setAutomatic(false);+ playback.pause();+ };+ onMount(() => {+ const position = () => {+ const selector = [+ undefined,+ undefined,+ '[data-company-row="kestrel"] .truncate',+ '[data-company-row="kestrel"] .truncate',+ undefined,+ '[data-discussion-composer]',+ ][phase()];+ const target = selector+ ? frame.querySelector<HTMLElement>(selector)+ : undefined;+ if (!automatic() || !target) {+ setPointer(undefined);+ return;+ }+ const bounds = target.getBoundingClientRect();+ const parent = frame.getBoundingClientRect();+ setPointer({+ x: bounds.left - parent.left + Math.min(bounds.width * 0.6, 160),+ y: bounds.top - parent.top + bounds.height / 2,+ });+ };+ createEffect(() => {+ phase();+ automatic();+ const timer = requestAnimationFrame(position);+ onCleanup(() => cancelAnimationFrame(timer));+ });+ const resize = new ResizeObserver(position);+ resize.observe(frame);+ onCleanup(() => resize.disconnect());});return (- <div- ref={root}- class="crm-enrichment-demo crm-editorial-window glass-input"- role="group"- aria-label="Company information added from an email domain"- >- <div class="crm-editorial-toolbar">- <Buildings />- <span>Customers</span>- <span class="crm-toolbar-divider">/</span>- <span>The Meadow</span>- </div>- <div class="crm-enrichment-body">- <div class="crm-enrichment-profile">- <div class="crm-enrichment-mark" aria-hidden="true">- m.- </div>- <h3>The Meadow</h3>- <span class="crm-enrichment-domain">- <Globe />- meadow.example- </span>- <p>- A Brooklyn design studio building brands and digital experiences for- growing teams.- </p>- <div class="crm-enrichment-people">- <span class="crm-contact-avatar">DW</span>- <span class="crm-contact-avatar">AC</span>- <span>Dana and Alex</span>- </div>- </div>- <div class="crm-enrichment-details">- <h4>Company information</h4>- <dl>- <For each={companyFacts}>- {(fact, index) => (- <div- class="crm-enrichment-fact"- data-revealed={revealed() > index()}- >- <dt>- <fact.icon />- {fact.label}- </dt>- <dd>- <Show- when={revealed() > index()}- fallback={- <span- class="crm-enrichment-placeholder"- aria-label="Looking up company information"- />- }- >- <span>{fact.value}</span>- <Check aria-hidden="true" />- </Show>- </dd>- </div>- )}- </For>- </dl>- <p class="crm-enrichment-status" role="status">- <span class="crm-sync-dot" />- {revealed() === companyFacts.length- ? 'Company information added'- : 'Finding company information…'}- </p>- </div>- </div>+ <div ref={frame} class="crm-demo-frame" onFocusIn={pause}>+ <ProductDemo+ label="A company created from email, already described from public sources"+ onInteract={pause}+ height={450}+ mobileHeight={520}+ >+ <CrmRecordWorkspace workspace={w} />+ </ProductDemo>+ <Show when={automatic() && pointer()}>+ {(p) => (+ <DemoCursor+ label="Jacob"+ class="crm-demo-pointer"+ clicking={phase() === 3}+ style={{ transform: `translate(${p().x}px, ${p().y}px)` }}+ />+ )}+ </Show></div>);}diff --git a/apps/marketing/src/features/marketing/components/crm/CrmFeatureIllustrations.tsx b/apps/marketing/src/features/marketing/components/crm/CrmFeatureIllustrations.tsxindex c5dac4fc87..e5af110bb5 100644--- a/apps/marketing/src/features/marketing/components/crm/CrmFeatureIllustrations.tsx+++ b/apps/marketing/src/features/marketing/components/crm/CrmFeatureIllustrations.tsx@@ -49,6 +49,28 @@ export function CaptureIllustration() {);}+export function EnrichmentIllustration() {+ return (+ <Illustration>+ <g opacity=".4">+ <rect x="26" y="52" width="52" height="34" rx="5" />+ <path d="m27 55 25 18 25-18" />+ </g>+ <path d="M80 69h18" opacity=".4" stroke-dasharray="2 4" />+ <g fill="#111">+ <rect x="100" y="26" width="114" height="92" rx="7" />+ <rect x="112" y="38" width="14" height="14" rx="3" />+ <path d="M133 45h40" opacity=".7" />+ <rect x="112" y="60" width="44" height="10" rx="5" opacity=".5" />+ <circle cx="119" cy="65" r="2.5" opacity=".7" />+ </g>+ <path d="M112 82h88M112 92h88" opacity=".6" />+ <path d="M112 102h52" opacity=".6" stroke-dasharray="3 3" />+ <path d="m192 98 3 6 6 3-6 3-3 6-3-6-6-3 6-3Z" stroke="#b5cbbb" />+ </Illustration>+ );+}+export function ContextIllustration() {return (<Illustration>diff --git a/apps/marketing/src/features/marketing/components/crm/CrmRecordDemo.tsx b/apps/marketing/src/features/marketing/components/crm/CrmRecordDemo.tsxindex 00de0b8c8b..dc65f13cc5 100644--- a/apps/marketing/src/features/marketing/components/crm/CrmRecordDemo.tsx+++ b/apps/marketing/src/features/marketing/components/crm/CrmRecordDemo.tsx@@ -1,10 +1,109 @@-import DummyWorkspace from '../workspace/DummyWorkspace';+import { createEffect, createSignal, onCleanup, onMount, Show } from 'solid-js';+import { createDummyWorkspace } from '../../primitives/createDummyWorkspace';+import { createProductWalkthrough } from '../../primitives/createProductWalkthrough';+import { DemoCursor } from '../DemoCursor';+import { ProductDemo } from '../product/ProductPage';+import type { CompanySection } from '../workspace/WorkspaceCompanies';+import { CrmRecordWorkspace } from './CrmRecordWorkspace';-/** The actual sample record, including linked email, discussion, and properties. */+/** Tab the walkthrough points at, then opens, for each step. */+const tour: (CompanySection | undefined)[] = [+ undefined,+ 'emails',+ 'emails',+ 'calls',+ 'calls',+ 'overview',+ 'overview',+];++/** The Meadow's record: Emails, then Calls, then back to the Discussion. */export function CrmRecordDemo() {+ let frame!: HTMLDivElement;+ const w = createDummyWorkspace('crm');+ w.open('crm', 'meadow');+ const [section, setSection] = createSignal<CompanySection>('overview');+ const [phase, setPhase] = createSignal(0);+ const [automatic, setAutomatic] = createSignal(true);+ const [pointer, setPointer] = createSignal<{ x: number; y: number }>();+ const playback = createProductWalkthrough({+ root: () => frame,+ steps: 6,+ reset: () => {},+ reduced: () => {+ setAutomatic(false);+ setSection('overview');+ },+ delay: (step) => (step === 1 ? 900 : step % 2 ? 1500 : 500),+ advance: (step) => {+ setPhase(step);+ const tab = tour[step];+ if (step % 2 === 0 && tab) setSection(tab);+ if (step === 6) {+ setAutomatic(false);+ // Back on Overview, bring the team's thread into view.+ requestAnimationFrame(() => {+ const scroll = frame.querySelector('.sample-company-scroll');+ scroll?.scrollTo?.({ top: scroll.scrollHeight, behavior: 'smooth' });+ });+ }+ },+ });+ const pause = () => {+ setAutomatic(false);+ playback.pause();+ };+ onMount(() => {+ const position = () => {+ const tab = tour[phase()];+ const target = tab+ ? frame.querySelector<HTMLElement>(`[data-record-tab="${tab}"]`)+ : undefined;+ if (!automatic() || !target) {+ setPointer(undefined);+ return;+ }+ const bounds = target.getBoundingClientRect();+ const parent = frame.getBoundingClientRect();+ setPointer({+ x: bounds.left - parent.left + bounds.width / 2,+ y: bounds.top - parent.top + bounds.height * 0.7,+ });+ };+ createEffect(() => {+ phase();+ automatic();+ const timer = requestAnimationFrame(position);+ onCleanup(() => cancelAnimationFrame(timer));+ });+ const resize = new ResizeObserver(position);+ resize.observe(frame);+ onCleanup(() => resize.disconnect());+ });return (- <div class="crm-record-demo glass-input">- <DummyWorkspace initialView="crm" initialCompany="meadow" embedded />+ <div ref={frame} class="crm-demo-frame" onFocusIn={pause}>+ <ProductDemo+ label="The Meadow’s emails, calls, and team discussion in one record"+ onInteract={pause}+ height={520}+ mobileHeight={600}+ >+ <CrmRecordWorkspace+ workspace={w}+ section={section()}+ onSectionChange={setSection}+ />+ </ProductDemo>+ <Show when={automatic() && pointer()}>+ {(p) => (+ <DemoCursor+ label="Jacob"+ class="crm-demo-pointer"+ clicking={phase() % 2 === 0}+ style={{ transform: `translate(${p().x}px, ${p().y}px)` }}+ />+ )}+ </Show></div>);}diff --git a/apps/marketing/src/features/marketing/components/crm/CrmRecordWorkspace.tsx b/apps/marketing/src/features/marketing/components/crm/CrmRecordWorkspace.tsxnew file mode 100644index 0000000000..1022065482--- /dev/null+++ b/apps/marketing/src/features/marketing/components/crm/CrmRecordWorkspace.tsx@@ -0,0 +1,42 @@+import { Match, Switch } from 'solid-js';+import type { DummyWorkspace } from '../../primitives/createDummyWorkspace';+import {+ type CompanySection,+ WorkspaceCompanies,+} from '../workspace/WorkspaceCompanies';+import { WorkspaceDocuments } from '../workspace/WorkspaceDocuments';+import { WorkspaceEmail } from '../workspace/WorkspaceEmail';+import '../email/email-demos.css';+import '../workspace/dummy-workspace.css';++/**+ * A company record whose linked emails and documents open in the same frame,+ * the way record rows open beside the record in the app.+ */+export function CrmRecordWorkspace(props: {+ workspace: DummyWorkspace;+ initialPanelOpen?: boolean;+ section?: CompanySection;+ onSectionChange?: (section: CompanySection) => void;+}) {+ const w = props.workspace;+ return (+ <Switch+ fallback={+ <WorkspaceCompanies+ workspace={w}+ initialPanelOpen={props.initialPanelOpen}+ section={props.section}+ onSectionChange={props.onSectionChange}+ />+ }+ >+ <Match when={w.contentView() === 'email'}>+ <WorkspaceEmail workspace={w} tab="all" account="all" />+ </Match>+ <Match when={w.contentView() === 'documents'}>+ <WorkspaceDocuments workspace={w} />+ </Match>+ </Switch>+ );+}diff --git a/apps/marketing/src/features/marketing/components/crm/crm-page.css b/apps/marketing/src/features/marketing/components/crm/crm-page.cssindex 27fa213c62..2449790759 100644--- a/apps/marketing/src/features/marketing/components/crm/crm-page.css+++ b/apps/marketing/src/features/marketing/components/crm/crm-page.css@@ -1,187 +1,36 @@-.crm-feature-page { width: 100%; min-width: 0; }-.crm-page-hero { display: flex; flex-direction: column; align-items: center; padding: 132px 24px 64px; text-align: center; }-.crm-page-label { display: flex; align-items: center; justify-content: center; gap: 10px; color: #a3a3a3; font-size: 12px; font-weight: 500; line-height: 18px; letter-spacing: .12em; text-transform: uppercase; }-.crm-page-label > svg { width: 20px; height: 20px; }-.crm-page-hero h1 { margin: 22px 0 24px; font: 315 clamp(44px, 5vw, 72px)/1.06 'Roboto Slab Variable', display, serif; letter-spacing: -.04em; }-.crm-page-hero h1 span { display: block; }-.crm-page-hero h1 span:last-child { color: #b8b8b8; }-.crm-page-description { max-width: 600px; color: #999; font: 400 17px/1.65 'Inter Variable', Inter, sans-serif; text-wrap: pretty; }-.crm-page-description > span { display: block; }-.crm-page-hero .feature-page-cta { margin-top: 28px; }-.crm-feature-links { width: min(872px, calc(100% - 48px)); margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }-.crm-feature-links a { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #b5b5b5; font-size: 13px; text-align: center; }+/* Jump links reuse the CRM line illustrations. */+.crm-feature-links a { gap: 8px; color: #b5b5b5; font-size: 13px; }.crm-feature-links a:hover { color: #fff; }-.crm-feature-illustration { display: grid; place-items: center; width: 240px; max-width: 100%; height: 150px; position: relative; isolation: isolate; }+.crm-feature-illustration { display: grid; place-items: center; width: 200px; max-width: 100%; height: 124px; position: relative; isolation: isolate; }.crm-feature-illustration::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(#fff4 .65px, transparent .9px); background-size: 8px 8px; mask-image: radial-gradient(ellipse, #000, transparent 70%); }.crm-feature-illustration .crm-feature-art { width: 100%; height: 100%; color: #888; transition: color 200ms; }.crm-feature-links a:hover .crm-feature-art { color: #ccc; }-.crm-feature-page .homepage-feature-heading { width: min(920px, 100%); margin-inline: auto; padding-inline: 24px; text-align: left; }-.crm-feature-page .homepage-feature-title { justify-content: flex-start; }-.crm-feature-page .homepage-section-break { display: block; }-.crm-feature-page .homepage-section-break > span { display: none; }-.crm-feature-page .homepage-section-break p { max-width: 550px; font-size: 17px; line-height: 1.65; margin-inline: 0; white-space: pre-line; text-wrap: wrap; }-#crm-context .homepage-section-break p { max-width: 660px; }-.crm-scene { position: relative; isolation: isolate; padding: 32px 24px 16px; }-.crm-scene::before { content: ''; position: absolute; inset: -24px -20px 0; z-index: -2; pointer-events: none; background: radial-gradient(ellipse at 55% 45%, #b4bedb14, transparent 68%); }-.crm-scene::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: radial-gradient(#d0d6e12e .6px, transparent .9px); background-size: 8px 8px; mask-image: radial-gradient(ellipse at 60% 45%, #000, transparent 70%); opacity: .45; }-.crm-feature-prose { width: min(920px, 100%); padding-inline: 24px; margin: 28px auto 0; color: #a3a3a3; font: 400 15px/1.85 'Inter Variable', Inter, sans-serif; }-.crm-feature-prose p + p { margin-top: 18px; }-.crm-feature-page .feature-page-reading { width: min(920px, 100%); }-.crm-feature-page .feature-page-comparison, .crm-feature-page .homepage-feature-end { width: min(872px, calc(100% - 48px)); margin-inline: auto; }-.crm-record-demo { position: relative; overflow: hidden; border-radius: 16px; box-shadow: var(--glass-shadow); }-.crm-record-demo .dummy-workspace[data-embedded=true] { height: 670px; border: 0; border-radius: inherit; box-shadow: none; }-.crm-record-demo .dummy-rail, .crm-record-demo .dummy-sidebar, .crm-record-demo .dummy-banner, .crm-record-demo .dummy-mobile-nav, .crm-record-demo .dummy-restore-sidebar { display: none; }-.crm-record-demo .dummy-workspace .sample-panel-section { border: 0; }-.crm-record-demo .dummy-workspace .sample-panel-section select { border-color: transparent; }-.crm-agent-scene .homepage-conversation { width: 100%; margin-bottom: 40px; }-.crm-pipeline-frame { position: relative; overflow: hidden; border-radius: 16px; background: #121315; box-shadow: var(--glass-shadow); }-.crm-feature-page .homepage-crm .mdf-frame { height: auto; padding: 0; background: transparent; overflow: visible; border-radius: 0; }-.crm-feature-page .homepage-crm .mds-card { height: auto; max-width: none; background: transparent; box-shadow: none; border-radius: 0; }-.crm-feature-page .homepage-crm .mdf-frame::before, .crm-feature-page .homepage-crm .mds-card::before { content: none; }-.crm-feature-page .homepage-crm-footer { border: 0; }-@media (max-width: 699px) {- .crm-page-hero { padding: 114px 18px 44px; }- .crm-page-hero h1 { font-size: clamp(28px, 7.8vw, 50px); line-height: 1.1; letter-spacing: -.035em; }- .crm-page-description { font-size: 15px; max-width: 340px; }- .crm-page-description > span { display: inline; }- .crm-feature-links { width: 100%; gap: 8px; }- .crm-feature-links a { font-size: 11px; }- .crm-feature-illustration { height: auto; aspect-ratio: 5/3; }- .crm-feature-page .homepage-feature-heading, .crm-feature-prose { padding-inline: 0; }- .crm-feature-page .homepage-section-break p { max-width: 100%; font-size: 15px; white-space: normal; text-wrap: pretty; }- .crm-feature-page .feature-page-comparison, .crm-feature-page .homepage-feature-end { width: 100%; }- .crm-feature-prose { font-size: 14px; margin-top: 24px; }- .crm-scene { padding: 24px 0 0; }- .crm-scene::before { inset: 0; }- .crm-record-demo .dummy-workspace[data-embedded=true] { height: 640px; }- .crm-feature-page .homepage-crm-viewport { height: 290px; }-}-/* Keep the record and its properties together on desktop; phones use the full panel. */-@media (min-width: 700px) {- .crm-record-demo .sample-detail-layout[data-panel-open=true] .sample-details {- position: static;- width: 280px;- min-width: 280px;- max-width: 280px;- background: transparent;- }-}+/* Walkthrough pointers sit over the product window they act in. */+.crm-demo-frame { position: relative; }+.crm-demo-pointer { position: absolute; top: 0; left: 0; z-index: 9; pointer-events: none; transition: transform 600ms cubic-bezier(.2, .8, .2, 1); }+.product-demo[data-action=stage] [data-company-property=stage],+.product-demo[data-action=owner] [data-company-property=owner] { background: #ffffff25; box-shadow: 0 0 0 3px #ffffff0d; }+.crm-demo-frame [data-thread-id] > .sample-message-row,+.crm-demo-frame .sample-thread-replies .sample-message-row:last-child { animation: crm-arrive 400ms ease-out both; }+@keyframes crm-arrive { from { opacity: 0; transform: translateY(4px); } }-@media (max-width: 699px) {- .crm-record-demo [data-view-shell-top-bar] > span.text-ink-muted,- .crm-record-demo [data-view-shell-top-bar] > span.text-ink-muted + span { display: none; }-}+/* The agent section keeps the homepage pipeline and its request. */+.crm-agent-scene .homepage-conversation { width: 100%; margin-bottom: 40px; }+.crm-pipeline-frame { position: relative; overflow: hidden; border-radius: 16px; background: #121315; box-shadow: var(--glass-shadow); }+.product-page .homepage-crm .mdf-frame { height: auto; padding: 0; background: transparent; overflow: visible; border-radius: 0; }+.product-page .homepage-crm .mds-card { height: auto; max-width: none; background: transparent; box-shadow: none; border-radius: 0; }+.product-page .homepage-crm .mdf-frame::before, .product-page .homepage-crm .mds-card::before { content: none; }+.product-page .homepage-crm-footer { border: 0; }-/* Reuse the app-shaped company page; only the surrounding presentation is styled here. */-.crm-capture-demo .homepage-conversation { width: 100%; margin: 0 0 36px; }-.crm-capture-record { position: relative; }-.crm-capture-pointer { position: absolute; left: 0; top: 0; z-index: 8; pointer-events: none; display: flex; align-items: flex-start; gap: 4px; color: #d4c5b4; transition: transform 650ms cubic-bezier(.2,.8,.2,1); }-.crm-capture-pointer svg { width: 22px; height: 22px; fill: currentColor; filter: drop-shadow(0 1px 2px #0008); }-.crm-capture-pointer span { margin-top: 16px; background: #b6a18b; color: #141211; padding: 2px 7px; border-radius: 5px; font: 500 10px/1.5 'Inter Variable', sans-serif; }-.crm-capture-record[data-step="2"] [aria-label="Deal stage"],-.crm-capture-record[data-step="3"] [aria-label="Company owner"],-.crm-capture-record:is([data-step="4"], [data-step="5"], [data-step="6"]) [aria-label="Company description"] { background: #b6a18b10; box-shadow: 0 0 0 2px #b6a18b35; transition: box-shadow 300ms; }-.crm-contact-avatar { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: #b5cbbb13; color: #b9c4bc; font-size: 10px; font-weight: 500; }-.crm-company-monogram { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #b8c5b413; color: #bdc7b9; font: 400 26px 'Roboto Slab Variable', serif; }-.crm-sync-dot { width: 5px; height: 5px; border-radius: 50%; background: #a7b9ad; }@media (max-width: 699px) {- .crm-capture-demo .homepage-conversation { margin-bottom: 24px; }- .crm-capture-pointer { display: none; }+ .crm-feature-links a { font-size: 12px; }+ .crm-feature-illustration { width: 150px; height: auto; aspect-ratio: 5 / 3; }+ .crm-agent-scene .homepage-conversation { margin-bottom: 24px; }+ .product-page .homepage-crm-viewport { height: 290px; }}--/* Detail-focused product scenes share the page's reading measure and glass rim. */-.crm-editorial-window { position: relative; overflow: hidden; border-radius: 16px; color: #d1d2d5; background: linear-gradient(135deg, #1b1c1f, #111214 65%, #0b0c0d); box-shadow: 0 24px 70px #0006; font: 400 14px/1.6 'Inter Variable', Inter, sans-serif; }-.crm-editorial-toolbar { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 24px; border-bottom: 1px solid #ffffff08; font-size: 11px; color: #979aa0; }-.crm-editorial-toolbar > svg { width: 14px; height: 14px; }-.crm-toolbar-divider { color: #555961; }-.crm-enrichment-body { display: grid; grid-template-columns: 1fr 1.08fr; min-height: 400px; }-.crm-enrichment-profile { padding: 40px; border-right: 1px solid #ffffff06; }-.crm-enrichment-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(145deg, #b5cbbb22, #b5cbbb08); box-shadow: inset 0 1px 0 #b5cbbb1f; color: #c0cdbb; font: 400 42px/1 'Roboto Slab Variable', serif; }-.crm-enrichment-profile h3 { font-size: 26px; font-weight: 500; letter-spacing: -.035em; margin: 18px 0 4px; }-.crm-enrichment-domain { display: flex; align-items: center; gap: 6px; color: #868a91; font-size: 12px; }-.crm-enrichment-domain svg { width: 13px; height: 13px; }-.crm-enrichment-profile > p { max-width: 300px; margin-top: 24px; color: #a1a4ab; font-size: 13px; line-height: 1.85; }-.crm-enrichment-people { display: flex; align-items: center; margin-top: 27px; }-.crm-enrichment-people .crm-contact-avatar { border: 2px solid #1a1b1d; }-.crm-enrichment-people .crm-contact-avatar + .crm-contact-avatar { margin-left: -6px; background: #272b2c; }-.crm-enrichment-people > span:last-child { margin-left: 9px; color: #868a91; font-size: 11px; }-.crm-enrichment-details { padding: 42px 32px 30px; }-.crm-enrichment-details h4 { font-size: 12px; font-weight: 500; margin-bottom: 24px; color: #a3a6ad; }-.crm-enrichment-fact { margin-top: 20px; }-.crm-enrichment-fact dt { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #797e87; }-.crm-enrichment-fact dt svg { width: 12px; height: 12px; }-.crm-enrichment-fact dd { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; padding-left: 19px; font-size: 13px; }-.crm-enrichment-fact dd > svg { width: 12px; height: 12px; color: #9eafa4; }-.crm-enrichment-fact[data-revealed=true] dd { animation: crm-detail-reveal 350ms ease-out both; }-.crm-enrichment-placeholder { width: 70%; height: 7px; border-radius: 6px; background: #ffffff07; }-.crm-enrichment-details .crm-enrichment-status { display: flex; align-items: center; gap: 7px; margin-top: 28px; color: #8fa197; font-size: 10px; }-#crm-enrichment .homepage-section-break p { max-width: 605px; }-#crm-connected-work .homepage-section-break p { max-width: 630px; }-.crm-context-picker { gap: 5px; padding: 8px 18px; }-.crm-context-picker button { display: flex; align-items: center; gap: 7px; border: 0; padding: 6px 10px; background: transparent; border-radius: 6px; color: #777d85; font-size: 11px; }-.crm-context-picker button[aria-pressed=true] { color: #d4d6da; background: #ffffff07; box-shadow: inset 0 1px 0 #ffffff05; }-.crm-context-picker button:hover { color: #e0e1e5; }-.crm-context-picker svg { width: 13px; height: 13px; }-.crm-connected-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; min-height: 490px; }-.crm-linked-context { padding: 34px 36px 42px; }-.crm-document-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #777d85; }-.crm-document-eyebrow svg { width: 12px; height: 12px; }-.crm-linked-context h3 { margin: 22px 0 16px; font-size: 25px; font-weight: 500; letter-spacing: -.04em; color: #e0e1e5; }-.crm-linked-context h4 { margin: 28px 0 8px; font-size: 13px; font-weight: 500; color: #c3c6cc; }-.crm-linked-context p, .crm-linked-context li { font-size: 13px; line-height: 1.9; color: #9298a1; }-.crm-linked-context .crm-plan-company { display: flex; align-items: center; gap: 12px; font-size: 11px; color: #717782; }-.crm-linked-context ul { padding-left: 18px; margin-top: 8px; }-.crm-company-mention { display: inline-flex; align-items: center; vertical-align: baseline; gap: 5px; padding: 1px 6px; border: 0; border-radius: 5px; color: #c5cfc9; font: inherit; background: #b5cbbb0d; box-shadow: inset 0 -1px 0 #b5cbbb20; transition: background 200ms, box-shadow 200ms; }-.crm-company-mention:hover, .crm-company-mention[data-highlighted=true] { background: #b5cbbb20; box-shadow: 0 0 0 2px #b5cbbb20; }-.crm-company-mention svg { width: 12px; height: 12px; }-.crm-company-mention svg:last-child { width: 10px; height: 10px; color: #8a9a90; }-.crm-linked-record { min-width: 0; padding: 24px; background: #ffffff02; border-left: 1px solid #ffffff08; }-.crm-linked-record[data-open=true] > * { animation: crm-detail-reveal 350ms ease-out both; }-.crm-linked-record-label { display: flex; align-items: center; gap: 6px; color: #858b94; font-size: 10px; margin-bottom: 26px; }-.crm-linked-record-label svg { width: 12px; height: 12px; }-.crm-linked-record h3 { font-size: 20px; font-weight: 500; letter-spacing: -.025em; margin-top: 13px; }-.crm-linked-record .crm-linked-domain { color: #828993; font-size: 11px; margin-top: 2px; }-.crm-linked-record dl { display: grid; gap: 15px; margin-top: 28px; font-size: 11px; }-.crm-linked-record dl > div { display: grid; grid-template-columns: 88px 1fr; gap: 5px; align-items: center; }-.crm-linked-record dt { color: #767e88; }-.crm-linked-record dd { display: flex; align-items: center; gap: 6px; }-.crm-linked-record dd img { width: 17px; height: 17px; border-radius: 50%; object-fit: cover; }-.crm-linked-stage-dot { width: 5px; height: 5px; border-radius: 50%; background: #b1a8c5; }-.crm-linked-record h4 { margin: 26px 0 9px; font-size: 11px; font-weight: 400; color: #767e88; }-.crm-linked-record > p:not(.crm-linked-domain) { font-size: 11px; line-height: 2; }-.crm-linked-note { border-top: 1px solid #ffffff07; margin-top: 25px; padding-top: 17px; }-.crm-linked-note > span { font-size: 10px; color: #727a86; }-.crm-linked-note p { color: #9a9fa7; font-size: 11px; line-height: 1.8; margin-top: 7px; }-.crm-record-invitation { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding-top: 55px; color: #626b77; }-.crm-record-invitation svg { width: 24px; height: 24px; }-.crm-record-invitation p { font-size: 12px; line-height: 1.9; max-width: 185px; }-.crm-chat-author { display: flex; align-items: center; gap: 9px; margin: 6px 0 22px; font-size: 12px; }-.crm-chat-author > img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }-.crm-chat-author strong { font-weight: 500; }-.crm-chat-author > span { font-size: 10px; color: #6e7782; }-.crm-linked-chat > p + p { margin-top: 18px; }-.crm-linked-document { display: flex; align-items: center; gap: 12px; margin-top: 24px; border: 1px solid #ffffff0a; border-radius: 10px; padding: 16px; }-.crm-linked-document > svg { width: 20px; height: 20px; color: #8a909b; }-.crm-linked-document strong { display: block; font-weight: 400; font-size: 12px; }-.crm-linked-document span { display: block; font-size: 10px; color: #747d8a; margin-top: 4px; }-@keyframes crm-detail-reveal { from { opacity: .25; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }-@media (max-width: 699px) {- .crm-enrichment-body { grid-template-columns: 1fr; }- .crm-enrichment-profile { padding: 26px; border-right: 0; border-bottom: 1px solid #ffffff08; }- .crm-enrichment-mark { width: 50px; height: 50px; font-size: 32px; border-radius: 12px; }- .crm-enrichment-profile h3 { font-size: 23px; }- .crm-enrichment-details { padding: 26px; }- .crm-enrichment-details dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }- .crm-enrichment-fact { margin: 0; }- .crm-enrichment-fact dd { font-size: 11px; padding-left: 0; gap: 5px; }- .crm-connected-body { grid-template-columns: 1fr; }- .crm-linked-context { padding: 24px; min-height: 430px; }- .crm-linked-context h3 { font-size: 23px; }- .crm-linked-record { border-left: 0; border-top: 1px solid #ffffff08; padding: 24px; }- .crm-linked-record dl > div { grid-template-columns: 120px 1fr; }- .crm-linked-record .crm-company-monogram { float: left; margin: 0 14px 0 0; }- .crm-linked-record h3 { margin-top: 0; }- .crm-record-invitation { padding-block: 15px; }- .crm-record-invitation p { max-width: 250px; }+@media (prefers-reduced-motion: reduce) {+ .crm-demo-pointer { display: none; }+ .crm-demo-frame [data-thread-id] > .sample-message-row,+ .crm-demo-frame .sample-thread-replies .sample-message-row:last-child { animation: none; }}diff --git a/apps/marketing/src/features/marketing/components/demo-cursor.css b/apps/marketing/src/features/marketing/components/demo-cursor.cssnew file mode 100644index 0000000000..e167495b22--- /dev/null+++ b/apps/marketing/src/features/marketing/components/demo-cursor.css@@ -0,0 +1,49 @@+/* Matches the homepage CRM pipeline cursor exactly; every demo reuses it. */+.demo-cursor {+ position: absolute;+ top: 0;+ left: 0;+ z-index: 8;+ font-size: 20px;+ pointer-events: none;+ filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.4));+}++.demo-cursor > svg {+ display: block;+ width: 0.7em;+ height: 0.7em;+ overflow: visible;+}++.demo-cursor > svg path {+ fill: oklch(0.96 0 59);+}++.demo-cursor > span {+ position: absolute;+ top: 16px;+ left: 15px;+ padding: 3px 8px;+ border-radius: 4px 10px 10px;+ background: oklch(1 0 0);+ color: oklch(0.17 0.002 250);+ font: 500 11px Inter, sans-serif;+ white-space: nowrap;+}++.demo-cursor[data-clicking='true'] > svg {+ animation: demo-cursor-click 600ms ease both;+}++@keyframes demo-cursor-click {+ 55% {+ transform: scale(0.8);+ }+}++@media (prefers-reduced-motion: reduce) {+ .demo-cursor {+ display: none;+ }+}diff --git a/apps/marketing/src/features/marketing/components/documents/DocMention.tsx b/apps/marketing/src/features/marketing/components/documents/DocMention.tsxnew file mode 100644index 0000000000..eab19fcdc3--- /dev/null+++ b/apps/marketing/src/features/marketing/components/documents/DocMention.tsx@@ -0,0 +1,103 @@+import BuildingOffice from '@phosphor/building-office.svg';+import Clock from '@phosphor/clock.svg';+import Envelope from '@phosphor/envelope.svg';+import File from '@phosphor/file.svg';+import HashStraight from '@phosphor/hash-straight.svg';+import ListChecks from '@phosphor/list-checks.svg';+import { type Component, type ComponentProps, Show } from 'solid-js';+import { Dynamic } from 'solid-js/web';+import { homepagePeople } from '../../core/homepage-demo-people';+import '../demo-mentions.css';++export type DocMentionKind =+ | 'person'+ | 'document'+ | 'task'+ | 'channel'+ | 'company'+ | 'email'+ | 'date';++export type DocMentionItem = {+ kind: DocMentionKind;+ label: string;+ /** People menu rows show their email beside the name. */+ detail?: string;+ photo?: string;+ status?: 'Not Started' | 'In Progress' | 'In Review';+};++// EntityIcon targets: md, task, channel, company, and the menu's email glyph.+const icons: Record<+ Exclude<DocMentionKind, 'person'>,+ Component<ComponentProps<'svg'>>+> = {+ document: File,+ task: ListChecks,+ channel: HashStraight,+ company: BuildingOffice,+ email: Envelope,+ date: Clock,+};++export function DocMentionIcon(props: { kind: DocMentionKind }) {+ return (+ <span aria-hidden="true" class={`demo-mention-icon mention-${props.kind}`}>+ <Show when={props.kind !== 'person' && props.kind}>+ {(kind) => (+ <Dynamic+ component={icons[kind() as Exclude<DocMentionKind, 'person'>]}+ />+ )}+ </Show>+ </span>+ );+}++/** UserMention and DocumentMention/MentionContainer, as the editor draws them. */+export function DocMention(props: { item: DocMentionItem }) {+ return (+ <span+ class={`demo-inline-mention mention-${props.item.kind}`}+ data-doc-mention={props.item.kind}+ contentEditable={false}+ >+ <Show+ when={props.item.kind !== 'person'}+ fallback={<span class="demo-mention-name">@{props.item.label}</span>}+ >+ <DocMentionIcon kind={props.item.kind} />+ <span class="demo-mention-name">{props.item.label}</span>+ <Show when={props.item.kind === 'task'}>+ <span+ class="demo-mention-status"+ data-status={props.item.status}+ role="img"+ aria-label={props.item.status ?? 'Not Started'}+ />+ </Show>+ </Show>+ </span>+ );+}++export const people = {+ julia: {+ kind: 'person',+ label: homepagePeople.julia.name,+ detail: '[email protected]',+ photo: homepagePeople.julia.photo,+ },+ teo: {+ kind: 'person',+ label: homepagePeople.teo.name,+ detail: '[email protected]',+ photo: homepagePeople.teo.photo,+ },+ gabriel: {+ kind: 'person',+ label: homepagePeople.gabriel.name,+ detail: '[email protected]',+ photo: homepagePeople.gabriel.photo,+ },+} satisfies Record<string, DocMentionItem>;diff --git a/apps/marketing/src/features/marketing/components/documents/DocMentionMenu.tsx b/apps/marketing/src/features/marketing/components/documents/DocMentionMenu.tsxnew file mode 100644index 0000000000..f4fc1ff2af--- /dev/null+++ b/apps/marketing/src/features/marketing/components/documents/DocMentionMenu.tsx@@ -0,0 +1,73 @@+import { For, type JSX, Show } from 'solid-js';+import { DocMentionIcon, type DocMentionItem } from './DocMention';+import '../demo-mentions.css';++export type DocMentionGroup = {+ /** MentionsMenu bucket labels, e.g. "Documents, Agents, & Tasks". */+ label: string;+ /** Bucket size; "View all (N)" appears when more exist than are shown. */+ total?: number;+ rows: readonly DocMentionItem[];+};++/**+ * MentionsMenu's Surface, ItemBin, and MentionsMenuItem as a still frame the+ * walkthrough drives: buckets in the editor's order and one selected row.+ */+export function DocMentionMenu(props: {+ groups: readonly DocMentionGroup[];+ selected: number;+ style?: JSX.CSSProperties;+}) {+ const offset = (index: number) =>+ props.groups+ .slice(0, index)+ .reduce((count, group) => count + group.rows.length, 0);+ return (+ <div+ class="demo-mention-menu"+ role="listbox"+ aria-label="Mentions"+ style={props.style}+ >+ <div class="demo-mention-groups">+ <For each={props.groups}>+ {(group, index) => (+ <section>+ <div class="demo-mention-heading">+ <span>{group.label}</span>+ <Show when={(group.total ?? 0) > group.rows.length}>+ <span>View all ({group.total})</span>+ </Show>+ </div>+ <For each={group.rows}>+ {(row, rowIndex) => (+ <div+ role="option"+ class="demo-mention-option"+ aria-selected={+ offset(index()) + rowIndex() === props.selected+ }+ >+ <Show+ when={row.photo}+ fallback={<DocMentionIcon kind={row.kind} />}+ >+ {(photo) => <img src={photo()} alt="" />}+ </Show>+ <span>+ {row.label}+ <Show when={row.detail}>+ <span class="demo-mention-detail">{row.detail}</span>+ </Show>+ </span>+ </div>+ )}+ </For>+ </section>+ )}+ </For>+ </div>+ </div>+ );+}diff --git a/apps/marketing/src/features/marketing/components/documents/DocumentFrame.tsx b/apps/marketing/src/features/marketing/components/documents/DocumentFrame.tsxnew file mode 100644index 0000000000..9bb59e6322--- /dev/null+++ b/apps/marketing/src/features/marketing/components/documents/DocumentFrame.tsx@@ -0,0 +1,115 @@+import ArrowLeft from '@phosphor/arrow-left.svg';+import FileText from '@phosphor/file-text.svg';+import Share from '@phosphor/share.svg';+import { Button } from '@ui';+import { createSignal, type JSX, Show } from 'solid-js';+import { ViewShell } from '../DemoWorkspaceChrome';+import { DemoTags } from '../workspace/frozen/DemoTags';+import { DetailLayout, PanelToggle } from '../workspace/frozen/DetailPanel';+import { DocumentShareSheet, LAUNCH_MEMBERS } from './DocumentShareSheet';+import '../workspace/dummy-workspace.css';+import '../demo-markdown.css';+import './document-stories.css';++/**+ * The open-document view shared by the Docs page demos: the same top bar,+ * title, tags row, and side panel as the sample workspace's document view,+ * with the body handed to each demo so it can animate edits in place.+ */+export function DocumentFrame(props: {+ title: string;+ tags?: readonly string[];+ /** Header island before Share, e.g. the offline indicator. */+ status?: JSX.Element;+ panel?: JSX.Element;+ panelOpen?: boolean;+ onPanelChange?: (open: boolean) => void;+ /** Replaces the built-in Share modal, which lists #launch's access. */+ onShare?: () => void;+ onBack?: () => void;+ backLabel?: string;+ /** Cursors and menus, positioned over the window. */+ overlay?: JSX.Element;+ children: JSX.Element;+}) {+ const [tags, setTags] = createSignal<string[]>([...(props.tags ?? [])]);+ const [panel, setPanel] = createSignal<boolean>();+ const [sharing, setSharing] = createSignal(false);+ // A visitor's toggle wins over the walkthrough's panel state.+ const open = () => panel() ?? props.panelOpen ?? false;+ return (+ <>+ <ViewShell.TopBar>+ <Show when={props.onBack}>+ {(back) => (+ <Button+ variant="plain"+ size="icon-sm"+ label={props.backLabel ?? 'Back'}+ onClick={() => back()()}+ >+ <ArrowLeft />+ </Button>+ )}+ </Show>+ <FileText class="size-4 shrink-0 text-note" />+ <span class="text-sm truncate">{props.title}</span>+ <div class="ml-auto flex items-center gap-1">+ {props.status}+ <Button+ size="sm"+ data-doc-share+ onClick={() => (props.onShare ? props.onShare() : setSharing(true))}+ >+ <Share />+ Share+ </Button>+ <PanelToggle+ open={open()}+ onChange={(next) => {+ setPanel(next);+ props.onPanelChange?.(next);+ }}+ />+ </div>+ </ViewShell.TopBar>+ <DetailLayout open={open()} panel={props.panel}>+ <div class="dummy-scroll px-6 doc-story-scroll">+ <div class="doc-story-page">+ <div+ role="textbox"+ aria-label="Document title"+ contentEditable+ class="doc-story-title"+ >+ {props.title}+ </div>+ <Show when={props.tags}>+ <div class="doc-story-tags">+ <DemoTags tags={tags()} onChange={setTags} />+ </div>+ </Show>+ <div+ contentEditable+ role="textbox"+ aria-label="Document body"+ aria-multiline="true"+ class="doc-story-body website-demo-markdown md"+ >+ {props.children}+ </div>+ </div>+ </div>+ </DetailLayout>+ <Show when={!props.onShare}>+ <DocumentShareSheet+ open={sharing()}+ title={props.title}+ channel={{ members: LAUNCH_MEMBERS, level: 'view' }}+ onClose={() => setSharing(false)}+ />+ </Show>+ {props.overlay}+ </>+ );+}diff --git a/apps/marketing/src/features/marketing/components/documents/DocumentMentionsDemo.tsx b/apps/marketing/src/features/marketing/components/documents/DocumentMentionsDemo.tsxnew file mode 100644index 0000000000..ed6545d87b--- /dev/null+++ b/apps/marketing/src/features/marketing/components/documents/DocumentMentionsDemo.tsx@@ -0,0 +1,372 @@+import HashStraight from '@phosphor/hash-straight.svg';+import ListChecks from '@phosphor/list-checks.svg';+import { createSignal, For, onCleanup, onMount, Show } from 'solid-js';+import { homepagePeople } from '../../core/homepage-demo-people';+import { DemoCursor } from '../DemoCursor';+import { ProductDemo } from '../product/ProductPage';+import { TagDot } from '../workspace/frozen/DemoTags';+import { PanelSection } from '../workspace/frozen/DetailPanel';+import { DocMention, type DocMentionItem, people } from './DocMention';+import { type DocMentionGroup, DocMentionMenu } from './DocMentionMenu';+import { DocumentFrame } from './DocumentFrame';+import {+ createAnchor,+ createSceneClock,+ type Point,+ typed,+} from './documentScene';++const ITEMS = {+ invite: {+ kind: 'task',+ label: 'Fix the team invite handoff',+ status: 'In Progress',+ },+ deploy: {+ kind: 'task',+ label: 'Fix the deploy pipeline',+ status: 'In Progress',+ },+ announcement: {+ kind: 'task',+ label: 'Write the launch announcement',+ status: 'In Review',+ },+ checklist: {+ kind: 'task',+ label: 'Prepare the launch checklist',+ status: 'Not Started',+ },+ rollout: { kind: 'document', label: 'Team rollout plan' },+ meadow: { kind: 'company', label: 'The Meadow' },+ email: { kind: 'email', label: 'Team invites for The Meadow' },+ launch: { kind: 'channel', label: 'launch' },+ today: { kind: 'date', label: 'Today' },+} satisfies Record<string, DocMentionItem>;++/** A bare @ offers every bucket; the editor's menu shows the first few. */+const EVERYTHING: DocMentionGroup[] = [+ {+ label: 'People & Groups',+ total: 14,+ rows: [people.julia, people.teo, people.gabriel],+ },+ {+ label: 'Documents, Agents, & Tasks',+ total: 62,+ rows: [ITEMS.rollout, ITEMS.invite, ITEMS.announcement],+ },+ { label: 'Channels', total: 9, rows: [ITEMS.launch] },+ { label: 'Companies', total: 23, rows: [ITEMS.meadow] },+ { label: 'Emails', total: 410, rows: [ITEMS.email] },+ { label: 'Dates', rows: [ITEMS.today] },+];++type Segment =+ | { text: string }+ | {+ query: string;+ item: DocMentionItem;+ groups: DocMentionGroup[];+ /** Rows the selection visits before Enter, e.g. arrowing to a channel. */+ picks: number[];+ browse?: boolean;+ };++const LINE: Segment[] = [+ { text: 'Teo is fixing ' },+ {+ query: 'fix',+ item: ITEMS.invite,+ browse: true,+ picks: [0],+ groups: [+ {+ label: 'Documents, Agents, & Tasks',+ rows: [ITEMS.invite, ITEMS.deploy],+ },+ ],+ },+ { text: ' for ' },+ {+ query: 'mea',+ item: ITEMS.meadow,+ picks: [0],+ groups: [+ { label: 'Companies', rows: [ITEMS.meadow] },+ { label: 'Emails', rows: [ITEMS.email] },+ ],+ },+ { text: '. Dana asked about it in ' },+ {+ query: 'invites',+ item: ITEMS.email,+ picks: [0],+ groups: [{ label: 'Emails', rows: [ITEMS.email] }],+ },+ { text: ', so post in ' },+ {+ query: 'launch',+ item: ITEMS.launch,+ picks: [0, 1, 2],+ groups: [+ {+ label: 'Documents, Agents, & Tasks',+ rows: [ITEMS.announcement, ITEMS.checklist],+ },+ { label: 'Channels', rows: [ITEMS.launch] },+ ],+ },+ { text: ' when it ships.' },+];++// Typing speeds: prose, the @query, the pause on a result, an arrow key.+const CHAR = 22;+const QUERY_CHAR = 70;+const HOLD = 480;+const BROWSE = 750;+const ARROW = 260;++type Timed =+ | { text: string; from: number; to: number }+ | (Extract<Segment, { query: string }> & {+ open: number;+ queryFrom: number;+ queryTo: number;+ pick: number;+ });++const timeline = (() => {+ let at = 0;+ return LINE.map((segment): Timed => {+ if ('text' in segment) {+ const from = at;+ at += segment.text.length * CHAR;+ return { text: segment.text, from, to: at };+ }+ const open = at + QUERY_CHAR;+ const queryFrom = open + (segment.browse ? BROWSE : 0);+ const queryTo = queryFrom + segment.query.length * QUERY_CHAR;+ at = queryTo + HOLD + (segment.picks.length - 1) * ARROW;+ return { ...segment, open, queryFrom, queryTo, pick: at };+ });+})();+const last = timeline[timeline.length - 1];+const END = ('text' in last ? last.to : last.pick) + 500;+const start = (segment: Timed) =>+ 'text' in segment ? segment.from : segment.open - QUERY_CHAR;++/** Typing @ in a doc opens the mention menu over every kind of workspace item. */+export function DocumentMentionsDemo() {+ let root!: HTMLDivElement;+ let overlay: HTMLDivElement | undefined;+ const clock = createSceneClock({ root: () => root, end: END, lead: 600 });+ const t = clock.t;+ const [wide, setWide] = createSignal(false);+ const active = () =>+ timeline.reduce(+ (current, segment, index) => (t() >= start(segment) ? index : current),+ 0+ );+ const menu = () => {+ const segment = timeline[active()];+ if (!clock.live() || 'text' in segment || t() < segment.open) return;+ if (t() >= segment.pick) return;+ if (segment.browse && t() < segment.queryFrom)+ return { groups: EVERYTHING, selected: 0 };+ const step = Math.floor((t() - segment.queryTo - HOLD / 2) / ARROW) + 1;+ const visit = Math.max(0, Math.min(segment.picks.length - 1, step));+ return { groups: segment.groups, selected: segment.picks[visit] };+ };+ const frame = () => overlay?.parentElement ?? undefined;+ const caret = createAnchor({+ frame,+ track: t,+ target: () => ({ selector: '[data-caret="jacob"]' }),+ });+ const query = createAnchor({+ frame,+ track: t,+ target: () =>+ menu()+ ? {+ selector: '[data-mention-query]',+ place: (rect): Point => ({ x: rect.left, y: rect.bottom + 6 }),+ }+ : undefined,+ });+ const menuLeft = (x: number) => {+ const width = overlay?.clientWidth ?? 0;+ return Math.max(8, Math.min(x, width - Math.min(384, width - 16) - 8));+ };+ onMount(() => {+ const element = frame();+ if (!element) return;+ const resize = new ResizeObserver(() =>+ setWide(element.clientWidth >= 700)+ );+ resize.observe(element);+ onCleanup(() => resize.disconnect());+ });+ // Wide windows keep References open beside the doc. Narrow ones open the+ // panel over it once the paragraph is written.+ const panelOpen = () =>+ wide() || (clock.done() && !clock.reduced()) ? true : undefined;+ const covered = () => !wide() && panelOpen() === true;+ return (+ <div+ ref={root}+ class="doc-story doc-story-page-fade doc-story-split"+ data-live={clock.live()}+ >+ <ProductDemo+ label="Mention a task, a company, an email, and a channel in a doc"+ onInteract={clock.takeOver}+ height={560}+ mobileHeight={620}+ >+ <DocumentFrame+ title="Q3 launch plan"+ tags={['Launch', 'Product']}+ panelOpen={panelOpen()}+ panel={<ReferencesPanel />}+ overlay={+ <div ref={overlay} class="doc-story-overlay" aria-hidden="true">+ <Show when={menu()}>+ {(open) => (+ <Show when={query()}>+ {(point) => (+ <DocMentionMenu+ groups={open().groups}+ selected={open().selected}+ style={{+ left: `${menuLeft(point().x)}px`,+ top: `${point().y}px`,+ }}+ />+ )}+ </Show>+ )}+ </Show>+ <Show when={clock.live() && !covered() && caret()}>+ {(point) => (+ <DemoCursor+ label="Jacob"+ class="doc-story-cursor"+ style={{+ transform: `translate(${point().x}px, ${point().y}px)`,+ }}+ />+ )}+ </Show>+ </div>+ }+ >+ <h2>Before Thursday</h2>+ <p>+ <For each={timeline}>+ {(segment, index) => (+ <>+ {'text' in segment ? (+ typed(segment.text, t(), segment.from, segment.to)+ ) : (+ <Show+ when={t() >= segment.pick}+ fallback={+ <Show when={t() >= start(segment)}>+ <span class="doc-mention-query" data-mention-query>+ @+ {typed(+ segment.query,+ t(),+ segment.queryFrom,+ segment.queryTo+ )}+ </span>+ </Show>+ }+ >+ <DocMention item={segment.item} />+ </Show>+ )}+ <Show when={index() === active()}>+ <span class="doc-caret" data-caret="jacob" />+ </Show>+ </>+ )}+ </For>+ </p>+ <p>+ Launch is Thursday at 9.{' '}+ <DocMention item={{ kind: 'person', label: 'Julia' }} /> sends the+ announcement once the invite fix ships.+ </p>+ <h2>Launch checklist</h2>+ <ul class="md-list md-check">+ <li class="checked md-strike text-ink-extra-muted">+ Finalize the product story+ </li>+ <li>Send the customer email</li>+ <li>Publish the changelog</li>+ </ul>+ <h2>Owners</h2>+ <p>+ Julia owns the announcement and the customer email. Teo owns the+ deploy and release checks.+ </p>+ </DocumentFrame>+ </ProductDemo>+ </div>+ );+}++/** MarkdownSidePanelSections: Tags, Properties, and References (N). */+function ReferencesPanel() {+ return (+ <>+ <PanelSection title="Tags" open>+ <div class="doc-panel-tags">+ <For each={['Launch', 'Product']}>+ {(tag) => (+ <span class="sample-file-tag">+ <TagDot label={tag} />+ {tag}+ </span>+ )}+ </For>+ </div>+ </PanelSection>+ <PanelSection title="References (2)" open>+ <div class="doc-ref-row">+ <div class="doc-ref-head">+ <img src={homepagePeople.julia.photo} alt="" />+ <b>Julia</b>+ <span class="doc-ref-in">in</span>+ <span class="doc-ref-source">+ <HashStraight />+ <span>launch</span>+ </span>+ <span class="doc-ref-time">· 2 hours ago</span>+ </div>+ <div class="doc-ref-body">+ Plan for Thursday is in{' '}+ <DocMention item={{ kind: 'document', label: 'Q3 launch plan' }} />.+ Comments welcome before noon.+ </div>+ </div>+ <div class="doc-ref-row">+ <div class="doc-ref-head">+ <img src={homepagePeople.teo.photo} alt="" />+ <b>Teo</b>+ <span class="doc-ref-in">in</span>+ <span class="doc-ref-source">+ <ListChecks class="text-task" />+ <span>Fix the team invite handoff</span>+ </span>+ <span class="doc-ref-time">· 3 hours ago</span>+ </div>+ </div>+ </PanelSection>+ </>+ );+}diff --git a/apps/marketing/src/features/marketing/components/documents/DocumentShareSheet.tsx b/apps/marketing/src/features/marketing/components/documents/DocumentShareSheet.tsxnew file mode 100644index 0000000000..886664229a--- /dev/null+++ b/apps/marketing/src/features/marketing/components/documents/DocumentShareSheet.tsx@@ -0,0 +1,279 @@+import CaretDown from '@phosphor/caret-down.svg';+import ChatTeardrop from '@phosphor/chat-teardrop.svg';+import Eye from '@phosphor/eye.svg';+import FileText from '@phosphor/file-text.svg';+import PaperPlaneTilt from '@phosphor/paper-plane-tilt.svg';+import Pencil from '@phosphor/pencil.svg';+import UserCircle from '@phosphor/user-circle.svg';+import Users from '@phosphor/users.svg';+import { Button } from '@ui';+import { createSignal, createUniqueId, For, Show } from 'solid-js';+import {+ type HomepagePersonId,+ homepagePeople,+} from '../../core/homepage-demo-people';++/** GroupChannelLabel for #launch: its other members, up to 20 characters. */+export const LAUNCH_MEMBERS = 'Julia, Teo, Gabriel +1 other';++type Level = 'view' | 'comment' | 'edit';+const LEVELS: { value: Level; label: string; icon: typeof Eye }[] = [+ { value: 'view', label: 'View', icon: Eye },+ { value: 'comment', label: 'Comment', icon: ChatTeardrop },+ { value: 'edit', label: 'Edit', icon: Pencil },+];++/** ShareOptions: the current level's icon and label over a native picker. */+function AccessLevel(props: {+ label: string;+ value: Level;+ onChange: (value: Level) => void;+ borderless?: boolean;+}) {+ const current = () =>+ LEVELS.find((level) => level.value === props.value) ?? LEVELS[0];+ const Icon = () => {+ const Glyph = current().icon;+ return <Glyph />;+ };+ return (+ <label+ class="doc-share-level"+ data-borderless={props.borderless ? 'true' : undefined}+ >+ <Icon />+ {current().label}+ <CaretDown />+ <select+ aria-label={props.label}+ value={props.value}+ onChange={(event) => props.onChange(event.currentTarget.value as Level)}+ >+ <For each={LEVELS}>+ {(level) => <option value={level.value}>{level.label}</option>}+ </For>+ </select>+ </label>+ );+}++const LINK_SCOPES = {+ NONE: {+ label: 'None',+ title: 'Link sharing off',+ description:+ 'Only people and channels you explicitly share with can access this item.',+ },+ TEAM: {+ label: 'Team',+ title: 'Team link',+ description:+ "Members of the owner's team with the link can access this item. This does not share it directly with a team or channel.",+ },+ PUBLIC: {+ label: 'Public',+ title: 'Public link',+ description: 'Anyone with the link can access this item.',+ },+} as const;+type Scope = keyof typeof LINK_SCOPES;++const MATCHES: [RegExp, HomepagePersonId][] = [+ [/teo/i, 'teo'],+ [/julia/i, 'julia'],+ [/gabriel/i, 'gabriel'],+ [/valentina/i, 'valentina'],+];++/**+ * The document Share modal's three cards: the share form, "People with+ * access to this document" (owner, then channels and people), and link+ * sharing. Recipients stay local to the page and survive closing it.+ */+export function DocumentShareSheet(props: {+ open: boolean;+ title: string;+ /** The channel the doc was mentioned in, labeled by its other members. */+ channel: { members: string; level: Level; fresh?: boolean };+ onClose: () => void;+}) {+ const titleId = createUniqueId();+ const [recipient, setRecipient] = createSignal('');+ const [level, setLevel] = createSignal<Level>('edit');+ const [channelLevel, setChannelLevel] = createSignal(props.channel.level);+ const [shared, setShared] = createSignal<+ { id: string; name: string; person?: HomepagePersonId; level: Level }[]+ >([]);+ const [scope, setScope] = createSignal<Scope>('NONE');+ const share = () => {+ const name = recipient().trim();+ if (!name) return;+ const person = MATCHES.find(([pattern]) => pattern.test(name))?.[1];+ setShared((rows) => [+ ...rows.filter((row) => row.person !== person || !person),+ {+ id: createUniqueId(),+ name: person ? homepagePeople[person].name : name,+ person,+ level: level(),+ },+ ]);+ setRecipient('');+ };+ return (+ <Show when={props.open}>+ <div+ class="doc-share-scrim"+ onClick={(event) => {+ if (event.target === event.currentTarget) props.onClose();+ }}+ onKeyDown={(event) => {+ if (event.key === 'Escape') props.onClose();+ }}+ >+ <section+ class="doc-share-card"+ role="dialog"+ aria-modal="false"+ aria-labelledby={titleId}+ >+ <header id={titleId}>+ <span>Share:</span>+ <FileText class="text-note" />+ <span>{props.title}</span>+ </header>+ <div class="doc-share-to">+ <input+ aria-label="Email or group"+ placeholder="To: Email or group"+ value={recipient()}+ onInput={(event) => setRecipient(event.currentTarget.value)}+ onKeyDown={(event) => {+ if (event.key === 'Enter' && (event.metaKey || event.ctrlKey))+ share();+ }}+ />+ <Show when={recipient().trim()}>+ <span class="doc-share-can">can</span>+ </Show>+ <AccessLevel+ label="Permission"+ value={level()}+ onChange={setLevel}+ borderless+ />+ </div>+ <textarea+ class="doc-share-message"+ aria-label="Optional message"+ placeholder="Optional message"+ />+ <div class="doc-share-actions">+ <Button+ variant="ghost"+ size="sm"+ class="text-ink-extra-muted"+ onClick={props.onClose}+ >+ Cancel+ </Button>+ <Button+ variant="strong"+ depth={3}+ disabled={!recipient().trim()}+ onClick={share}+ >+ <PaperPlaneTilt class="size-4" />+ Share+ <kbd>⌘↵</kbd>+ </Button>+ </div>+ </section>+ <section class="doc-share-card" aria-label="People with access">+ <header>+ <span>People with access to this document</span>+ </header>+ <div class="doc-share-people">+ <div class="doc-share-person">+ <span>+ <img src={homepagePeople.jacob.photo} alt="" />+ <span>Me</span>+ </span>+ <span class="doc-share-owner">Owner</span>+ </div>+ <div+ class="doc-share-person"+ data-new={props.channel.fresh ? 'true' : undefined}+ data-channel-access+ >+ <span>+ <Users />+ <span>{props.channel.members}</span>+ </span>+ <AccessLevel+ label={`Access for ${props.channel.members}`}+ value={channelLevel()}+ onChange={setChannelLevel}+ />+ </div>+ <For each={shared()}>+ {(row) => (+ <div class="doc-share-person" data-new="true">+ <span>+ <Show when={row.person} fallback={<UserCircle />}>+ {(person) => (+ <img src={homepagePeople[person()].photo} alt="" />+ )}+ </Show>+ <span>{row.name}</span>+ </span>+ <AccessLevel+ label={`Access for ${row.name}`}+ value={row.level}+ onChange={(next) =>+ setShared((rows) =>+ rows.map((item) =>+ item.id === row.id ? { ...item, level: next } : item+ )+ )+ }+ />+ </div>+ )}+ </For>+ </div>+ </section>+ <section class="doc-share-card" aria-label="Link sharing">+ <div class="doc-share-link">+ <div>+ <span>+ {LINK_SCOPES[scope()].title}+ <span class="doc-share-status">+ {scope() === 'NONE' ? 'Shared' : LINK_SCOPES[scope()].label}+ </span>+ </span>+ <span+ class="doc-share-scope"+ role="group"+ aria-label="Link sharing scope"+ >+ <For each={Object.keys(LINK_SCOPES) as Scope[]}>+ {(option) => (+ <button+ type="button"+ aria-pressed={scope() === option}+ onClick={() => setScope(option)}+ >+ {LINK_SCOPES[option].label}+ </button>+ )}+ </For>+ </span>+ </div>+ <p>{LINK_SCOPES[scope()].description}</p>+ </div>+ </section>+ </div>+ </Show>+ );+}diff --git a/apps/marketing/src/features/marketing/components/documents/DocumentSharingDemo.tsx b/apps/marketing/src/features/marketing/components/documents/DocumentSharingDemo.tsxnew file mode 100644index 0000000000..7a2b5475db--- /dev/null+++ b/apps/marketing/src/features/marketing/components/documents/DocumentSharingDemo.tsx@@ -0,0 +1,171 @@+import { createSignal, Show } from 'solid-js';+import { createDummyWorkspace } from '../../primitives/createDummyWorkspace';+import { createProductWalkthrough } from '../../primitives/createProductWalkthrough';+import { DemoCursor } from '../DemoCursor';+import { ProductDemo } from '../product/ProductPage';+import { WorkspaceChannel } from '../workspace/WorkspaceChannel';+import { DocumentFrame } from './DocumentFrame';+import { DocumentShareSheet, LAUNCH_MEMBERS } from './DocumentShareSheet';+import { controlPoint, createAnchor } from './documentScene';++/**+ * Mentioning a doc in a channel gives that channel access. Jacob opens the+ * doc from #launch and its Share modal already lists the channel.+ * Phases: 0 channel, 1 point at the mention, 2 click, 3 doc open, point at+ * Share, 4 click, 5 Share modal open.+ */+export function DocumentSharingDemo() {+ let root!: HTMLDivElement;+ let overlay: HTMLDivElement | undefined;+ const w = createDummyWorkspace('messages');+ w.setData('channels', (c) => c.id === 'launch', 'messages', [+ {+ id: 'demo-video',+ person: 'gabriel',+ body: 'Product demo is recorded. I dropped the link in the announcement draft.',+ time: '9:12 AM',+ },+ {+ id: 'invite-fix',+ person: 'teo',+ body: 'Invite fix is in review. Should land this afternoon.',+ time: '9:20 AM',+ },+ {+ id: 'announcement',+ person: 'julia',+ body: 'Announcement draft is done. I’ll schedule it once Teo’s fix ships.',+ time: '9:24 AM',+ },+ {+ id: 'plan',+ person: 'jacob',+ body: 'Plan for Thursday is up. Comments welcome @[Q3 launch plan](demo-mention:plan)',+ time: '9:31 AM',+ },+ ]);+ w.open('messages', 'launch');+ const [phase, setPhase] = createSignal(0);+ const [automatic, setAutomatic] = createSignal(true);+ const [doc, setDoc] = createSignal(false);+ const [sharing, setSharing] = createSignal(false);+ const finish = () => {+ setDoc(true);+ setSharing(true);+ setPhase(5);+ };+ const playback = createProductWalkthrough({+ root: () => root,+ steps: 5,+ reset: () => {},+ reduced: () => {+ setAutomatic(false);+ finish();+ },+ delay: (step) => [0, 1000, 800, 350, 1000, 350][step] ?? 600,+ advance: (step) => {+ if (step === 3) setDoc(true);+ if (step === 5) setSharing(true);+ setPhase(step);+ },+ });+ const pause = () => {+ setAutomatic(false);+ playback.pause();+ };+ const pointer = createAnchor({+ frame: () => overlay?.parentElement ?? undefined,+ track: phase,+ target: () => {+ if (!automatic()) return;+ const selector = [+ undefined,+ '[data-demo-mention="plan"]',+ '[data-demo-mention="plan"]',+ '[data-doc-share]',+ '[data-doc-share]',+ '[data-channel-access] .doc-share-level',+ ][phase()];+ return selector ? { selector, place: controlPoint } : undefined;+ },+ });+ return (+ <div ref={root} class="doc-story">+ <ProductDemo+ label="Mention a doc in a channel and the channel can open it"+ onInteract={pause}+ height={560}+ mobileHeight={660}+ >+ <Show+ when={doc()}+ fallback={+ // Mentions in the channel open the doc, as they do in the app.+ <div+ class="contents"+ onClick={(event) => {+ if (+ (event.target as HTMLElement).closest(+ '[data-demo-mention="plan"]'+ )+ )+ setDoc(true);+ }}+ >+ <WorkspaceChannel workspace={w} />+ </div>+ }+ >+ <DocumentFrame+ title="Q3 launch plan"+ tags={['Launch', 'Product']}+ onBack={() => {+ setSharing(false);+ setDoc(false);+ }}+ backLabel="Back to #launch"+ onShare={() => setSharing(true)}+ >+ <h2>Launch checklist</h2>+ <ul class="md-list md-check">+ <li class="checked md-strike text-ink-extra-muted">+ Finalize the product story+ </li>+ <li>Send the customer email</li>+ <li>Publish the changelog</li>+ </ul>+ <h2>Owners</h2>+ <p>+ Julia owns the announcement and the customer email. Teo owns the+ deploy and release checks. Jacob owns customer conversations.+ </p>+ </DocumentFrame>+ </Show>+ <DocumentShareSheet+ open={doc() && sharing()}+ title="Q3 launch plan"+ channel={{+ members: LAUNCH_MEMBERS,+ level: 'view',+ fresh: automatic(),+ }}+ onClose={() => setSharing(false)}+ />+ <div ref={overlay} class="doc-story-overlay" aria-hidden="true">+ <Show when={automatic() && pointer()}>+ {(point) => (+ <DemoCursor+ label="Jacob"+ class="doc-story-cursor doc-story-glide"+ clicking={phase() === 2 || phase() === 4}+ style={{+ transform: `translate(${point().x}px, ${point().y}px)`,+ }}+ />+ )}+ </Show>+ </div>+ </ProductDemo>+ </div>+ );+}diff --git a/apps/marketing/src/features/marketing/components/documents/DocumentStories.test.tsx b/apps/marketing/src/features/marketing/components/documents/DocumentStories.test.tsxnew file mode 100644index 0000000000..54338eb4a0--- /dev/null+++ b/apps/marketing/src/features/marketing/components/documents/DocumentStories.test.tsx@@ -0,0 +1,226 @@+import { cleanup, fireEvent, render, within } from '@solidjs/testing-library';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import {+ DocumentAgentDemo,+ DocumentMentionsDemo,+ DocumentOfflineDemo,+ DocumentSharingDemo,+} from './DocumentStories';++let intersections: IntersectionObserverCallback[];+let motionListeners: (() => void)[];+let reduced = false;+let hidden = false;+beforeEach(() => {+ intersections = [];+ motionListeners = [];+ reduced = false;+ hidden = false;+ vi.useFakeTimers();+ vi.stubGlobal('fetch', vi.fn());+ vi.spyOn(document, 'hidden', 'get').mockImplementation(() => hidden);+ vi.stubGlobal('matchMedia', () => ({+ get matches() {+ return reduced;+ },+ addEventListener: (_: string, callback: () => void) =>+ motionListeners.push(callback),+ removeEventListener: vi.fn(),+ }));+ vi.stubGlobal(+ 'IntersectionObserver',+ class {+ constructor(callback: IntersectionObserverCallback) {+ intersections.push(callback);+ }+ observe() {}+ disconnect() {}+ }+ );+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+});+afterEach(() => {+ cleanup();+ vi.advanceTimersByTime(100);+ expect(fetch).not.toHaveBeenCalled();+ expect(vi.getTimerCount()).toBe(0);+ vi.useRealTimers();+ vi.restoreAllMocks();+ vi.unstubAllGlobals();+});+function visible(value: boolean) {+ for (const callback of intersections)+ callback(+ [{ isIntersecting: value } as IntersectionObserverEntry],+ {} as IntersectionObserver+ );+}+function reduce() {+ reduced = true;+ for (const callback of motionListeners) callback();+}+const body = (view: ReturnType<typeof render>) =>+ view.getByRole('textbox', { name: 'Document body' });++it('rewrites the intro and types the checklist while Jacob keeps writing', () => {+ const view = render(() => <DocumentAgentDemo />);+ expect(body(view).textContent).toContain('We’re introducing the team');+ visible(true);+ vi.advanceTimersByTime(2000);+ expect(body(view).textContent).not.toContain('We’re introducing the team');+ expect(body(view).textContent).toContain('Thursday we launch');+ expect(body(view).textContent).toContain('Dana’s team');+ vi.advanceTimersByTime(30000);+ expect(body(view).textContent).toContain('Jacob: confirm the launch checks.');+ expect(body(view).textContent).toContain(+ 'Dana’s team gets a heads-up the night before.'+ );+ expect(vi.getTimerCount()).toBe(0);+});++it('leaves the document editable and never replaces the visitor’s text', () => {+ const view = render(() => <DocumentAgentDemo />);+ visible(true);+ const editor = body(view);+ fireEvent.pointerDown(editor);+ editor.innerHTML = '<p>Our team’s revised launch plan.</p>';+ fireEvent.blur(editor);+ reduce();+ vi.advanceTimersByTime(30000);+ expect(editor.textContent).toContain('Our team’s revised launch plan.');+ expect(editor.textContent).not.toContain('Teo: verify');+ expect(view.container.querySelector('.demo-cursor')).toBeNull();+});++it('shows the finished document for reduced motion', () => {+ reduced = true;+ const view = render(() => <DocumentAgentDemo />);+ expect(body(view).textContent).toContain('Teo: verify the invite flow.');+ expect(view.container.querySelector('.demo-cursor')).toBeNull();+ vi.advanceTimersByTime(100);+ expect(vi.getTimerCount()).toBe(0);+});++it('goes from offline to reconnecting to synced, with Julia’s edit merged', () => {+ const view = render(() => <DocumentOfflineDemo />);+ expect(view.getByRole('status', { name: 'Offline' })).toBeTruthy();+ expect(+ view.getByText("You're offline. Changes will sync when you reconnect.")+ ).toBeTruthy();+ visible(true);+ vi.advanceTimersByTime(3800);+ expect(body(view).textContent).toContain(+ 'Pricing doesn’t change for existing teams.'+ );+ expect(body(view).textContent).not.toContain('Send it Thursday at 9.');+ vi.advanceTimersByTime(300);+ expect(view.getByRole('status', { name: 'Reconnecting' })).toBeTruthy();+ vi.advanceTimersByTime(30000);+ expect(view.queryByRole('status')).toBeNull();+ expect(body(view).textContent).toContain(+ 'Send it Thursday at 9. Lead with the shared inbox. Pricing doesn’t change for existing teams.'+ );+ expect(vi.getTimerCount()).toBe(0);+});++it('shows the merged, synced document for reduced motion', () => {+ reduced = true;+ const view = render(() => <DocumentOfflineDemo />);+ expect(view.queryByRole('status')).toBeNull();+ expect(body(view).textContent).toContain('Send it Thursday at 9.');+ expect(body(view).textContent).toContain('existing teams.');+});++it('opens the mention menu and inserts a task, company, email, and channel', () => {+ const view = render(() => <DocumentMentionsDemo />);+ visible(true);+ vi.advanceTimersByTime(1100);+ // The scripted menu is decorative, so it sits in the aria-hidden overlay.+ const menu = within(+ view.getByRole('listbox', { name: 'Mentions', hidden: true })+ );+ expect(menu.getByText('People & Groups')).toBeTruthy();+ vi.advanceTimersByTime(900);+ expect(menu.getByText('Documents, Agents, & Tasks')).toBeTruthy();+ expect(+ menu.getByRole('option', { selected: true, hidden: true }).textContent+ ).toContain('Fix the team invite handoff');+ vi.advanceTimersByTime(30000);+ expect(view.queryByRole('listbox', { hidden: true })).toBeNull();+ const kinds = [+ ...body(view).querySelectorAll<HTMLElement>('[data-doc-mention]'),+ ].map((mention) => `${mention.dataset.docMention}:${mention.textContent}`);+ expect(kinds).toEqual(+ expect.arrayContaining([+ 'task:Fix the team invite handoff',+ 'company:The Meadow',+ 'email:Team invites for The Meadow',+ 'channel:launch',+ ])+ );+ expect(view.getByText('References (2)')).toBeTruthy();+ expect(vi.getTimerCount()).toBe(0);+});++it('shows every mention without the menu for reduced motion', () => {+ reduced = true;+ const view = render(() => <DocumentMentionsDemo />);+ expect(view.queryByRole('listbox', { hidden: true })).toBeNull();+ expect(body(view).textContent).toContain('when it ships.');+ expect(body(view).querySelectorAll('[data-doc-mention]').length).toBe(5);+});++it('opens the doc from #launch and shows the channel already has access', () => {+ const view = render(() => <DocumentSharingDemo />);+ expect(view.getByRole('log', { name: 'Channel launch' })).toBeTruthy();+ visible(true);+ vi.advanceTimersByTime(30000);+ const access = within(+ view.getByRole('region', { name: 'People with access' })+ );+ expect(access.getByText('Julia, Teo, Gabriel +1 other')).toBeTruthy();+ expect(+ (+ access.getByLabelText(+ 'Access for Julia, Teo, Gabriel +1 other'+ ) as HTMLSelectElement+ ).value+ ).toBe('view');+ expect(view.getByText('Link sharing off')).toBeTruthy();+ expect(vi.getTimerCount()).toBe(0);+});++it('shares the doc with a person and keeps the access after closing', () => {+ const view = render(() => <DocumentSharingDemo />);+ fireEvent.click(+ view.container.querySelector('[data-demo-mention="plan"]') as HTMLElement+ );+ fireEvent.click(view.getByRole('button', { name: 'Share' }));+ const dialog = within(view.getByRole('dialog'));+ fireEvent.input(dialog.getByLabelText('Email or group'), {+ target: { value: 'teo' },+ });+ fireEvent.change(dialog.getByLabelText('Permission'), {+ target: { value: 'comment' },+ });+ fireEvent.click(dialog.getByRole('button', { name: /Share/ }));+ const people = () =>+ within(view.getByRole('region', { name: 'People with access' }));+ expect(people().getByText('Teo')).toBeTruthy();+ expect(+ (people().getByLabelText('Access for Teo') as HTMLSelectElement).value+ ).toBe('comment');+ fireEvent.click(dialog.getByRole('button', { name: 'Cancel' }));+ expect(view.queryByRole('dialog')).toBeNull();+ fireEvent.click(view.getByRole('button', { name: 'Share' }));+ expect(+ (people().getByLabelText('Access for Teo') as HTMLSelectElement).value+ ).toBe('comment');+});diff --git a/apps/marketing/src/features/marketing/components/documents/DocumentStories.tsx b/apps/marketing/src/features/marketing/components/documents/DocumentStories.tsxindex 094840e87c..6a32c84447 100644--- a/apps/marketing/src/features/marketing/components/documents/DocumentStories.tsx+++ b/apps/marketing/src/features/marketing/components/documents/DocumentStories.tsx@@ -1,170 +1,380 @@-import ListChecks from '@phosphor/list-checks.svg';-import { createSignal, Show } from 'solid-js';-import { createDummyWorkspace } from '../../primitives/createDummyWorkspace';-import { createProductWalkthrough } from '../../primitives/createProductWalkthrough';+import Cloud from '@phosphor/cloud.svg';+import CloudWarning from '@phosphor/cloud-warning.svg';+import { Tooltip } from '@ui/components/Tooltip';+import { For, Show } from 'solid-js';+import { DemoCursor } from '../DemoCursor';import { HomepageConversation } from '../HomepageConversation';+import { HomepageMention } from '../HomepageMention';import { ProductDemo } from '../product/ProductPage';-import { ProductShareDialog } from '../product/ProductShareDialog';-import { ProductWorkspace } from '../product/ProductWorkspace';-import { WorkspaceDocuments } from '../workspace/WorkspaceDocuments';-import '../workspace/dummy-workspace.css';-import '../demo-markdown.css';+import { DocumentFrame } from './DocumentFrame';+import {+ controlPoint,+ createAnchor,+ createSceneClock,+ typed,+} from './documentScene';-const draft =- '## Thursday’s launch\n\nWe’re introducing the team workspace on Thursday. The invite flow and announcement need a final check.';-const finished =- '## Thursday’s launch\n\nBring the team’s emails, messages, and tasks into one workspace.\n\n## Before we publish\n\n- Teo: verify the invite flow.\n- Julia: review the announcement.\n- Jacob: confirm the final launch checks.';-function documentWorkspace() {- const w = createDummyWorkspace('documents');- w.open('documents', 'plan');- w.setData('documents', (d) => d.id === 'plan', { body: draft, comments: [] });- return w;-}+export { DocumentMentionsDemo } from './DocumentMentionsDemo';+export { DocumentSharingDemo } from './DocumentSharingDemo';-export function DocumentEditingDemo() {- let root!: HTMLDivElement;- const w = documentWorkspace();- const [editing, setEditing] = createSignal(false);- const finish = () =>- w.setData('documents', (d) => d.id === 'plan', 'body', finished);- const playback = createProductWalkthrough({- root: () => root,- steps: 3,- reset: () => {},- reduced: finish,- advance: (s) => {- if (s === 1) setEditing(true);- if (s === 2) finish();- if (s === 3) setEditing(false);- },- });- return (- <ProductDemo- ref={(el) => (root = el)}- label="Edit the working launch document"- action={editing() ? 'document' : undefined}- onInteract={playback.pause}- >- <WorkspaceDocuments workspace={w} />- </ProductDemo>- );+/** A collaborator's insertion point inside the editable text. */+function Caret(props: { who: 'claude' | 'jacob' | 'julia' }) {+ return <span class="doc-caret" data-caret={props.who} />;}+const OLD_INTRO =+ 'We’re introducing the team workspace on Thursday. It brings email, messages, tasks, and docs into one place, so a team can stop switching between five apps to get work done. The invite flow and the announcement still need a final check before we publish.';+const NEW_INTRO =+ 'Thursday we launch the team workspace: email, chat, tasks, and docs in one place.';+const CHECK_HEADING = 'Before we publish';+const CHECKLIST = [+ 'Teo: verify the invite flow.',+ 'Julia: final read of the announcement.',+ 'Jacob: confirm the launch checks.',+];+const ANNOUNCEMENT = 'Julia sends it at 9.';+const JACOB_ADDS = ' Dana’s team gets a heads-up the night before.';++// Claude selects the intro, retypes it, then writes the checklist line by+// line. Jacob keeps writing further down the whole time.+const AGENT = {+ select: 250,+ replace: 750,+ intro: 2050,+ heading: [2200, 2500],+ items: [+ [2600, 3200],+ [3250, 3900],+ [3950, 4550],+ ],+ jacob: [600, 3000],+ end: 4700,+} as const;++/** Claude edits the open document with its own cursor while Jacob types. */export function DocumentAgentDemo() {let root!: HTMLDivElement;- const w = documentWorkspace();- const [editing, setEditing] = createSignal(false);- const finish = () => {- w.setData('documents', (d) => d.id === 'plan', 'body', finished);- setEditing(false);- };- const playback = createProductWalkthrough({+ let overlay: HTMLDivElement | undefined;+ const clock = createSceneClock({root: () => root,- steps: 4,- reset: () => {},- reduced: finish,- advance: (s) => {- if (s === 1) setEditing(true);- if (s === 2) finish();- },+ end: AGENT.end,+ lead: 700,+ });+ const t = clock.t;+ const claudeAt = () => {+ if (t() < AGENT.select) return 'start';+ if (t() < AGENT.replace) return 'selected';+ if (t() < AGENT.heading[0]) return 'intro';+ if (t() < AGENT.items[0][0]) return 'heading';+ const item = AGENT.items.reduce(+ (current, [from], index) => (t() >= from ? index : current),+ 0+ );+ return `item-${item}`;+ };+ const frame = () => overlay?.parentElement ?? undefined;+ const claude = createAnchor({+ frame,+ track: t,+ target: () => ({ selector: '[data-caret="claude"]' }),+ });+ const jacob = createAnchor({+ frame,+ track: t,+ target: () => ({ selector: '[data-caret="jacob"]' }),});return (- <div ref={root} onPointerDown={playback.pause} onKeyDown={playback.pause}>+ <div+ ref={root}+ class="doc-story doc-story-page-fade"+ data-live={clock.live()}+ ><div class="product-demo-request"><HomepageConversationmessages={[{person: 'julia',- text: '@Claude, make the launch introduction shorter and add a checklist with Teo, Julia, and Jacob’s next steps.',+ text: (+ <>+ <span class="homepage-person-mention">@Claude</span>, make the+ intro in{' '}+ <HomepageMention+ kind="md"+ label="Q3 launch plan"+ description="Thursday’s launch: the intro, owners, and the announcement plan."+ href="#document-agents"+ />{' '}+ shorter and add a checklist with Teo, Julia, and Jacob’s next+ steps.+ </>+ ),},]}/></div><ProductDemo- label="An agent edits the same document"- onInteract={playback.pause}- action={editing() ? 'document' : undefined}+ label="Claude edits the launch plan while Jacob keeps writing"+ onInteract={clock.takeOver}+ height={540}+ mobileHeight={640}>- <WorkspaceDocuments workspace={w} />- <Show when={editing()}>- <div class="product-editing-pointer" aria-hidden="true">- <svg viewBox="0 0 16 20">- <path d="M2 1v15l4-4 3 7 3-1-3-7h6Z" fill="currentColor" />- </svg>- <span>Claude</span>- </div>- </Show>+ <DocumentFrame+ title="Q3 launch plan"+ tags={['Launch', 'Product']}+ overlay={+ <div ref={overlay} class="doc-story-overlay" aria-hidden="true">+ <Show when={clock.live() && claude()}>+ {(point) => (+ <DemoCursor+ label="Claude"+ class="doc-story-cursor"+ style={{+ transform: `translate(${point().x}px, ${point().y}px)`,+ }}+ />+ )}+ </Show>+ <Show when={clock.live() && jacob()}>+ {(point) => (+ <DemoCursor+ label="Jacob"+ class="doc-story-cursor"+ style={{+ transform: `translate(${point().x}px, ${point().y}px)`,+ }}+ />+ )}+ </Show>+ </div>+ }+ >+ <h2>Thursday’s launch</h2>+ <p>+ <Show+ when={t() < AGENT.replace}+ fallback={+ <>+ {typed(NEW_INTRO, t(), AGENT.replace, AGENT.intro)}+ <Show when={claudeAt() === 'intro'}>+ <Caret who="claude" />+ </Show>+ </>+ }+ >+ <Show when={claudeAt() === 'start'}>+ <Caret who="claude" />+ </Show>+ <span+ class={+ claudeAt() === 'selected' ? 'doc-story-selected' : undefined+ }+ >+ {OLD_INTRO}+ </span>+ <Show when={claudeAt() === 'selected'}>+ <Caret who="claude" />+ </Show>+ </Show>+ </p>+ <Show when={t() >= AGENT.heading[0]}>+ <h2>+ {typed(CHECK_HEADING, t(), AGENT.heading[0], AGENT.heading[1])}+ <Show when={claudeAt() === 'heading'}>+ <Caret who="claude" />+ </Show>+ </h2>+ </Show>+ <Show when={t() >= AGENT.items[0][0]}>+ <ul class="md-list md-check">+ <For each={CHECKLIST}>+ {(item, index) => (+ <Show when={t() >= AGENT.items[index()][0]}>+ <li>+ {typed(+ item,+ t(),+ AGENT.items[index()][0],+ AGENT.items[index()][1]+ )}+ <Show when={claudeAt() === `item-${index()}`}>+ <Caret who="claude" />+ </Show>+ </li>+ </Show>+ )}+ </For>+ </ul>+ </Show>+ <h2>Announcement</h2>+ <p>+ {ANNOUNCEMENT}+ {typed(JACOB_ADDS, t(), AGENT.jacob[0], AGENT.jacob[1])}+ <Caret who="jacob" />+ </p>+ <h2>Owners</h2>+ <p>+ Julia owns the announcement and the customer email. Teo owns the+ deploy and release checks. Jacob owns customer conversations.+ </p>+ <h2>After launch</h2>+ <p>+ Check activation on Friday and send Dana’s team the rollout plan.+ </p>+ </DocumentFrame></ProductDemo></div>);}-export function DocumentDiscussionDemo() {- const w = documentWorkspace();- w.setData('documents', (d) => d.id === 'plan', {- body: '## Announcement wording\n\nBring your team’s emails, messages, and tasks into one workspace.',- comments: [- {- id: 'wording',- person: 'teo',- body: 'Can we make the invite flow explicit? That’s what changes for existing teams.',- time: '9:40 AM',- },- {- id: 'answer',- person: 'julia',- body: 'Yes. I’ll add that in the next paragraph before publishing.',- time: '9:42 AM',- },- ],- });- return (- <ProductDemo label="Discuss the document alongside its content">- <WorkspaceDocuments workspace={w} />- </ProductDemo>- );-}+const JULIA_EDIT = 'Send it Thursday at 9. ';+const ANNOUNCEMENT_LINE = 'Lead with the shared inbox.';+const JACOB_OFFLINE = ' Pricing doesn’t change for existing teams.';++// Offline while Jacob writes, reconnecting, then synced with Julia's edit to+// the same paragraph merged in front of his.+const OFFLINE = {+ hover: 1100,+ type: [1500, 3200],+ connecting: 3500,+ synced: 4400,+ end: 4600,+} as const;-export function DocumentLinkedTaskDemo() {- const w = documentWorkspace();+/** The real offline indicator while Jacob writes; Julia's edit merges in. */+export function DocumentOfflineDemo() {+ let root!: HTMLDivElement;+ let overlay: HTMLDivElement | undefined;+ const clock = createSceneClock({+ root: () => root,+ end: OFFLINE.end,+ lead: 500,+ });+ const t = clock.t;+ const status = () =>+ t() < OFFLINE.connecting+ ? 'offline'+ : t() < OFFLINE.synced+ ? 'connecting'+ : undefined;+ const hovering = () => clock.live() && t() < OFFLINE.hover;+ const synced = () => t() >= OFFLINE.synced;+ const gliding = () => t() >= OFFLINE.hover && t() < OFFLINE.type[0];+ const frame = () => overlay?.parentElement ?? undefined;+ const jacob = createAnchor({+ frame,+ track: t,+ target: () =>+ hovering()+ ? { selector: '[data-sync-status]', place: controlPoint }+ : { selector: '[data-caret="jacob"]' },+ });+ const julia = createAnchor({+ frame,+ track: t,+ target: () => (synced() ? { selector: '[data-caret="julia"]' } : undefined),+ });return (- <ProductDemo label="Open the task linked to the document">- <Show- when={w.contentView() === 'documents'}- fallback={<ProductWorkspace workspace={w} />}+ <div+ ref={root}+ class="doc-story doc-story-page-fade"+ data-live={clock.live()}+ >+ <ProductDemo+ label="Jacob writes offline, then his edits merge with Julia’s"+ onInteract={clock.takeOver}+ height={470}+ mobileHeight={560}>- <WorkspaceDocuments- workspace={w}- relatedContent={- <div class="mt-6">- <button- type="button"- class="dummy-entity-link"- onClick={() => w.open('tasks', 'checklist')}- >- <ListChecks class="size-4 text-task" />- Prepare the launch checklist- </button>+ <DocumentFrame+ title="Q3 launch plan"+ tags={['Launch', 'Product']}+ status={+ <Show when={status()}>+ {(current) => (+ <span class="doc-sync">+ <Tooltip+ as="span"+ label={+ current() === 'offline'+ ? "You're offline. Changes will sync when you reconnect."+ : 'Reconnecting…'+ }+ >+ <span+ role="status"+ data-sync-status+ class="doc-sync-status"+ data-status={current()}+ aria-label={+ current() === 'offline' ? 'Offline' : 'Reconnecting'+ }+ >+ <Show when={current() === 'offline'} fallback={<Cloud />}>+ <CloudWarning />+ </Show>+ </span>+ </Tooltip>+ <Show when={hovering() && current() === 'offline'}>+ <span class="doc-tooltip" aria-hidden="true">+ You're offline. Changes will sync when you reconnect.+ </span>+ </Show>+ </span>+ )}+ </Show>+ }+ overlay={+ <div ref={overlay} class="doc-story-overlay" aria-hidden="true">+ <Show when={clock.live() && jacob()}>+ {(point) => (+ <DemoCursor+ label="Jacob"+ class={`doc-story-cursor${gliding() ? ' doc-story-glide' : ''}`}+ style={{+ transform: `translate(${point().x}px, ${point().y}px)`,+ }}+ />+ )}+ </Show>+ <Show when={clock.live() && julia()}>+ {(point) => (+ <DemoCursor+ label="Julia"+ class="doc-story-cursor"+ style={{+ transform: `translate(${point().x}px, ${point().y}px)`,+ }}+ />+ )}+ </Show></div>}- />- </Show>- </ProductDemo>- );-}--/** The native Share flow, isolated from real document access. */-export function DocumentSharingDemo() {- const w = documentWorkspace();- const [open, setOpen] = createSignal(false);- return (- <ProductDemo label="Share a working document with a teammate">- <WorkspaceDocuments workspace={w} onShare={() => setOpen(true)} />- <ProductShareDialog- open={open()}- title="Q3 launch plan"- onClose={() => setOpen(false)}- />- </ProductDemo>+ >+ <h2>Launch checklist</h2>+ <ul class="md-list md-check">+ <li class="checked md-strike text-ink-extra-muted">+ Finalize the product story+ </li>+ <li>Send the customer email</li>+ <li>Publish the changelog</li>+ </ul>+ <h2>Announcement</h2>+ <p>+ <Show when={synced()}>+ <span class="doc-story-merged">{JULIA_EDIT}</span>+ <Caret who="julia" />+ </Show>+ {ANNOUNCEMENT_LINE}+ {typed(JACOB_OFFLINE, t(), OFFLINE.type[0], OFFLINE.type[1])}+ <Caret who="jacob" />+ </p>+ <h2>Owners</h2>+ <p>+ Julia owns the announcement and the customer email. Teo owns the+ deploy and release checks.+ </p>+ </DocumentFrame>+ </ProductDemo>+ </div>);}diff --git a/apps/marketing/src/features/marketing/components/documents/document-stories.css b/apps/marketing/src/features/marketing/components/documents/document-stories.cssnew file mode 100644index 0000000000..a9964b19d3--- /dev/null+++ b/apps/marketing/src/features/marketing/components/documents/document-stories.css@@ -0,0 +1,133 @@+/* Docs page demos. Body spacing follows the LexicalMarkdown theme:+ paragraphs my-4, h2 at 1.125em with mb-2, lists my-4 with 0.25em items. */+.doc-story { position: relative; }+.doc-story-scroll { scrollbar-width: none; }+.doc-story-page { max-width: 768px; margin: 0 auto; padding: 44px 0 64px; text-align: left; }+.doc-story-title { margin-bottom: 14px; outline: none; font: 600 24px/32px 'Inter Variable', Inter, sans-serif; }+.doc-story-tags { margin: 0 0 22px -6px; }+.doc-story-body { outline: none; color: var(--color-ink); font-size: 15px; line-height: 1.6; overflow-wrap: break-word; }+.doc-story-body > * { margin: 0; }+.doc-story-body > p { margin: 12px 0; }+.doc-story-body > h2 { margin: 22px 0 6px; font-size: 1.125em; font-weight: 600; line-height: 1.5; }+.doc-story-body > :first-child { margin-top: 0; }+.doc-story-body > .md-list { margin: 8px 0 8px 1.5em; }+.doc-story-body > .md-list > li { margin: 0.25em 0; }++/* A doc runs past the window: let it fade out under the stage's tail+ instead of clipping a line of text at the window's edge. */+.product-page .doc-story-page-fade .product-demo > .dummy-main { flex: none; height: calc(100% + var(--product-demo-fade-tail, 0px)); }++/* MarkdownSidePanelSections beside the doc once the window is wide enough. */+@container sample-main (min-width: 700px) {+ .doc-story-split .sample-detail-layout[data-panel-open='true'] .sample-details { position: relative; inset: auto; z-index: auto; display: block; width: 300px; min-width: 0; max-width: none; padding: 8px 8px 8px 0; background: transparent; }+}++/* Everything that moves sits in one layer over the window. */+.doc-story-overlay { position: absolute; inset: 0; z-index: 7; overflow: hidden; pointer-events: none; }+.doc-story-cursor { transition: transform 160ms linear; }+.doc-story-cursor.doc-story-glide { transition-duration: 650ms; transition-timing-function: cubic-bezier(.2, .8, .2, 1); }++/* An insertion point: zero width, so it never shifts the text it marks. */+.doc-caret { position: relative; display: inline-block; width: 0; height: 1.25em; vertical-align: text-bottom; pointer-events: none; }+.doc-caret::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; border-radius: 1px; background: var(--doc-caret, var(--color-ink)); }+.doc-caret[data-caret='claude'] { --doc-caret: #d97757; }+.doc-caret[data-caret='julia'] { --doc-caret: var(--color-violet); }+.doc-story[data-live='false'] .doc-caret { display: none; }+.doc-story-selected { border-radius: 2px; background: color-mix(in srgb, #d97757 30%, transparent); }++/* An edit that arrived from someone else while this copy was offline. */+.doc-story-merged { border-radius: 3px; animation: doc-story-merged 2.4s ease-out both; }+@keyframes doc-story-merged {+ 0%, 35% { background: color-mix(in srgb, var(--color-violet) 32%, transparent); }+ 100% { background: transparent; }+}++/* CollaborationStatusIndicator: offline and reconnecting islands. */+.doc-sync { position: relative; display: inline-flex; }+.doc-sync-status { display: inline-flex; width: 24px; height: 24px; flex-shrink: 0; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 6px; }+.doc-sync-status > svg { width: 16px; height: 16px; }+.doc-sync-status[data-status='offline'] { border-color: color-mix(in oklch, var(--color-alert) 20%, transparent); background: var(--color-alert-bg); color: var(--color-alert-ink); }+.doc-sync-status[data-status='connecting'] { color: var(--color-ink-extra-muted); }+.doc-sync-status[data-status='connecting'] > svg { animation: doc-story-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; }+@keyframes doc-story-pulse { 50% { opacity: 0.5; } }+.doc-tooltip { position: absolute; top: calc(100% + 4px); right: 0; z-index: 6; width: max-content; max-width: 240px; padding: 8px; border-radius: 8px; background: var(--color-tooltip); box-shadow: 0 8px 24px rgb(0 0 0 / 0.45); color: var(--color-ink-muted); font-size: 12px; line-height: 16px; white-space: normal; }++/* MentionsMenu, positioned inside the window instead of a portal. */+.workspace-demo .doc-story-overlay .demo-mention-menu { position: absolute; width: min(384px, calc(100% - 16px)); max-height: none; background: var(--color-menu); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); pointer-events: none; }+.workspace-demo .doc-story-overlay .demo-mention-groups { max-height: 256px; overflow: hidden; }+.doc-mention-query { color: var(--color-ink); }+.doc-story-body .demo-inline-mention:not(.mention-person) > .demo-mention-name { color: var(--color-ink); }+.demo-mention-icon.mention-company, .demo-mention-icon.mention-email, .demo-mention-icon.mention-channel { color: var(--color-ink-muted); }+.demo-mention-icon.mention-document { color: var(--color-note); }++/* References: avatar, sender, "in", source chip, relative time, quoted body. */+.doc-ref-row { display: flex; min-width: 0; flex-direction: column; padding: 4px 0; border-radius: 8px; }+.doc-ref-row + .doc-ref-row { margin-top: 6px; }+.doc-ref-head { display: flex; min-width: 0; min-height: 24px; align-items: center; gap: 6px; font-size: 12px; line-height: 20px; }+.doc-ref-head > img { width: 16px; height: 16px; flex: none; border-radius: 50%; object-fit: cover; }+.doc-ref-head > b { flex: none; font-weight: 500; color: var(--color-ink); }+.doc-ref-head > .doc-ref-in { flex: none; color: color-mix(in srgb, var(--color-ink-muted) 70%, transparent); }+.doc-ref-source { display: inline-flex; min-width: 0; align-items: center; gap: 4px; color: var(--color-ink-muted); }+.doc-ref-source > svg { width: 12px; height: 12px; flex: none; }+.doc-ref-source > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 20%, transparent); text-underline-offset: 2px; }+.doc-ref-time { flex: none; color: var(--color-ink-extra-muted); font-variant-numeric: tabular-nums; }+.doc-ref-body { margin: 6px 0 0 4px; padding-left: 10px; border-left: 2px solid color-mix(in srgb, var(--color-ink-muted) 12%, transparent); color: color-mix(in srgb, var(--color-ink-muted) 80%, transparent); font-size: 12px; line-height: 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }+.doc-panel-tags { display: flex; flex-wrap: wrap; gap: 6px; }+.doc-panel-meta { padding: 4px 12px 8px; color: var(--color-ink-extra-muted); font-size: 12px; line-height: 18px; }++/* Share modal: three Panel cards (form, people with access, link sharing). */+.doc-share-scrim { position: absolute; inset: 0 0 calc(-1 * var(--product-demo-fade-tail, 0px)); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 16px 16px; overflow: hidden; background: rgb(8 9 11 / 0.55); }+.doc-share-card { width: min(640px, 100%); flex: none; overflow: hidden; border: 1px solid var(--color-edge-muted); border-radius: 12px; background: var(--color-dialog); box-shadow: 0 18px 48px rgb(0 0 0 / 0.45); text-align: left; animation: doc-share-in 220ms ease-out both; }+.doc-share-card > header { display: flex; min-width: 0; align-items: center; gap: 6px; padding: 12px 16px; font-size: 14px; font-weight: 500; }+.doc-share-card > header > svg { width: 16px; height: 16px; flex: none; }+.doc-share-card > header > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.doc-share-to { display: flex; min-height: 44px; align-items: center; gap: 8px; padding: 0 12px 0 16px; background: var(--color-surface); }+.doc-share-to input { min-width: 0; flex: 1; background: transparent; color: var(--color-ink); font-size: 14px; outline: none; }+.doc-share-to input::placeholder, .doc-share-message::placeholder { color: var(--color-ink-placeholder); }+.doc-share-can { color: var(--color-ink-extra-muted); font-size: 14px; }+.doc-share-message { display: block; width: 100%; min-height: 64px; padding: 8px 16px; border-top: 1px solid var(--color-edge-muted); background: transparent; color: var(--color-ink); font-size: 14px; resize: none; outline: none; }+.doc-share-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px 16px; }+.doc-share-actions kbd { font: 500 11px/1 'Inter Variable', Inter, sans-serif; opacity: 0.6; }+.doc-share-people { display: grid; gap: 12px; padding: 4px 16px 16px; font-size: 14px; }+.doc-share-person { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; border-radius: 6px; }+.doc-share-person > span:first-child { display: flex; min-width: 0; align-items: center; gap: 8px; font-weight: 500; }+.doc-share-person > span:first-child > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.doc-share-person img { width: 16px; height: 16px; flex: none; border-radius: 50%; object-fit: cover; }+.doc-share-person > span:first-child > svg { width: 16px; height: 16px; flex: none; }+.doc-share-owner { color: var(--color-ink-muted); font-size: 12px; font-weight: 500; }+.doc-share-person[data-new='true'] { animation: doc-share-row 1.8s ease-out both; }+@keyframes doc-share-row { 0%, 40% { background: color-mix(in srgb, var(--color-accent) 16%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--color-accent) 16%, transparent); } 100% { background: transparent; box-shadow: 0 0 0 6px transparent; } }+.doc-share-level { position: relative; display: inline-flex; min-width: 67px; height: 28px; flex: none; align-items: center; gap: 4px; padding: 0 4px 0 8px; border: 1px solid var(--color-edge-muted); border-radius: 6px; color: var(--color-ink); font-size: 13px; }+.doc-share-level[data-borderless='true'] { border-color: transparent; }+.doc-share-level > svg { width: 16px; height: 16px; flex: none; }+.doc-share-level > svg:last-of-type { color: var(--color-ink-extra-muted); }+.doc-share-level > select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }+.doc-share-link { display: flex; flex-direction: column; gap: 12px; padding: 16px; font-size: 14px; }+.doc-share-link > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }+.doc-share-link > div > span { display: flex; align-items: center; gap: 8px; font-weight: 500; }+.doc-share-status { padding: 2px 8px; border: 1px solid color-mix(in srgb, var(--color-accent) 30%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--color-accent) 10%, transparent); color: var(--color-accent); font-size: 12px; font-weight: 500; }+.doc-share-scope { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--color-surface); font-size: 12px; }+.doc-share-scope > button { padding: 3px 10px; border-radius: 6px; color: var(--color-ink-muted); }+.doc-share-scope > button[aria-pressed='true'] { background: var(--color-surface-3, var(--color-active)); color: var(--color-ink); }+.doc-share-link > p { color: var(--color-ink-muted); }+@keyframes doc-share-in { from { opacity: 0; transform: translateY(6px); } }++@media (max-width: 699px) {+ .doc-story-page { padding: 28px 0 48px; }+ .doc-story-scroll { padding-inline: 18px; }+ .doc-story-title { font-size: 22px; line-height: 30px; }+ .doc-story-body { font-size: 14px; }+ .doc-tooltip { max-width: 210px; }+ .doc-share-scrim { padding: 16px 10px 10px; }+ .doc-share-card > header { padding: 10px 12px; }+ .doc-share-to { padding-left: 12px; }+ .doc-share-message { min-height: 44px; padding-inline: 12px; }+ .doc-share-actions { padding: 8px 12px 12px; }+ .doc-share-actions kbd { display: none; }+ .doc-share-people { padding-inline: 12px; }+ .doc-share-link { padding: 12px; }+}+@media (prefers-reduced-motion: reduce) {+ .doc-story-merged, .doc-share-card, .doc-share-person[data-new='true'] { animation: none; }+ .doc-sync-status[data-status='connecting'] > svg { animation: none; }+}diff --git a/apps/marketing/src/features/marketing/components/documents/documentScene.ts b/apps/marketing/src/features/marketing/components/documents/documentScene.tsnew file mode 100644index 0000000000..723e06b220--- /dev/null+++ b/apps/marketing/src/features/marketing/components/documents/documentScene.ts@@ -0,0 +1,109 @@+import { createEffect, createSignal, onCleanup, onMount } from 'solid-js';+import { createProductWalkthrough } from '../../primitives/createProductWalkthrough';++export type Point = { x: number; y: number };++/**+ * A walkthrough clock. Every frame of a scene is a pure function of `t`+ * (milliseconds), so reduced motion and a visitor's takeover can jump to the+ * finished document without replaying anything.+ */+export function createSceneClock(options: {+ root: () => HTMLElement;+ end: number;+ /** Wait before the first frame once the demo is on screen. */+ lead?: number;+ tick?: number;+}) {+ const tick = options.tick ?? 50;+ const [t, setT] = createSignal(0);+ const [live, setLive] = createSignal(true);+ const [reduced, setReduced] = createSignal(false);+ const finish = () => setT(options.end);+ const playback = createProductWalkthrough({+ root: options.root,+ steps: Math.ceil(options.end / tick),+ reset: () => {},+ reduced: () => {+ setReduced(true);+ setLive(false);+ finish();+ },+ delay: (step) => (step === 1 ? (options.lead ?? 600) : tick),+ advance: (step) => setT(Math.min(options.end, step * tick)),+ });+ return {+ t,+ /** False once the visitor takes over or motion is reduced. */+ live,+ reduced,+ done: () => t() >= options.end,+ /** The visitor's first interaction settles the scene, then stops it. */+ takeOver: () => {+ if (!live()) return;+ playback.pause();+ finish();+ setLive(false);+ },+ };+}++/** The visible part of `text` while it is typed between `from` and `to`. */+export function typed(text: string, t: number, from: number, to: number) {+ if (t <= from) return '';+ if (t >= to) return text;+ return text.slice(0, Math.round((text.length * (t - from)) / (to - from)));+}++/** Where the pointer tip rests on an insertion point or a control. */+export const caretPoint = (rect: DOMRect): Point => ({+ x: rect.left + 1,+ y: rect.top + rect.height * 0.72,+});+export const controlPoint = (rect: DOMRect): Point => ({+ x: rect.left + Math.min(rect.width / 2, 36),+ y: rect.top + rect.height / 2,+});++/**+ * Measures a target inside the demo window so a DemoCursor can follow it,+ * re-measuring whenever the scene changes, the window resizes or it scrolls.+ */+export function createAnchor(options: {+ frame: () => HTMLElement | undefined;+ target: () =>+ | { selector: string; place?: (rect: DOMRect) => Point }+ | undefined;+ /** Re-measure whenever this changes, e.g. the scene clock. */+ track?: () => unknown;+}) {+ const [point, setPoint] = createSignal<Point>();+ const measure = () => {+ options.track?.();+ const frame = options.frame();+ const target = options.target();+ const element = target+ ? frame?.querySelector<HTMLElement>(target.selector)+ : undefined;+ if (!frame || !target || !element) {+ setPoint(undefined);+ return;+ }+ const bounds = frame.getBoundingClientRect();+ const place = (target.place ?? caretPoint)(element.getBoundingClientRect());+ setPoint({ x: place.x - bounds.left, y: place.y - bounds.top });+ };+ createEffect(measure);+ onMount(() => {+ const frame = options.frame();+ if (!frame) return;+ const resize = new ResizeObserver(measure);+ resize.observe(frame);+ frame.addEventListener('scroll', measure, true);+ onCleanup(() => {+ resize.disconnect();+ frame.removeEventListener('scroll', measure, true);+ });+ });+ return point;+}diff --git a/apps/marketing/src/features/marketing/components/email/EmailAutoTagsDemo.tsx b/apps/marketing/src/features/marketing/components/email/EmailAutoTagsDemo.tsxindex 6e85599ff8..53b4f367da 100644--- a/apps/marketing/src/features/marketing/components/email/EmailAutoTagsDemo.tsx+++ b/apps/marketing/src/features/marketing/components/email/EmailAutoTagsDemo.tsx@@ -4,7 +4,6 @@ import Tag from '@phosphor/tag.svg';import X from '@phosphor/x.svg';import { Button } from '@ui';import { createSignal, For, Show } from 'solid-js';-import { DocsDemoPointer } from '../../../../app/components/featureGraphics/DocsMarkdownScene';import {type DemoEmail,demoEmails,@@ -12,6 +11,7 @@ import {emailTags,} from '../../core/demo-email';import { createEmailWalkthrough } from '../../primitives/createEmailWalkthrough';+import { DemoCursor } from '../DemoCursor';import { EmailRows } from './frozen/EmailRows';import { EmailShell } from './frozen/EmailShell';import { EmailThread } from './frozen/EmailThread';@@ -196,8 +196,7 @@ export function EmailAutoTagsDemo() {}}aria-hidden="true">- <DocsDemoPointer />- <span>Claude</span>+ <DemoCursor /></div></Show></EmailShell>diff --git a/apps/marketing/src/features/marketing/components/email/EmailSharingDemo.tsx b/apps/marketing/src/features/marketing/components/email/EmailSharingDemo.tsxindex 89cde0ed83..acf3690573 100644--- a/apps/marketing/src/features/marketing/components/email/EmailSharingDemo.tsx+++ b/apps/marketing/src/features/marketing/components/email/EmailSharingDemo.tsx@@ -1,4 +1,3 @@-import Cursor from '@phosphor/cursor.svg';import Envelope from '@phosphor/envelope.svg';import Hash from '@phosphor/hash.svg';import PaperPlane from '@phosphor/paper-plane-tilt.svg';@@ -6,6 +5,7 @@ import X from '@phosphor/x.svg';import { Button } from '@ui';import { createEffect, createSignal, onCleanup, onMount, Show } from 'solid-js';import { homepagePeople } from '../../core/homepage-demo-people';+import { DemoCursor } from '../DemoCursor';import { HomepageConversation } from '../HomepageConversation';import { demoEmails } from './email-fixtures';import { ChannelComposer } from './frozen/ChannelComposer';@@ -352,7 +352,7 @@ export function EmailSharingDemo(props: { onClose?: () => void } = {}) {transform: `translate(${position().x}px, ${position().y}px)`,}}>- <Cursor />+ <DemoCursor label="Jacob" clicking={phase() === 5} /></div>)}</Show>diff --git a/apps/marketing/src/features/marketing/components/email/email-auto-tags-stage.css b/apps/marketing/src/features/marketing/components/email/email-auto-tags-stage.cssindex 63149f6bc2..beb244f1d5 100644--- a/apps/marketing/src/features/marketing/components/email/email-auto-tags-stage.css+++ b/apps/marketing/src/features/marketing/components/email/email-auto-tags-stage.css@@ -55,7 +55,6 @@.email-tags-demo .mail-row { min-height: 54px; }.email-tags-demo .mail-row[aria-current='true'] { background: linear-gradient(100deg, rgb(255 255 255 / 0.07), rgb(255 255 255 / 0.025)); box-shadow: inset 0 1px rgb(255 255 255 / 0.045); }.email-tags-demo .email-auto-tag-menu { background: #1c1d20; border-color: rgb(255 255 255 / 0.13); box-shadow: 0 24px 50px #0009, 0 1px 0 rgb(255 255 255 / 0.06) inset; }-.email-tags-demo .email-agent-pointer { --c0: #dedbd2; }.email-tag-count { margin-left: auto; color: #82858a; font-size: 11px; white-space: nowrap; }.email-tags-demo .mail-demo-controls { margin-top: 18px; }diff --git a/apps/marketing/src/features/marketing/components/email/email-feature-demos.css b/apps/marketing/src/features/marketing/components/email/email-feature-demos.cssindex 1122285dab..2d71dfb71f 100644--- a/apps/marketing/src/features/marketing/components/email/email-feature-demos.css+++ b/apps/marketing/src/features/marketing/components/email/email-feature-demos.css@@ -71,18 +71,14 @@.email-tag-summary > :last-child { margin-left: auto; white-space: nowrap; }.email-agent-pointer {- --c0: #f0eee8;position: absolute;z-index: 4;pointer-events: none;top: calc(119px + var(--email-cursor-row) * 52px);left: 63%;- font-size: 20px;- filter: drop-shadow(0 2px 3px #0006);transition: top 650ms ease, left 650ms ease;}.email-agent-pointer[data-menu='true'] { top: calc(106px + var(--email-tag-index) * 36px); left: calc(100% - 95px); }-.email-agent-pointer > span { position: absolute; top: 16px; left: 15px; padding: 4px 9px; background: #f0eee8; color: #171717; font: 500 11px Inter, sans-serif; border-radius: 4px 10px 10px; }.email-keyboard-demo:focus { outline: none; }.email-keyboard-demo:focus-visible .mail-app { outline: 1px solid var(--color-accent); outline-offset: 4px; }.email-keyboard-content { flex: 1; min-height: 440px; }diff --git a/apps/marketing/src/features/marketing/components/email/email-sharing-stage.css b/apps/marketing/src/features/marketing/components/email/email-sharing-stage.cssindex 08bd78f4db..f5a8de61b5 100644--- a/apps/marketing/src/features/marketing/components/email/email-sharing-stage.css+++ b/apps/marketing/src/features/marketing/components/email/email-sharing-stage.css@@ -53,10 +53,7 @@.mail-sharing-stage .mail-channel-composer { flex-shrink: 0; }.mail-sharing-stage .mail-channel-messages { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }.mail-sharing-demo > .mail-demo-controls { height: 48px; padding-inline: 12px; }-.mail-sharing-pointer { position: absolute; top: 0; left: 0; z-index: 8; pointer-events: none; color: #eceeed; transition: transform 650ms cubic-bezier(.2,.8,.2,1); }-.mail-sharing-pointer svg { width: 23px; height: 23px; fill: currentColor; filter: drop-shadow(0 1px 2px #0008); }-.mail-sharing-pointer[data-clicking='true'] svg { animation: mail-pointer-click 650ms ease both; }-@keyframes mail-pointer-click { 55% { transform: scale(.8); } }+.mail-sharing-pointer { position: absolute; top: 0; left: 0; z-index: 8; pointer-events: none; transition: transform 650ms cubic-bezier(.2,.8,.2,1); }@media (max-width: 699px) {.mail-sharing-demo > .mail-demo-controls { height: 64px; }}diff --git a/apps/marketing/src/features/marketing/components/homepage-crm.css b/apps/marketing/src/features/marketing/components/homepage-crm.cssindex c2f9c965e8..9cbe9615f2 100644--- a/apps/marketing/src/features/marketing/components/homepage-crm.css+++ b/apps/marketing/src/features/marketing/components/homepage-crm.css@@ -8,8 +8,7 @@.homepage-crm-card { height: 62px; flex-shrink: 0; }.homepage-crm-company-mark { display: flex; width: 16px; height: 16px; align-items: center; justify-content: center; border-radius: 4px; background: var(--color-surface-4); font-size: 10px; color: var(--color-ink-muted); }.homepage-crm-drag { position: absolute; top: 0; left: 0; width: 256px; z-index: 2; pointer-events: none; filter: drop-shadow(0 16px 18px rgb(0 0 0 / 0.4)); }-.homepage-crm-cursor { position: absolute; left: 0; top: 0; z-index: 3; font-size: 20px; pointer-events: none; filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.4)); }-.homepage-crm-cursor > span { position: absolute; top: 16px; left: 15px; padding: 3px 8px; background: var(--color-ink); color: var(--color-surface-0); font: 500 11px Inter, sans-serif; border-radius: 4px 10px 10px; }+.homepage-crm-cursor { z-index: 3; }.homepage-crm-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--color-edge-muted); color: var(--color-ink-muted); font-size: 12px; min-height: 62px; }.homepage-crm-footer button { transition: color 160ms; }.homepage-crm-footer button:hover { color: var(--color-ink); }diff --git a/apps/marketing/src/features/marketing/components/product/ProductDemos.test.tsx b/apps/marketing/src/features/marketing/components/product/ProductDemos.test.tsxdeleted file mode 100644index 7f03c90980..0000000000--- a/apps/marketing/src/features/marketing/components/product/ProductDemos.test.tsx+++ /dev/null@@ -1,357 +0,0 @@-import { cleanup, fireEvent, render, within } from '@solidjs/testing-library';-import { afterEach, beforeEach, expect, it, vi } from 'vitest';-import {- AgentEmailReviewDemo,- AgentTaskResultDemo,-} from '../agents/AgentStories';-import { CallTranscriptDemo } from '../calls/CallStories';-import { ChannelThreadDemo } from '../channels/ChannelStories';-import {- DocumentAgentDemo,- DocumentSharingDemo,-} from '../documents/DocumentStories';-import {- ReviewDiscussionDemo,- ReviewQueueDemo,-} from '../reviews/ReviewStories';-import {- TaskFromChannelDemo,- TaskFromMessageDemo,- TaskOwnershipDemo,-} from '../tasks/TaskStories';--let intersections: IntersectionObserverCallback[];-let motionListeners: (() => void)[];-let reduced = false;-let hidden = false;-beforeEach(() => {- intersections = [];- motionListeners = [];- reduced = false;- hidden = false;- vi.useFakeTimers();- vi.stubGlobal('fetch', vi.fn());- vi.spyOn(document, 'hidden', 'get').mockImplementation(() => hidden);- vi.stubGlobal('matchMedia', () => ({- get matches() {- return reduced;- },- addEventListener: (_: string, callback: () => void) =>- motionListeners.push(callback),- removeEventListener: vi.fn(),- }));- vi.stubGlobal(- 'IntersectionObserver',- class {- constructor(callback: IntersectionObserverCallback) {- intersections.push(callback);- }- observe() {}- disconnect() {}- }- );- vi.stubGlobal(- 'ResizeObserver',- class {- observe() {}- unobserve() {}- disconnect() {}- }- );-});-afterEach(() => {- cleanup();- vi.advanceTimersByTime(100);- expect(fetch).not.toHaveBeenCalled();- expect(vi.getTimerCount()).toBe(0);- vi.useRealTimers();- vi.restoreAllMocks();- vi.unstubAllGlobals();-});-function visible(value: boolean) {- for (const callback of intersections)- callback(- [{ isIntersecting: value } as IntersectionObserverEntry],- {} as IntersectionObserver- );-}-function reduce() {- reduced = true;- for (const callback of motionListeners) callback();-}--it('creates the task with the source channel and stops at a useful final state', () => {- const view = render(() => <TaskFromMessageDemo />);- vi.advanceTimersByTime(10000);- expect(- view.getByRole('button', { name: 'Create task from message' })- ).toBeTruthy();- visible(true);- vi.advanceTimersByTime(2800);- expect(view.getByRole('textbox', { name: 'New task title' })).toBeTruthy();- expect(view.queryByRole('textbox', { name: 'Task title' })).toBeNull();- vi.advanceTimersByTime(4200);- expect(view.getByRole('textbox', { name: 'Task title' }).textContent).toBe(- 'Fix the team invite handoff'- );- expect(view.getByRole('button', { name: 'From launch' })).toBeTruthy();- expect(- view.getAllByRole('button', { name: 'Change assignee' })[0].textContent- ).toContain('Teo');- vi.advanceTimersByTime(30000);- expect(vi.getTimerCount()).toBe(0);-});--it('keeps a visitor’s conversion draft and assignment instead of advancing over it', () => {- const view = render(() => <TaskFromMessageDemo />);- fireEvent.click(- view.getByRole('button', { name: 'Create task from message' })- );- const title = view.getByRole('textbox', { name: 'New task title' });- fireEvent.input(title, {- target: { value: 'Keep the invited workspace selected' },- });- reduce();- visible(true);- vi.advanceTimersByTime(30000);- expect((title as HTMLInputElement).value).toBe(- 'Keep the invited workspace selected'- );- fireEvent.submit(view.getByRole('form', { name: 'Create task preview' }));- expect(view.getByRole('textbox', { name: 'Task title' }).textContent).toBe(- 'Keep the invited workspace selected'- );- expect(view.getByRole('button', { name: 'From launch' })).toBeTruthy();- fireEvent.click(view.getByRole('button', { name: '2 Create task' }));- fireEvent.input(view.getByRole('textbox', { name: 'New task title' }), {- target: { value: 'Revised invite handoff' },- });- fireEvent.submit(view.getByRole('form', { name: 'Create task preview' }));- expect(view.getByRole('textbox', { name: 'Task title' }).textContent).toBe(- 'Revised invite handoff'- );-});--it('sends the new task to its channel and opens the same assigned task from its message', () => {- const view = render(() => <TaskFromChannelDemo />);- visible(true);- vi.advanceTimersByTime(2800);- expect(- view- .getByRole('switch', { name: 'Send as task' })- .getAttribute('aria-checked')- ).toBe('true');- vi.advanceTimersByTime(4200);- const log = within(view.getByRole('log', { name: 'Channel launch' }));- fireEvent.click(- log.getByRole('button', { name: 'Fix the team invite handoff' })- );- expect(- view.getByRole('textbox', { name: 'Task description' }).textContent- ).toContain('Keep the invited team selected');- expect(- view.getAllByRole('button', { name: 'Change assignee' })[0].textContent- ).toContain('Teo');- fireEvent.click(view.getByRole('button', { name: 'From launch' }));- expect(view.getByRole('log', { name: 'Channel launch' })).toBeTruthy();- vi.advanceTimersByTime(30000);- expect(vi.getTimerCount()).toBe(0);-});--it('shows a linked result without animation for reduced motion', () => {- reduced = true;- const view = render(() => <TaskFromMessageDemo />);- expect(view.getByRole('button', { name: 'From launch' })).toBeTruthy();- expect(view.container.querySelector('.task-flow-pointer')).toBeNull();-});--it('pauses offscreen and in a hidden tab, then preserves a visitor’s task edits', () => {- const view = render(() => <TaskOwnershipDemo />);- visible(true);- vi.advanceTimersByTime(1400);- expect(- view.getAllByRole('button', { name: 'Change assignee' })[0].textContent- ).toContain('Teo');- visible(false);- vi.advanceTimersByTime(10000);- expect(- view.getAllByRole('button', { name: 'Change priority' })[0].textContent- ).toContain('Low');- visible(true);- hidden = true;- document.dispatchEvent(new Event('visibilitychange'));- vi.advanceTimersByTime(10000);- expect(- view.getAllByRole('button', { name: 'Change priority' })[0].textContent- ).toContain('Low');- hidden = false;- document.dispatchEvent(new Event('visibilitychange'));- const title = view.getByRole('textbox', { name: 'Task title' });- fireEvent.keyDown(title, { key: 'ArrowLeft' });- title.innerText = 'Visitor’s task title';- fireEvent.blur(title);- reduce();- vi.advanceTimersByTime(30000);- expect(title.textContent).toBe('Visitor’s task title');- expect(- view.getAllByRole('button', { name: 'Change priority' })[0].textContent- ).toContain('Low');-});--it('leaves the document editable and never replaces the visitor’s text', () => {- const view = render(() => <DocumentAgentDemo />);- visible(true);- const body = view.getByRole('textbox', { name: 'Document body' });- fireEvent.pointerDown(body);- body.innerHTML = '<p>Our team’s revised launch plan.</p>';- fireEvent.blur(body);- reduce();- vi.advanceTimersByTime(30000);- expect(body.textContent).toContain('Our team’s revised launch plan.');- expect(body.textContent).not.toContain('Teo: verify');-});--it('shows the finished document for reduced motion', () => {- reduced = true;- const view = render(() => <DocumentAgentDemo />);- expect(- view.getByRole('textbox', { name: 'Document body' }).textContent- ).toContain('Teo: verify the invite flow.');- vi.advanceTimersByTime(100);- expect(vi.getTimerCount()).toBe(0);-});--it('shares the document with the chosen access and preserves it when reopened', () => {- const view = render(() => <DocumentSharingDemo />);- fireEvent.click(view.getByRole('button', { name: 'Share' }));- const dialog = within(view.getByRole('dialog'));- fireEvent.change(dialog.getByLabelText('Email or group'), {- target: { value: 'teo' },- });- fireEvent.change(dialog.getByLabelText('Access level'), {- target: { value: 'Comment' },- });- fireEvent.click(dialog.getByRole('button', { name: 'Share' }));- const access = view.container.querySelector('.product-share-access')!;- expect(access.textContent).toContain('Teo Nys');- expect(access.textContent).toContain('Comment');- fireEvent.click(dialog.getByRole('button', { name: 'Close sharing' }));- fireEvent.click(view.getByRole('button', { name: 'Share' }));- expect(- view.container.querySelector('.product-share-access')?.textContent- ).toContain('Comment');-});--it('adds a reply to its original thread rather than a new channel message', () => {- const view = render(() => <ChannelThreadDemo />);- fireEvent.click(view.getByRole('button', { name: /2 replies/ }));- const thread = view.container.querySelector('.sample-channel-thread')!;- fireEvent.click(- within(thread as HTMLElement).getAllByRole('button', {- name: 'Reply to message',- })[0]- );- const input = within(thread as HTMLElement).getByRole('textbox');- input.textContent = 'Confirmed. Keep the invite flow first.';- fireEvent.input(input);- fireEvent.click(- within(thread as HTMLElement).getByRole('button', {- name: 'Send demo message',- })- );- expect(- within(thread as HTMLElement).getByText(- 'Confirmed. Keep the invite flow first.'- )- ).toBeTruthy();- expect(- view.container.querySelectorAll('.sample-channel-thread')- ).toHaveLength(2);-});--it('opens an agent-created task in the ordinary editable task view', () => {- reduced = true;- const view = render(() => <AgentTaskResultDemo />);- fireEvent.click(- view.getByRole('button', { name: 'Review Thursday’s launch checks' })- );- expect(view.getByRole('textbox', { name: 'Task title' }).textContent).toBe(- 'Review Thursday’s launch checks'- );- expect(- view.getAllByRole('button', { name: 'Change assignee' })[0]- ).toBeTruthy();-});--it('keeps the edited agent email as the actual Sent artifact', () => {- const view = render(() => <AgentEmailReviewDemo />);- const subject = view.getByRole('textbox', { name: 'Subject' });- fireEvent.input(subject, { target: { value: 'Thursday at 9 — confirmed' } });- const body = view.getByRole('textbox', { name: 'Email body' });- body.innerText = 'Thursday at 9 works for our follow-up. Julia will join us.';- fireEvent.input(body);- fireEvent.click(view.getByRole('button', { name: 'Send email' }));- expect(- view.getByRole('heading', { name: 'Thursday at 9 — confirmed' })- ).toBeTruthy();- expect(- view.getByText('Thursday at 9 works for our follow-up.', { exact: false })- ).toBeTruthy();-});--it('lets a visitor choose a transcript segment without being moved back by motion', () => {- const view = render(() => <CallTranscriptDemo />);- visible(true);- const segment = view.getByRole('button', {- name: 'Go to 1:24: Julia Westphal',- });- fireEvent.pointerDown(segment);- fireEvent.click(segment);- reduce();- vi.advanceTimersByTime(20000);- expect(segment.getAttribute('aria-pressed')).toBe('true');-});--it('combines review filters and search, opens the correct item, and preserves the queue', () => {- const view = render(() => <ReviewQueueDemo />);- fireEvent.click(view.getByRole('button', { name: 'All reviews' }));- fireEvent.input(view.getByRole('searchbox'), {- target: { value: 'announcement' },- });- fireEvent.click(- view.getByRole('button', {- name: 'Open review: Update the launch announcement',- })- );- expect(- view.getByRole('heading', { name: 'Update the launch announcement' })- ).toBeTruthy();- fireEvent.click(view.getByRole('button', { name: 'Back to reviews' }));- expect((view.getByRole('searchbox') as HTMLInputElement).value).toBe(- 'announcement'- );- expect(- view.queryByRole('button', {- name: 'Open review: Retry transient deploy failures',- })- ).toBeNull();-});--it('filters bot messages without removing the human review and its line context', () => {- const view = render(() => <ReviewDiscussionDemo />);- fireEvent.click(view.getByRole('checkbox', { name: 'Hide bots (1)' }));- expect(view.queryByText('Preview available for this branch.')).toBeNull();- expect(view.getByText('deploy/retry.ts · L6')).toBeTruthy();- expect(view.getByText(/Only temporary registry failures/)).toBeTruthy();-});--it('keeps a supplied email draft intact for reduced motion', () => {- reduced = true;- const view = render(() => <AgentEmailReviewDemo />);- expect(- view.getByRole('textbox', { name: 'Email body' }).textContent- ).toContain('Thursday at 9 works');- expect(- view.getByRole('textbox', { name: 'Email body' }).textContent- ).not.toContain('Macro sales overview');-});diff --git a/apps/marketing/src/features/marketing/components/product/ProductPage.tsx b/apps/marketing/src/features/marketing/components/product/ProductPage.tsxindex cecb79ddfe..65a5387149 100644--- a/apps/marketing/src/features/marketing/components/product/ProductPage.tsx+++ b/apps/marketing/src/features/marketing/components/product/ProductPage.tsx@@ -50,6 +50,9 @@ export function ProductDemo(props: {ref?: (element: HTMLDivElement) => void;onInteract?: () => void;action?: string;+ /** Window height in px, so short scenes don't leave an empty frame. */+ height?: number;+ mobileHeight?: number;}) {return (<div@@ -57,6 +60,12 @@ export function ProductDemo(props: {class="product-demo-stage"role="group"aria-label={props.label}+ style={{+ '--demo-h': props.height ? `${props.height}px` : undefined,+ '--demo-h-mobile': props.mobileHeight+ ? `${props.mobileHeight}px`+ : undefined,+ }}onPointerDown={() => props.onInteract?.()}onKeyDown={() => props.onInteract?.()}>diff --git a/apps/marketing/src/features/marketing/components/product/ProductShareDialog.tsx b/apps/marketing/src/features/marketing/components/product/ProductShareDialog.tsxdeleted file mode 100644index d51b146e5e..0000000000--- a/apps/marketing/src/features/marketing/components/product/ProductShareDialog.tsx+++ /dev/null@@ -1,104 +0,0 @@-import X from '@phosphor/x.svg';-import { Button } from '@ui';-import { createSignal, createUniqueId, Show } from 'solid-js';-import { PersonIcon } from '../workspace/frozen/TaskProperties';--/** Presentation port of Macro's Share form. Recipients and access stay local. */-export function ProductShareDialog(props: {- open: boolean;- title: string;- kind?: string;- onClose: () => void;-}) {- const titleId = createUniqueId();- const recipientId = createUniqueId();- const [person, setPerson] = createSignal('');- const [shared, setShared] = createSignal<{ person: string; level: string }>();- const [level, setLevel] = createSignal('Edit');- return (- <Show when={props.open}>- <div class="product-share-scrim">- <div- class="product-share-form glass-input"- role="dialog"- aria-modal="false"- aria-labelledby={titleId}- >- <header>- <h3 id={titleId}>Share: {props.title}</h3>- <Button- variant="plain"- size="icon-sm"- label="Close sharing"- onClick={props.onClose}- >- <X />- </Button>- </header>- <div class="product-share-recipient">- <label for={recipientId}>To:</label>- <select- id={recipientId}- aria-label="Email or group"- value={person()}- onChange={(e) => setPerson(e.currentTarget.value)}- >- <option value="">Email or group</option>- <option value="teo">Teo Nys</option>- <option value="julia">Julia Westphal</option>- </select>- <select- aria-label="Access level"- value={level()}- onChange={(e) => setLevel(e.currentTarget.value)}- >- <option>Edit</option>- <option>Comment</option>- <option>View</option>- </select>- </div>- <textarea- aria-label="Optional message"- placeholder="Optional message"- />- <div class="product-share-actions">- <Button variant="plain" size="sm" onClick={props.onClose}>- Cancel- </Button>- <Button- size="sm"- disabled={!person()}- onClick={() => setShared({ person: person(), level: level() })}- >- Share- </Button>- </div>- <div class="product-share-access">- <p>People with access to this {props.kind ?? 'document'}</p>- <div>- <PersonIcon person="jacob" />- <span>Me</span>- <span>Owner</span>- </div>- <Show when={shared()}>- <div>- <PersonIcon- person={shared()?.person === 'teo' ? 'teo' : 'julia'}- />- <span>- {shared()?.person === 'teo' ? 'Teo Nys' : 'Julia Westphal'}- </span>- <span>{shared()?.level}</span>- </div>- </Show>- <p class="mt-4">Link sharing scope</p>- <span>None</span>- <p class="text-xs text-ink-muted mt-2">- Only people with access can open this {props.kind ?? 'document'}.- </p>- </div>- </div>- </div>- </Show>- );-}diff --git a/apps/marketing/src/features/marketing/components/product/product-demo-stage.css b/apps/marketing/src/features/marketing/components/product/product-demo-stage.cssindex 4071feb140..57c6444efa 100644--- a/apps/marketing/src/features/marketing/components/product/product-demo-stage.css+++ b/apps/marketing/src/features/marketing/components/product/product-demo-stage.css@@ -1,7 +1,7 @@/* Email's quiet dot field and cool glow, only around the focused subgraphics.The extra tail fades the window into the page without dimming its controls. */.product-page .feature-page-visual .product-demo-stage {- --product-demo-height: 580px;+ --product-demo-height: var(--demo-h, 580px);--product-demo-fade-tail: 84px;padding-top: 28px;}@@ -47,7 +47,7 @@@media (max-width: 699px) {.product-page .feature-page-visual .product-demo-stage {- --product-demo-height: 620px;+ --product-demo-height: var(--demo-h-mobile, 620px);--product-demo-fade-tail: 64px;padding-top: 12px;}diff --git a/apps/marketing/src/features/marketing/components/product/product-page.css b/apps/marketing/src/features/marketing/components/product/product-page.cssindex 3d3c78ed39..dbf647ac9d 100644--- a/apps/marketing/src/features/marketing/components/product/product-page.css+++ b/apps/marketing/src/features/marketing/components/product/product-page.css@@ -14,22 +14,17 @@.product-page .feature-page-comparison, .product-page > .homepage-feature-end { width: min(872px, calc(100% - 48px)); margin-inline: auto; }.product-demo-stage { position: relative; isolation: isolate; }.product-demo-stage::before { content: ''; position: absolute; pointer-events: none; z-index: -1; inset: -24px -32px; background: radial-gradient(#ffffff18 .6px, transparent .6px) 0 0 / 12px 12px; mask-image: radial-gradient(ellipse, #0008, transparent 70%); }-.product-page .product-demo { height: 580px; border-radius: 16px; overflow: hidden; background-color: var(--color-panel); box-shadow: var(--glass-shadow); }+.product-page .product-demo { height: var(--demo-h, 580px); border-radius: 16px; overflow: hidden; background-color: var(--color-panel); box-shadow: var(--glass-shadow); }.product-demo > .dummy-main { height: 100%; }.product-demo .sample-chat-log { padding: 32px; }-.product-demo .sample-message-actions { opacity: 1; }.product-demo .sample-message-row { margin-bottom: 22px; }.product-demo .sample-details { display: none; }.product-demo .sample-detail-layout[data-panel-open=true] .sample-details { display: block; }.product-demo-request { margin-bottom: 28px; }.product-demo-request .homepage-conversation { margin-bottom: 0; }.product-demo-request .homepage-message { max-width: 90%; }-.product-demo-active { outline: 1px solid #ffffff30; outline-offset: 4px; }.product-demo .dummy-task-row { grid-template-columns: 8px minmax(0, 1fr) 116px 105px 100px; }.product-demo .dummy-created, .product-demo .dummy-updated { display: none; }-.product-task-filters { display: flex; gap: 8px; padding: 12px 16px 0; }-.product-task-filters button { padding: 6px 10px; border-radius: 8px; font-size: 12px; color: var(--color-ink-muted); }-.product-task-filters button[aria-pressed=true] { background: var(--color-active); color: var(--color-ink); }@media (max-width: 699px) {.product-page { padding-inline: 18px; }.product-page .homepage-feature-heading, .product-prose { padding-inline: 0; }@@ -38,7 +33,7 @@.product-page .email-feature-graphic { width: 130px; height: 94px; }.product-page .email-desktop-demo { --desktop-stage-width: calc(100vw - 24px); }.product-prose { font-size: 14px; }- .product-page .product-demo { height: 620px; border-radius: 12px; }+ .product-page .product-demo { height: var(--demo-h-mobile, 620px); border-radius: 12px; }.product-demo .sample-chat-log { padding: 20px 12px; }.product-demo .sample-details { position: absolute; inset: 48px 0 0; width: 100%; max-width: none; background: var(--color-panel); z-index: 3; }.product-demo .dummy-task-row { grid-template-columns: 6px minmax(0, 1fr) 100px; }@@ -47,83 +42,12 @@.product-demo .sample-tabs-inset { max-width: 100%; }}-.product-demo[data-action="assignee"] [aria-label="Change assignee"], .product-demo[data-action="priority"] [aria-label="Change priority"], .product-demo[data-action="status"] [aria-label="Change status"], .product-demo[data-action="create"] [aria-label="Create task from message"] { background: #ffffff25; box-shadow: 0 0 0 3px #ffffff0d; }.product-page .product-sidebared-scene { display:flex; height:100%; min-height:0; }.product-sidebared-scene > [data-view-sidebar] { flex:0 0 224px; width:224px; }.product-sidebared-scene > .dummy-main { flex:1; min-width:0; }@media(max-width:699px) { .product-sidebared-scene { position:relative; } .product-sidebared-scene > [data-view-sidebar] { position:absolute; inset:0 auto 0 0; width:min(248px, 85%); z-index:3; background:var(--color-panel); box-shadow:16px 0 32px #0006; } }-.product-editing-pointer { position:absolute; top:42%; left:65%; z-index:2; display:flex; align-items:start; gap:3px; color:#a4b9a6; pointer-events:none; }-.product-editing-pointer svg { width:16px; height:20px; }-.product-editing-pointer span { margin-top:14px; padding:2px 7px; border-radius:4px; color:#131713; background:#a4b9a6; font:500 11px/1.4 Inter,sans-serif; }-.product-demo[data-action=document] [aria-label="Document body"] { background:#ffffff06; }-.product-share-scrim { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:#0008; padding:16px; z-index:5; }-.product-share-form { width:min(560px,100%); border-radius:18px; background:var(--color-panel); font-size:14px; overflow:hidden; }-.product-share-form header { display:flex; align-items:center; justify-content:space-between; padding:14px 18px; gap:12px; }-.product-share-form h3 { font:500 14px/1.5 Inter,sans-serif; }-.product-share-recipient { display:flex; align-items:center; gap:8px; padding:12px 18px; background:var(--color-surface-2); }-.product-share-recipient select { min-width:0; background:transparent; color:var(--color-ink); font-size:13px; }-.product-share-recipient select:first-of-type { flex:1; }-.product-share-form textarea { width:100%; padding:14px 18px; background:transparent; min-height:72px; resize:none; }-.product-share-actions { display:flex; justify-content:flex-end; gap:10px; padding:8px 18px 16px; }-.product-share-access { padding:18px; background:var(--color-surface-2); }-.product-share-access > p { font-size:12px; color:var(--color-ink-muted); margin-bottom:12px; }-.product-share-access > div { display:flex; align-items:center; gap:8px; margin-top:10px; }-.product-share-access > div > span:last-child { margin-left:auto; color:var(--color-ink-muted); }-.product-agent-log { padding:36px 40px; flex:1; }-.product-agent-log > [data-agent-message] + [data-agent-message] { margin-top:24px; }-.product-email-review { padding:24px; }-.product-email-review .homepage-email-demo { width:100%; }-@media(max-width:699px) { .product-agent-log { padding:24px 18px; } .product-email-review { padding:12px; } }.product-page .email-desktop-content .product-demo-stage { height:100%; }.product-page .email-desktop-content .product-demo { height:100%; border-radius:0; box-shadow:none; }-.product-call-body { padding:36px 40px 48px; }-.product-call-body > header h1 { font:600 24px/1.35 Inter,sans-serif; }-.product-call-body > header p { color:var(--color-ink-muted); margin-top:12px; font-size:13px; }-.product-call-body > header p span { margin:0 6px; }-.product-call-body section { margin-top:28px; }-.product-call-body h3 { font:600 14px/1.5 Inter,sans-serif; margin-bottom:12px; }-.product-call-body h3 > span { font-weight:400; color:var(--color-ink-muted); margin-left:4px; }-.product-call-body section > p { font:400 14px/1.7 Inter,sans-serif; }-.product-call-participants { display:flex; flex-wrap:wrap; gap:14px; }-.product-call-participants > span { display:flex; align-items:center; gap:6px; font-size:12px; }-.product-call-transcript { border:1px solid var(--color-edge-muted); border-radius:6px; padding:8px; }-.product-call-segment { width:100%; display:flex; align-items:flex-start; gap:10px; padding:12px 8px; border-radius:5px; text-align:left; }-.product-call-segment > span { min-width:0; flex:1; }-.product-call-segment[aria-pressed=true] { background:var(--color-active); }-.product-call-speaker { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:13px; font-weight:500; }-.product-call-speaker > span { color:var(--color-ink-muted); font-size:12px; font-weight:400; }-.product-call-words { display:block; font-size:14px; line-height:1.6; margin-top:6px; }-.product-call-list { padding:28px; }-.product-call-list > p { font-size:12px; color:var(--color-ink-muted); margin-bottom:16px; }-.product-call-list > button { display:flex; align-items:center; gap:16px; padding:18px 12px; width:100%; text-align:left; border-radius:8px; }-.product-call-list > button:hover { background:var(--color-hover); }-.product-call-list > button > span:first-of-type { flex:1; min-width:0; font-size:14px; }-.product-call-list > button > span:first-of-type > span { display:block; margin-top:6px; }-.product-call-list > button > span:last-child { color:var(--color-ink-muted); font-size:12px; }-.product-call-list-people { display:flex; gap:4px; }-@media(max-width:699px) { .product-call-body { padding:28px 18px; } .product-call-list { padding:20px 10px; } .product-call-list-people { display:none; } }-.product-pr-body { padding:36px 40px; }-.product-pr-body h1 { font:600 24px/1.4 Inter,sans-serif; }-.product-pr-meta { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 24px; }-.product-pr-meta > span { display:flex; align-items:center; gap:6px; padding:4px 8px; border-radius:999px; background:var(--color-surface); border:1px solid var(--color-edge-muted); font-size:12px; }-.product-pr-meta b { font-weight:400; }-.product-pr-discussion-heading { display:flex; justify-content:space-between; gap:12px; margin-top:32px; font-size:12px; }-.product-pr-discussion-heading button, .product-pr-discussion-heading label { display:flex; align-items:center; gap:6px; }-.product-pr-discussion-heading label { color:var(--color-ink-muted); }-.product-pr-discussion { margin-top:20px; }-.product-pr-discussion .sample-message-row[data-reply=true] { margin-left:20px; border-left:1px solid var(--color-edge-muted); padding-left:14px; }-.product-pr-file { display:inline-block; margin-top:8px; font:400 11px/1.5 monospace; color:var(--color-ink-muted); }-.product-review-queue { padding:24px; }-.product-review-row { width:100%; display:flex; gap:12px; align-items:center; padding:18px 12px; text-align:left; border-radius:8px; }-.product-review-row:hover { background:var(--color-hover); }-.product-review-row > span:first-of-type { flex:1; min-width:0; font-size:14px; }-.product-review-row small { display:block; font-size:12px; color:var(--color-ink-muted); margin-top:6px; }-.product-review-row > span:last-child { display:flex; align-items:center; gap:6px; font-size:12px; }-@media(max-width:699px) { .product-pr-body { padding:28px 18px; } .product-review-queue { padding:20px 10px; } .product-review-row > span:last-child { display:none; } }-.product-pr-body .website-demo-markdown { font:400 14px/1.7 Inter,sans-serif; }-.product-pr-body .website-demo-markdown h2 { font-size:16px; margin:24px 0 8px; }-.product-pr-body .website-demo-markdown p { margin:10px 0 20px; }-.product-email-review:has(.sample-email-thread) { padding:0; }diff --git a/apps/marketing/src/features/marketing/components/reviews/ReviewHome.tsx b/apps/marketing/src/features/marketing/components/reviews/ReviewHome.tsxnew file mode 100644index 0000000000..9f198fe088--- /dev/null+++ b/apps/marketing/src/features/marketing/components/reviews/ReviewHome.tsx@@ -0,0 +1,506 @@+import Reply from '@phosphor/arrow-bend-up-left.svg';+import ArrowCounterClockwise from '@phosphor/arrow-counter-clockwise.svg';+import Buildings from '@phosphor/buildings.svg';+import Calendar from '@phosphor/calendar-blank.svg';+import ChatTeardrop from '@phosphor/chat-teardrop.svg';+import Chats from '@phosphor/chats-circle.svg';+import Check from '@phosphor/check.svg';+import Envelope from '@phosphor/envelope.svg';+import Folder from '@phosphor/folder-simple.svg';+import Hash from '@phosphor/hash.svg';+import ListChecks from '@phosphor/list-checks.svg';+import Search from '@phosphor/magnifying-glass.svg';+import Plus from '@phosphor/plus.svg';+import Sparkle from '@phosphor/sparkle.svg';+import X from '@phosphor/x.svg';+import HouseFill from '@phosphor-fill/house-fill.svg';+import { Button } from '@ui';+import {+ batch,+ createEffect,+ createMemo,+ createSignal,+ For,+ type JSX,+ Match,+ Show,+ Switch,+} from 'solid-js';+import { Dynamic } from 'solid-js/web';+import type { WorkspaceView } from '../../core/dummy-workspace';+import {+ type HomepagePersonId,+ homepagePeople,+} from '../../core/homepage-demo-people';+import { createDummyWorkspace } from '../../primitives/createDummyWorkspace';+import { ViewSidebar } from '../DemoViewSidebar';+import { ProductWorkspace } from '../product/ProductWorkspace';+import { WorkspaceAgents } from '../workspace/WorkspaceAgents';+import { PrIcon, PullRequestView } from './ReviewPullRequest';+import {+ type DemoPullRequest,+ invitePr,+ onboardingPr,+} from './review-fixtures';++/** One single-line HomeListEntity row and the item it opens. */+export type HomeRow = {+ id: string;+ kind: 'pr' | 'thread' | 'channel' | 'dm' | 'task' | 'email' | 'comment';+ /** Plain label, also the row's accessible name. */+ label: string;+ /** Hover timestamp. */+ time: string;+ unread?: boolean;+ pr?: DemoPullRequest;+ person?: HomepagePersonId;+ open?: { view: WorkspaceView; id: string; thread?: string };+};++export type HomeGroup = { label: string; rows: HomeRow[] };++export const reviewRequestRow: HomeRow = {+ id: 'pr-491',+ kind: 'pr',+ label: `${invitePr.title} #${invitePr.number}`,+ time: '11:36 AM',+ unread: true,+ pr: invitePr,+};++const row = {+ engineers: {+ id: 'channel-engineers',+ kind: 'channel',+ label: 'engineers',+ time: '11:17 AM',+ unread: true,+ open: { view: 'messages', id: 'engineers' },+ },+ dm: {+ id: 'dm-teo',+ kind: 'dm',+ label: 'Teo',+ time: '11:14 AM',+ unread: true,+ person: 'teo',+ open: { view: 'messages', id: 'dm-teo' },+ },+ onboarding: {+ id: 'pr-479',+ kind: 'pr',+ label: `${onboardingPr.title} #${onboardingPr.number}`,+ time: '11:05 AM',+ pr: onboardingPr,+ },+ email: {+ id: 'email-dana',+ kind: 'email',+ label: 'Next steps for our team',+ time: '9:41 AM',+ unread: true,+ open: { view: 'email', id: 'dana' },+ },+ task: {+ id: 'task-checklist',+ kind: 'task',+ label: 'Prepare the launch checklist',+ time: '9:38 AM',+ unread: true,+ open: { view: 'tasks', id: 'checklist' },+ },+ thread: {+ id: 'thread-launch',+ kind: 'thread',+ label: 'Julia in #launch',+ time: '9:35 AM',+ open: { view: 'messages', id: 'launch', thread: 'm1' },+ },+ comment: {+ id: 'comment-plan',+ kind: 'comment',+ label: 'Valentina commented on Q3 launch plan',+ time: '8:52 AM',+ open: { view: 'documents', id: 'plan' },+ },+ invite: {+ id: 'task-invite',+ kind: 'task',+ label: 'Fix the team invite handoff',+ time: '8:31 AM',+ open: { view: 'tasks', id: 'invite' },+ },+} satisfies Record<string, HomeRow>;++/** Hero: review requests and PR updates among messages, tasks, and email. */+export const heroGroups: HomeGroup[] = [+ {+ label: 'Last hour',+ rows: [reviewRequestRow, row.engineers, row.dm, row.onboarding],+ },+ {+ label: 'This morning',+ rows: [row.email, row.task, row.thread, row.comment, row.invite],+ },+];++/** The walkthrough's review request arrives in its own, newest section. */+export const arrivalGroups: HomeGroup[] = [+ { label: 'Last few minutes', rows: [reviewRequestRow] },+ { label: 'Last hour', rows: [row.engineers, row.dm, row.onboarding] },+ { label: 'This morning', rows: [row.email, row.task, row.thread] },+];++/** Local Home state: what's open, read, done, or not yet arrived. */+export function createHomeInbox(options: {+ groups: HomeGroup[];+ initial?: string;+ pending?: string[];+}) {+ const w = createDummyWorkspace('home');+ w.setData('documents', (doc) => doc.id === 'plan', 'comments', [+ {+ id: 'plan-screenshots',+ person: 'valentina',+ body: 'Can we add the mobile screenshots to the checklist? They’re ready.',+ time: '8:52 AM',+ },+ ]);+ const [active, setActive] = createSignal<string>();+ const [pr, setPr] = createSignal<DemoPullRequest>();+ const [pane, setPane] = createSignal<'list' | 'detail'>('list');+ const [read, setRead] = createSignal<string[]>([]);+ const [done, setDone] = createSignal<string[]>([]);+ const [pending, setPending] = createSignal(options.pending ?? []);+ const [toast, setToast] = createSignal<string>();+ const all = options.groups.flatMap((group) => group.rows);+ const shown = (item: HomeRow) =>+ !done().includes(item.id) && !pending().includes(item.id);+ // Fixture objects keep their identity, so rows aren't re-created.+ const rowsOf = (group: HomeGroup) => group.rows.filter(shown);+ const groups = createMemo(() =>+ options.groups.filter((group) => group.rows.some(shown))+ );+ const rows = () => all.filter(shown);+ const unread = (item: HomeRow) => !!item.unread && !read().includes(item.id);+ const open = (item: HomeRow) =>+ batch(() => {+ setPr(item.pr);+ if (item.pr || !item.open) w.open('home');+ else {+ w.openItem(item.open.view, item.open.id);+ if (item.open.thread) w.setChannelThread(item.open.thread);+ }+ setRead((ids) => (ids.includes(item.id) ? ids : [...ids, item.id]));+ setActive(item.id);+ setPane('detail');+ });+ const home = () =>+ batch(() => {+ setPr(undefined);+ w.open('home');+ setActive(undefined);+ setPane('list');+ });+ /** Mark done (E): the row leaves Home and the next item opens. */+ const markDone = (id = active()) => {+ if (!id) return;+ const visible = rows();+ const index = visible.findIndex((item) => item.id === id);+ if (index < 0) return;+ const next = visible[index + 1] ?? visible[index - 1];+ batch(() => {+ setDone((ids) => [...ids, id]);+ setToast(id);+ if (next) open(next);+ else home();+ setPane('list');+ });+ };+ const undo = () => {+ const id = toast();+ if (!id) return;+ batch(() => {+ setDone((ids) => ids.filter((item) => item !== id));+ setToast(undefined);+ });+ };+ // Items' own Home breadcrumbs return to the list.+ createEffect(() => {+ if (w.contentView() === 'home' && !pr() && active()) {+ setActive(undefined);+ setPane('list');+ }+ });+ if (options.initial) {+ const initial = all.find((item) => item.id === options.initial);+ if (initial) {+ open(initial);+ setPane('list');+ }+ }+ return {+ w,+ active,+ pr,+ pane,+ groups,+ unread,+ open,+ home,+ markDone,+ undo,+ toast,+ dismissToast: () => setToast(undefined),+ rowsOf,+ reveal: (id: string) => {+ if (pending().includes(id))+ setPending((ids) => ids.filter((x) => x !== id));+ },+ };+}++export type HomeInboxState = ReturnType<typeof createHomeInbox>;++function RowIcon(props: { row: HomeRow }) {+ const icons = {+ thread: Reply,+ channel: Hash,+ task: ListChecks,+ email: Envelope,+ comment: ChatTeardrop,+ } as const;+ return (+ <Switch>+ <Match when={props.row.pr}>+ {(pr) => (+ <ViewSidebar.Icon>+ <PrIcon status={pr().status} />+ </ViewSidebar.Icon>+ )}+ </Match>+ <Match when={props.row.person}>+ {(person) => (+ <img+ class="size-5 shrink-0 rounded-full"+ src={homepagePeople[person()].photo}+ alt=""+ />+ )}+ </Match>+ <Match when={props.row.kind in icons}>+ <ViewSidebar.Icon>+ <Dynamic component={icons[props.row.kind as keyof typeof icons]} />+ </ViewSidebar.Icon>+ </Match>+ </Switch>+ );+}++/** "Julia in #launch", "Valentina commented on Q3 launch plan". */+function ActorTitle(props: { label: string; joiner: string }) {+ const parts = () => props.label.split(props.joiner);+ return (+ <span class="flex min-w-0 items-center">+ <span class="max-w-1/2 shrink-0 truncate">{parts()[0]}</span>+ <span class="shrink-0 whitespace-pre">{props.joiner}</span>+ <span class="min-w-0 truncate">{parts()[1]}</span>+ </span>+ );+}++function RowTitle(props: { row: HomeRow }) {+ return (+ <Switch fallback={props.row.label}>+ <Match when={props.row.pr}>+ {(pr) => (+ <>+ {pr().title}{' '}+ <span class="font-normal text-ink-extra-muted">#{pr().number}</span>+ </>+ )}+ </Match>+ <Match when={props.row.kind === 'thread'}>+ <ActorTitle label={props.row.label} joiner=" in " />+ </Match>+ <Match when={props.row.kind === 'comment'}>+ <ActorTitle label={props.row.label} joiner=" commented on " />+ </Match>+ </Switch>+ );+}++/** Home's list rail: "Home", New chat, then date sections of one-line items. */+export function HomeSidebar(props: {+ inbox: HomeInboxState;+ arriving?: string;+}) {+ const inbox = props.inbox;+ return (+ <ViewSidebar.Root aria-label="Home" class="review-home-sidebar">+ <ViewSidebar.Header>+ <ViewSidebar.Title>Home</ViewSidebar.Title>+ </ViewSidebar.Header>+ <ViewSidebar.Primary>+ <ViewSidebar.Action onClick={inbox.home}>+ <ViewSidebar.Icon>+ <Plus />+ </ViewSidebar.Icon>+ New chat+ </ViewSidebar.Action>+ </ViewSidebar.Primary>+ <ViewSidebar.Content>+ <For each={inbox.groups()}>+ {(group) => (+ <section>+ <p class="review-home-group">{group.label}</p>+ <ViewSidebar.Nav>+ <For each={inbox.rowsOf(group)}>+ {(item) => (+ <ViewSidebar.Item+ class="review-home-row"+ active={inbox.active() === item.id}+ data-home-row={item.id}+ data-arriving={+ props.arriving === item.id ? 'true' : undefined+ }+ aria-label={item.label}+ onClick={() => inbox.open(item)}+ >+ <RowIcon row={item} />+ <span+ class="block min-w-0 flex-1 truncate font-normal"+ classList={{ 'text-ink': inbox.unread(item) }}+ >+ <RowTitle row={item} />+ </span>+ <span class="review-home-time" aria-hidden="true">+ {item.time}+ </span>+ <Show when={inbox.unread(item)}>+ <span+ role="img"+ aria-label="Unread"+ class="size-1.5 shrink-0 rounded-full bg-accent"+ />+ </Show>+ </ViewSidebar.Item>+ )}+ </For>+ </ViewSidebar.Nav>+ </section>+ )}+ </For>+ </ViewSidebar.Content>+ </ViewSidebar.Root>+ );+}++/** What Home's main pane shows: the opened item, or the new-chat start. */+export function HomeDetail(props: { inbox: HomeInboxState }) {+ const inbox = props.inbox;+ return (+ <Switch fallback={<ProductWorkspace workspace={inbox.w} />}>+ <Match when={inbox.pr()}>+ {(pr) => (+ <PullRequestView+ pr={pr()}+ crumb={{ label: 'Home', onClick: inbox.home }}+ />+ )}+ </Match>+ <Match when={inbox.w.contentView() === 'home'}>+ <WorkspaceAgents workspace={inbox.w} home />+ </Match>+ </Switch>+ );+}++/** The toast Mark done raises, with its Undo action. */+export function DoneToast(props: { inbox: HomeInboxState }) {+ return (+ <Show when={props.inbox.toast()} keyed>+ <div class="review-toast" role="status">+ <span class="review-toast-icon">+ <Check class="size-3.5" />+ </span>+ <span class="min-w-0 flex-1 truncate font-semibold">+ Marked as done+ </span>+ <Button size="sm" variant="plain" onClick={props.inbox.undo}>+ <ArrowCounterClockwise class="size-3.5" />+ Undo+ </Button>+ <Button+ size="icon-sm"+ variant="plain"+ label="Dismiss"+ onClick={props.inbox.dismissToast}+ >+ <X />+ </Button>+ </div>+ </Show>+ );+}++/** E marks the open item done, as in Home; typing in a composer is exempt. */+export function markDoneOnE(inbox: HomeInboxState, onKey?: () => void) {+ return (event: KeyboardEvent) => {+ const target = event.target as HTMLElement;+ if (+ event.key.toLowerCase() !== 'e' ||+ event.metaKey ||+ event.ctrlKey ||+ event.altKey ||+ target.closest('input, textarea, select, [contenteditable="true"]')+ )+ return;+ if (!inbox.active()) return;+ event.preventDefault();+ onKey?.();+ inbox.markDone();+ };+}++const RAIL = [+ Folder,+ Envelope,+ Chats,+ ListChecks,+ Calendar,+ Sparkle,+ Buildings,+];++/** The app's left rail with Home selected; the hero only explores Home. */+export function HomeRail(): JSX.Element {+ return (+ <div class="dummy-rail review-rail" aria-hidden="true">+ <span class="review-rail-button" data-create="true">+ <Plus class="size-5" />+ </span>+ <span class="review-rail-button">+ <Search class="size-5" />+ </span>+ <span class="review-rail-nav">+ <span class="review-rail-button" data-active="true">+ <HouseFill class="size-5" />+ </span>+ <For each={RAIL}>+ {(icon) => (+ <span class="review-rail-button">+ <Dynamic component={icon} class="size-5" />+ </span>+ )}+ </For>+ </span>+ <span class="min-h-0 flex-1" />+ <img+ src={homepagePeople.jacob.photo}+ alt=""+ class="size-8 rounded-full"+ />+ </div>+ );+}diff --git a/apps/marketing/src/features/marketing/components/reviews/ReviewPrMention.tsx b/apps/marketing/src/features/marketing/components/reviews/ReviewPrMention.tsxnew file mode 100644index 0000000000..278dea8d5a--- /dev/null+++ b/apps/marketing/src/features/marketing/components/reviews/ReviewPrMention.tsx@@ -0,0 +1,128 @@+import OpenIcon from '@phosphor/arrows-out.svg';+import ChatCircle from '@phosphor/chat-circle.svg';+import { cn } from '@ui';+import type { JSX } from 'solid-js';+import { PrIcon, prRef } from './ReviewPullRequest';+import {+ type DemoPullRequest,+ type PrStatus,+ prCommentCount,+} from './review-fixtures';++const CHIP_CLASS: Record<PrStatus, string> = {+ open: 'bg-success/15 text-success',+ merged: 'bg-note/15 text-note',+ closed: 'bg-failure/15 text-failure',+};++/**+ * PullRequestMention's face inside markdown: status icon, title, and a muted+ * `#N`. Hover or focus shows the preview card; activating it opens the PR.+ */+export function PrMention(props: {+ pr: DemoPullRequest;+ status: PrStatus;+ hovered?: boolean;+ onHover?: (hovered: boolean, event: MouseEvent | FocusEvent) => void;+ onOpen?: () => void;+ ref?: (element: HTMLSpanElement) => void;+}) {+ const open = (event: MouseEvent | KeyboardEvent) => {+ event.stopPropagation();+ props.onOpen?.();+ };+ return (+ <span+ ref={props.ref}+ class="review-pr-mention"+ data-pr-mention="true"+ data-status={props.status}+ data-hovered={props.hovered ? 'true' : undefined}+ role="link"+ tabIndex={0}+ aria-label={`${props.pr.title} #${props.pr.number}`}+ onMouseEnter={(event) => props.onHover?.(true, event)}+ onMouseLeave={(event) => props.onHover?.(false, event)}+ onFocus={(event) => props.onHover?.(true, event)}+ onBlur={(event) => props.onHover?.(false, event)}+ onClick={open}+ onKeyDown={(event) => {+ if (event.key === 'Enter') open(event);+ }}+ >+ <span class="review-pr-mention-icon">+ <PrIcon status={props.status} class="size-full" />+ </span>+ <span class="review-pr-mention-label">+ {props.pr.title}+ <span class="text-ink-extra-muted text-[0.8em]">{` #${props.pr.number}`}</span>+ </span>+ </span>+ );+}++function Stat(props: { class?: string; children: JSX.Element }) {+ return (+ <span class={cn('flex items-center gap-1 font-mono', props.class)}>+ {props.children}+ </span>+ );+}++/** PullRequestPreviewCard: ref, status chip, title, then size, comments, checks. */+export function PrPreviewCard(props: {+ pr: DemoPullRequest;+ status: PrStatus;+ class?: string;+ style?: JSX.CSSProperties;+ onHover?: (hovered: boolean, event: MouseEvent) => void;+}) {+ return (+ <div+ class={cn('review-pr-card', props.class)}+ style={props.style}+ role="dialog"+ aria-label={`Preview of ${prRef(props.pr)}`}+ onMouseEnter={(event) => props.onHover?.(true, event)}+ onMouseLeave={(event) => props.onHover?.(false, event)}+ >+ <div class="flex items-center justify-between gap-2 p-2">+ <div class="flex min-w-0 items-center gap-2">+ <span class="relative inline-flex size-4 shrink-0">+ <PrIcon status={props.status} class="size-full" />+ </span>+ <span class="truncate font-mono text-[0.8em] text-ink-muted">+ {prRef(props.pr)}+ </span>+ <span+ class={cn(+ 'shrink-0 rounded-full px-1.5 py-0.5 text-xxs font-medium uppercase tracking-wide',+ CHIP_CLASS[props.status]+ )}+ >+ {props.status}+ </span>+ </div>+ <span class="shrink-0 text-link" aria-hidden="true">+ <OpenIcon class="size-4" />+ </span>+ </div>+ <div class="mb-2 line-clamp-2 px-2 text-sm font-semibold">+ {props.pr.title}+ </div>+ <div class="flex items-center gap-3 border-t border-edge-muted p-2 text-xs text-ink-muted">+ <Stat>+ <span class="text-success">{`+${props.pr.additions}`}</span>+ <span class="text-failure">{`-${props.pr.deletions}`}</span>+ </Stat>+ <Stat>+ <ChatCircle class="size-3.5" />+ {prCommentCount(props.pr)}+ </Stat>+ <Stat class="ml-auto">+ <span class="text-success">{`${props.pr.checksPassed} passed`}</span>+ </Stat>+ </div>+ </div>+ );+}diff --git a/apps/marketing/src/features/marketing/components/reviews/ReviewPullRequest.tsx b/apps/marketing/src/features/marketing/components/reviews/ReviewPullRequest.tsxnew file mode 100644index 0000000000..9a2c6ad9f2--- /dev/null+++ b/apps/marketing/src/features/marketing/components/reviews/ReviewPullRequest.tsx@@ -0,0 +1,236 @@+import ClaudeIcon from '@icon/wide-claude.svg';+import CursorIcon from '@icon/wide-cursor-ide.svg';+import CaretDown from '@phosphor/caret-down.svg';+import CaretRight from '@phosphor/caret-right.svg';+import GitMerge from '@phosphor/git-merge.svg';+import GitPullRequest from '@phosphor/git-pull-request.svg';+import { Button, cn } from '@ui';+import { ToggleSwitch } from '@ui/components/ToggleSwitch';+import { createSignal, For, type JSX, Show } from 'solid-js';+import {+ type HomepagePersonId,+ homepagePeople,+} from '../../core/homepage-demo-people';+import { DemoMarkdown } from '../DemoMarkdown';+import { ViewShell } from '../DemoWorkspaceChrome';+import type {+ DemoGithubComment,+ DemoPullRequest,+ PrStatus,+} from './review-fixtures';+import '../demo-markdown.css';+import './review-stories.css';++const STATUS_CLASS: Record<PrStatus, string> = {+ open: 'text-success',+ merged: 'text-note',+ closed: 'text-failure',+};++/** block-pr/PrStatus: merged uses the merge glyph, the rest a PR glyph. */+export function PrIcon(props: { status: PrStatus; class?: string }) {+ return (+ <Show+ when={props.status === 'merged'}+ fallback={+ <GitPullRequest+ class={cn('size-3.5', STATUS_CLASS[props.status], props.class)}+ />+ }+ >+ <GitMerge class={cn('size-3.5 text-note', props.class)} />+ </Show>+ );+}++export const prRef = (pr: DemoPullRequest) => `${pr.repo}#${pr.number}`;++const isBot = (login: string) => login.endsWith('[bot]');+const displayLogin = (login: string) => login.replace(/\[bot\]$/, '');++export function DemoAvatar(props: {+ person: HomepagePersonId;+ class?: string;+}) {+ return (+ <Show+ when={props.person === 'claude' || props.person === 'cursor'}+ fallback={+ <img+ src={homepagePeople[props.person].photo}+ alt=""+ class={cn('rounded-full object-cover', props.class)}+ />+ }+ >+ <span+ class={cn('sample-agent-avatar', props.class)}+ data-agent={props.person}+ >+ <Show when={props.person === 'claude'} fallback={<CursorIcon />}>+ <ClaudeIcon />+ </Show>+ </span>+ </Show>+ );+}++function Pill(props: { class?: string; children: JSX.Element }) {+ return (+ <span class={cn('review-pr-pill', props.class)}>{props.children}</span>+ );+}++/** GithubMessageView: avatar, login, file/line badge, time, then replies on a rail. */+function GithubComment(props: { comment: DemoGithubComment; reply?: boolean }) {+ return (+ <article+ class="review-gh-comment"+ data-reply={props.reply ? 'true' : undefined}+ >+ <DemoAvatar person={props.comment.person} class="size-8" />+ <div class="min-w-0">+ <div class="review-gh-header">+ <span class="truncate text-sm font-medium">+ {displayLogin(props.comment.login)}+ </span>+ <Show when={!props.reply && props.comment.badge}>+ <span+ class="review-gh-badge"+ data-anchor={props.comment.anchor ? 'true' : undefined}+ title={props.comment.anchor ? props.comment.badge : undefined}+ >+ {props.comment.badge}+ </span>+ </Show>+ <span class="ml-auto shrink-0 text-xs text-ink-extra-muted tabular-nums">+ {props.comment.time}+ </span>+ </div>+ <p class="review-gh-body">{props.comment.body}</p>+ </div>+ </article>+ );+}++/**+ * block-pr's PrDetail: title, status/author/repo/size pills, the GitHub+ * description, and the read-only "Discussion" timeline. There is no diff;+ * Open on GitHub covers the code.+ */+export function PullRequestView(props: {+ pr: DemoPullRequest;+ status?: PrStatus;+ /** Where the PR was opened from, e.g. Home's return breadcrumb. */+ crumb?: { label: string; onClick: () => void };+}) {+ const status = () => props.status ?? props.pr.status;+ const [expanded, setExpanded] = createSignal(true);+ const [hideBots, setHideBots] = createSignal(false);+ const bots = () => props.pr.comments.filter((c) => isBot(c.login)).length;+ const comments = () =>+ props.pr.comments.filter((c) => !hideBots() || !isBot(c.login));+ return (+ <>+ <ViewShell.TopBar>+ <Show when={props.crumb}>+ {(crumb) => (+ <>+ <button+ type="button"+ class="text-sm text-ink-muted"+ onClick={() => crumb().onClick()}+ >+ {crumb().label}+ </button>+ <span class="text-ink-muted px-1">›</span>+ </>+ )}+ </Show>+ <PrIcon status={status()} class="shrink-0" />+ <span class="min-w-0 truncate text-sm font-semibold">+ {props.pr.title}+ </span>+ <div class="ml-auto flex shrink-0 items-center gap-2 pr-1">+ <Button variant="outline" size="sm">+ Open on GitHub+ </Button>+ </div>+ </ViewShell.TopBar>+ <div class="dummy-scroll">+ <div class="review-pr" data-pr={props.pr.number}>+ <h1>{props.pr.title}</h1>+ <div class="review-pr-meta">+ <Pill class={STATUS_CLASS[status()]}>+ <PrIcon status={status()} class="size-3 shrink-0" />+ {status().charAt(0).toUpperCase() + status().slice(1)}+ </Pill>+ <Pill class="text-ink-muted">+ <DemoAvatar person={props.pr.author} class="size-3.5" />+ {props.pr.login}+ </Pill>+ <Pill class="text-ink-muted">{prRef(props.pr)}</Pill>+ <Pill>+ <span class="text-success">+{props.pr.additions}</span>+ <span class="text-failure">−{props.pr.deletions}</span>+ </Pill>+ </div>+ <div class="review-pr-description">+ <DemoMarkdown markdown={props.pr.description} />+ </div>+ <section class="review-pr-timeline" aria-label="Discussion">+ <div class="review-pr-timeline-head">+ <span class="review-pr-rule review-pr-rule-short" />+ <button+ type="button"+ aria-expanded={expanded()}+ onClick={() => setExpanded(!expanded())}+ >+ <Show+ when={expanded()}+ fallback={<CaretRight class="size-3" />}+ >+ <CaretDown class="size-3" />+ </Show>+ Discussion+ </button>+ <span class="review-pr-rule" />+ <Show when={bots() > 0}>+ <ToggleSwitch+ class="shrink-0"+ checked={hideBots()}+ onChange={setHideBots}+ label={`Hide bots (${bots()})`}+ labelClass="text-xs text-ink-muted"+ />+ </Show>+ </div>+ <Show when={expanded()}>+ <div class="review-pr-comments">+ <For each={comments()}>+ {(comment) => (+ <div+ class="review-gh-thread"+ data-thread-open={+ comment.replies?.length ? 'true' : undefined+ }+ >+ <GithubComment comment={comment} />+ <Show when={comment.replies?.length}>+ <div class="review-gh-replies">+ <For each={comment.replies}>+ {(reply) => <GithubComment comment={reply} reply />}+ </For>+ </div>+ </Show>+ </div>+ )}+ </For>+ </div>+ </Show>+ </section>+ </div>+ </div>+ </>+ );+}diff --git a/apps/marketing/src/features/marketing/components/reviews/ReviewStories.test.tsx b/apps/marketing/src/features/marketing/components/reviews/ReviewStories.test.tsxnew file mode 100644index 0000000000..52cfd0ca0e--- /dev/null+++ b/apps/marketing/src/features/marketing/components/reviews/ReviewStories.test.tsx@@ -0,0 +1,196 @@+import { cleanup, fireEvent, render, within } from '@solidjs/testing-library';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import { GithubHomeHero, PrLinkDemo, ReviewInboxDemo } from './ReviewStories';++let intersections: IntersectionObserverCallback[];+let motionListeners: (() => void)[];+let reduced = false;+let hidden = false;+beforeEach(() => {+ intersections = [];+ motionListeners = [];+ reduced = false;+ hidden = false;+ vi.useFakeTimers();+ vi.stubGlobal('fetch', vi.fn());+ vi.spyOn(document, 'hidden', 'get').mockImplementation(() => hidden);+ vi.stubGlobal('matchMedia', () => ({+ get matches() {+ return reduced;+ },+ addEventListener: (_: string, callback: () => void) =>+ motionListeners.push(callback),+ removeEventListener: vi.fn(),+ }));+ vi.stubGlobal(+ 'IntersectionObserver',+ class {+ constructor(callback: IntersectionObserverCallback) {+ intersections.push(callback);+ }+ observe() {}+ disconnect() {}+ }+ );+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+});+afterEach(() => {+ cleanup();+ vi.advanceTimersByTime(100);+ expect(fetch).not.toHaveBeenCalled();+ expect(vi.getTimerCount()).toBe(0);+ vi.useRealTimers();+ vi.restoreAllMocks();+ vi.unstubAllGlobals();+});+function visible(value: boolean) {+ for (const callback of intersections)+ callback(+ [{ isIntersecting: value } as IntersectionObserverEntry],+ {} as IntersectionObserver+ );+}++const REQUEST = 'Keep the invited team through sign-up #491';+const home = (view: ReturnType<typeof render>) =>+ within(view.getByRole('complementary', { name: 'Home' }));++it('delivers a review request to Home, opens the pull request, then marks it done', () => {+ const view = render(() => <ReviewInboxDemo />);+ expect(home(view).queryByRole('button', { name: REQUEST })).toBeNull();+ visible(true);+ vi.advanceTimersByTime(900);+ const request = home(view).getByRole('button', { name: REQUEST });+ expect(within(request).getByRole('img', { name: 'Unread' })).toBeTruthy();+ expect(home(view).getByText('Last few minutes')).toBeTruthy();+ vi.advanceTimersByTime(2000);+ expect(+ view.getByRole('heading', { name: 'Keep the invited team through sign-up' })+ ).toBeTruthy();+ expect(view.getByText('launch-team/web#491')).toBeTruthy();+ expect(view.getByText('src/invite/accept-invite.ts:42')).toBeTruthy();+ expect(view.getByRole('button', { name: 'Open on GitHub' })).toBeTruthy();+ expect(within(request).queryByRole('img', { name: 'Unread' })).toBeNull();+ vi.advanceTimersByTime(2600);+ expect(home(view).queryByRole('button', { name: REQUEST })).toBeNull();+ expect(view.getByRole('status').textContent).toContain('Marked as done');+ expect(+ home(view)+ .getByRole('button', { name: 'engineers' })+ .getAttribute('aria-current')+ ).toBe('page');+ fireEvent.click(view.getByRole('button', { name: 'Undo' }));+ expect(home(view).getByRole('button', { name: REQUEST })).toBeTruthy();+ vi.advanceTimersByTime(30000);+ expect(vi.getTimerCount()).toBe(0);+});++it('shows the review request open, without a cursor, for reduced motion', () => {+ reduced = true;+ const view = render(() => <ReviewInboxDemo />);+ expect(+ home(view)+ .getByRole('button', { name: REQUEST })+ .getAttribute('aria-current')+ ).toBe('page');+ expect(view.getByText('src/invite/accept-invite.ts:42')).toBeTruthy();+ expect(view.container.querySelector('.demo-cursor')).toBeNull();+});++it('lets a visitor open Home items, filter bots, and press E to mark a PR done', () => {+ const view = render(() => <GithubHomeHero />);+ expect(+ view.getByRole('heading', { name: 'Keep the invited team through sign-up' })+ ).toBeTruthy();+ fireEvent.click(view.getByRole('switch', { name: 'Hide bots (1)' }));+ expect(view.queryByText(/Bugbot reviewed/)).toBeNull();+ expect(view.getByText(/Expired invites go to the error page/)).toBeTruthy();+ fireEvent.click(+ home(view).getByRole('button', {+ name: 'Shorten the onboarding checklist #479',+ })+ );+ expect(+ view.getByRole('heading', { name: 'Shorten the onboarding checklist' })+ ).toBeTruthy();+ expect(view.getByText('Merged')).toBeTruthy();+ fireEvent.keyDown(+ view.getByRole('heading', { name: 'Shorten the onboarding checklist' }),+ { key: 'e' }+ );+ expect(+ home(view).queryByRole('button', {+ name: 'Shorten the onboarding checklist #479',+ })+ ).toBeNull();+ expect(view.getByRole('status').textContent).toContain('Marked as done');+ expect(+ home(view)+ .getByRole('button', { name: 'Next steps for our team' })+ .getAttribute('aria-current')+ ).toBe('page');+});++/** jsdom has no layout; give the overlays a box to measure. */+function layout() {+ vi.spyOn(HTMLElement.prototype, 'getBoundingClientRect').mockReturnValue({+ x: 40,+ y: 120,+ left: 40,+ top: 120,+ right: 340,+ bottom: 144,+ width: 300,+ height: 24,+ toJSON: () => ({}),+ });+}++it('previews a pull request link on hover and follows it to merged', () => {+ layout();+ const view = render(() => <PrLinkDemo />);+ const link = view.getByRole('link', { name: REQUEST });+ expect(link.getAttribute('data-status')).toBe('open');+ expect(view.queryByRole('dialog')).toBeNull();+ visible(true);+ vi.advanceTimersByTime(2250);+ const card = view.getByRole('dialog', {+ name: 'Preview of launch-team/web#491',+ });+ expect(card.textContent).toContain('open');+ expect(card.textContent).toContain('+38');+ expect(card.textContent).toContain('12 passed');+ expect(view.container.querySelector('.demo-cursor')).toBeTruthy();+ vi.advanceTimersByTime(2200);+ expect(link.getAttribute('data-status')).toBe('merged');+ expect(card.textContent).toContain('merged');+ fireEvent.click(link);+ expect(+ view.getByRole('heading', { name: 'Keep the invited team through sign-up' })+ ).toBeTruthy();+ fireEvent.click(view.getByRole('button', { name: '#launch' }));+ expect(view.getByRole('log', { name: 'Channel launch' })).toBeTruthy();+});++it('opens the preview for a visitor who hovers the link', () => {+ layout();+ const view = render(() => <PrLinkDemo />);+ const link = view.getByRole('link', { name: REQUEST });+ fireEvent.mouseEnter(link);+ vi.advanceTimersByTime(50);+ expect(+ view.getByRole('dialog', { name: 'Preview of launch-team/web#491' })+ ).toBeTruthy();+ fireEvent.mouseLeave(link);+ expect(view.queryByRole('dialog', { hidden: true })).toBeNull();+ visible(true);+ vi.advanceTimersByTime(30000);+ expect(link.getAttribute('data-status')).toBe('open');+});diff --git a/apps/marketing/src/features/marketing/components/reviews/ReviewStories.tsx b/apps/marketing/src/features/marketing/components/reviews/ReviewStories.tsxindex d2d0144323..0b752b5440 100644--- a/apps/marketing/src/features/marketing/components/reviews/ReviewStories.tsx+++ b/apps/marketing/src/features/marketing/components/reviews/ReviewStories.tsx@@ -1,346 +1,470 @@-import ArrowLeft from '@phosphor/arrow-left.svg';-import CaretDown from '@phosphor/caret-down.svg';-import GitPullRequest from '@phosphor/git-pull-request.svg';+import Hash from '@phosphor/hash.svg';+import Phone from '@phosphor/phone.svg';+import Sparkle from '@phosphor/sparkle.svg';+import UserPlus from '@phosphor/user-plus.svg';import { Button } from '@ui';-import { createSignal, For, Show } from 'solid-js';-import type { DemoAgentMessage } from '../../core/deploy-agent-demo';-import { createDummyWorkspace } from '../../primitives/createDummyWorkspace';+import {+ type Accessor,+ createEffect,+ createSignal,+ For,+ Match,+ onCleanup,+ onMount,+ Show,+ Switch,+} from 'solid-js';+import type { WorkspaceComment } from '../../core/dummy-workspace';+import { homepagePeople } from '../../core/homepage-demo-people';import { createProductWalkthrough } from '../../primitives/createProductWalkthrough';-import { AgentMessage } from '../DemoAgentMessage';-import DemoDeployDiff from '../DemoDeployDiff';-import { DemoMarkdown } from '../DemoMarkdown';+import { DemoCursor } from '../DemoCursor';+import { DemoMentionText } from '../DemoMention';import { ViewShell } from '../DemoWorkspaceChrome';-import { SearchBar } from '../email/frozen/SearchBar';+import { ChannelComposer } from '../email/frozen/ChannelComposer';import { ProductDemo } from '../product/ProductPage';+import { Segments } from '../workspace/frozen/DetailPanel';import { MessageRow } from '../workspace/frozen/MessageRow';-import { TaskNotebook } from '../workspace/frozen/TaskNotebook';-import { PersonIcon } from '../workspace/frozen/TaskProperties';+import {+ arrivalGroups,+ createHomeInbox,+ DoneToast,+ HomeDetail,+ HomeRail,+ HomeSidebar,+ heroGroups,+ markDoneOnE,+ reviewRequestRow,+} from './ReviewHome';+import { PrMention, PrPreviewCard } from './ReviewPrMention';+import { PullRequestView } from './ReviewPullRequest';+import { invitePr, type PrStatus } from './review-fixtures';import '../workspace/dummy-workspace.css';+import './review-stories.css';-const title = 'Retry transient deploy failures';-const description =- '## Summary\n\nRetry temporary registry failures with a bounded delay. Permanent failures still stop immediately.\n\n## Review focus\n\nCheck the attempt limit and the permanent-error path in `deploy/retry.ts`. The linked task contains the original deployment report.';+type Point = { x: number; y: number };-/** PR metadata and read-only GitHub discussion, ported from block-pr. */-function PullRequest(props: {- onBack?: () => void;- discussion?: boolean;- name?: string;- number?: number;+/**+ * Keeps an overlay on a target inside `frame`, re-measured whenever the+ * target selector changes or the frame resizes (the TaskCreationFlow model).+ */+function trackTarget(options: {+ frame: () => HTMLElement;+ selector: Accessor<string | undefined>;+ measure: (target: DOMRect, frame: DOMRect) => Point;}) {- const [expanded, setExpanded] = createSignal(true);- const [hideBots, setHideBots] = createSignal(false);+ const [point, setPoint] = createSignal<Point>();+ onMount(() => {+ const position = () => {+ const selector = options.selector();+ const target = selector+ ? options.frame().querySelector<HTMLElement>(selector)+ : null;+ const bounds = target?.getBoundingClientRect();+ // A target hidden by the narrow layout has no box to point at.+ if (!bounds || (bounds.width === 0 && bounds.height === 0)) {+ setPoint(undefined);+ return;+ }+ setPoint(+ options.measure(bounds, options.frame().getBoundingClientRect())+ );+ };+ createEffect(() => {+ options.selector();+ const timer = requestAnimationFrame(position);+ onCleanup(() => cancelAnimationFrame(timer));+ });+ const resize = new ResizeObserver(position);+ resize.observe(options.frame());+ options.frame().addEventListener('scroll', position, true);+ onCleanup(() => {+ resize.disconnect();+ options.frame().removeEventListener('scroll', position, true);+ });+ });+ return point;+}++const pointAt = (target: DOMRect, frame: DOMRect): Point => ({+ x: target.left - frame.left + Math.min(target.width / 2, 72),+ y: target.top - frame.top + target.height / 2,+});++/** Hero: Home with a review request open, every row clickable. */+export function GithubHomeHero() {+ const inbox = createHomeInbox({ groups: heroGroups, initial: 'pr-491' });return (- <>- <ViewShell.TopBar>- <Show when={props.onBack}>- <Button- variant="plain"- size="icon-sm"- label="Back to reviews"- onClick={props.onBack}- >- <ArrowLeft />- </Button>- </Show>- <GitPullRequest class="size-4 text-success" />- <span class="truncate text-sm font-medium">{props.name ?? title}</span>- </ViewShell.TopBar>- <div class="dummy-scroll product-pr-body">- <h1>{props.name ?? title}</h1>- <div class="product-pr-meta">- <span class="text-success">- <GitPullRequest class="size-3" />- Open- </span>- <span>- <PersonIcon person={props.number === 483 ? 'julia' : 'teo'} />- {props.number === 483 ? 'Julia' : 'Teo'}- </span>- <span>launch-team/website#{props.number ?? 482}</span>- <span>- <b class="text-success">+{props.number === 483 ? 4 : 8}</b>- <b class="text-failure">−{props.number === 483 ? 2 : 1}</b>- </span>+ <ProductDemo label="Explore pull requests in Home">+ <div+ class="review-home"+ data-pane={inbox.pane()}+ onKeyDown={markDoneOnE(inbox)}+ >+ <HomeRail />+ <HomeSidebar inbox={inbox} />+ <div class="dummy-main review-home-main">+ <HomeDetail inbox={inbox} /></div>- <DemoMarkdown- markdown={- props.number === 483- ? '## Summary\n\nUpdate the announcement with Thursday’s launch time and a link to the team workspace.\n\n## Review focus\n\nConfirm the wording with Julia before publishing.'- : description- }- />- <Show when={props.discussion}>- <div class="product-pr-discussion-heading">- <button- type="button"- aria-expanded={expanded()}- onClick={() => setExpanded(!expanded())}- >- <CaretDown class="size-3" />- Discussion- </button>- <label>- <input- type="checkbox"- checked={hideBots()}- onChange={(e) => setHideBots(e.currentTarget.checked)}- />- Hide bots (1)- </label>- </div>- <Show when={expanded()}>- <div class="product-pr-discussion">- <MessageRow- message={{- id: 'review-1',- person: 'julia',- time: '10:14 AM',- body: 'Can we confirm that authentication failures still stop on the first attempt?',- }}- >- <span class="product-pr-file">deploy/retry.ts · L6</span>- </MessageRow>- <MessageRow- message={{- id: 'review-reply',- person: 'teo',- time: '10:18 AM',- replyTo: 'review-1',- body: 'Yes. Only temporary registry failures take the retry path; the permanent-error branch still throws.',- }}- />- <Show when={!hideBots()}>- <MessageRow- message={{- id: 'bot',- person: 'cursor',- time: '10:20 AM',- body: 'Preview available for this branch.',- }}- />- </Show>- </div>- </Show>- </Show>+ <DoneToast inbox={inbox} /></div>- </>+ </ProductDemo>);}-export function ReviewQueueDemo(props: { animate?: boolean }) {+/**+ * A review request arrives at the top of Home. Jacob opens it, reads the PR,+ * and marks it done (E), which removes it and opens the next item.+ * Phases: 0 Home, 1 request arrives, 2 point at it, 3 open, 4 done.+ */+export function ReviewInboxDemo() {let root!: HTMLDivElement;- const [opened, setOpened] = createSignal<number>();- const [query, setQuery] = createSignal('');- const [filter, setFilter] = createSignal('involving');+ let frame!: HTMLDivElement;+ const inbox = createHomeInbox({+ groups: arrivalGroups,+ initial: 'channel-engineers',+ pending: ['pr-491'],+ });+ const [phase, setPhase] = createSignal(0);+ const [automatic, setAutomatic] = createSignal(true);+ const arrive = () => inbox.reveal(reviewRequestRow.id);+ const openRequest = () => {+ arrive();+ inbox.open(reviewRequestRow);+ };const playback = createProductWalkthrough({root: () => root,- steps: 3,+ steps: 4,reset: () => {},- reduced: () => {- if (props.animate) setOpened(482);- },- advance: (s) => {- if (props.animate && s === 2) setOpened(482);+ // A still frame is most useful with the pull request open.+ reduced: openRequest,+ delay: (step) => [0, 900, 1200, 800, 2600][step] ?? 1400,+ advance: (step) => {+ if (step === 1) arrive();+ if (step === 3) openRequest();+ if (step === 4) {+ inbox.markDone(reviewRequestRow.id);+ setAutomatic(false);+ }+ setPhase(step);},});- const rows = [- { name: title, author: 'teo' as const, number: 482, involving: true },- {- name: 'Update the launch announcement',- author: 'julia' as const,- number: 483,- involving: false,- },- ];+ const pause = () => {+ setAutomatic(false);+ arrive();+ playback.pause();+ };+ const pointer = trackTarget({+ frame: () => frame,+ selector: () =>+ automatic()+ ? [+ undefined,+ '[data-home-row="channel-engineers"]',+ '[data-home-row="pr-491"]',+ '[data-home-row="pr-491"]',+ ][phase()]+ : undefined,+ measure: pointAt,+ });return (- <ProductDemo- ref={(el) => (root = el)}- label="Find and open a pull request in Reviews"- onInteract={playback.pause}- >- <Show- when={opened()}- fallback={- <>- <ViewShell.TopBar>- <span class="text-sm font-medium">Reviews</span>- </ViewShell.TopBar>- <nav class="product-task-filters" aria-label="Review views">- <button- type="button"- aria-pressed={filter() === 'involving'}- onClick={() => setFilter('involving')}- >- Involving me- </button>- <button- type="button"- aria-pressed={filter() === 'all'}- onClick={() => setFilter('all')}- >- All reviews- </button>- </nav>- <div class="product-review-queue">- <SearchBar- label="Search sample reviews"- placeholder="Search reviews"- value={query()}- onValueChange={setQuery}- />- <For- each={rows.filter(- (r) =>- (filter() === 'all' || r.involving) &&- r.name.toLowerCase().includes(query().toLowerCase())- )}- >- {(r) => (- <button- class="product-review-row"- type="button"- onClick={() => setOpened(r.number)}- aria-label={`Open review: ${r.name}`}- >- <GitPullRequest class="size-4 text-success" />- <span>- {r.name}- <small>launch-team/website · #{r.number}</small>- </span>- <span>- <PersonIcon person={r.author} />- {r.author === 'teo' ? 'Teo' : 'Julia'}- </span>- </button>- )}- </For>+ <div ref={root} class="review-flow">+ <div ref={frame} class="review-flow-frame" onFocusIn={pause}>+ <ProductDemo+ label="A review request arrives in Home and opens the pull request"+ onInteract={pause}+ height={520}+ mobileHeight={500}+ >+ <div+ class="review-home review-home-zoomed"+ data-pane={inbox.pane()}+ onKeyDown={markDoneOnE(inbox)}+ >+ <HomeSidebar+ inbox={inbox}+ arriving={phase() >= 1 ? reviewRequestRow.id : undefined}+ />+ <div class="dummy-main review-home-main">+ <HomeDetail inbox={inbox} /></div>- </>- }- >- <PullRequest- name={rows.find((r) => r.number === opened())?.name}- number={opened()}- onBack={() => setOpened(undefined)}- />- </Show>- </ProductDemo>- );-}--export function ReviewDiffDemo() {- return (- <ProductDemo label="Inspect an agent’s proposed code change">- <ViewShell.TopBar>- <span class="text-sm font-medium">Changes · deploy/retry.ts</span>- <span class="ml-auto text-xs">- <span class="text-success">+8</span>{' '}- <span class="text-failure">−1</span>- </span>- </ViewShell.TopBar>- <div class="dummy-scroll product-pr-body">- <DemoDeployDiff />+ <DoneToast inbox={inbox} />+ </div>+ </ProductDemo>+ <Show when={pointer()}>+ {(p) => (+ <DemoCursor+ label="Jacob"+ class="review-flow-pointer"+ clicking={phase() === 3}+ style={{ transform: `translate(${p().x}px, ${p().y}px)` }}+ />+ )}+ </Show></div>- </ProductDemo>+ </div>);}-export function ReviewDiscussionDemo() {- return (- <ProductDemo label="Read the GitHub review discussion and filter bot messages">- <PullRequest discussion />- </ProductDemo>- );-}+const CHANNEL_TABS = ['Messages', 'Attachments', 'Calls', 'Participants'];-export function ReviewAgentDemo() {+/**+ * A pull request link in a channel renders as a mention; hovering it shows+ * the preview card, and the mention follows the PR when it merges.+ * Phases: 0 channel, 1 cursor in, 2 hover the link, 3 card, 4 merged.+ */+export function PrLinkDemo() {let root!: HTMLDivElement;- const [finished, setFinished] = createSignal(false);+ let frame!: HTMLDivElement;+ const [phase, setPhase] = createSignal(0);+ const [automatic, setAutomatic] = createSignal(true);+ const [status, setStatus] = createSignal<PrStatus>('open');+ const [hovered, setHovered] = createSignal(false);+ const [opened, setOpened] = createSignal(false);+ const [tab, setTab] = createSignal('Messages');+ const [reacted, setReacted] = createSignal<string[]>([]);+ const [sent, setSent] = createSignal<WorkspaceComment[]>([]);const playback = createProductWalkthrough({root: () => root,- steps: 3,+ steps: 4,reset: () => {},- reduced: () => setFinished(true),- advance: (s) => {- if (s === 2) setFinished(true);+ reduced: () => {+ setHovered(true);+ setStatus('merged');},+ delay: (step) => [0, 700, 900, 600, 2200][step] ?? 1400,+ advance: (step) => {+ setPhase(step);+ if (step === 3) setHovered(true);+ if (step === 4) setStatus('merged');+ },+ });+ const pause = () => {+ setAutomatic(false);+ playback.pause();+ };+ // Hover moves between the link and its card without closing it.+ const hover = (next: boolean, event: MouseEvent | FocusEvent) => {+ pause();+ const related = event.relatedTarget as Node | null;+ if (!next && related && frame.contains(related)) {+ const element = related instanceof Element ? related : null;+ if (element?.closest('[data-pr-mention], .review-pr-card')) return;+ }+ setHovered(next);+ };+ const pointer = trackTarget({+ frame: () => frame,+ selector: () =>+ automatic() && phase() >= 1+ ? phase() === 1+ ? '[data-message="staging"] p'+ : '[data-pr-mention]'+ : undefined,+ measure: pointAt,});- const message = (text: string, user = false): DemoAgentMessage => ({- agentSessionId: 'review-example',- turn: 0,- requestId: null,- pending: false,- author: user ? { kind: 'user', userId: 'jacob' } : { kind: 'agent' },- stop: { kind: 'end_turn' },- parts: [{ kind: 'text', text }],+ const cardOpen = () => hovered() && !opened() && tab() === 'Messages';+ const card = trackTarget({+ frame: () => frame,+ selector: () => (cardOpen() ? '[data-pr-mention]' : undefined),+ measure: (target, bounds) => ({+ x: Math.max(+ 8,+ Math.min(target.left - bounds.left, bounds.width - CARD_WIDTH - 8)+ ),+ y: target.bottom - bounds.top + 8,+ }),+ });+ const react = (id: string) =>+ setReacted((ids) =>+ ids.includes(id) ? ids.filter((x) => x !== id) : [...ids, id]+ );+ const message = (+ id: string,+ person: WorkspaceComment['person'],+ time: string,+ body = ''+ ) => ({+ id,+ person,+ time,+ body,+ reactions: reacted().includes(id) ? ['jacob' as const] : undefined,});return (- <ProductDemo- ref={(el) => (root = el)}- label="Ask an agent to inspect the retry change"- onInteract={playback.pause}- >- <ViewShell.TopBar>- <span class="text-sm font-medium">Review deploy retry</span>- </ViewShell.TopBar>- <div class="dummy-scroll product-agent-log">- <AgentMessage- message={message(- 'Review this retry change. What stops a permanent failure from being retried?',- true- )}- inFlight={false}- />- <Show when={finished()}>- <AgentMessage- message={message(- 'The catch branch throws when the error is not transient. Only temporary failures continue through the bounded retry loop. Inspect that branch before approving the change.'- )}- inFlight={false}+ <div ref={root} class="review-flow">+ <div ref={frame} class="review-flow-frame" onFocusIn={pause}>+ <ProductDemo+ label="Hover a pull request link in a channel to see its status"+ onInteract={pause}+ height={470}+ mobileHeight={560}+ >+ <Show+ when={!opened()}+ fallback={+ <PullRequestView+ pr={invitePr}+ status={status()}+ crumb={{ label: '#launch', onClick: () => setOpened(false) }}+ />+ }+ >+ <ViewShell.TopBar>+ <Hash class="size-4" />+ <span class="text-sm font-medium">launch</span>+ <Segments+ label="Conversation view"+ items={CHANNEL_TABS}+ value={tab()}+ onChange={setTab}+ />+ <div class="ml-auto flex items-center gap-1">+ <Button size="sm" variant="plain" class="review-channel-invite">+ <UserPlus class="size-3" />+ Invite+ </Button>+ <Button size="sm" variant="plain">+ <Phone class="size-3" />+ Call+ </Button>+ <Button size="sm" variant="plain">+ <Sparkle class="size-3" />+ Ask Macro+ </Button>+ </div>+ </ViewShell.TopBar>+ <div+ class="dummy-scroll sample-chat-log review-channel-log"+ role="log"+ aria-label="Channel launch"+ >+ <Switch+ fallback={+ <p class="py-12 text-center text-sm text-ink-muted">+ {tab() === 'Calls'+ ? 'No calls in this channel'+ : 'No documents in this channel yet.'}+ </p>+ }+ >+ <Match when={tab() === 'Participants'}>+ <For each={['jacob', 'julia', 'teo', 'gabriel'] as const}>+ {(person) => (+ <div class="flex items-center gap-3 py-3">+ <img+ class="size-8 rounded-full"+ alt=""+ src={homepagePeople[person].photo}+ />+ {homepagePeople[person].name}+ </div>+ )}+ </For>+ </Match>+ <Match when={tab() === 'Messages'}>+ <div class="sample-date-divider">+ <span>Today</span>+ </div>+ <div class="sample-channel-thread" data-message="staging">+ <MessageRow+ message={message(+ 'staging',+ 'gabriel',+ '9:58 AM',+ 'staging still drops new people into their personal workspace after they accept an invite'+ )}+ onReact={() => react('staging')}+ />+ </div>+ <div class="sample-channel-thread" data-message="fix">+ <MessageRow+ message={message('fix', 'teo', '10:14 AM')}+ onReact={() => react('fix')}+ >+ <p class="review-message-body">+ fix is up:{' '}+ <PrMention+ pr={invitePr}+ status={status()}+ hovered={hovered() || (automatic() && phase() >= 2)}+ onHover={hover}+ onOpen={() => {+ pause();+ setHovered(false);+ setOpened(true);+ }}+ />+ <DemoMentionText text=" @[Jacob](demo-mention:jacob) can you review before Thursday?" />+ </p>+ </MessageRow>+ </div>+ <div class="sample-channel-thread" data-message="announce">+ <MessageRow+ message={message(+ 'announce',+ 'julia',+ '10:16 AM',+ 'if it lands today I’ll send the announcement tomorrow morning'+ )}+ onReact={() => react('announce')}+ />+ </div>+ <For each={sent()}>+ {(item) => (+ <div class="sample-channel-thread">+ <MessageRow message={item} />+ </div>+ )}+ </For>+ </Match>+ </Switch>+ </div>+ <Show when={tab() === 'Messages'}>+ <div class="dummy-composer sample-chat-composer">+ <ChannelComposer+ richMentions+ label="Message #launch"+ placeholder="Type @ to share with #launch"+ onSend={(body) =>+ setSent((items) => [+ ...items,+ {+ id: `sent-${items.length}`,+ person: 'jacob',+ time: '10:20 AM',+ body,+ },+ ])+ }+ />+ </div>+ </Show>+ </Show>+ </ProductDemo>+ <Show when={cardOpen()}>+ <PrPreviewCard+ pr={invitePr}+ status={status()}+ class="review-flow-card"+ style={{+ transform: `translate(${card()?.x ?? 0}px, ${card()?.y ?? 0}px)`,+ visibility: card() ? undefined : 'hidden',+ }}+ onHover={hover}/>- <div class="mt-6">- <DemoDeployDiff />- </div>+ </Show>+ <Show when={pointer()}>+ {(p) => (+ <DemoCursor+ label="Jacob"+ class="review-flow-pointer"+ style={{ transform: `translate(${p().x}px, ${p().y}px)` }}+ />+ )}</Show></div>- </ProductDemo>+ </div>);}-export function ReviewLinkedTaskDemo() {- const w = createDummyWorkspace('tasks');- w.open('tasks', 'deploy');- w.updateTask('deploy', {- status: 'In Review',- owner: 'teo',- description:- 'Temporary registry failures interrupt deployment. Review the bounded retry change in PR #482 before completing this task.',- });- const [opened, setOpened] = createSignal(false);- return (- <ProductDemo label="Open a linked pull request from its task">- <Show- when={opened()}- fallback={- <TaskNotebook- workspace={w}- task={w.data.tasks.find((t) => t.id === 'deploy')!}- relatedContent={- <button- type="button"- class="dummy-entity-link"- onClick={() => setOpened(true)}- >- <GitPullRequest class="size-4 text-success" />- Retry transient deploy failures · #482- </button>- }- />- }- >- <PullRequest onBack={() => setOpened(false)} />- </Show>- </ProductDemo>- );-}+const CARD_WIDTH = 320;diff --git a/apps/marketing/src/features/marketing/components/reviews/review-fixtures.ts b/apps/marketing/src/features/marketing/components/reviews/review-fixtures.tsnew file mode 100644index 0000000000..80f9218eeb--- /dev/null+++ b/apps/marketing/src/features/marketing/components/reviews/review-fixtures.ts@@ -0,0 +1,108 @@+import type { HomepagePersonId } from '../../core/homepage-demo-people';++export type PrStatus = 'open' | 'merged' | 'closed';++/** One GitHub comment as block-pr's timeline receives it. */+export type DemoGithubComment = {+ id: string;+ person: HomepagePersonId;+ /** GitHub login; `[bot]` logins count toward "Hide bots". */+ login: string;+ time: string;+ body: string;+ /** `review_comment` anchor (`path:line`) or a source label like "review". */+ badge?: string;+ anchor?: boolean;+ replies?: DemoGithubComment[];+};++export type DemoPullRequest = {+ id: string;+ title: string;+ repo: string;+ number: number;+ status: PrStatus;+ author: HomepagePersonId;+ login: string;+ additions: number;+ deletions: number;+ checksPassed: number;+ description: string;+ comments: DemoGithubComment[];+};++/** The same pull request the Tasks page links to its task. */+export const invitePr: DemoPullRequest = {+ id: 'pr-491',+ title: 'Keep the invited team through sign-up',+ repo: 'launch-team/web',+ number: 491,+ status: 'open',+ author: 'teo',+ login: 'teo',+ additions: 38,+ deletions: 6,+ checksPassed: 12,+ description:+ '## What changed\n\nNew teammates who accept an invite now stay in the invited team through sign-up. Existing accounts switch to that team after they sign in.\n\nFixes LAUNCH-42.\n\n## Testing\n\n- New account from an invite link\n- Existing account from an invite link\n- Expired invite still shows the error page',+ comments: [+ {+ id: 'expired',+ person: 'julia',+ login: 'juliawestphal',+ time: '10:21 AM',+ badge: 'src/invite/accept-invite.ts:42',+ anchor: true,+ body: 'If the invite has expired this still falls through to the personal workspace. Can we keep the error page for that case?',+ replies: [+ {+ id: 'expired-reply',+ person: 'teo',+ login: 'teo',+ time: '10:34 AM',+ body: 'Good catch. Expired invites go to the error page again, and there’s a test for it now.',+ },+ ],+ },+ {+ id: 'bugbot',+ person: 'cursor',+ login: 'cursor[bot]',+ time: '10:36 AM',+ body: 'Bugbot reviewed this pull request and found no new issues.',+ },+ ],+};++export const onboardingPr: DemoPullRequest = {+ id: 'pr-479',+ title: 'Shorten the onboarding checklist',+ repo: 'launch-team/web',+ number: 479,+ status: 'merged',+ author: 'jacob',+ login: 'jbeckerman',+ additions: 12,+ deletions: 31,+ checksPassed: 9,+ description:+ '## What changed\n\nThe onboarding checklist goes from seven steps to four. Calendar and email setup move to Settings, where people looked for them anyway.\n\nFixes LAUNCH-38.',+ comments: [+ {+ id: 'approve',+ person: 'valentina',+ login: 'valentina',+ time: '9:12 AM',+ badge: 'review',+ body: 'Checked it on mobile too. Ship it.',+ },+ ],+};++/** GitHub comment count as the hover card reports it (replies included). */+export function prCommentCount(pr: DemoPullRequest) {+ return pr.comments.reduce(+ (count, comment) => count + 1 + (comment.replies?.length ?? 0),+ 0+ );+}diff --git a/apps/marketing/src/features/marketing/components/reviews/review-stories.css b/apps/marketing/src/features/marketing/components/reviews/review-stories.cssnew file mode 100644index 0000000000..63bd3392ab--- /dev/null+++ b/apps/marketing/src/features/marketing/components/reviews/review-stories.css@@ -0,0 +1,100 @@+/* GitHub page: Home (unified inbox), block-pr's PrDetail, and the PR mention. */++/* Desktop Home: the list is the view's sidebar; the opened item fills the rest. */+.review-home { position: relative; display: flex; flex: 1; min-height: 0; min-width: 0; }+.review-home > .dummy-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; padding: 8px 8px 12px; border-right: 1px solid var(--color-edge-frame); background: var(--color-panel); }+.review-home-sidebar { flex: 0 0 256px; width: 256px; border-right: 1px solid var(--color-edge-frame); }+.review-home-main { flex: 1; min-width: 0; }+.review-home-group { margin-bottom: 12px; padding-inline: 8px; color: var(--color-ink-muted); font-size: 12px; }+.review-home-row .review-home-time { display: none; flex: none; color: var(--color-ink-extra-muted); font-size: 12px; }+.review-home-row:hover .review-home-time { display: block; }+.review-home-row[data-arriving='true'] { animation: review-row-in 420ms cubic-bezier(.2, .8, .2, 1) both; }+@keyframes review-row-in { from { opacity: 0; transform: translateY(-6px); } }++/* The app rail around the hero; Home is selected. */+.review-rail { flex: 0 0 56px; width: 56px; }+.review-rail-nav { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 16px; }+.review-rail-button { display: inline-flex; width: 40px; height: 40px; flex: none; align-items: center; justify-content: center; border-radius: 12px; color: var(--color-ink-muted); }+.review-rail-button[data-create='true'] { border: 1px solid var(--color-edge-button); background: var(--color-control); }+.review-rail-button[data-active='true'] { background: var(--color-hover); color: var(--color-ink); }++/* Section 1 shows Home closer up, without the rail. */+.review-home-zoomed .review-home-sidebar { flex-basis: 300px; width: 300px; }++/* Mark done's toast, as the app's ToastRegion raises it. */+.review-toast { position: absolute; right: 16px; bottom: 16px; z-index: 6; display: flex; align-items: center; gap: 8px; width: min(340px, calc(100% - 32px)); padding: 10px 10px 10px 12px; border: 0.5px solid var(--color-edge); border-radius: 12px; background: var(--color-menu); box-shadow: 0 16px 40px rgb(0 0 0 / 0.45); font-size: 14px; animation: review-toast 3.6s ease both; }+.review-toast-icon { display: inline-flex; width: 20px; height: 20px; flex: none; align-items: center; justify-content: center; border-radius: 999px; background: var(--color-success); color: var(--color-surface); }+@keyframes review-toast { 0% { opacity: 0; transform: translateY(8px); } 8%, 86% { opacity: 1; transform: none; } 100% { opacity: 0; visibility: hidden; } }++/* PrDetail: centered max-w-3xl column. */+.review-pr { max-width: 768px; min-width: 0; margin-inline: auto; padding: 48px 24px; text-align: left; }+.review-pr h1 { font: 600 24px/32px 'Inter Variable', Inter, sans-serif; }+.review-pr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 24px; font-size: 14px; }+.review-pr-pill { display: inline-flex; min-width: 0; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--color-edge-muted); border-radius: 999px; background: var(--color-surface); line-height: 1.25; }+.review-pr-description { font-size: 14px; overflow-wrap: break-word; }+.review-pr-description .website-demo-markdown h2 { margin-top: 20px; }+.review-pr-description .website-demo-markdown p { margin-block: 8px 16px; }+.review-pr-timeline { margin-top: 32px; padding-bottom: 24px; }+.review-pr-timeline-head { display: flex; align-items: center; gap: 8px; padding-top: 8px; }+.review-pr-timeline-head > button { display: flex; align-items: center; gap: 4px; padding-inline: 8px; font-size: 12px; }+.review-pr-timeline-head > button:hover { opacity: 0.7; }+.review-pr-rule { flex: 1; border-top: 1px solid var(--color-edge-muted); }+.review-pr-rule-short { flex: 0 0 24px; }+.review-pr-comments { display: flex; flex-direction: column; padding-top: 8px; }++/* GithubMessageView: channel message rows, replies on the thread rail. */+.review-gh-thread { position: relative; isolation: isolate; }+.review-gh-thread[data-thread-open='true']::before { content: ''; position: absolute; z-index: -1; top: 52px; bottom: 30px; left: 16px; width: 1px; background: var(--color-edge); }+.review-gh-comment { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; padding: 12px 0 4px; }+.review-gh-header { display: flex; min-width: 0; align-items: center; gap: 4px; }+.review-gh-badge { display: inline-flex; min-width: 0; align-items: center; overflow: hidden; padding: 2px 8px; border-radius: 4px; background: var(--color-hover); color: var(--color-ink-muted); font-size: 12px; font-weight: 500; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }+.review-gh-badge[data-anchor='true'] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }+.review-gh-body { margin-top: 2px; font-size: 14px; line-height: 22px; overflow-wrap: break-word; }+.review-gh-replies { position: relative; margin-left: 40px; }+.review-gh-comment[data-reply='true']::before { content: ''; position: absolute; z-index: -1; top: 0; left: -24px; width: 20px; height: 28px; border-bottom: 1px solid var(--color-edge); border-left: 1px solid var(--color-edge); border-bottom-left-radius: 14px; }++/* PullRequestMention: icon, underlined title, muted #N. */+.review-pr-mention { padding: 2px 0; border-radius: 2px; cursor: pointer; outline: none; }+.review-pr-mention:hover, .review-pr-mention[data-hovered='true'] { background: var(--color-hover); }+.review-pr-mention:focus-visible { background: var(--color-active); }+.review-pr-mention-icon { position: relative; top: 0.125em; display: inline-flex; width: 1em; height: 1em; margin-inline: 4px; }+.review-pr-mention-label { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 20%, transparent); text-decoration-thickness: max(1px, 0.1em); text-underline-offset: 2px; }+.review-message-body { margin-top: 2px; font-size: 15px; line-height: 24px; overflow-wrap: break-word; }++/* PullRequestPreviewCard: w-80 Surface depth 3, rounded-xl, shadow-lg. */+.review-pr-card { width: 320px; overflow: hidden; border: 0.5px solid var(--color-edge); border-radius: 12px; background: var(--color-surface-2); color: var(--color-ink); box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.45), 0 4px 6px -4px rgb(0 0 0 / 0.45); font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, 'Inter Variable', Roboto, sans-serif; text-align: left; user-select: none; }++/* Walkthrough overlays sit over the window, measured from their targets. */+.review-flow-frame { position: relative; }+.review-flow-pointer { position: absolute; top: 0; left: 0; z-index: 9; pointer-events: none; transition: transform 600ms cubic-bezier(.2, .8, .2, 1); }+.review-flow-card { position: absolute; top: 0; left: 0; z-index: 10; animation: review-card-in 160ms ease-out both; }+@keyframes review-card-in { from { opacity: 0; } }+.review-channel-log .sample-channel-thread { margin-bottom: 12px; }++/* The homepage styles its own #coding-agents heading; keep this page's.+ Its demo sits in a bare .dummy-workspace so its buttons keep their type. */+.product-page .review-agent-demo.dummy-workspace { display: block; height: auto; min-height: 0; background: none; color: inherit; font: inherit; text-align: inherit; }+.product-page .review-agent-demo :is(section, div) { min-width: 0; }+.product-page #coding-agents .homepage-feature-title { flex-direction: row; }++@media (max-width: 699px) {+ .review-home > .dummy-rail { display: none; }+ .review-home .review-home-sidebar { flex: 1 1 auto; width: 100%; border-right: 0; }+ .review-home[data-pane='list'] .review-home-main, .review-home[data-pane='detail'] .review-home-sidebar { display: none; }+ .review-pr { padding: 28px 16px; }+ .review-pr h1 { font-size: 20px; line-height: 28px; }+ .review-gh-replies { margin-left: 28px; }+ .review-gh-comment[data-reply='true']::before { left: -12px; width: 8px; }+ .review-channel-invite { display: none; }+ .review-message-body { font-size: 14px; }+ .review-toast { right: 12px; bottom: 12px; width: calc(100% - 24px); }+ .product-page #coding-agents.feature-page-section { padding-top: 56px; }+ .product-page #coding-agents .homepage-feature-title { gap: 16px; }+ .product-page #coding-agents .homepage-feature-heading h2 { font-size: clamp(28px, 3.2vw, 40px); white-space: normal; }+ /* The homepage lays this demo out at an 18px gutter; give it the same room. */+ .product-page .review-agent-demo.dummy-workspace { width: calc(100% + 24px); margin-inline: -12px; }+}+@media (prefers-reduced-motion: reduce) {+ .review-flow-pointer { display: none; }+ .review-home-row[data-arriving='true'], .review-flow-card { animation: none; }+}diff --git a/apps/marketing/src/features/marketing/components/tasks/TaskCreationFlow.tsx b/apps/marketing/src/features/marketing/components/tasks/TaskCreationFlow.tsxindex 2e13aa1010..c0d3b5934c 100644--- a/apps/marketing/src/features/marketing/components/tasks/TaskCreationFlow.tsx+++ b/apps/marketing/src/features/marketing/components/tasks/TaskCreationFlow.tsx@@ -1,159 +1,97 @@-import Cursor from '@phosphor/cursor.svg';-import Hash from '@phosphor/hash.svg';-import ListChecks from '@phosphor/list-checks.svg';-import { Button } from '@ui';-import {- createEffect,- createSignal,- For,- onCleanup,- onMount,- Show,-} from 'solid-js';+import { createEffect, createSignal, onCleanup, onMount, Show } from 'solid-js';import { createStore } from 'solid-js/store';import type { WorkspaceTask } from '../../core/dummy-workspace';import { createDummyWorkspace } from '../../primitives/createDummyWorkspace';import { createProductWalkthrough } from '../../primitives/createProductWalkthrough';-import { ViewShell } from '../DemoWorkspaceChrome';+import { DemoCursor } from '../DemoCursor';import { ProductDemo } from '../product/ProductPage';-import { MessageRow } from '../workspace/frozen/MessageRow';-import {- TaskOwnerMenu,- TaskPriorityMenu,-} from '../workspace/frozen/TaskProperties';+import { TaskComposer } from '../workspace/frozen/TaskComposer';import { WorkspaceChannel } from '../workspace/WorkspaceChannel';import { WorkspaceTasks } from '../workspace/WorkspaceTasks';import './task-creation-flow.css';+const context =+ 'Reproduced it. New teammates land in their personal workspace after accepting an invite.';const request =- 'Keep the invited team selected through sign-up. New and existing accounts should land in the right workspace.';+ 'Keep the invited team selected through sign-up @[Teo](demo-mention:teo)';-/** Both paths use the same local task model and the app's message/property presentation. */-export function TaskCreationFlow(props: { fromChannel?: boolean }) {+/**+ * The channel ActionMenu's Task button opens ComposeTask with the message as+ * its title, a link back to the message, and the mentioned person assigned.+ * Phases: 0 channel, 1 hover the message, 2 composer, 3 priority, 4 created.+ */+export function TaskCreationFlow() {let root!: HTMLDivElement;let frame!: HTMLDivElement;const w = createDummyWorkspace('messages');- if (props.fromChannel) {- w.setData('channels', (c) => c.id === 'launch', 'messages', [- {- id: 'context',- person: 'julia',- body: 'Last pass before Thursday. Can someone take the invite flow?',- time: '9:16 AM',- },- ]);- }+ w.setData('channels', (c) => c.id === 'launch', 'messages', [+ {+ id: 'checks',+ person: 'gabriel',+ body: 'Ran through signup on staging. Existing accounts are fine, new ones are not.',+ time: '9:11 AM',+ },+ { id: 'context', person: 'teo', body: context, time: '9:16 AM' },+ { id: 'invite-request', person: 'julia', body: request, time: '9:18 AM' },+ ]);+ w.open('messages', 'launch');const [phase, setPhase] = createSignal(0);const [automatic, setAutomatic] = createSignal(true);const [taskId, setTaskId] = createSignal<string>();- const [sendAsTask, setSendAsTask] = createSignal(false);const [pointer, setPointer] = createSignal<{ x: number; y: number }>();const [draft, setDraft] = createStore<WorkspaceTask>({id: 'task-draft',- title: 'Fix the team invite handoff',- description: props.fromChannel ? '' : request,- owner: 'jacob',+ title: 'Keep the invited team selected through sign-up',+ description: '',+ owner: 'teo',creator: 'jacob',- priority: 'High',+ priority: 'Medium',status: 'Not Started',channel: 'launch',- tags: ['Launch'],+ tags: [],steps: [],comments: [],});const create = () => {let id = taskId();if (!id) {- id = w.createTask(draft.title, draft.description, 'launch');- if (props.fromChannel) w.post(draft.description, undefined, id);- else- w.setData('channels', (c) => c.id === 'launch', 'messages', [- {- id: 'invite-request',- person: 'julia',- body: request,- time: '9:18 AM',- taskId: id,- },- ]);+ id = w.createTask(draft.title, context, 'launch');setTaskId(id);}w.updateTask(id, {title: draft.title,- description: draft.description,owner: draft.owner,priority: draft.priority,+ status: draft.status,});- w.open(- props.fromChannel ? 'messages' : 'tasks',- props.fromChannel ? 'launch' : id- );- setPhase(5);+ w.open('tasks', id);+ setPhase(4);setAutomatic(false);};- const advance = (step: number) => {- setPhase(step);- if (step === 1 && props.fromChannel) setDraft('description', request);- if (step === 2) setSendAsTask(true);- if (step === 3) setDraft('owner', 'teo');- if (step === 5) create();- };const playback = createProductWalkthrough({root: () => root,- steps: 5,+ steps: 4,reset: () => {},- reduced: () => {- setDraft('owner', 'teo');- if (props.fromChannel) setDraft('description', request);- create();+ reduced: create,+ delay: (step) => [0, 1200, 1600, 1500, 1500][step] ?? 1400,+ advance: (step) => {+ if (step === 3) setDraft('priority', 'High');+ if (step === 4) create();+ else setPhase(step);},- advance,});const pause = () => {setAutomatic(false);playback.pause();};- const select = (step: number) => {- pause();- if (step === 5) {- if (taskId()) {- w.open(- props.fromChannel ? 'messages' : 'tasks',- props.fromChannel ? 'launch' : taskId()- );- setPhase(5);- } else {- if (props.fromChannel && !draft.description)- setDraft('description', request);- create();- }- } else {- setPhase(step);- if (step >= 2) {- setSendAsTask(true);- if (props.fromChannel && !draft.description)- setDraft('description', request);- }- }- };onMount(() => {const position = () => {- const selectors = props.fromChannel- ? [- '[aria-label="Channel task message"]',- '[aria-label="Send as task"]',- '[aria-label="Change assignee"]',- '[aria-label="Change assignee"]',- '[data-task-submit]',- ]- : [- '[aria-label="Create task from message"]',- '[aria-label="Create task from message"]',- '[aria-label="New task title"]',- '[aria-label="Change assignee"]',- '[data-task-submit]',- ];- const selector = selectors[phase()];+ const selector = [+ undefined,+ '[data-hovered=true] [aria-label="Task"]',+ '[aria-label="Change priority"]',+ '[data-task-submit]',+ ][phase()];const target = selector? frame.querySelector<HTMLElement>(selector): undefined;@@ -164,7 +102,7 @@ export function TaskCreationFlow(props: { fromChannel?: boolean }) {const bounds = target.getBoundingClientRect();const parent = frame.getBoundingClientRect();setPointer({- x: bounds.left - parent.left + Math.min(bounds.width / 2, 90),+ x: bounds.left - parent.left + Math.min(bounds.width / 2, 40),y: bounds.top - parent.top + bounds.height / 2,});};@@ -178,202 +116,54 @@ export function TaskCreationFlow(props: { fromChannel?: boolean }) {resize.observe(frame);onCleanup(() => resize.disconnect());});- const labels = () =>- props.fromChannel- ? ['Write in chat', 'Send as task', 'Assign', 'In the channel']- : ['The request', 'Create task', 'Assign', 'The task'];return (<div ref={root} class="task-creation-flow">- <nav- class="task-flow-steps"- aria-label={- props.fromChannel- ? 'Channel task creation steps'- : 'Message conversion steps'- }- >- <For each={[0, 2, 3, 5]}>- {(step, index) => (- <button- type="button"- aria-pressed={phase() >= step && phase() < [2, 3, 5, 6][index()]}- onClick={() => select(step)}- >- <span>{index() + 1}</span>- {labels()[index()]}- </button>- )}- </For>- </nav><div ref={frame} class="task-flow-frame" onFocusIn={pause}><ProductDemo- label={- props.fromChannel- ? 'Send a task directly to a channel'- : 'Create a task from a channel message'- }+ label="Create a task from a channel message"onInteract={pause}- action={phase() === 1 ? 'create' : undefined}+ height={520}+ mobileHeight={600}><Show- when={phase() < 5}- fallback={- <Show- when={w.contentView() === 'messages'}- fallback={<WorkspaceTasks workspace={w} filter="all" />}- >- <WorkspaceChannel workspace={w} />- </Show>- }+ when={phase() < 4}+ fallback={<WorkspaceTasks workspace={w} filter="all" />}>- <ViewShell.TopBar>- <Hash class="size-4" />- <span class="text-sm font-medium">launch</span>- </ViewShell.TopBar>- <div class="sample-chat-log dummy-scroll task-flow-chat">- <div class="sample-date-divider">- <span>Today</span>- </div>- <MessageRow- message={{- id: 'context',- person: props.fromChannel ? 'julia' : 'teo',- body: props.fromChannel- ? 'Last pass before Thursday. Can someone take the invite flow?'- : 'I can reproduce it. The invite lands in the personal workspace after sign-up.',- time: '9:16 AM',- }}- />- <Show when={!props.fromChannel}>- <MessageRow- message={{- id: 'invite-request',- person: 'julia',- body: request,- time: '9:18 AM',- }}- onTask={() => select(2)}- />- </Show>- </div>- <Show when={props.fromChannel}>- <form- class="task-flow-compose"- onSubmit={(e) => {- e.preventDefault();- pause();- if (sendAsTask()) create();- }}- >- <textarea- aria-label="Channel task message"- placeholder="Write a message to #launch…"- value={draft.description}- onInput={(e) => {+ <WorkspaceChannel+ workspace={w}+ hoveredMessage={phase() === 1 ? 'invite-request' : undefined}+ onTaskMessage={() => {+ pause();+ setPhase(2);+ }}+ />+ <Show when={phase() >= 2}>+ <div class="task-flow-popover">+ <TaskComposer+ draft={draft}+ sourceChannel="launch"+ update={(patch) => setDraft(patch)}+ submit={() => {pause();- setDraft('description', e.currentTarget.value);- setPhase(Math.max(phase(), 1));+ create();}}- />- <div class="task-flow-compose-actions">- <button- type="button"- role="switch"- aria-label="Send as task"- aria-checked={sendAsTask()}- onClick={() => {- pause();- setSendAsTask(!sendAsTask());- setPhase(2);- }}- >- <ListChecks class="size-4" />- Send as task- <span class="task-flow-switch" />- </button>- <Show when={sendAsTask()}>- <TaskOwnerMenu- task={draft}- onSave={(owner) => setDraft('owner', owner)}- />- </Show>- <Button- type="submit"- data-task-submit- disabled={!sendAsTask() || !draft.description.trim()}- variant="accent"- size="sm"- >- Send task- </Button>- </div>- </form>- </Show>- <Show when={!props.fromChannel && phase() >= 2}>- <div class="task-flow-scrim">- <form- class="task-flow-draft glass-input"- aria-label="Create task preview"- onSubmit={(e) => {- e.preventDefault();+ close={() => {pause();- create();+ setPhase(0);}}- >- <header>- <ListChecks class="size-4 text-task" />- New task <span>From #launch</span>- </header>- <input- aria-label="New task title"- value={draft.title}- onInput={(e) => setDraft('title', e.currentTarget.value)}- />- <textarea- aria-label="New task description"- value={draft.description}- onInput={(e) =>- setDraft('description', e.currentTarget.value)- }- />- <div class="task-flow-properties">- <TaskOwnerMenu- task={draft}- onSave={(owner) => setDraft('owner', owner)}- />- <TaskPriorityMenu- task={draft}- onSave={(priority) => setDraft('priority', priority)}- />- </div>- <footer>- <Button variant="plain" size="sm" onClick={() => select(0)}>- Cancel- </Button>- <Button- type="submit"- variant="accent"- size="sm"- data-task-submit- disabled={!draft.title.trim()}- >- Create task- </Button>- </footer>- </form>+ /></div></Show></Show></ProductDemo><Show when={automatic() && pointer()}>{(p) => (- <div+ <DemoCursor+ label="Jacob"class="task-flow-pointer"- aria-hidden="true"+ clicking={phase() === 3}style={{ transform: `translate(${p().x}px, ${p().y}px)` }}- >- <Cursor />- </div>+ />)}</Show></div>diff --git a/apps/marketing/src/features/marketing/components/tasks/TaskStories.test.tsx b/apps/marketing/src/features/marketing/components/tasks/TaskStories.test.tsxnew file mode 100644index 0000000000..310dc26547--- /dev/null+++ b/apps/marketing/src/features/marketing/components/tasks/TaskStories.test.tsx@@ -0,0 +1,162 @@+import { cleanup, fireEvent, render, within } from '@solidjs/testing-library';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import {+ TaskAgentChannelDemo,+ TaskFromChecklistDemo,+ TaskFromMessageDemo,+ TaskGithubDemo,+} from './TaskStories';++let intersections: IntersectionObserverCallback[];+let motionListeners: (() => void)[];+let reduced = false;+let hidden = false;+beforeEach(() => {+ intersections = [];+ motionListeners = [];+ reduced = false;+ hidden = false;+ vi.useFakeTimers();+ vi.stubGlobal('fetch', vi.fn());+ vi.spyOn(document, 'hidden', 'get').mockImplementation(() => hidden);+ vi.stubGlobal('matchMedia', () => ({+ get matches() {+ return reduced;+ },+ addEventListener: (_: string, callback: () => void) =>+ motionListeners.push(callback),+ removeEventListener: vi.fn(),+ }));+ vi.stubGlobal(+ 'IntersectionObserver',+ class {+ constructor(callback: IntersectionObserverCallback) {+ intersections.push(callback);+ }+ observe() {}+ disconnect() {}+ }+ );+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+});+afterEach(() => {+ cleanup();+ vi.advanceTimersByTime(100);+ expect(fetch).not.toHaveBeenCalled();+ expect(vi.getTimerCount()).toBe(0);+ vi.useRealTimers();+ vi.restoreAllMocks();+ vi.unstubAllGlobals();+});+function visible(value: boolean) {+ for (const callback of intersections)+ callback(+ [{ isIntersecting: value } as IntersectionObserverEntry],+ {} as IntersectionObserver+ );+}+function reduce() {+ reduced = true;+ for (const callback of motionListeners) callback();+}++it('turns a message into a task with its title, assignee, and source channel', () => {+ const view = render(() => <TaskFromMessageDemo />);+ visible(true);+ vi.advanceTimersByTime(1300);+ expect(+ view.container.querySelector('[data-hovered="true"] [aria-label="Task"]')+ ).toBeTruthy();+ vi.advanceTimersByTime(1600);+ const title = view.getByRole('textbox', { name: 'New task title' });+ expect((title as HTMLInputElement).value).toBe(+ 'Keep the invited team selected through sign-up'+ );+ expect(+ view.getAllByRole('button', { name: 'Change assignee' })[0].textContent+ ).toContain('Teo');+ vi.advanceTimersByTime(3200);+ expect(view.getByRole('textbox', { name: 'Task title' }).textContent).toBe(+ 'Keep the invited team selected through sign-up'+ );+ expect(view.getByRole('button', { name: 'From launch' })).toBeTruthy();+ expect(+ view.getAllByRole('button', { name: 'Change priority' })[0].textContent+ ).toContain('High');+ vi.advanceTimersByTime(30000);+ expect(vi.getTimerCount()).toBe(0);+});++it('keeps a visitor’s task draft instead of advancing over it', () => {+ const view = render(() => <TaskFromMessageDemo />);+ const buttons = view.getAllByRole('button', { name: 'Task' });+ fireEvent.click(buttons[buttons.length - 1]);+ const title = view.getByRole('textbox', { name: 'New task title' });+ fireEvent.input(title, {+ target: { value: 'Keep the invited workspace selected' },+ });+ reduce();+ visible(true);+ vi.advanceTimersByTime(30000);+ expect((title as HTMLInputElement).value).toBe(+ 'Keep the invited workspace selected'+ );+ fireEvent.submit(view.getByRole('form', { name: 'Create task' }));+ expect(view.getByRole('textbox', { name: 'Task title' }).textContent).toBe(+ 'Keep the invited workspace selected'+ );+});++it('shows the created task without a cursor for reduced motion', () => {+ reduced = true;+ const view = render(() => <TaskFromMessageDemo />);+ expect(view.getByRole('button', { name: 'From launch' })).toBeTruthy();+ expect(view.container.querySelector('.demo-cursor')).toBeNull();+});++it('lets @Macro create assigned tasks from one channel message', () => {+ const view = render(() => <TaskAgentChannelDemo />);+ expect(view.queryByText('Own the launch checklist')).toBeNull();+ visible(true);+ vi.advanceTimersByTime(2600);+ const log = within(view.getByRole('log', { name: 'Channel launch' }));+ expect(log.getByText('Fix the team invite handoff')).toBeTruthy();+ expect(log.getByText('Final read of the launch announcement')).toBeTruthy();+ fireEvent.click(log.getByText('Own the launch checklist'));+ expect(view.getByRole('textbox', { name: 'Task title' }).textContent).toBe(+ 'Own the launch checklist'+ );+});++it('converts a selected checklist into task links', () => {+ const view = render(() => <TaskFromChecklistDemo />);+ visible(true);+ vi.advanceTimersByTime(1300);+ fireEvent.click(view.getByRole('button', { name: 'Tasks' }));+ expect(+ view.getByText('Final read of the announcement').closest('button')+ ).toBeTruthy();+ vi.advanceTimersByTime(30000);+ expect(vi.getTimerCount()).toBe(0);+});++it('moves the task to In Review, then Completed, as its pull request changes', () => {+ const view = render(() => <TaskGithubDemo />);+ visible(true);+ vi.advanceTimersByTime(1100);+ expect(+ view.getAllByRole('button', { name: 'Change status' })[0].textContent+ ).toContain('In Review');+ vi.advanceTimersByTime(4500);+ expect(+ view.getAllByRole('button', { name: 'Change status' })[0].textContent+ ).toContain('Completed');+ expect(view.getByText('launch-team/web#491')).toBeTruthy();+});diff --git a/apps/marketing/src/features/marketing/components/tasks/TaskStories.tsx b/apps/marketing/src/features/marketing/components/tasks/TaskStories.tsxindex aec082793f..41778b5e5f 100644--- a/apps/marketing/src/features/marketing/components/tasks/TaskStories.tsx+++ b/apps/marketing/src/features/marketing/components/tasks/TaskStories.tsx@@ -1,201 +1,352 @@+import ChatTeardrop from '@phosphor/chat-teardrop.svg';+import CheckSquare from '@phosphor/check-square.svg';import FileText from '@phosphor/file-text.svg';+import GridFour from '@phosphor/grid-four.svg';+import LinkIcon from '@phosphor/link.svg';+import TextB from '@phosphor/text-b.svg';+import TextItalic from '@phosphor/text-italic.svg';+import TextStrikethrough from '@phosphor/text-strikethrough.svg';import { createSignal, For, Show } from 'solid-js';+import type { TaskStatus, WorkspaceTask } from '../../core/dummy-workspace';import { createDummyWorkspace } from '../../primitives/createDummyWorkspace';import { createProductWalkthrough } from '../../primitives/createProductWalkthrough';-import { HomepageConversation } from '../HomepageConversation';+import { DemoCursor } from '../DemoCursor';+import { PrStatusIcon } from '../DemoPrDocument';+import { ViewShell } from '../DemoWorkspaceChrome';import { ProductDemo } from '../product/ProductPage';+import { ProductWorkspace } from '../product/ProductWorkspace';+import { TaskMention } from '../workspace/frozen/TaskMention';import { TaskNotebook } from '../workspace/frozen/TaskNotebook';-import { WorkspaceChannel } from '../workspace/WorkspaceChannel';-import { WorkspaceDocuments } from '../workspace/WorkspaceDocuments';-import { type TaskFilter, WorkspaceTasks } from '../workspace/WorkspaceTasks';+import { WorkspaceTasks } from '../workspace/WorkspaceTasks';import '../workspace/dummy-workspace.css';import '../demo-markdown.css';+import './task-stories.css';import { TaskCreationFlow } from './TaskCreationFlow';export function TaskFromMessageDemo() {return <TaskCreationFlow />;}-export function TaskFromChannelDemo() {- return <TaskCreationFlow fromChannel />;-}-export function TaskOwnershipDemo() {- let root!: HTMLDivElement;- const w = createDummyWorkspace('tasks');- w.open('tasks', 'checklist');- w.updateTask('checklist', {+const launchAsks = [+ {+ title: 'Fix the team invite handoff',+ owner: 'teo',+ priority: 'Urgent',+ },+ {+ title: 'Final read of the launch announcement',+ owner: 'julia',+ priority: 'High',+ },+ {+ title: 'Own the launch checklist',owner: 'jacob',- priority: 'Low',- status: 'Not Started',- });- const [action, setAction] = createSignal<string>();+ priority: 'Medium',+ },+] as const;++/** @Macro in a channel: one request becomes several assigned tasks. */+export function TaskAgentChannelDemo() {+ let root!: HTMLDivElement;+ const w = createDummyWorkspace('messages');+ const thread = [+ {+ id: 'launch-asks',+ person: 'julia' as const,+ body: 'Last pass before Thursday. The invite still drops people in their personal workspace, the announcement needs a final read, and nobody owns the checklist yet.',+ time: '9:20 AM',+ },+ {+ id: 'make-tasks',+ person: 'jacob' as const,+ body: '@[Macro](demo-mention:macro) make tasks for these. Teo takes the invite fix, Julia the announcement, I’ll take the checklist.',+ time: '9:22 AM',+ },+ ];+ w.setData('channels', (c) => c.id === 'launch', 'messages', thread);+ w.open('messages', 'launch');+ let created = false;+ const finish = () => {+ if (created) return;+ created = true;+ const ids = launchAsks.map((ask) => {+ const id = w.createTask(ask.title, '', 'launch');+ w.updateTask(id, { owner: ask.owner, priority: ask.priority });+ return id;+ });+ w.setData('channels', (c) => c.id === 'launch', 'messages', [+ ...thread,+ {+ id: 'macro-tasks',+ person: 'macro',+ body: 'Created 3 tasks for Thursday’s launch and assigned them.',+ time: '9:22 AM',+ taskIds: ids,+ },+ ]);+ w.open('messages', 'launch');+ };const playback = createProductWalkthrough({root: () => root,- steps: 4,+ steps: 2,reset: () => {},- reduced: () =>- w.updateTask('checklist', {- owner: 'teo',- priority: 'High',- status: 'In Progress',- }),+ reduced: finish,+ delay: (step) => (step === 1 ? 900 : 1600),advance: (step) => {- setAction(['assignee', 'priority', 'status', undefined][step - 1]);- if (step === 1) w.updateTask('checklist', { owner: 'teo' });- if (step === 2) w.updateTask('checklist', { priority: 'High' });- if (step === 3) w.updateTask('checklist', { status: 'In Progress' });+ if (step === 2) finish();},});return (<ProductDemoref={(el) => (root = el)}- label="Assign a task and set its next step"- action={action()}+ label="Ask the Macro agent to make tasks from a channel message"onInteract={playback.pause}+ height={540}+ mobileHeight={640}>- <WorkspaceTasks workspace={w} filter="all" />+ <ProductWorkspace workspace={w} /></ProductDemo>);}-export function TaskContextDemo() {- const w = createDummyWorkspace('tasks');- w.open('tasks', 'announcement');- return (- <ProductDemo label="Task checklist, linked plan, and discussion">- <Show- when={w.contentView() === 'documents'}- fallback={- <Show- when={w.contentView() === 'messages'}- fallback={- <TaskNotebook- workspace={w}- task={w.data.tasks.find((t) => t.id === 'announcement')!}- relatedContent={- <button- type="button"- class="dummy-entity-link"- onClick={() => w.open('documents', 'plan')}- >- <FileText class="size-4 text-document" />- Q3 launch plan- </button>- }- />- }- >- <WorkspaceChannel workspace={w} />- </Show>- }- >- <WorkspaceDocuments workspace={w} />- </Show>- </ProductDemo>- );-}+const checklist = [+ 'Verify both invite paths before Thursday',+ 'Final read of the announcement',+ 'Record the product demo',+];-export function TaskAttentionDemo() {+/**+ * MarkdownPopup's selection toolbar offers "Tasks" when the selection holds+ * checkboxes. Each checkbox becomes a task mention in place.+ */+export function TaskFromChecklistDemo() {let root!: HTMLDivElement;- const w = createDummyWorkspace('tasks');- const [filter, setFilter] = createSignal<TaskFilter>('all');+ const w = createDummyWorkspace('documents');+ const [phase, setPhase] = createSignal(0);+ const [tasks, setTasks] = createSignal<WorkspaceTask[]>([]);+ const convert = () => {+ if (tasks().length) return;+ const owners = ['teo', 'julia', 'jacob'] as const;+ const ids = checklist.map((title, index) => {+ const id = w.createTask(title, '', 'launch');+ w.updateTask(id, { owner: owners[index] });+ return id;+ });+ w.open('documents', 'plan');+ setTasks(ids.map((id) => w.data.tasks.find((task) => task.id === id)!));+ setPhase(3);+ };const playback = createProductWalkthrough({root: () => root,steps: 3,reset: () => {},- reduced: () => {- setFilter('mine');- w.setQuery('launch');- },+ reduced: convert,+ delay: (step) => [0, 1200, 1500, 1400][step] ?? 1400,advance: (step) => {- if (step === 1) setFilter('mine');- if (step === 2) w.setQuery('launch');+ if (step === 3) convert();+ else setPhase(step);},});+ const opened = () =>+ w.contentView() === 'tasks'+ ? w.data.tasks.find((t) => t.id === w.selected())+ : undefined;return (<ProductDemoref={(el) => (root = el)}- label="Find your next task"+ label="Turn checklist items in a document into tasks"onInteract={playback.pause}+ height={460}+ mobileHeight={560}>- <nav class="product-task-filters" aria-label="Task views">- <For- each={- [- { id: 'all', label: 'All Tasks' },- { id: 'mine', label: 'My Tasks' },- { id: 'created', label: 'Created by me' },- ] as const- }- >- {(view) => (- <button- type="button"- aria-pressed={filter() === view.id}- onClick={() => {- setFilter(view.id);- w.open('tasks');- w.setQuery('');- }}+ <Show when={!opened()} fallback={<ProductWorkspace workspace={w} />}>+ <ViewShell.TopBar>+ <FileText class="size-4 text-note" />+ <span class="text-sm font-medium">Q3 launch plan</span>+ </ViewShell.TopBar>+ <div class="dummy-scroll task-checklist-doc">+ <h1>Q3 launch plan</h1>+ <h2>Before Thursday</h2>+ <div+ class="task-checklist-block"+ data-selected={phase() >= 1 && phase() < 3}+ >+ <Show when={phase() >= 1 && phase() < 3}>+ <div+ class="task-checklist-toolbar"+ role="toolbar"+ aria-label="Selection"+ >+ <button type="button">AI edit</button>+ <button+ type="button"+ data-convert-tasks+ onClick={() => {+ playback.pause();+ convert();+ }}+ >+ <CheckSquare class="size-4" />+ Tasks+ <Show when={phase() === 2}>+ <DemoCursor+ label="Jacob"+ class="task-checklist-cursor"+ clicking+ />+ </Show>+ </button>+ <span class="task-checklist-divider" />+ <button type="button" aria-label="Bold">+ <TextB class="size-4" />+ </button>+ <button type="button" aria-label="Italic">+ <TextItalic class="size-4" />+ </button>+ <button type="button" aria-label="Strikethrough">+ <TextStrikethrough class="size-4" />+ </button>+ <button type="button" aria-label="Insert link">+ <LinkIcon class="size-4" />+ </button>+ <span class="task-checklist-divider" />+ <button type="button">+ <GridFour class="size-4" />+ Table+ </button>+ <span class="task-checklist-divider" />+ <button type="button" aria-label="Comment">+ <ChatTeardrop class="size-4" />+ </button>+ </div>+ </Show>+ <Show+ when={tasks().length}+ fallback={+ <ul class="task-checklist-list">+ <For each={checklist}>+ {(item) => (+ <li>+ <span class="task-checklist-box" aria-hidden="true" />+ <span class="task-checklist-text">{item}</span>+ </li>+ )}+ </For>+ </ul>+ }>- {view.label}- </button>- )}- </For>- </nav>- <WorkspaceTasks workspace={w} filter={filter()} />+ <ul class="task-checklist-list" data-converted="true">+ <For each={tasks()}>+ {(task) => (+ <li>+ <TaskMention+ task={+ w.data.tasks.find((t) => t.id === task.id) ?? task+ }+ onOpen={() => {+ playback.pause();+ w.open('tasks', task.id);+ }}+ />+ </li>+ )}+ </For>+ </ul>+ </Show>+ </div>+ <p class="task-checklist-after">+ Launch is Thursday at 9. Julia sends the announcement once the+ invite fix ships.+ </p>+ <h2>Owners</h2>+ <p class="task-checklist-after">+ Teo owns sign-up, Julia owns the announcement, and Jacob runs the+ final checklist.+ </p>+ </div>+ </Show></ProductDemo>);}-export function TaskAgentDemo() {+const PR = {+ title: 'Keep the invited team through sign-up',+ repo: 'launch-team/web',+ number: 491,+};++/** InlineTaskGithubPullRequests plus the GitHub sync's status changes. */+export function TaskGithubDemo() {let root!: HTMLDivElement;const w = createDummyWorkspace('tasks');- w.open('tasks', 'announcement');- w.updateTask('announcement', { status: 'In Progress', comments: [] });- const finish = () => {- w.updateTask('announcement', {- status: 'In Review',- description:- 'Draft the Thursday launch announcement. Include the Q3 launch plan, product demo, and the invite checklist.',- comments: [- {- id: 'agent-draft',- person: 'claude',- body: 'I added the launch details to the brief. Julia, please review before publishing.',- time: '9:34 AM',- },- ],- });+ w.open('tasks', 'invite');+ w.updateTask('invite', {+ status: 'In Progress',+ steps: [+ { id: 'new', text: 'New accounts land in the invited team', done: true },+ { id: 'existing', text: 'Existing accounts switch teams', done: true },+ { id: 'tests', text: 'Regression tests for both paths', done: false },+ ],+ comments: [],+ });+ const [pr, setPr] = createSignal<'none' | 'open' | 'merged'>('none');+ const move = (next: 'open' | 'merged', status: TaskStatus) => {+ setPr(next);+ w.updateTask('invite', { status });};const playback = createProductWalkthrough({root: () => root,steps: 3,reset: () => {},- reduced: finish,+ reduced: () => {+ move('merged', 'Completed');+ w.updateTask('invite', {+ steps: task().steps.map((item) => ({ ...item, done: true })),+ });+ },+ delay: (step) => [0, 1000, 2200, 2200][step] ?? 1400,advance: (step) => {- if (step === 2) finish();+ if (step === 1) move('open', 'In Review');+ if (step === 3) {+ move('merged', 'Completed');+ w.updateTask('invite', {+ steps: task().steps.map((item) => ({ ...item, done: true })),+ });+ }},});+ const task = () => w.data.tasks.find((t) => t.id === 'invite')!;return (- <div ref={root}>- <div class="product-demo-request">- <HomepageConversation- messages={[- {- person: 'julia',- text: '@Claude, add the launch details to this task and leave the draft ready for my review.',- },- ]}- />- </div>- <ProductDemo- label="An agent prepares a task for human review"- onInteract={playback.pause}+ <ProductDemo+ ref={(el) => (root = el)}+ label="A linked pull request moves the task to review, then done"+ onInteract={playback.pause}+ height={500}+ mobileHeight={600}+ >+ <Show+ when={w.contentView() === 'tasks' && w.selected() === 'invite'}+ fallback={<WorkspaceTasks workspace={w} filter="all" />}>- <WorkspaceTasks workspace={w} filter="all" />- </ProductDemo>- </div>+ <TaskNotebook+ workspace={w}+ task={task()}+ pills={+ <Show when={pr() !== 'none'}>+ <span class="task-pr-pill" data-status={pr()}>+ <PrStatusIcon status={pr()} class="size-3 shrink-0" />+ <span class="truncate">{PR.title}</span>+ <span class="text-ink-muted">+ {PR.repo}#{PR.number}+ </span>+ <span class="text-success">+38</span>+ <span class="text-failure">−6</span>+ </span>+ </Show>+ }+ />+ </Show>+ </ProductDemo>);}diff --git a/apps/marketing/src/features/marketing/components/tasks/task-creation-flow.css b/apps/marketing/src/features/marketing/components/tasks/task-creation-flow.cssindex 1f1577004b..dc0889e9c5 100644--- a/apps/marketing/src/features/marketing/components/tasks/task-creation-flow.css+++ b/apps/marketing/src/features/marketing/components/tasks/task-creation-flow.css@@ -1,32 +1,35 @@-.task-flow-steps { display: flex; gap: 16px; margin-bottom: 14px; }-.task-flow-steps button { display: flex; align-items: center; gap: 8px; color: #777; font-size: 12px; padding: 8px 0; }-.task-flow-steps button span { border: 1px solid #333; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; font-size: 10px; }-.task-flow-steps button[aria-pressed=true] { color: #ddd; }-.task-flow-steps button[aria-pressed=true] span { background: #222; border-color: #666; }.task-flow-frame { position: relative; }.task-flow-chat { flex: 1; }-.task-flow-scrim { position: absolute; inset: 48px 0 84px; display: grid; place-items: center; padding: 24px; background: #08090bb8; }-.task-flow-draft { width: min(520px, 100%); padding: 20px; border-radius: 14px; background: var(--color-panel); }-.task-flow-draft header { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 26px; }-.task-flow-draft header span { margin-left: auto; font-size: 11px; color: var(--color-ink-muted); }-.task-flow-draft input { display: block; width: 100%; font-size: 22px; font-weight: 600; outline: none; }-.task-flow-draft textarea { width: 100%; min-height: 100px; margin-top: 18px; resize: vertical; font-size: 14px; outline: none; }-.task-flow-properties { display: flex; gap: 8px; margin-top: 16px; }-.task-flow-draft footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 30px; }-.task-flow-compose { margin: 0 24px 32px; padding: 16px; border-radius: 16px; background: var(--color-surface-2); border: 1px solid var(--color-edge-muted); }-.task-flow-compose textarea { width: 100%; min-height: 80px; font-size: 14px; outline: none; resize: none; }-.task-flow-compose-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }-.task-flow-compose-actions > button[role=switch] { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-ink-muted); }-.task-flow-compose-actions > [data-task-submit] { margin-left: auto; }-.task-flow-switch { display: inline-block; width: 24px; height: 14px; border-radius: 8px; background: #444; position: relative; }-.task-flow-switch::after { content: ''; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #aaa; left: 2px; top: 2px; }-[aria-checked=true] .task-flow-switch { background: #477961; }-[aria-checked=true] .task-flow-switch::after { background: #e1eee6; left: 12px; }-.task-flow-pointer { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 5; color: #fff; filter: drop-shadow(0 2px 3px #0009); transition: transform 500ms ease; }-.task-flow-pointer svg { width: 24px; height: 24px; fill: #161719; stroke: #fff; stroke-width: 1.5; }+.task-flow-pointer { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 9; transition: transform 600ms cubic-bezier(.2,.8,.2,1); }++/* ComposeTask opens as a popover split over the conversation. */+.task-flow-popover { position: absolute; inset: 48px 0 0; z-index: 4; display: grid; place-items: start center; padding: 40px 24px; background: rgb(8 9 11 / 0.45); }++/* EntityComposer: Root p-4 gap-4, Title text-xl/7, Body min-h-24, Properties, Footer. */+.sample-task-composer { display: flex; flex-direction: column; gap: 16px; width: min(560px, 100%); padding: 16px; border-radius: 16px; border: 1px solid color-mix(in oklch, var(--color-content-0) 8%, transparent); background: var(--color-menu); box-shadow: 0 24px 60px rgb(0 0 0 / 0.5); text-align: left; }+.sample-task-composer-header { display: flex; align-items: center; gap: 4px; color: var(--color-ink-muted); }+.sample-task-composer-title { display: block; width: 100%; padding: 0 8px; background: transparent; outline: none; color: var(--color-ink); font: 500 20px/28px 'Inter Variable', Inter, sans-serif; }+.sample-task-composer-title::placeholder { color: var(--color-ink-placeholder); }+.sample-task-composer-body { min-height: 72px; padding: 0 8px; font-size: 15px; }+.sample-task-composer-body textarea { width: 100%; min-height: 72px; resize: none; background: transparent; outline: none; }+.sample-channel-mention { margin-top: 0; color: var(--color-ink); }+.sample-task-composer-properties { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 28px; font-size: 14px; }+.sample-task-composer-empty { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--color-surface-2); color: var(--color-ink-muted); font-size: 12px; }+.sample-task-composer-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }+.sample-task-composer-footer [data-task-submit] { gap: 10px; }+.sample-task-composer-kbd { font: 500 11px/1 'Inter Variable', Inter, sans-serif; color: inherit; opacity: 0.6; }+.sample-task-composer-sharing { display: flex; align-items: center; gap: 12px; margin: 0 -16px; padding: 16px 24px 0; border-top: 1px solid var(--color-edge-muted); font-size: 12px; color: var(--color-ink-muted); }+.tasks-founder-letter { width: min(872px, 100% - 48px); margin: 76px auto 100px; color: #999; font: 400 15px/1.85 'Inter Variable', Inter, sans-serif; }.tasks-founder-letter h2 { font-family: 'Roboto Slab Variable', Georgia, serif; font-size: 30px; line-height: 1.3; color: #ddd; margin-bottom: 24px; }.tasks-founder-letter p + p { margin-top: 18px; }.tasks-founder-letter footer { color: #ccc; margin-top: 24px; font-size: 13px; }-@media (max-width: 699px) { .task-flow-steps { gap: 8px; justify-content: space-between; } .task-flow-steps button { font-size: 10px; gap: 4px; } .task-flow-steps button span { width: 18px; height: 18px; } .task-flow-scrim { padding: 12px; bottom: 64px; } .task-flow-draft { padding: 16px; } .task-flow-draft input { font-size: 18px; } .task-flow-compose { margin-inline: 12px; } .tasks-founder-letter { width: 100%; margin-block: 54px 76px; font-size: 14px; } }+@media (max-width: 699px) {+ .task-flow-popover { padding: 16px 10px; }+ .sample-task-composer { padding: 12px; }+ .sample-task-composer-title { font-size: 18px; line-height: 26px; }+ .sample-task-composer-sharing { margin: 0 -12px; padding: 12px 16px 0; }+ .sample-task-composer-sharing > span { display: none; }+ .tasks-founder-letter { width: 100%; margin-block: 54px 76px; font-size: 14px; }+}@media (prefers-reduced-motion: reduce) { .task-flow-pointer { display: none; } }diff --git a/apps/marketing/src/features/marketing/components/tasks/task-stories.css b/apps/marketing/src/features/marketing/components/tasks/task-stories.cssnew file mode 100644index 0000000000..ba1e776eee--- /dev/null+++ b/apps/marketing/src/features/marketing/components/tasks/task-stories.css@@ -0,0 +1,33 @@+/* A native Macro document with a checklist selected (MarkdownPopup). */+.task-checklist-doc { position: relative; padding: 40px 56px 32px; text-align: left; }+.task-checklist-doc h1 { font: 600 24px/1.4 'Inter Variable', Inter, sans-serif; margin-bottom: 20px; }+.task-checklist-doc h2 { font: 600 17px/1.5 'Inter Variable', Inter, sans-serif; margin: 8px 0 10px; }+.task-checklist-block { position: relative; border-radius: 6px; }+.task-checklist-list { list-style: none; margin: 0; padding: 0; }+.task-checklist-list > li { display: flex; align-items: center; gap: 10px; min-height: 34px; font-size: 15px; }+.task-checklist-box { flex: 0 0 auto; width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--color-ink-muted); }+.task-checklist-block[data-selected='true'] .task-checklist-text { background: color-mix(in srgb, var(--color-accent) 32%, transparent); }+.task-checklist-list[data-converted='true'] > li { min-height: 38px; }+.task-checklist-list[data-converted='true'] .dummy-entity-link { margin-top: 0; }+.task-checklist-after { margin-top: 22px; font-size: 15px; line-height: 1.7; color: var(--color-ink); }++/* Toolbar: rounded-xl border-edge-frame bg-control p-1.5, groups split by dividers. */+.task-checklist-toolbar { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 3; display: inline-flex; align-items: center; gap: 4px; padding: 6px; border-radius: 12px; border: 1px solid color-mix(in oklch, var(--color-content-0) 8%, transparent); background: var(--color-surface-2); box-shadow: 0 10px 28px rgb(0 0 0 / 0.45); white-space: nowrap; }+.task-checklist-toolbar > button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: 6px; font-size: 13px; color: var(--color-ink); }+.task-checklist-toolbar > button[aria-label] { width: 28px; padding: 0; justify-content: center; color: var(--color-ink-muted); }+.task-checklist-toolbar > button:hover { background: var(--color-hover); }+.task-checklist-divider { width: 1px; height: 16px; margin: 0 2px; background: var(--color-edge-muted); }+.task-checklist-toolbar > [data-convert-tasks] { position: relative; }+.task-checklist-cursor { top: 62%; left: 55%; }++/* InlineTaskGithubPullRequests pill in the task's property row. */+.task-pr-pill { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--color-edge-muted); background: var(--color-surface-0); font-size: 12px; animation: task-pr-in 400ms ease both; }+.task-pr-pill[data-status='open'] svg { color: var(--color-success); }+.task-pr-pill[data-status='merged'] svg { color: var(--color-purple); }+@keyframes task-pr-in { from { opacity: 0; transform: translateY(4px); } }++@media (max-width: 699px) {+ .task-checklist-doc { padding: 28px 18px; }+ .task-checklist-toolbar > button:not([data-convert-tasks]):not(:first-child), .task-checklist-divider { display: none; }+}+@media (prefers-reduced-motion: reduce) { .task-pr-pill { animation: none; } }diff --git a/apps/marketing/src/features/marketing/components/workspace/CompanyRecord.tsx b/apps/marketing/src/features/marketing/components/workspace/CompanyRecord.tsxnew file mode 100644index 0000000000..b4dcb26fbf--- /dev/null+++ b/apps/marketing/src/features/marketing/components/workspace/CompanyRecord.tsx@@ -0,0 +1,1047 @@+import BuildingOffice from '@phosphor/building-office.svg';+import CaretDown from '@phosphor/caret-down.svg';+import CaretRight from '@phosphor/caret-right.svg';+import CheckSquare from '@phosphor/check-square.svg';+import CircleDashed from '@phosphor/circle-dashed.svg';+import Clock from '@phosphor/clock.svg';+import Envelope from '@phosphor/envelope.svg';+import File from '@phosphor/file.svg';+import FilePdf from '@phosphor/file-pdf.svg';+import Files from '@phosphor/files.svg';+import Globe from '@phosphor/globe.svg';+import LinkIcon from '@phosphor/link.svg';+import ListBullets from '@phosphor/list-bullets.svg';+import Phone from '@phosphor/phone.svg';+import PhoneCall from '@phosphor/phone-call.svg';+import Plus from '@phosphor/plus.svg';+import SidebarSimple from '@phosphor/sidebar-simple.svg';+import SquaresFour from '@phosphor/squares-four.svg';+import Users from '@phosphor/users.svg';+import { Button, Dropdown } from '@ui';+import { Badge, badgeTriggerClasses } from '@ui/components/Badge';+import { TabsInset } from '@ui/components/TabsInset';+import {+ type Component,+ createEffect,+ createSignal,+ For,+ type JSX,+ onCleanup,+ onMount,+ Show,+} from 'solid-js';+import type {+ WorkspaceComment,+ WorkspaceView,+} from '../../core/dummy-workspace';+import {+ type HomepagePersonId,+ homepagePeople,+} from '../../core/homepage-demo-people';+import {+ type CompanyEmail,+ type DealStage,+ dealStages,+ type SampleCompany,+} from '../../core/workspace-fixtures';+import type { DummyWorkspace } from '../../primitives/createDummyWorkspace';+import { ChannelComposer } from '../email/frozen/ChannelComposer';+import { SearchBar } from '../email/frozen/SearchBar';+import { PanelGrid, PanelRow } from './frozen/DetailPanel';+import { MessageRow } from './frozen/MessageRow';+import { PropertyValueIcon } from './frozen/PropertyValueIcon';+import { PROPERTY_OPTION_IDS } from './frozen/property-identifiers';+import { PersonIcon, PRIORITY_IDS, STATUS_IDS } from './frozen/TaskProperties';+import './workspace-companies.css';++/** crm/core/record: a company's top-bar tabs, in display order. */+export const COMPANY_SECTIONS = [+ 'overview',+ 'team',+ 'emails',+ 'files',+ 'tasks',+ 'calls',+] as const;+export type CompanySection = (typeof COMPANY_SECTIONS)[number];+const SECTION_LABELS: Record<CompanySection, string> = {+ overview: 'Overview',+ team: 'Team',+ emails: 'Emails',+ files: 'Files',+ tasks: 'Tasks',+ calls: 'Calls',+};+const SECTION_ICONS: Record<+ CompanySection,+ Component<JSX.SvgSVGAttributes<SVGSVGElement>>+> = {+ overview: SquaresFour,+ team: Users,+ emails: Envelope,+ files: Files,+ tasks: CheckSquare,+ calls: Phone,+};++export const STAGE_IDS: Record<Exclude<DealStage, 'No stage'>, string> = {+ Lead: PROPERTY_OPTION_IDS.STAGE.LEAD,+ Qualified: PROPERTY_OPTION_IDS.STAGE.QUALIFIED,+ Demo: PROPERTY_OPTION_IDS.STAGE.DEMO,+ Trial: PROPERTY_OPTION_IDS.STAGE.TRIAL,+ Negotiation: PROPERTY_OPTION_IDS.STAGE.NEGOTIATION,+ Customer: PROPERTY_OPTION_IDS.STAGE.CUSTOMER,+ Churned: PROPERTY_OPTION_IDS.STAGE.CHURNED,+};+const COMPANY_OWNERS = [+ 'jacob',+ 'julia',+ 'teo',+ 'valentina',+ 'gabriel',+] as const;++/** CrmStageIcon: the system stage dot, or the dashed circle for No stage. */+export function StageIcon(props: { stage: DealStage; class?: string }) {+ return (+ <Show+ when={props.stage !== 'No stage' && props.stage}+ fallback={+ <CircleDashed+ class={`${props.class ?? 'size-3'} shrink-0 text-ink-extra-muted`}+ />+ }+ >+ {(stage) => (+ <PropertyValueIcon+ optionId={STAGE_IDS[stage() as Exclude<DealStage, 'No stage'>]}+ class={`${props.class ?? 'size-3'} shrink-0`}+ />+ )}+ </Show>+ );+}++/** crm/views/company-header Description: three lines, then Show more. */+function Description(props: { text: string }) {+ const [expanded, setExpanded] = createSignal(false);+ const [overflow, setOverflow] = createSignal(false);+ let ref: HTMLParagraphElement | undefined;+ const measure = () => {+ if (ref && !expanded())+ setOverflow(ref.scrollHeight > ref.clientHeight + 1);+ };+ createEffect(() => {+ props.text;+ if (expanded()) return;+ const frame = requestAnimationFrame(measure);+ onCleanup(() => cancelAnimationFrame(frame));+ });+ onMount(() => {+ if (typeof ResizeObserver === 'undefined' || !ref) return;+ const observer = new ResizeObserver(measure);+ observer.observe(ref);+ onCleanup(() => observer.disconnect());+ });+ return (+ <div class="sample-company-description flex flex-col items-start gap-0.5">+ <p+ ref={ref}+ class={`text-sm text-ink-muted ${expanded() ? '' : 'line-clamp-3'}`}+ >+ {props.text}+ </p>+ <Show when={overflow() || expanded()}>+ <button+ type="button"+ onClick={() => setExpanded(!expanded())}+ class="text-xs text-ink-muted underline hover:text-ink"+ >+ {expanded() ? 'Show less' : 'Show more'}+ </button>+ </Show>+ </div>+ );+}++/** EntityConversation on the company: unanchored roots with inline replies. */+function Discussion(props: {+ comments: WorkspaceComment[];+ onChange: (comments: WorkspaceComment[]) => void;+}) {+ const [expanded, setExpanded] = createSignal(true);+ const [replying, setReplying] = createSignal<string>();+ const [openThreads, setOpenThreads] = createSignal<string[]>([]);+ const roots = () => props.comments.filter((comment) => !comment.replyTo);+ const replies = (id: string) =>+ props.comments.filter((comment) => comment.replyTo === id);+ const time = () =>+ new Date().toLocaleTimeString('en-US', {+ hour: 'numeric',+ minute: '2-digit',+ });+ const send = (body: string, replyTo?: string) =>+ props.onChange([+ ...props.comments,+ {+ id: crypto.randomUUID(),+ person: 'jacob',+ body,+ time: time(),+ replyTo,+ },+ ]);+ const react = (id: string) =>+ props.onChange(+ props.comments.map((comment) =>+ comment.id !== id+ ? comment+ : {+ ...comment,+ reactions: comment.reactions?.includes('jacob')+ ? comment.reactions.filter((person) => person !== 'jacob')+ : [...(comment.reactions ?? []), 'jacob'],+ }+ )+ );+ const row = (message: WorkspaceComment) => (+ <MessageRow+ message={message}+ onReact={() => react(message.id)}+ onReply={() => setReplying(message.replyTo ?? message.id)}+ />+ );+ return (+ <section class="sample-company-discussion" data-entity-conversation>+ <button+ type="button"+ class="flex items-center gap-1"+ aria-expanded={expanded()}+ onClick={() => setExpanded(!expanded())}+ >+ <Show when={expanded()} fallback={<CaretRight class="size-3" />}>+ <CaretDown class="size-3" />+ </Show>+ <span class="text-xs">Discussion</span>+ </button>+ <Show when={expanded()}>+ <For each={roots()}>+ {(root) => {+ const shown = () =>+ openThreads().includes(root.id)+ ? replies(root.id)+ : replies(root.id).slice(0, 3);+ const hidden = () => replies(root.id).slice(shown().length);+ return (+ <div+ class="sample-channel-thread"+ data-thread-id={root.id}+ data-thread-open={+ replies(root.id).length > 0 || replying() === root.id+ }+ >+ {row(root)}+ <Show when={replies(root.id).length || replying() === root.id}>+ <div class="sample-thread-replies">+ <For each={shown()}>{(reply) => row(reply)}</For>+ <Show when={hidden().length}>+ <button+ type="button"+ class="sample-thread-expand"+ title="Expand thread"+ onClick={() =>+ setOpenThreads((ids) => [...ids, root.id])+ }+ >+ <span class="sample-thread-avatars" aria-hidden="true">+ <For+ each={[+ ...new Set(hidden().map((reply) => reply.person)),+ ].slice(0, 4)}+ >+ {(person) => (+ <img alt="" src={homepagePeople[person].photo} />+ )}+ </For>+ </span>+ <span class="text-accent">+ {hidden().length}{' '}+ {hidden().length === 1+ ? 'more reply'+ : 'more replies'}+ </span>+ <span class="text-ink-extra-muted">+ Last reply today+ </span>+ <CaretRight class="size-3 text-ink-extra-muted" />+ </button>+ </Show>+ <Show when={replying() === root.id}>+ <div class="sample-thread-editor">+ <ChannelComposer+ label="Thread reply"+ placeholder="Send a reply"+ onSend={(body) => {+ send(body, root.id);+ setReplying(undefined);+ }}+ />+ </div>+ </Show>+ </div>+ </Show>+ </div>+ );+ }}+ </For>+ <div class="mt-4" data-discussion-composer>+ <ChannelComposer+ label="Comment on company"+ placeholder="Leave a comment..."+ onSend={(body) => send(body)}+ />+ </div>+ </Show>+ </section>+ );+}++/** Property.Pill / Property.Caret with the app's Dropdown surface. */+function PropertyMenu<T extends string>(props: {+ id: string;+ label: string;+ value: T | '';+ options: readonly T[];+ icon: (value: T) => JSX.Element;+ display?: (value: T) => string;+ onSave: (value: T) => void;+}) {+ return (+ <Dropdown modal={false}>+ <Dropdown.Trigger+ aria-label={`Change ${props.label}`}+ data-company-property={props.id}+ data-slot="property-pill"+ noTouchResize+ class={badgeTriggerClasses({+ variant: 'outline',+ size: 'sm',+ class: 'max-w-full text-left bg-surface-2 border-0',+ })}+ >+ <Show+ when={props.value}+ fallback={<span class="text-ink-extra-muted">Empty</span>}+ >+ {(value) => (+ <>+ {props.icon(value() as T)}+ <span class="truncate">+ {props.display?.(value() as T) ?? value()}+ </span>+ </>+ )}+ </Show>+ <CaretDown class="size-3 shrink-0" />+ </Dropdown.Trigger>+ <Dropdown.Content+ depth={3}+ class="max-h-96 overflow-hidden flex flex-col w-56 max-w-70 p-0 text-sm"+ portalScope="local"+ >+ <Dropdown.Group>+ <Dropdown.GroupLabel>{props.label}</Dropdown.GroupLabel>+ <For each={props.options}>+ {(option) => (+ <Dropdown.Item onSelect={() => props.onSave(option)}>+ {props.icon(option)}+ <span>{props.display?.(option) ?? option}</span>+ <span class="ml-auto text-ink-muted">+ {option === props.value ? '✓' : ''}+ </span>+ </Dropdown.Item>+ )}+ </For>+ </Dropdown.Group>+ </Dropdown.Content>+ </Dropdown>+ );+}++/** SidePanel.Section in its floating form: a header row that collapses. */+function PanelSection(props: {+ title: string;+ open?: boolean;+ children: JSX.Element;+}) {+ return (+ <details class="sample-company-panel-section" open={props.open}>+ <summary>+ <span>{props.title}</span>+ <CaretRight class="size-3 shrink-0" />+ </summary>+ <div class="px-2 pb-2 text-sm">{props.children}</div>+ </details>+ );+}++function SharingToggle(props: {+ label: string;+ checked: boolean;+ onChange: (checked: boolean) => void;+ children: JSX.Element;+}) {+ return (+ <div class="flex flex-col gap-2">+ <button+ type="button"+ role="checkbox"+ aria-checked={props.checked}+ class="sample-company-toggle"+ onClick={() => props.onChange(!props.checked)}+ >+ <span class="sample-company-checkbox" data-checked={props.checked} />+ <span class="whitespace-nowrap">{props.label}</span>+ </button>+ <p class="text-ink-muted leading-5">{props.children}</p>+ </div>+ );+}++function CompanyPanel(props: {+ company: SampleCompany;+ update: (patch: Partial<SampleCompany>) => void;+}) {+ const [visible, setVisible] = createSignal(true);+ const [sync, setSync] = createSignal(true);+ return (+ <aside aria-label="Details panel" class="sample-company-panel">+ <PanelSection title="Properties" open>+ <PanelGrid>+ <PanelRow label="Stage">+ <PropertyMenu+ id="stage"+ label="Stage"+ value={+ props.company.stage === 'No stage' ? '' : props.company.stage+ }+ options={dealStages.filter((stage) => stage !== 'No stage')}+ icon={(stage) => <StageIcon stage={stage} />}+ onSave={(stage) => props.update({ stage })}+ />+ </PanelRow>+ <PanelRow label="Owner">+ <PropertyMenu+ id="owner"+ label="Owner"+ value={props.company.owner}+ options={COMPANY_OWNERS}+ icon={(person) => <PersonIcon person={person} />}+ display={(person) => homepagePeople[person].shortName}+ onSave={(owner) => props.update({ owner })}+ />+ </PanelRow>+ <PanelRow label="Revenue">+ <input+ aria-label="Revenue"+ class="sample-inline-input sample-company-revenue"+ placeholder="Empty"+ inputMode="decimal"+ value={props.company.revenue}+ onInput={(e) => props.update({ revenue: e.currentTarget.value })}+ />+ </PanelRow>+ </PanelGrid>+ </PanelSection>+ <PanelSection title="Lists" open>+ <div class="flex flex-col gap-3">+ <Show+ when={props.company.lists?.length}+ fallback={+ <p class="text-xs text-ink-muted">Not in any lists yet.</p>+ }+ >+ <div+ class="flex flex-wrap gap-1.5"+ aria-label="Company list memberships"+ >+ <For each={props.company.lists}>+ {(list) => (+ <span class="inline-flex max-w-full items-center gap-1.5 rounded-lg bg-active px-2 py-1 text-xs">+ <ListBullets class="size-3.5 shrink-0" />+ <span class="truncate">{list}</span>+ </span>+ )}+ </For>+ </div>+ </Show>+ </div>+ </PanelSection>+ <PanelSection title="Sharing">+ <div class="flex flex-col gap-4 text-xs">+ <SharingToggle+ label="Visible in CRM"+ checked={visible()}+ onChange={setVisible}+ >+ Shows this company in your team's CRM lists and search. Hide+ companies that aren't relevant to your team's CRM.+ </SharingToggle>+ <SharingToggle+ label="Sync Emails"+ checked={sync()}+ onChange={setSync}+ >+ Lets everyone on your team see each other's emails with this+ company.+ </SharingToggle>+ </div>+ </PanelSection>+ </aside>+ );+}++/** components/record-section: a title row with actions above the list. */+function RecordSection(props: {+ title: string;+ actions?: JSX.Element;+ children: JSX.Element;+}) {+ return (+ <div class="sample-record-section">+ <div class="sample-record-section-header">+ <h2 class="text-sm font-medium text-ink-muted">{props.title}</h2>+ <Show when={props.actions}>+ <div class="ml-auto flex shrink-0 items-center gap-2.5">+ {props.actions}+ </div>+ </Show>+ </div>+ <div class="dummy-scroll px-2 pb-6">{props.children}</div>+ </div>+ );+}++function EmptyList(props: { children: JSX.Element }) {+ return (+ <div class="rounded-lg border border-dashed border-edge-muted p-6 text-center text-sm text-ink-muted">+ {props.children}+ </div>+ );+}++/** A unified-list row (ListEntity's wide layout) for emails, files and calls. */+function RecordRow(props: {+ icon: JSX.Element;+ title: string;+ label: string;+ detail?: JSX.Element;+ time: string;+ unread?: boolean;+ onOpen?: () => void;+}) {+ const content = () => (+ <>+ <span class="sample-record-row-indicator">+ <Show when={props.unread}>+ <span class="size-1.5 rounded-full bg-accent" />+ </Show>+ </span>+ <span class="sample-record-row-content">+ {props.icon}+ <span class="sample-record-row-title truncate">{props.title}</span>+ <span class="sample-record-row-detail truncate">{props.detail}</span>+ </span>+ <span class="sample-record-row-time">{props.time}</span>+ </>+ );+ return (+ <Show+ when={props.onOpen}+ fallback={<div class="sample-record-row">{content()}</div>}+ >+ {(open) => (+ <button+ type="button"+ class="sample-record-row"+ aria-label={props.label}+ onClick={() => open()()}+ >+ {content()}+ </button>+ )}+ </Show>+ );+}++function CompanyEmails(props: {+ emails: CompanyEmail[];+ onOpen: (email: CompanyEmail) => (() => void) | undefined;+}) {+ const [signal, setSignal] = createSignal<'signal' | 'all'>('all');+ const [scope, setScope] = createSignal<'team' | 'me'>('team');+ const emails = () =>+ props.emails.filter(+ (email) =>+ (signal() === 'all' || email.signal) &&+ (scope() === 'team' || email.mine)+ );+ const empty = () => {+ const kind = signal() === 'signal' ? 'signal emails' : 'emails';+ return scope() === 'me'+ ? `No ${kind} with this company in your inbox.`+ : `No ${kind} with this company yet.`;+ };+ return (+ <RecordSection+ title="Emails"+ actions={+ <>+ <TabsInset+ aria-label="Email importance"+ list={[+ { value: 'signal', label: 'Signal' },+ { value: 'all', label: 'All' },+ ]}+ value={signal()}+ onChange={(value) =>+ setSignal(value === 'signal' ? 'signal' : 'all')+ }+ />+ <TabsInset+ aria-label="Whose emails"+ list={[+ { value: 'team', label: 'Team' },+ { value: 'me', label: 'Me' },+ ]}+ value={scope()}+ onChange={(value) => setScope(value === 'me' ? 'me' : 'team')}+ />+ </>+ }+ >+ <Show when={emails().length} fallback={<EmptyList>{empty()}</EmptyList>}>+ <div aria-label="Company emails">+ <For each={emails()}>+ {(email) => (+ <RecordRow+ icon={<Envelope class="size-4 shrink-0 text-email" />}+ title={email.sender}+ label={`${email.sender} ${email.subject} ${email.time}`}+ detail={+ <>+ <span class="text-ink">{email.subject}</span>{' '}+ <span class="sample-record-row-snippet truncate">+ {email.snippet}+ </span>+ </>+ }+ time={email.time}+ unread={email.unread}+ onOpen={props.onOpen(email)}+ />+ )}+ </For>+ </div>+ </Show>+ </RecordSection>+ );+}++function CompanyTeam(props: { company: SampleCompany }) {+ const [search, setSearch] = createSignal('');+ const contacts = () =>+ props.company.contacts.filter((contact) =>+ `${contact.name} ${contact.email}`+ .toLowerCase()+ .includes(search().trim().toLowerCase())+ );+ return (+ <RecordSection+ title="Team"+ actions={+ <Button variant="ghost" size="sm">+ <Plus class="size-3.5" />+ Add contact+ </Button>+ }+ >+ <div class="px-2">+ <Show+ when={props.company.contacts.length}+ fallback={<div class="text-sm text-ink-muted">No contacts yet.</div>}+ >+ <div class="flex flex-col gap-2">+ <input+ type="text"+ aria-label="Search contacts"+ value={search()}+ onInput={(e) => setSearch(e.currentTarget.value)}+ placeholder="Search contacts…"+ class="w-full rounded-md border border-edge bg-surface px-2 py-1 text-sm text-ink placeholder:text-ink-placeholder focus:outline-none"+ />+ <Show+ when={contacts().length}+ fallback={+ <div class="text-sm text-ink-muted">No matching contacts.</div>+ }+ >+ <div class="flex flex-col gap-1" aria-label="Contacts">+ <For each={contacts()}>+ {(contact) => (+ <div class="flex min-w-0 flex-col gap-0.5 rounded-md px-2 py-1.5 text-left hover:bg-ink-muted/[0.06]">+ <span class="truncate text-sm">{contact.name}</span>+ <span class="truncate text-xs text-ink-muted">+ {contact.email}+ </span>+ </div>+ )}+ </For>+ </div>+ </Show>+ </div>+ </Show>+ </div>+ </RecordSection>+ );+}++function CompanyTasks(props: { company: SampleCompany }) {+ const [search, setSearch] = createSignal('');+ const tasks = () =>+ (props.company.tasks ?? []).filter((task) =>+ task.title.toLowerCase().includes(search().trim().toLowerCase())+ );+ const groups = () =>+ (Object.keys(STATUS_IDS) as (keyof typeof STATUS_IDS)[])+ .map((status) => ({+ status,+ tasks: tasks().filter((task) => task.status === status),+ }))+ .filter((group) => group.tasks.length);+ return (+ <RecordSection+ title="Tasks"+ actions={+ <SearchBar+ label="Search company tasks"+ placeholder="Search tasks"+ class="sample-record-search"+ value={search()}+ onValueChange={setSearch}+ />+ }+ >+ <Show+ when={groups().length}+ fallback={<EmptyList>No tasks with this company yet.</EmptyList>}+ >+ <div aria-label="Company tasks">+ <For each={groups()}>+ {(group) => (+ <>+ <div class="mx-2 mt-1 px-2 h-8 rounded-lg bg-hover text-xs text-ink-muted flex items-center gap-2">+ <CaretDown class="size-3" />+ <PropertyValueIcon+ optionId={STATUS_IDS[group.status]}+ class="size-3.5"+ />+ {group.status}+ <span class="rounded-full px-1.5 bg-active">+ {group.tasks.length}+ </span>+ </div>+ <For each={group.tasks}>+ {(task) => (+ <div class="sample-record-task">+ <PropertyValueIcon+ optionId={STATUS_IDS[task.status]}+ class="size-4"+ />+ <span class="truncate font-medium">{task.title}</span>+ <span class="sample-record-task-priority">+ <PropertyValueIcon+ optionId={PRIORITY_IDS[task.priority]}+ class="size-3.5"+ />+ <span>{task.priority}</span>+ </span>+ <span class="sample-record-task-owner">+ <PersonIcon person={task.owner} />+ <span>{homepagePeople[task.owner].shortName}</span>+ </span>+ </div>+ )}+ </For>+ </>+ )}+ </For>+ </div>+ </Show>+ </RecordSection>+ );+}++function People(props: { people: HomepagePersonId[]; guests: string[] }) {+ return (+ <span class="sample-record-people">+ <For each={props.people}>+ {(person) => <img alt="" src={homepagePeople[person].photo} />}+ </For>+ <For each={props.guests}>+ {(guest) => (+ <span aria-hidden="true">+ {guest+ .split(' ')+ .map((part) => part[0])+ .join('')}+ </span>+ )}+ </For>+ </span>+ );+}++/**+ * crm/views/record-detail + company-detail: breadcrumbs, section tabs, copy+ * link and the floating information panel around a company's sections.+ */+export function CompanyRecord(props: {+ workspace: DummyWorkspace;+ company: SampleCompany;+ section: CompanySection;+ onSectionChange: (section: CompanySection) => void;+ panelOpen: boolean;+ onPanelChange: (open: boolean) => void;+ onOpenItem: (view: WorkspaceView, id: string) => void;+}) {+ const w = props.workspace;+ const update = (patch: Partial<SampleCompany>) =>+ w.setData('companies', (c) => c.id === props.company.id, patch);+ const emails = (): CompanyEmail[] => [+ ...w.data.emails+ .filter((email) => props.company.emailIds.includes(email.id))+ .map((email) => ({+ id: email.id,+ sender: email.sender,+ subject: email.subject,+ snippet: email.snippet,+ time: email.time,+ unread: email.unread,+ signal: !email.noise,+ mine: true,+ })),+ ...(props.company.emails ?? []),+ ];+ return (+ <div+ class="sample-company-record"+ data-panel-open={props.panelOpen ? 'true' : 'false'}+ >+ <div class="sample-company-topbar">+ <nav aria-label="CRM record location" class="sample-company-crumbs">+ <button+ type="button"+ class="sample-crumb sample-crumb-root"+ title={`Back to ${w.companyFilter()}`}+ onClick={() => w.open('crm')}+ >+ <span class="truncate">{w.companyFilter()}</span>+ </button>+ <CaretRight+ aria-hidden="true"+ class="sample-crumb-separator size-3 shrink-0 text-ink-extra-muted"+ />+ <button type="button" class="sample-crumb" aria-current="page">+ <BuildingOffice class="size-3.5 shrink-0" />+ <span class="truncate">{props.company.name}</span>+ </button>+ </nav>+ <div class="sample-company-tabs">+ <TabsInset+ aria-label="Record sections"+ class="shrink-0 whitespace-nowrap"+ list={COMPANY_SECTIONS.map((section) => {+ const Icon = SECTION_ICONS[section];+ return {+ value: section,+ label: (+ <span+ class="sample-record-tab"+ data-record-tab={section}+ title={SECTION_LABELS[section]}+ >+ <Icon class="size-4" aria-hidden="true" />+ <span>{SECTION_LABELS[section]}</span>+ </span>+ ),+ };+ })}+ value={props.section}+ onChange={(value) => {+ const section = COMPANY_SECTIONS.find((item) => item === value);+ if (section) props.onSectionChange(section);+ }}+ />+ </div>+ <div class="ml-auto flex shrink-0 items-center gap-1">+ <Button+ variant="outline"+ size="sm"+ class="sample-company-copy shrink-0 bg-surface"+ label="Copy company link"+ onClick={() =>+ void navigator.clipboard+ ?.writeText(+ `${location.origin}/demo#company-${props.company.id}`+ )+ .catch(() => {})+ }+ >+ <LinkIcon class="size-3.5" />+ <span>Copy link</span>+ </Button>+ <Button+ variant="ghost"+ size="icon-md"+ label="Toggle details panel"+ aria-expanded={props.panelOpen}+ onClick={() => props.onPanelChange(!props.panelOpen)}+ >+ <SidebarSimple />+ </Button>+ </div>+ </div>+ <div class="sample-company-body">+ <Show when={props.section === 'overview'}>+ <div class="dummy-scroll sample-company-scroll">+ <div class="sample-company-overview">+ <div>+ <div class="flex items-center gap-3">+ <BuildingOffice class="size-8 shrink-0" aria-hidden="true" />+ <h1 class="min-w-0 flex-1 text-2xl font-semibold">+ <input+ class="sample-inline-input"+ aria-label="Company name"+ placeholder="Company"+ value={props.company.name}+ onInput={(e) => update({ name: e.currentTarget.value })}+ />+ </h1>+ </div>+ <div+ class="mb-6 mt-3 flex flex-wrap items-center gap-2"+ aria-label="Company details"+ >+ <Badge variant="outline" size="sm">+ <Globe class="size-3" />+ {props.company.domain}+ </Badge>+ <Show when={props.company.lastInteracted}>+ {(when) => (+ <Badge variant="outline" size="sm">+ <Clock class="size-3" />+ Last interacted {when()}+ </Badge>+ )}+ </Show>+ </div>+ <Show when={props.company.description}>+ {(text) => <Description text={text()} />}+ </Show>+ </div>+ <Discussion+ comments={props.company.comments}+ onChange={(comments) => update({ comments })}+ />+ </div>+ </div>+ </Show>+ <Show when={props.section === 'team'}>+ <CompanyTeam company={props.company} />+ </Show>+ <Show when={props.section === 'emails'}>+ <CompanyEmails+ emails={emails()}+ onOpen={(email) =>+ props.company.emailIds.includes(email.id)+ ? () => props.onOpenItem('email', email.id)+ : undefined+ }+ />+ </Show>+ <Show when={props.section === 'files'}>+ <RecordSection title="Files">+ <Show+ when={props.company.files?.length}+ fallback={<EmptyList>No files with this company yet.</EmptyList>}+ >+ <div aria-label="Company files">+ <For each={props.company.files}>+ {(file) => (+ <RecordRow+ icon={+ file.kind === 'pdf' ? (+ <FilePdf class="size-4 shrink-0 text-pdf" />+ ) : (+ <File class="size-4 shrink-0 text-note" />+ )+ }+ title={file.title}+ label={`${file.title} ${file.time}`}+ time={file.time}+ onOpen={+ file.documentId+ ? () =>+ props.onOpenItem(+ 'documents',+ file.documentId ?? ''+ )+ : undefined+ }+ />+ )}+ </For>+ </div>+ </Show>+ </RecordSection>+ </Show>+ <Show when={props.section === 'tasks'}>+ <CompanyTasks company={props.company} />+ </Show>+ <Show when={props.section === 'calls'}>+ <RecordSection title="Calls">+ <Show+ when={props.company.calls?.length}+ fallback={<EmptyList>No calls with this company yet.</EmptyList>}+ >+ <div aria-label="Company calls">+ <For each={props.company.calls}>+ {(call) => (+ <RecordRow+ icon={+ <PhoneCall class="size-4 shrink-0 text-ink-muted" />+ }+ title={call.title}+ label={`${call.title} ${call.time}`}+ detail={+ <>+ <People people={call.people} guests={call.guests} />+ <span>{call.duration}</span>+ </>+ }+ time={call.time}+ />+ )}+ </For>+ </div>+ </Show>+ </RecordSection>+ </Show>+ <Show when={props.panelOpen}>+ <CompanyPanel company={props.company} update={update} />+ </Show>+ </div>+ </div>+ );+}diff --git a/apps/marketing/src/features/marketing/components/workspace/DummyWorkspace.test.tsx b/apps/marketing/src/features/marketing/components/workspace/DummyWorkspace.test.tsxindex fd5862702f..2a9185f666 100644--- a/apps/marketing/src/features/marketing/components/workspace/DummyWorkspace.test.tsx+++ b/apps/marketing/src/features/marketing/components/workspace/DummyWorkspace.test.tsx@@ -100,7 +100,7 @@ it('clears a thread reply when switching to another conversation', () => {fireEvent.click(home.getByRole('button', { name: 'agents-team' }));fireEvent.click(within(screen.getByRole('log')).getAllByRole('button', {- name: 'Reply to message',+ name: 'Reply',})[0]);expect(screen.getByRole('textbox', { name: 'Thread reply' })).toBeTruthy();diff --git a/apps/marketing/src/features/marketing/components/workspace/DummyWorkspace.tsx b/apps/marketing/src/features/marketing/components/workspace/DummyWorkspace.tsxindex 405cb33b2c..72b0e1d84c 100644--- a/apps/marketing/src/features/marketing/components/workspace/DummyWorkspace.tsx+++ b/apps/marketing/src/features/marketing/components/workspace/DummyWorkspace.tsx@@ -69,6 +69,7 @@ export default function DummyWorkspace(props: {initialTask?: string;initialCompany?: string;initialDocument?: string;+ initialAgent?: string;embedded?: boolean;}) {let workspaceElement!: HTMLDivElement;@@ -82,6 +83,7 @@ export default function DummyWorkspace(props: {w.open('crm', companyId);}if (props.initialDocument) w.open('documents', props.initialDocument);+ if (props.initialAgent) w.open('agents', props.initialAgent);if (props.initialTask) w.open('tasks', props.initialTask);if (props.initialCompany) w.open('crm', props.initialCompany);const [filter, setFilter] = createSignal<TaskFilter>('all');diff --git a/apps/marketing/src/features/marketing/components/workspace/WorkspaceAgents.tsx b/apps/marketing/src/features/marketing/components/workspace/WorkspaceAgents.tsxindex 55724627f1..00b6c3c5c5 100644--- a/apps/marketing/src/features/marketing/components/workspace/WorkspaceAgents.tsx+++ b/apps/marketing/src/features/marketing/components/workspace/WorkspaceAgents.tsx@@ -3,30 +3,38 @@ import ClaudeIcon from '@icon/wide-claude.svg';import CursorIcon from '@icon/wide-cursor-ide.svg';import GitPull from '@phosphor/git-pull-request.svg';import Plus from '@phosphor/plus.svg';-import Terminal from '@phosphor/terminal.svg';+import Terminal from '@phosphor/terminal-window.svg';import { Button } from '@ui';-import { createSignal, For, Show } from 'solid-js';+import { createEffect, createSignal, For, on, Show } from 'solid-js';import { DEPLOY_PROMPT, DEPLOY_TRACE } from '../../core/deploy-agent-demo';import { sampleAgentSessions } from '../../core/workspace-parity-fixtures';import type { DummyWorkspace } from '../../primitives/createDummyWorkspace';+import { AgentAnswer, AgentPrompt, AgentTurn } from '../agents/AgentTranscript';+import { AGENT_MODELS, AGENT_PLACEHOLDER } from '../agents/agentDemoData';+import { LaunchConversation } from '../agents/LaunchConversation';import { AgentMessage } from '../DemoAgentMessage';import { ViewShell } from '../DemoWorkspaceChrome';import { InputActionButton } from '../email/frozen/ActionButton';import { ChannelComposer } from '../email/frozen/ChannelComposer';import { ModelCatalogPicker } from './frozen/model-picker/ModelCatalogPicker';-const SAMPLE_MODELS = [- { id: 'auto', label: 'Auto' },- { id: 'claude-opus-5', label: 'Opus 5' },- { id: 'gpt-5', label: 'GPT-5' },-];-export function WorkspaceAgents(props: {workspace: DummyWorkspace;home?: boolean;}) {const w = props.workspace;- const [model, setModel] = createSignal('auto');+ const [model, setModel] = createSignal(AGENT_MODELS[0].id);+ let log: HTMLDivElement | undefined;+ // A new reply lands below the cited answer; keep it in view.+ createEffect(+ on(+ () => [w.agentReplies().length, w.busy()],+ () => {+ if (log) log.scrollTop = log.scrollHeight;+ },+ { defer: true }+ )+ );const session = () =>sampleAgentSessions.find((item) => item.id === w.selected());const conversation = () => !props.home && !!session();@@ -46,8 +54,12 @@ export function WorkspaceAgents(props: {<ChannelComposerrichMentionsagent- label="Ask sample agent"- placeholder={w.busy() ? 'Working…' : 'Ask about your workspace…'}+ label="Message the agent"+ placeholder={+ conversation()+ ? AGENT_PLACEHOLDER+ : 'Type @ to mention docs, people, or channels'+ }leadingAction={<InputActionButtonlabel="Add workspace context"@@ -59,9 +71,9 @@ export function WorkspaceAgents(props: {accessory={<ModelCatalogPickervalue={model()}- options={SAMPLE_MODELS}+ options={AGENT_MODELS}onSelect={setModel}- ariaLabel="Choose sample model"+ ariaLabel="Model"placement="top-end"triggerClass="h-[33.75px] min-w-0 max-w-full gap-[5.625px] rounded-full border-0 bg-transparent hover:bg-hover px-[7.5px] text-base font-normal text-ink-muted [&_svg]:size-[15px]"/>@@ -75,7 +87,7 @@ export function WorkspaceAgents(props: {return (<><ViewShell.TopBar>- <span class="text-sm font-medium">+ <span class="min-w-0 truncate text-sm font-semibold tracking-[-0.03em] text-ink">{props.home? '': w.selected() === 'connections'@@ -93,16 +105,6 @@ export function WorkspaceAgents(props: {<span>Open</span></span></Show>- <span- class="text-xs text-ink-extra-muted"- classList={{- 'ml-auto': !conversation() || !pullRequest(),- 'ml-4': !!pullRequest(),- }}- title="Agent responses use scripted sample data"- >- Sample workspace- </span></ViewShell.TopBar><Showwhen={@@ -140,46 +142,83 @@ export function WorkspaceAgents(props: {</div>}>- <div class="dummy-scroll sample-agent-log">- <Show when={w.selected() === 'deploy'}>- <div class="mb-8">- <AgentMessage message={message(DEPLOY_PROMPT, true)} />- </div>- <AgentMessage message={DEPLOY_TRACE} inFlight={false} />- </Show>- <Show when={w.selected() !== 'deploy' && session()}>- {(current) => (- <>+ <Show+ when={w.selected() === 'launch-status'}+ fallback={+ <div class="dummy-scroll sample-agent-log">+ <Show when={w.selected() === 'deploy'}><div class="mb-8">- <AgentMessage message={message(current().prompt, true)} />+ <AgentMessage message={message(DEPLOY_PROMPT, true)} /></div>- <AgentMessage- message={message(current().answer)}- inFlight={false}- />- </>- )}- </Show>- <For each={w.agentReplies()}>- {(reply) => (- <div class="mb-8">- <div class="mb-6">- <AgentMessage message={message(reply.prompt, true)} />- </div>- <AgentMessage- message={message(reply.answer)}- inFlight={false}- />- </div>- )}- </For>- <Show when={w.busy()}>- <p class="text-sm text-ink-muted">- Reviewing sample workspace…- </p>- </Show>+ <AgentMessage message={DEPLOY_TRACE} inFlight={false} />+ </Show>+ <Show when={w.selected() !== 'deploy' && session()}>+ {(current) => (+ <>+ <div class="mb-8">+ <AgentMessage+ message={message(current().prompt, true)}+ />+ </div>+ <AgentMessage+ message={message(current().answer)}+ inFlight={false}+ />+ </>+ )}+ </Show>+ <For each={w.agentReplies()}>+ {(reply) => (+ <div class="mb-8">+ <div class="mb-6">+ <AgentMessage message={message(reply.prompt, true)} />+ </div>+ <AgentMessage+ message={message(reply.answer)}+ inFlight={false}+ />+ </div>+ )}+ </For>+ <Show when={w.busy()}>+ <p class="text-sm magic-chip-shimmer" role="status">+ Working+ </p>+ </Show>+ </div>+ }+ >+ <div+ ref={(element) => (log = element)}+ class="dummy-scroll agent-transcript"+ role="log"+ aria-label={session()?.title}+ >+ <LaunchConversation workspace={w} />+ <For each={w.agentReplies()}>+ {(reply) => (+ <>+ <AgentTurn>+ <AgentPrompt text={reply.prompt} />+ </AgentTurn>+ <AgentTurn>+ <AgentAnswer text={reply.answer} mentions={{}} />+ </AgentTurn>+ </>+ )}+ </For>+ <Show when={w.busy()}>+ <AgentTurn>+ <span class="magic-chip-shimmer text-sm" role="status">+ Working+ </span>+ </AgentTurn>+ </Show>+ </div>+ </Show>+ <div class="dummy-composer sample-chat-composer agent-composer">+ {composer()}</div>- <div class="dummy-composer sample-chat-composer">{composer()}</div></Show>}>@@ -188,15 +227,14 @@ export function WorkspaceAgents(props: {fallback={<div class="mx-auto max-w-3xl p-8"><h1 class="text-2xl font-semibold mb-6">Connections</h1>- <p class="text-sm text-ink-muted mb-6">- This sample workspace uses local data. Your accounts are not- connected.- </p>+ <div class="text-sm text-ink-muted mb-6">+ Connect the tools your team already uses so Macro's agent can+ work in them.+ </div><For each={['Gmail', 'Google Calendar', 'GitHub', 'Slack']}>{(name) => (<div class="border-b border-edge-muted py-4 flex justify-between gap-12"><span>{name}</span>- <span class="text-xs text-ink-muted">Sample data</span></div>)}</For>@@ -206,16 +244,22 @@ export function WorkspaceAgents(props: {<div class="dummy-scroll"><div class="sample-agent-catalog"><h1 class="text-2xl font-semibold mb-2">Agents</h1>- <p class="text-sm text-ink-muted leading-6 mb-6">- Bring your conversations and coding agents into one workspace.- Choose a sample agent to explore its work.- </p>- <div class="rounded-xl bg-surface-2 p-6 mb-8">- <Terminal class="size-5 mb-4 text-ink-muted" />- <h2 class="text-xl mb-2">Bring your own agent to Macro.</h2>- <p class="text-sm text-ink-muted leading-6">- Your agent, your workspace. Coding sessions, pull requests,- and conversations stay together.+ <div class="text-sm text-ink-muted leading-6 mb-6">+ Agents let you customize your Macro AI experience by combining a+ unique name, specific instructions, default model, and harness.+ </div>+ <div class="rounded-xl border border-edge-muted bg-surface-2 p-6 mb-8">+ <div class="mb-5 flex items-center gap-2 text-xs font-medium text-ink-muted">+ <Terminal class="size-4" />+ Bring your own agent+ </div>+ <h2 class="text-xl font-medium tracking-tight mb-3">+ Bring <span class="text-accent">Claude Code</span> to Macro.+ </h2>+ <p class="text-sm text-ink-muted leading-relaxed">+ Your agent, on your machine. Connect a runtime with macrod,+ then give your agent instructions and a place in your+ workspace.</p></div><h2 class="text-sm font-medium mb-3">Team agents</h2>diff --git a/apps/marketing/src/features/marketing/components/workspace/WorkspaceChannel.tsx b/apps/marketing/src/features/marketing/components/workspace/WorkspaceChannel.tsxindex 14ad0fca32..2f723ae37b 100644--- a/apps/marketing/src/features/marketing/components/workspace/WorkspaceChannel.tsx+++ b/apps/marketing/src/features/marketing/components/workspace/WorkspaceChannel.tsx@@ -1,7 +1,7 @@+import CaretRight from '@phosphor/caret-right.svg';import Envelope from '@phosphor/envelope.svg';import File from '@phosphor/file.svg';import Hash from '@phosphor/hash.svg';-import ListChecks from '@phosphor/list-checks.svg';import Phone from '@phosphor/phone.svg';import Plus from '@phosphor/plus.svg';import Sparkle from '@phosphor/sparkle.svg';@@ -15,8 +15,18 @@ import { ViewShell } from '../DemoWorkspaceChrome';import { ChannelComposer } from '../email/frozen/ChannelComposer';import { Segments } from './frozen/DetailPanel';import { MessageRow } from './frozen/MessageRow';+import { TaskMention } from './frozen/TaskMention';-export function WorkspaceChannel(props: { workspace: DummyWorkspace }) {+/** channel/Thread: up to this many replies render inline under the root. */+const THREAD_PREVIEW = 3;++export function WorkspaceChannel(props: {+ workspace: DummyWorkspace;+ /** A walkthrough can show one message's hover toolbar. */+ hoveredMessage?: string;+ /** Replaces the default Task action, e.g. to open the task composer. */+ onTaskMessage?: (message: WorkspaceComment) => void;+}) {const w = props.workspace;const channel = () => w.data.channels.find((c) => c.id === w.channel());const name = () =>@@ -76,26 +86,30 @@ export function WorkspaceChannel(props: { workspace: DummyWorkspace }) {const row = (message: WorkspaceComment, rootId = message.id) => (<MessageRowmessage={message}+ hovered={props.hoveredMessage === message.id}onReact={() => react(message.id)}onReply={() => startReply(rootId)}+ onChat={() => w.openItem('agents')}onTask={- !message.taskId- ? () => {- const id = w.createTask(- plainDemoMentions(message.body).slice(0, 90),- message.body,- w.channel()- );- w.setData(- 'channels',- (c) => c.id === w.channel(),- 'messages',- (m) => m.id === message.id,- 'taskId',- id- );- }- : undefined+ props.onTaskMessage+ ? () => props.onTaskMessage?.(message)+ : !message.taskId+ ? () => {+ const id = w.createTask(+ plainDemoMentions(message.body).slice(0, 90),+ message.body,+ w.channel()+ );+ w.setData(+ 'channels',+ (c) => c.id === w.channel(),+ 'messages',+ (m) => m.id === message.id,+ 'taskId',+ id+ );+ }+ : undefined}><Show when={message.emailId}>@@ -122,18 +136,25 @@ export function WorkspaceChannel(props: { workspace: DummyWorkspace }) {</button>)}</Show>- <Show when={message.taskId}>+ <For+ each={[+ ...(message.taskId ? [message.taskId] : []),+ ...(message.taskIds ?? []),+ ]}+ >{(id) => (- <button- type="button"- class="dummy-entity-link"- onClick={() => w.openItem('tasks', id())}- >- <ListChecks class="size-4 text-task" />- {w.data.tasks.find((t) => t.id === id())?.title}- </button>+ <Show when={w.data.tasks.find((t) => t.id === id)}>+ {(task) => (+ <div>+ <TaskMention+ task={task()}+ onOpen={() => w.openItem('tasks', id)}+ />+ </div>+ )}+ </Show>)}- </Show>+ </For></MessageRow>);return (@@ -233,7 +254,7 @@ export function WorkspaceChannel(props: { workspace: DummyWorkspace }) {class="sample-channel-thread"data-thread-id={message.id}data-thread-open={- expanded().includes(message.id) || reply() === message.id+ children(message.id).length > 0 || reply() === message.id}>{row(message)}@@ -242,34 +263,66 @@ export function WorkspaceChannel(props: { workspace: DummyWorkspace }) {children(message.id).length > 0 || reply() === message.id}>- <Show- when={expanded().includes(message.id)}- fallback={+ <div class="sample-thread-replies">+ <For+ each={+ expanded().includes(message.id)+ ? children(message.id)+ : children(message.id).slice(0, THREAD_PREVIEW)+ }+ >+ {(child) => row(child, message.id)}+ </For>+ <Show+ when={+ !expanded().includes(message.id) &&+ children(message.id).length > THREAD_PREVIEW+ }+ ><buttontype="button"class="sample-thread-expand"+ title="Expand thread"onClick={() =>setExpanded((ids) => [...ids, message.id])}>- {children(message.id).length}{' '}- {children(message.id).length === 1- ? 'reply'- : 'replies'}{' '}+ <span class="sample-thread-avatars" aria-hidden="true">+ <For+ each={[+ ...new Set(+ children(message.id)+ .slice(THREAD_PREVIEW)+ .map((m) => m.person)+ ),+ ].slice(0, 4)}+ >+ {(person) => (+ <img alt="" src={homepagePeople[person].photo} />+ )}+ </For>+ </span>+ <span class="text-accent">+ {children(message.id).length - THREAD_PREVIEW}{' '}+ {children(message.id).length - THREAD_PREVIEW === 1+ ? 'more reply'+ : 'more replies'}+ </span><span class="text-ink-extra-muted">Last reply today</span>- <span>›</span>+ <CaretRight class="size-3 text-ink-extra-muted" /></button>- }- >- <div class="sample-thread-replies">- <For each={children(message.id)}>- {(child) => row(child, message.id)}- </For>- <Show- when={reply() === message.id}- fallback={+ </Show>+ <Show+ when={reply() === message.id}+ fallback={+ <Show+ when={+ expanded().includes(message.id) ||+ children(message.id).length <= THREAD_PREVIEW+ }+ ><buttontype="button"class="sample-thread-reply-button"@@ -278,35 +331,35 @@ export function WorkspaceChannel(props: { workspace: DummyWorkspace }) {><Plus class="size-4" /></button>- }- >- <div class="sample-thread-editor">- <ChannelComposer- richMentions- label="Thread reply"- placeholder={`Reply to ${homepagePeople[message.person].shortName}…`}- onSend={(body) => {- w.post(- body,- undefined,- undefined,- undefined,- message.id- );- setReply(undefined);- }}- />- <Button- size="sm"- variant="plain"- onClick={() => setReply(undefined)}- >- Cancel- </Button>- </div>- </Show>- </div>- </Show>+ </Show>+ }+ >+ <div class="sample-thread-editor">+ <ChannelComposer+ richMentions+ label="Thread reply"+ placeholder="Send a reply"+ onSend={(body) => {+ w.post(+ body,+ undefined,+ undefined,+ undefined,+ message.id+ );+ setReply(undefined);+ }}+ />+ <Button+ size="sm"+ variant="plain"+ onClick={() => setReply(undefined)}+ >+ Cancel+ </Button>+ </div>+ </Show>+ </div></Show></div>)}diff --git a/apps/marketing/src/features/marketing/components/workspace/WorkspaceCompanies.tsx b/apps/marketing/src/features/marketing/components/workspace/WorkspaceCompanies.tsxindex 295ff5ab91..9aa848ff3e 100644--- a/apps/marketing/src/features/marketing/components/workspace/WorkspaceCompanies.tsx+++ b/apps/marketing/src/features/marketing/components/workspace/WorkspaceCompanies.tsx@@ -1,37 +1,53 @@-import ArrowLeft from '@phosphor/arrow-left.svg';-import Buildings from '@phosphor/buildings.svg';-import Link from '@phosphor/link.svg';-import { Button } from '@ui';-import { createSignal, For, Show } from 'solid-js';-import {- type HomepagePersonId,- homepagePeople,-} from '../../core/homepage-demo-people';-import { type DealStage, dealStages } from '../../core/workspace-fixtures';+import BuildingOffice from '@phosphor/building-office.svg';+import { createEffect, createSignal, For, on, Show } from 'solid-js';+import type { WorkspaceView } from '../../core/dummy-workspace';+import { homepagePeople } from '../../core/homepage-demo-people';+import { dealStages, type SampleCompany } from '../../core/workspace-fixtures';import type { DummyWorkspace } from '../../primitives/createDummyWorkspace';-import { ViewShell } from '../DemoWorkspaceChrome';-import { ChannelComposer } from '../email/frozen/ChannelComposer';import { SearchBar } from '../email/frozen/SearchBar';-import {- DetailLayout,- PanelGrid,- PanelRow,- PanelSection,- PanelToggle,-} from './frozen/DetailPanel';-import { MessageRow } from './frozen/MessageRow';+import { CompanyRecord, type CompanySection, StageIcon } from './CompanyRecord';+export type { CompanySection } from './CompanyRecord';++/** Last Interaction, newest first: today's times, then earlier dates. */+const recency = (updated = '') => {+ const time = /^(\d+):(\d+) (AM|PM)$/.exec(updated);+ if (time)+ return (+ 1e14 ++ ((Number(time[1]) % 12) + (time[3] === 'PM' ? 12 : 0)) * 60 ++ Number(time[2])+ );+ const date = Date.parse(`${updated} 2026`);+ return Number.isNaN(date) ? 0 : date;+};+const byRecency = (a: SampleCompany, b: SampleCompany) =>+ recency(b.updated) - recency(a.updated);++/**+ * The Customers view: a stage board (or list) of companies, and the company+ * record from crm/views/record-detail. Walkthroughs can drive the record's+ * tab with `section` and keep linked items inside their own frame with+ * `onOpenItem`.+ */export function WorkspaceCompanies(props: {workspace: DummyWorkspace;+ /** The floating details panel is closed by default, as in the app. */initialPanelOpen?: boolean;+ section?: CompanySection;+ onSectionChange?: (section: CompanySection) => void;+ onOpenItem?: (view: WorkspaceView, id: string) => void;}) {const w = props.workspace;const selected = () => w.data.companies.find((c) => c.id === w.selected());- const [panel, setPanel] = createSignal<boolean | undefined>(- props.initialPanelOpen- );- const [contactSearch, setContactSearch] = createSignal('');- const [copied, setCopied] = createSignal(false);+ const [panel, setPanel] = createSignal(props.initialPanelOpen ?? false);+ const [localSection, setLocalSection] =+ createSignal<CompanySection>('overview');+ createEffect(on(w.selected, () => setLocalSection('overview')));+ const open = (id: string) => {+ w.setData('companies', (c) => c.id === id && !!c.unread, 'unread', false);+ w.open('crm', id);+ };const companies = () =>w.data.companies.filter((c) =>@@ -40,19 +56,20 @@ export function WorkspaceCompanies(props: {.includes(w.query().toLowerCase()) &&(w.companyFilter() !== 'My companies' || c.owner === 'jacob') &&(w.companyFilter() !== 'Unassigned' || !c.owner) &&- (w.companyFilter() !== 'Needs follow-up' || c.stage === 'Lead')+ (w.companyFilter() !== 'Needs follow-up' || c.stage === 'Lead') &&+ (w.companyFilter() !== 'Recently active' || !!c.updated?.includes(':')));- const update = (patch: Partial<NonNullable<ReturnType<typeof selected>>>) =>- w.setData('companies', (c) => c.id === w.selected(), patch);return (<Showwhen={selected()}fallback={<>- <ViewShell.TopBar>- <span class="text-sm font-medium">{w.companyFilter()}</span>- </ViewShell.TopBar>- <div class="p-4">+ <div class="sample-company-titlebar">+ <h1>+ <span class="truncate">{w.companyFilter()}</span>+ </h1>+ </div>+ <div class="sample-company-search"><SearchBarlabel="Search companies"placeholder="Search companies"@@ -64,18 +81,60 @@ export function WorkspaceCompanies(props: {<Showwhen={w.companyLayout() === 'Board'}fallback={- <div class="dummy-scroll p-3">- <For each={companies()}>+ <div class="dummy-scroll sample-company-rows">+ <div class="sample-company-row" data-header>+ <span />+ <span>Customer</span>+ <span>Stage</span>+ <span>Owner</span>+ <span>Revenue</span>+ <span>Last Interaction</span>+ </div>+ <For each={[...companies()].sort(byRecency)}>{(c) => (<button- class="sample-company-list"+ class="sample-company-row"type="button"- onClick={() => w.open('crm', c.id)}+ data-company-row={c.id}+ data-unread={c.unread ? 'true' : undefined}+ onClick={() => open(c.id)}>- <Buildings class="size-4" />- <span>{c.name}</span>- <span class="ml-auto text-ink-muted">{c.domain}</span>- <span class="w-24 text-right text-xs">{c.stage}</span>+ <span class="sample-company-row-indicator">+ <Show when={c.unread}>+ <span class="size-1.5 rounded-full bg-accent" />+ </Show>+ </span>+ <span class="sample-company-row-content">+ <BuildingOffice class="size-4 shrink-0" />+ <span class="truncate">{c.name}</span>+ <span class="sample-company-row-domain truncate">+ {c.domain}+ </span>+ </span>+ <span class="sample-company-row-value">+ <Show when={c.stage !== 'No stage'}>+ <StageIcon stage={c.stage} />+ <span class="truncate">{c.stage}</span>+ </Show>+ </span>+ <span class="sample-company-row-value">+ <Show when={c.owner || undefined}>+ {(owner) => (+ <>+ <img+ class="size-4 shrink-0 rounded-full object-cover"+ src={homepagePeople[owner()].photo}+ alt=""+ />+ <span class="truncate">+ {homepagePeople[owner()].shortName}+ </span>+ </>+ )}+ </Show>+ </span>+ <span class="sample-company-row-value">{c.revenue}</span>+ <span class="sample-company-row-time">{c.updated}</span></button>)}</For>@@ -102,8 +161,8 @@ export function WorkspaceCompanies(props: {}}><h3>- <span class="sample-stage-dot" data-stage={stage} />- {stage}+ <StageIcon stage={stage} class="size-3.5" />+ <span class="truncate">{stage}</span></h3><For each={companies().filter((c) => c.stage === stage)}>{(c) => (@@ -114,15 +173,24 @@ export function WorkspaceCompanies(props: {}type="button"class="sample-company-card"- onClick={() => w.open('crm', c.id)}+ onClick={() => open(c.id)}>- <span class="flex gap-2 items-center">- <Buildings class="size-4 shrink-0" />+ <span class="flex min-w-0 items-center gap-2">+ <BuildingOffice class="size-4 shrink-0" /><strong class="truncate">{c.name}</strong>+ <Show when={c.owner || undefined}>+ {(owner) => (+ <img+ class="sample-company-owner"+ src={homepagePeople[owner()].photo}+ alt={homepagePeople[owner()].name}+ />+ )}+ </Show></span>- <span class="flex gap-2 text-xs text-ink-extra-muted">+ <span class="flex min-w-0 items-center gap-2 text-xs text-ink-extra-muted"><span class="truncate">{c.domain}</span>- <span class="ml-auto shrink-0">9:41 AM</span>+ <span class="ml-auto shrink-0">{c.updated}</span></span></button>)}@@ -136,207 +204,18 @@ export function WorkspaceCompanies(props: {}>{(company) => (- <>- <ViewShell.TopBar>- <Button- size="icon-sm"- variant="plain"- label="Back to companies"- onClick={() => w.open('crm')}- >- <ArrowLeft />- </Button>- <span class="text-sm text-ink-muted">All companies</span>- <span>›</span>- <Buildings class="size-4" />- <span class="truncate text-sm">{company().name}</span>- <Button- class="ml-auto"- size="sm"- variant="plain"- onClick={async () => {- await navigator.clipboard.writeText(- `${location.origin}/demo#company-${company().id}`- );- setCopied(true);- }}- >- <Link />- {copied() ? 'Copied' : 'Copy link'}- </Button>- <PanelToggle open={panel()} onChange={setPanel} />- </ViewShell.TopBar>- <DetailLayout- open={panel()}- panel={- <>- <PanelSection title="Details" open>- <p class="text-xs text-ink-muted">Domains</p>- <input- aria-label="Company domain"- class="sample-inline-input"- value={company().domain}- onInput={(e) => update({ domain: e.currentTarget.value })}- />- <p class="text-xs text-ink-muted mt-3">Last interaction</p>- <p>Today, 9:41 AM</p>- </PanelSection>- <PanelSection title="Properties" open>- <PanelGrid>- <PanelRow label="Deal Stage">- <select- aria-label="Deal stage"- value={company().stage}- onChange={(e) =>- update({ stage: e.currentTarget.value as DealStage })- }- >- <For each={dealStages}>- {(stage) => <option>{stage}</option>}- </For>- </select>- </PanelRow>- <PanelRow label="Owner">- <select- aria-label="Company owner"- value={company().owner}- onChange={(e) =>- update({- owner: e.currentTarget.value as- | HomepagePersonId- | '',- })- }- >- <option value="">Unassigned</option>- <For each={['jacob', 'julia', 'teo'] as const}>- {(id) => (- <option value={id}>- {homepagePeople[id].shortName}- </option>- )}- </For>- </select>- </PanelRow>- <PanelRow label="Revenue">- <input- aria-label="Revenue"- class="sample-inline-input"- placeholder="Empty"- value={company().revenue}- onInput={(e) =>- update({ revenue: e.currentTarget.value })- }- />- </PanelRow>- </PanelGrid>- </PanelSection>- <PanelSection title="Contacts" open>- <input- class="sample-inline-input sample-contact-search"- aria-label="Search contacts"- placeholder="Search contacts…"- value={contactSearch()}- onInput={(e) => setContactSearch(e.currentTarget.value)}- />- <For- each={company().contacts.filter((c) =>- `${c.name} ${c.email}`- .toLowerCase()- .includes(contactSearch().toLowerCase())- )}- >- {(contact) => (- <div class="py-2">- <p>{contact.name}</p>- <p class="text-xs text-ink-muted">{contact.email}</p>- </div>- )}- </For>- </PanelSection>- <PanelSection title="Sharing">- <p class="text-xs text-ink-muted">- Visible to your sample workspace.- </p>- </PanelSection>- </>- }- >- <div class="dummy-scroll">- <div class="mx-auto flex w-full max-w-3xl min-w-0 flex-col gap-6 px-6 pt-12 pb-12">- <div class="flex items-start gap-3">- <Buildings class="size-10 shrink-0 text-ink-muted" />- <div class="min-w-0 flex-1">- <input- class="sample-inline-input text-xl font-semibold"- aria-label="Company name"- value={company().name}- onInput={(e) => update({ name: e.currentTarget.value })}- />- <textarea- class="sample-inline-input resize-none text-sm text-ink-muted"- aria-label="Company description"- value={company().description}- onInput={(e) =>- update({ description: e.currentTarget.value })- }- />- </div>- </div>- <details open class="sample-discussion">- <summary>Discussion</summary>- <For each={company().comments}>- {(comment) => <MessageRow message={comment} />}- </For>- <ChannelComposer- label="Comment on company"- placeholder="Leave a comment…"- onSend={(body) =>- update({- comments: [- ...company().comments,- {- id: crypto.randomUUID(),- person: 'jacob',- body,- time: 'Now',- },- ],- })- }- />- </details>- <section class="mt-12">- <h2 class="text-sm mb-6">Emails</h2>- <For- each={w.data.emails.filter((e) =>- company().emailIds.includes(e.id)- )}- fallback={- <p class="text-sm text-ink-muted text-center py-8">- No email conversations yet.- </p>- }- >- {(email) => (- <button- type="button"- class="sample-company-list"- onClick={() => w.open('email', email.id)}- >- <span>{email.sender}</span>- <span class="truncate">{email.subject}</span>- <span class="ml-auto text-xs text-ink-muted">- {email.time}- </span>- </button>- )}- </For>- </section>- </div>- </div>- </DetailLayout>- </>+ <CompanyRecord+ workspace={w}+ company={company()}+ section={props.section ?? localSection()}+ onSectionChange={(section) => {+ setLocalSection(section);+ props.onSectionChange?.(section);+ }}+ panelOpen={panel()}+ onPanelChange={setPanel}+ onOpenItem={props.onOpenItem ?? ((view, id) => w.open(view, id))}+ />)}</Show>);diff --git a/apps/marketing/src/features/marketing/components/workspace/dummy-workspace.css b/apps/marketing/src/features/marketing/components/workspace/dummy-workspace.cssindex 03f5ba3031..b77e45c7ad 100644--- a/apps/marketing/src/features/marketing/components/workspace/dummy-workspace.css+++ b/apps/marketing/src/features/marketing/components/workspace/dummy-workspace.css@@ -65,9 +65,17 @@.sample-message-row {position:relative;display:grid;grid-template-columns:32px minmax(0,1fr);gap:8px;padding:8px;border-radius:6px;margin-bottom:12px}.sample-message-row:hover {background:color-mix(in srgb,var(--color-hover) 45%,transparent)}.sample-message-row[data-reply=true] {margin-left:40px;border-left:1px solid var(--color-edge);border-radius:0 0 0 16px;padding-left:16px}-.sample-message-actions {position:absolute;right:8px;top:-18px;border:1px solid var(--color-edge);border-radius:12px;background:var(--color-surface-2);padding:5px;display:flex;gap:8px;opacity:0}-.sample-message-actions button {padding:4px;display:flex;align-items:center}-.sample-message-row:hover .sample-message-actions,.sample-message-row:focus-within .sample-message-actions {opacity:1}+/* channel/Message/ActionMenu: a Toolbar straddling the row's top edge, shown on hover or focus. */+.sample-message-actions {position:absolute;right:16px;top:0;transform:translateY(-50%);z-index:2;display:none;align-items:center;gap:4px;padding:6px;border-radius:12px;border:1px solid color-mix(in oklch,var(--color-content-0) 8%,transparent);background:var(--color-surface-2);box-shadow:0 4px 14px #0004}+.sample-message-actions button {display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:6px;color:var(--color-ink-muted)}+.sample-message-actions button:hover {background:var(--color-hover);color:var(--color-ink)}+.sample-message-actions-divider {width:1px;height:16px;margin:0 2px;background:var(--color-edge-muted)}+.sample-message-row:hover .sample-message-actions,.sample-message-row:focus-within .sample-message-actions,.sample-message-row[data-hovered=true] .sample-message-actions {display:flex}+.sample-message-row[data-hovered=true] {background:color-mix(in srgb,var(--color-hover) 45%,transparent)}+.sample-agent-badge {display:inline-flex;align-items:center;border-radius:999px;background:var(--color-hover);padding:2px 6px;font-size:11px;font-weight:500;line-height:1;color:var(--color-ink-muted)}+.sample-agent-avatar {display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:var(--color-panel);border:1px solid var(--color-edge-muted);color:var(--color-ink)}+.sample-agent-avatar[data-agent=claude] {color:#d97757}+.sample-agent-avatar > svg {width:16px;height:16px}.sample-reaction {display:inline-flex;gap:4px;font-size:12px;border-radius:999px;border:1px solid var(--color-edge);padding:2px 8px;margin-top:8px}.sample-chat-log {width:100%;max-width:944px;margin:auto;padding:24px 12px 12px}.sample-chat-composer {width:100%;max-width:944px;padding:12px 12px 10px}@@ -128,7 +136,11 @@.sample-thread-replies {margin-left:40px;position:relative}.sample-chat-log .sample-thread-replies .sample-message-row {margin-left:0;border:0;border-radius:6px;padding-left:8px;margin-top:8px}.sample-thread-replies .sample-message-row:before {content:'';position:absolute;left:-16px;top:0;width:16px;height:26px;border-left:1px solid var(--color-edge);border-bottom:1px solid var(--color-edge);border-bottom-left-radius:14px;z-index:-1}-.sample-thread-expand {display:flex;align-items:center;gap:8px;margin:12px 0 0 48px;padding:4px 12px;border:1px solid var(--color-edge);border-radius:999px;color:var(--color-accent);font-size:12px}+.sample-thread-expand {position:relative;display:inline-flex;align-items:center;gap:8px;margin:10px 0 0 8px;padding:4px 10px 4px 6px;border:1px solid var(--color-edge);border-radius:999px;font-size:12px;background:var(--color-surface-0)}+.sample-thread-expand:before {content:'';position:absolute;left:-17px;top:-10px;width:16px;height:24px;border-left:1px solid var(--color-edge);border-bottom:1px solid var(--color-edge);border-bottom-left-radius:14px;z-index:-1}+.sample-thread-avatars {display:flex}+.sample-thread-avatars img {width:18px;height:18px;border-radius:50%;border:1.5px solid var(--color-surface-0);object-fit:cover}+.sample-thread-avatars img + img {margin-left:-6px}.sample-thread-reply-button {display:flex;align-items:center;justify-content:center;margin:16px 0 0 8px;width:32px;height:32px;border:1px solid var(--color-edge);border-radius:50%;color:var(--color-ink-muted)}.sample-thread-editor {padding:12px 8px 0}.sample-email-thread .mail-thread-body {max-width:968px;padding:48px 24px}@@ -175,3 +187,7 @@.sample-search-category {border:1px solid transparent;background:transparent;font-family:inherit}.sample-search-category[aria-checked=true] {border-color:var(--color-edge-muted);background:var(--color-active);color:var(--color-ink)}+/* DocumentMention + InlineTaskProperties for tasks. */+.sample-task-mention {max-width:100%}+.sample-task-mention-properties {display:inline-flex;align-items:center;gap:4px;margin-left:2px}+.sample-task-mention-properties img, .sample-task-mention-properties svg:last-child:not([class*=size-3]) {width:13px;height:13px}diff --git a/apps/marketing/src/features/marketing/components/workspace/frozen/MessageRow.tsx b/apps/marketing/src/features/marketing/components/workspace/frozen/MessageRow.tsxindex a8a10e8af5..8a18d1c0e8 100644--- a/apps/marketing/src/features/marketing/components/workspace/frozen/MessageRow.tsx+++ b/apps/marketing/src/features/marketing/components/workspace/frozen/MessageRow.tsx@@ -1,31 +1,72 @@+import ClaudeIcon from '@icon/wide-claude.svg';+import CursorIcon from '@icon/wide-cursor-ide.svg';import Reply from '@phosphor/arrow-bend-up-left.svg';+import LinkIcon from '@phosphor/link.svg';import ListChecks from '@phosphor/list-checks.svg';-import { type JSX, Show } from 'solid-js';+import Smiley from '@phosphor/smiley.svg';+import Sparkle from '@phosphor/sparkle.svg';+import { For, type JSX, Show } from 'solid-js';import type { WorkspaceComment } from '../../../core/dummy-workspace';import { homepagePeople } from '../../../core/homepage-demo-people';import { DemoMentionText } from '../../DemoMention';+const QUICK_REACTIONS = ['❤️', '👍', '😂'] as const;+// Presentation from channel/Message/Layout, SenderName, Timestamp, Content-// and HoverActions. Callbacks replace the app's channel context and mutations.+// and ActionMenu. The toolbar keeps the app's groups and labels and, like the+// app, appears on hover or focus. `hovered` lets a walkthrough show it.export function MessageRow(props: {message: WorkspaceComment;children?: JSX.Element;+ hovered?: boolean;onReply?: () => void;onTask?: () => void;onReact?: () => void;+ onChat?: () => void;}) {+ const hasActions = () =>+ !!(props.onReact || props.onTask || props.onReply || props.onChat);return (- <article class="sample-message-row" data-reply={!!props.message.replyTo}>- <img- src={homepagePeople[props.message.person].photo}- alt=""- class="size-8 rounded-full object-cover"- />+ <article+ class="sample-message-row"+ data-reply={!!props.message.replyTo}+ data-hovered={props.hovered ? 'true' : undefined}+ >+ <Show+ when={+ props.message.person === 'claude' || props.message.person === 'cursor'+ }+ fallback={+ <img+ src={homepagePeople[props.message.person].photo}+ alt=""+ class="size-8 rounded-full object-cover"+ />+ }+ >+ <span class="sample-agent-avatar" data-agent={props.message.person}>+ <Show+ when={props.message.person === 'claude'}+ fallback={<CursorIcon />}+ >+ <ClaudeIcon />+ </Show>+ </span>+ </Show><div class="min-w-0"><div class="flex items-baseline gap-1.5"><span class="text-sm font-medium">{homepagePeople[props.message.person].name}</span>+ <Show+ when={+ props.message.person === 'claude' ||+ props.message.person === 'cursor' ||+ props.message.person === 'macro'+ }+ >+ <span class="sample-agent-badge">Agent</span>+ </Show><span class="text-xs text-ink-extra-muted tabular-nums">{props.message.time}</span>@@ -40,35 +81,65 @@ export function MessageRow(props: {</button></Show></div>- <Show when={props.onReact || props.onTask || props.onReply}>- <div class="sample-message-actions">+ <Show when={hasActions()}>+ <div class="sample-message-actions" role="toolbar"><Show when={props.onReact}>+ <For each={QUICK_REACTIONS}>+ {(emoji) => (+ <button+ type="button"+ aria-label={`React ${emoji}`}+ onClick={props.onReact}+ >+ <span class="text-base leading-none">{emoji}</span>+ </button>+ )}+ </For><buttontype="button"- aria-label="Like message"+ aria-label="More reactions"onClick={props.onReact}>- 👍+ <Smiley class="size-4" /></button>+ <span class="sample-message-actions-divider" /></Show>- <Show when={props.onReply}>+ <Show when={props.onTask}><buttontype="button"- aria-label="Reply to message"- onClick={props.onReply}+ aria-label="Task"+ title="Task"+ onClick={props.onTask}>- <Reply class="size-4" />+ <ListChecks class="size-4" /></button></Show>- <Show when={props.onTask}>+ <Show when={props.onChat}><buttontype="button"- aria-label="Create task from message"- onClick={props.onTask}+ aria-label="Chat with Agent"+ title="Chat with Agent"+ onClick={props.onChat}>- <ListChecks class="size-4" />+ <Sparkle class="size-4" /></button></Show>+ <Show when={props.onTask || props.onChat}>+ <span class="sample-message-actions-divider" />+ </Show>+ <Show when={props.onReply}>+ <button+ type="button"+ aria-label="Reply"+ title="Reply"+ onClick={props.onReply}+ >+ <Reply class="size-4" />+ </button>+ </Show>+ <button type="button" aria-label="Copy Link" title="Copy Link">+ <LinkIcon class="size-4" />+ </button></div></Show></article>diff --git a/apps/marketing/src/features/marketing/components/workspace/frozen/TaskComposer.tsx b/apps/marketing/src/features/marketing/components/workspace/frozen/TaskComposer.tsxnew file mode 100644index 0000000000..2d4a3e248a--- /dev/null+++ b/apps/marketing/src/features/marketing/components/workspace/frozen/TaskComposer.tsx@@ -0,0 +1,155 @@+import ArrowsOut from '@phosphor/arrows-out-simple.svg';+import CalendarBlank from '@phosphor/calendar-blank.svg';+import HashStraight from '@phosphor/hash-straight.svg';+import Paperclip from '@phosphor/paperclip.svg';+import Tag from '@phosphor/tag.svg';+import X from '@phosphor/x.svg';+import { Button } from '@ui';+import { ToggleSwitch } from '@ui/components/ToggleSwitch';+import { createSignal, Show } from 'solid-js';+import type { WorkspaceTask } from '../../../core/dummy-workspace';+import {+ TaskOwnerMenu,+ TaskPriorityMenu,+ TaskStatusMenu,+} from './TaskProperties';++/**+ * block-md ComposeTask in its popover: EntityComposer header, title, body,+ * property pills, footer, and the team-sharing row. Local state replaces the+ * editors and property providers.+ */+export function TaskComposer(props: {+ draft: WorkspaceTask;+ /** The channel whose message became this task's description. */+ sourceChannel?: string;+ update: (patch: Partial<WorkspaceTask>) => void;+ submit: () => void;+ close: () => void;+}) {+ const [createMore, setCreateMore] = createSignal(false);+ const [shared, setShared] = createSignal(true);+ return (+ <form+ class="sample-task-composer"+ aria-label="Create task"+ onSubmit={(event) => {+ event.preventDefault();+ if (props.draft.title.trim()) props.submit();+ }}+ >+ <div class="sample-task-composer-header">+ <Button+ type="button"+ size="icon-sm"+ variant="plain"+ label="Continue editing in split"+ tabIndex={-1}+ >+ <ArrowsOut />+ </Button>+ <Button+ type="button"+ size="icon-sm"+ variant="plain"+ label="Close"+ class="ml-auto"+ onClick={props.close}+ >+ <X />+ </Button>+ </div>+ <input+ class="sample-task-composer-title"+ aria-label="New task title"+ placeholder="New task"+ value={props.draft.title}+ onInput={(event) => props.update({ title: event.currentTarget.value })}+ />+ <div class="sample-task-composer-body">+ <Show+ when={props.sourceChannel}+ fallback={+ <textarea+ aria-label="New task description"+ placeholder="Add description..."+ value={props.draft.description}+ onInput={(event) =>+ props.update({ description: event.currentTarget.value })+ }+ />+ }+ >+ <span class="dummy-entity-link sample-channel-mention">+ <HashStraight class="size-4" />+ {props.sourceChannel}+ </span>+ </Show>+ </div>+ <div class="sample-task-composer-properties">+ <TaskStatusMenu+ task={props.draft}+ onSave={(status) => props.update({ status })}+ />+ <TaskPriorityMenu+ task={props.draft}+ onSave={(priority) => props.update({ priority })}+ />+ <TaskOwnerMenu+ task={props.draft}+ onSave={(owner) => props.update({ owner })}+ />+ <span class="sample-task-composer-empty">+ <CalendarBlank class="size-3" />+ Due Date+ </span>+ <span class="sample-task-composer-empty">+ <Tag class="size-3" />+ Tags+ </span>+ </div>+ <div class="sample-task-composer-footer">+ <Button+ type="button"+ size="icon-sm"+ variant="plain"+ label="Attach image or video"+ tabIndex={-1}+ >+ <Paperclip />+ </Button>+ <div class="flex items-center gap-3">+ <ToggleSwitch+ label="Create More"+ labelClass="text-xs text-ink-muted font-normal whitespace-nowrap"+ checked={createMore()}+ onChange={setCreateMore}+ />+ <Button+ type="submit"+ variant="strong"+ size="sm"+ data-task-submit+ disabled={!props.draft.title.trim()}+ >+ Create Task+ <kbd class="sample-task-composer-kbd">⌘↵</kbd>+ </Button>+ </div>+ </div>+ <div class="sample-task-composer-sharing">+ <ToggleSwitch+ label="Shared with Team"+ labelClass="text-xs text-ink-muted font-normal whitespace-nowrap"+ checked={shared()}+ onChange={setShared}+ />+ <span>+ {shared()+ ? 'Visible to your whole team'+ : 'Only you and people you share with'}+ </span>+ </div>+ </form>+ );+}diff --git a/apps/marketing/src/features/marketing/components/workspace/frozen/TaskMention.tsx b/apps/marketing/src/features/marketing/components/workspace/frozen/TaskMention.tsxnew file mode 100644index 0000000000..a2ff7fdd1f--- /dev/null+++ b/apps/marketing/src/features/marketing/components/workspace/frozen/TaskMention.tsx@@ -0,0 +1,36 @@+import ListChecks from '@phosphor/list-checks.svg';+import { Show } from 'solid-js';+import type { WorkspaceTask } from '../../../core/dummy-workspace';+import { PropertyValueIcon } from './PropertyValueIcon';+import { PersonIcon, PRIORITY_IDS, STATUS_IDS } from './TaskProperties';++/** DocumentMention for a task: icon, title, then InlineTaskProperties'+ * status, priority, and first-assignee badges. */+export function TaskMention(props: {+ task: WorkspaceTask;+ onOpen?: () => void;+}) {+ return (+ <button+ type="button"+ class="dummy-entity-link sample-task-mention"+ onClick={props.onOpen}+ >+ <ListChecks class="size-4 shrink-0 text-task" />+ <span class="truncate">{props.task.title}</span>+ <span class="sample-task-mention-properties" aria-hidden="true">+ <PropertyValueIcon+ optionId={STATUS_IDS[props.task.status]}+ class="size-3"+ />+ <PropertyValueIcon+ optionId={PRIORITY_IDS[props.task.priority]}+ class="size-3"+ />+ <Show when={props.task.owner}>+ <PersonIcon person={props.task.owner} />+ </Show>+ </span>+ </button>+ );+}diff --git a/apps/marketing/src/features/marketing/components/workspace/frozen/TaskNotebook.tsx b/apps/marketing/src/features/marketing/components/workspace/frozen/TaskNotebook.tsxindex 8a9762367d..04158d9241 100644--- a/apps/marketing/src/features/marketing/components/workspace/frozen/TaskNotebook.tsx+++ b/apps/marketing/src/features/marketing/components/workspace/frozen/TaskNotebook.tsx@@ -32,6 +32,8 @@ export function TaskNotebook(props: {workspace: DummyWorkspace;task: WorkspaceTask;relatedContent?: JSX.Element;+ /** Extra pills in the property row, e.g. linked GitHub pull requests. */+ pills?: JSX.Element;}) {const [panel, setPanel] = createSignal<boolean>();const save = (patch: Partial<WorkspaceTask>) =>@@ -250,6 +252,7 @@ export function TaskNotebook(props: {tags={props.task.tags}onChange={(tags) => save({ tags })}/>+ {props.pills}<Show when={props.task.steps.length}><divclass="h-6 inline-flex min-w-0 items-center gap-1.5 rounded-full border border-edge-muted bg-surface-2 px-2 py-1 leading-tight text-xs"diff --git a/apps/marketing/src/features/marketing/components/workspace/frozen/model-picker/ProviderIcon.tsx b/apps/marketing/src/features/marketing/components/workspace/frozen/model-picker/ProviderIcon.tsxindex c47ece93dd..5e0d9ef3f4 100644--- a/apps/marketing/src/features/marketing/components/workspace/frozen/model-picker/ProviderIcon.tsx+++ b/apps/marketing/src/features/marketing/components/workspace/frozen/model-picker/ProviderIcon.tsx@@ -2,6 +2,7 @@ import OpenAiIcon from '@icon/openai.svg';import ClaudeIcon from '@icon/wide-claude.svg';import CursorIcon from '@icon/wide-cursor-ide.svg';import SparkleIcon from '@phosphor/sparkle.svg';+import GoogleIcon from '@phosphor-fill/google-logo-fill.svg';import { Match, Switch } from 'solid-js';/** Production provider glyphs for the local sample catalog. */@@ -26,6 +27,9 @@ export function ModelIcon(props: {><OpenAiIcon class={`shrink-0 ${sizing()}`} /></Match>+ <Match when={props.model?.startsWith('gemini-')}>+ <GoogleIcon class={`shrink-0 ${sizing()}`} />+ </Match></Switch>);}diff --git a/apps/marketing/src/features/marketing/components/workspace/workspace-companies.css b/apps/marketing/src/features/marketing/components/workspace/workspace-companies.cssnew file mode 100644index 0000000000..2d0957ecc9--- /dev/null+++ b/apps/marketing/src/features/marketing/components/workspace/workspace-companies.css@@ -0,0 +1,119 @@+/* Customers board: crm/views/company-board columns and cards. */+.sample-company-titlebar { display: flex; align-items: center; gap: 12px; height: 48px; flex-shrink: 0; padding: 0 16px; border-bottom: 1px solid var(--color-edge-muted); }+.sample-company-titlebar h1 { display: flex; align-items: center; min-width: 0; height: 28px; padding: 0 4px; font-size: 14px; font-weight: 600; letter-spacing: -0.03em; }+.sample-company-search { padding: 12px 16px 0; }+.sample-company-board .sample-company-column { gap: 8px; padding: 0 8px 8px; }+.sample-company-board .sample-company-column h3 { padding: 10px 4px; }+.sample-company-board .sample-company-card { margin: 0; gap: 6px; padding: 10px; background: var(--color-surface); }+.sample-company-board .sample-company-card:hover { background: var(--color-hover); }+.sample-company-owner { width: 20px; height: 20px; margin-left: auto; flex-shrink: 0; border-radius: 50%; object-fit: cover; }+/* The List layout: company-grid-layout's Customer, Stage, Owner, Revenue and Last Interaction. */+.sample-company-rows { padding: 4px 0 24px; }+.sample-company-row { display: grid; grid-template-columns: 1rem minmax(0, 100%) 8rem 8rem 7rem 7rem; align-items: center; gap: 8px; width: calc(100% - 8px); min-height: 40px; margin: 0 4px; padding: 0 8px; border-radius: 12px; text-align: left; font-size: 14px; color: var(--color-ink); }+button.sample-company-row:hover { background: var(--color-list-hover, var(--color-hover)); }+.sample-company-row[data-header] { min-height: 40px; font-size: 12px; font-weight: 500; color: var(--color-ink-extra-muted); }+.sample-company-row[data-header] > span:last-child, .sample-company-row-time { text-align: right; }+.sample-company-row-indicator { display: grid; place-items: center; }+.sample-company-row-content { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }+.sample-company-row-domain { flex-shrink: 2; font-size: 12px; font-weight: 400; color: var(--color-ink-extra-muted); }+.sample-company-row-value { display: flex; align-items: center; gap: 6px; min-width: 0; padding-left: 8px; font-size: 12px; }+.sample-company-row-time { font-size: 12px; font-weight: 300; color: var(--color-ink-extra-muted); }+.sample-company-row[data-unread=true] { animation: sample-company-row-in 400ms ease-out both; }+@keyframes sample-company-row-in { from { opacity: 0; transform: translateY(-4px); } }+@media (prefers-reduced-motion: reduce) { .sample-company-row[data-unread=true] { animation: none; } }+@container sample-main (max-width: 840px) {+ .sample-company-row { grid-template-columns: 1rem minmax(0, 100%) 6.5rem 5.5rem 5rem; }+ .sample-company-row > :nth-child(5) { display: none; }+}++/* Company record: crm/views/record-detail top bar and company-detail sections. */+.sample-company-record { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }+.sample-company-topbar { display: flex; align-items: center; gap: 12px; height: 48px; flex-shrink: 0; min-width: 0; padding: 0 16px; border-bottom: 1px solid var(--color-edge-muted); }+.sample-company-crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; flex-shrink: 1; font-size: 14px; }+.sample-crumb { display: flex; align-items: center; gap: 6px; height: 28px; min-width: 0; padding: 0 4px; font-weight: 600; letter-spacing: -0.03em; color: var(--color-ink); }+.sample-crumb-root { flex-shrink: 0; color: var(--color-ink-muted); }+.sample-crumb-root:hover { color: var(--color-ink); }+.sample-company-tabs { min-width: 0; overflow-x: auto; scrollbar-width: none; }+.sample-record-tab { display: flex; align-items: center; gap: 6px; }+.sample-record-tab > svg { display: none; }+.sample-company-body { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }+.sample-company-scroll { padding: 48px 24px 0; }+.sample-company-overview { display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: 768px; min-width: 0; margin: 0 auto; }+.sample-company-overview h1 .sample-inline-input[aria-label="Company name"] { font-size: 24px; line-height: 32px; font-weight: 600; }+.sample-company-overview [aria-label="Company details"] [data-slot=badge] { gap: 4px; font-weight: 400; }++/* EntityConversation: roots and inline replies on the channel message rows. */+.sample-company-discussion { margin-top: 12px; padding-bottom: 48px; }+.sample-company-discussion > button { color: var(--color-ink-muted); margin-bottom: 8px; }+.sample-company-discussion > button:hover { color: var(--color-ink); }+.sample-company-discussion .sample-channel-thread { margin-bottom: 12px; }+.sample-company-discussion .sample-message-row { padding: 10px 8px 0; margin-bottom: 0; gap: 8px; }+.sample-company-discussion .sample-message-row p { font-size: 15px; line-height: 24px; margin-top: 2px; margin-bottom: 2px; }+.sample-company-discussion .sample-thread-replies .sample-message-row { margin-left: 0; border: 0; border-radius: 6px; padding-left: 8px; margin-top: 8px; }++/* SidePanel floating: a card over the record, sections split by rules. */+.sample-company-panel { position: absolute; top: 12px; right: 12px; z-index: 5; display: flex; flex-direction: column; width: min(320px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow-y: auto; border: 1px solid color-mix(in oklch, var(--color-content-0) 10%, transparent); border-radius: 12px; background: var(--color-surface); box-shadow: 0 20px 40px #0007; scrollbar-width: none; }+.sample-company-panel-section { border-bottom: 1px solid var(--color-edge-muted); }+.sample-company-panel-section:last-child { border-bottom: 0; }+.sample-company-panel-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px; list-style: none; font-size: 12px; color: var(--color-ink-muted); cursor: pointer; }+.sample-company-panel-section > summary::-webkit-details-marker { display: none; }+.sample-company-panel-section > summary:hover { text-decoration: underline; }+.sample-company-panel-section > summary > svg { transition: transform 90ms; }+.sample-company-panel-section[open] > summary > svg { transform: rotate(90deg); }+.sample-company-revenue { padding-left: 8px; }+.sample-company-revenue::placeholder { color: var(--color-ink-extra-muted); }+.sample-company-toggle { display: inline-flex; align-items: center; gap: 8px; width: fit-content; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--color-ink-muted) 8%, transparent); background: color-mix(in srgb, var(--color-ink-muted) 2.5%, transparent); color: var(--color-ink); font-size: 12px; }+.sample-company-checkbox { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--color-edge); }+.sample-company-checkbox[data-checked=true] { border-color: var(--color-accent); background: var(--color-accent); }++/* RecordSection tabs and their unified-list rows. */+.sample-record-section { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }+.sample-record-section-header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; padding: 12px 16px; }+.sample-record-search { width: 224px; }+.sample-record-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) 8ch; align-items: center; gap: 8px; width: calc(100% - 8px); min-height: 40px; margin: 0 4px; padding: 2px 8px 2px 8px; border-radius: 12px; text-align: left; font-size: 14px; color: var(--color-ink); }+button.sample-record-row:hover, div.sample-record-row:hover { background: var(--color-list-hover, var(--color-hover)); }+.sample-record-row-indicator { display: grid; place-items: center; }+.sample-record-row-content { display: flex; align-items: center; gap: 8px; min-width: 0; }+.sample-record-row-title { flex-shrink: 0; max-width: 45%; }+.sample-record-row-detail { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: color-mix(in srgb, var(--color-ink) 50%, transparent); }+.sample-record-row-detail > .text-ink { flex-shrink: 0; }+.sample-record-row-time { text-align: right; font-size: 12px; color: var(--color-ink-extra-muted); }+.sample-record-people { display: inline-flex; flex-shrink: 0; }+.sample-record-people > * { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--color-panel); object-fit: cover; }+.sample-record-people > * + * { margin-left: -6px; }+.sample-record-people > span { display: grid; place-items: center; background: var(--color-surface-2); color: var(--color-ink-muted); font-size: 8px; font-weight: 600; }+.sample-record-task { display: grid; grid-template-columns: 16px minmax(0, 1fr) 96px 96px; align-items: center; gap: 8px; min-height: 44px; padding: 2px 16px; border-radius: 12px; font-size: 14px; }+.sample-record-task:hover { background: var(--color-list-hover, var(--color-hover)); }+.sample-record-task-priority, .sample-record-task-owner { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--color-ink-muted); }++/* A details panel that is open keeps the record readable beside it. */+@container sample-main (min-width: 641px) {+ .sample-company-record[data-panel-open=true] .sample-company-scroll { padding-right: 344px; }+}++/* The app's compact record bar: icon tabs, and the panel as a bottom sheet. */+@container sample-main (max-width: 640px) {+ .sample-company-topbar { gap: 6px; padding: 0 8px; }+ .sample-company-crumbs { display: none; }+ .sample-record-tab > svg { display: block; }+ .sample-record-tab > span { display: none; }+ .sample-company-copy > span { display: none; }+ .sample-company-copy { width: 28px; padding: 0; justify-content: center; }+ .sample-company-scroll { padding: 24px 16px 0; }+ .sample-company-overview { gap: 16px; }+ .sample-company-overview h1 .sample-inline-input[aria-label="Company name"] { font-size: 21px; line-height: 28px; }+ .sample-company-panel { top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-height: 60%; border-radius: 16px 16px 0 0; border-bottom: 0; }+ .sample-company-record[data-panel-open=true] .sample-company-scroll { padding-bottom: 260px; }+ .sample-record-section-header { padding: 12px; }+ .sample-record-search { width: 100%; }+ .sample-record-row { grid-template-columns: 8px minmax(0, 1fr) 7ch; gap: 6px; padding: 6px 4px; font-size: 13px; }+ .sample-record-row-content { flex-wrap: wrap; row-gap: 2px; }+ .sample-record-row-title { max-width: calc(100% - 24px); }+ .sample-record-row-detail { flex-basis: 100%; padding-left: 24px; font-size: 12px; }+ .sample-record-row-snippet { display: none; }+ .sample-record-task { grid-template-columns: 16px minmax(0, 1fr) 24px; padding-inline: 8px; }+ .sample-record-task-priority > span, .sample-record-task-owner { display: none; }+ .sample-company-row { grid-template-columns: 8px minmax(0, 100%) 6.5rem; gap: 6px; padding-inline: 4px; }+ .sample-company-row[data-header] > span { white-space: nowrap; }+ .sample-company-row > :nth-child(3), .sample-company-row > :nth-child(4), .sample-company-row-domain { display: none; }+}diff --git a/apps/marketing/src/features/marketing/core/demo-mentions.ts b/apps/marketing/src/features/marketing/core/demo-mentions.tsindex daa1a3ec0a..4da1d8bd50 100644--- a/apps/marketing/src/features/marketing/core/demo-mentions.ts+++ b/apps/marketing/src/features/marketing/core/demo-mentions.ts@@ -12,13 +12,15 @@ export type DemoMention = {/** The same fictional reference set is available in every writable demo. */export const demoMentions: DemoMention[] = [- ...(['julia', 'teo', 'jacob', 'valentina', 'gabriel'] as const).map((id) => ({- id,- label: homepagePeople[id].name,- kind: 'person' as const,- photo: homepagePeople[id].photo,- shortName: homepagePeople[id].shortName,- })),+ ...(['julia', 'teo', 'jacob', 'valentina', 'gabriel', 'macro'] as const).map(+ (id) => ({+ id,+ label: homepagePeople[id].name,+ kind: 'person' as const,+ photo: homepagePeople[id].photo,+ shortName: homepagePeople[id].shortName,+ })+ ),{ id: 'plan', label: 'Q3 launch plan', kind: 'document' },{id: 'announcement',diff --git a/apps/marketing/src/features/marketing/core/dummy-workspace.ts b/apps/marketing/src/features/marketing/core/dummy-workspace.tsindex 3373c5f37e..25c78733b4 100644--- a/apps/marketing/src/features/marketing/core/dummy-workspace.ts+++ b/apps/marketing/src/features/marketing/core/dummy-workspace.ts@@ -34,6 +34,8 @@ export type WorkspaceComment = {time: string;emailId?: string;taskId?: string;+ /** An agent reply can reference several tasks it created. */+ taskIds?: string[];documentId?: string;replyTo?: string;reactions?: string[];diff --git a/apps/marketing/src/features/marketing/core/homepage-demo-people.ts b/apps/marketing/src/features/marketing/core/homepage-demo-people.tsindex 4cdaac45f0..51d856cd92 100644--- a/apps/marketing/src/features/marketing/core/homepage-demo-people.ts+++ b/apps/marketing/src/features/marketing/core/homepage-demo-people.ts@@ -3,6 +3,7 @@ import cursor from '@icon/wide-cursor-ide.svg?url';import gabriel from '../../../assets/people/gabriel.webp';import jacob from '../../../assets/people/jacob-work.webp';import julia from '../../../assets/people/julia.webp';+import macro from '../../../assets/people/macro-agent.svg?url';import teo from '../../../assets/people/teo.webp';import valentina from '../../../assets/people/valentina.webp';@@ -33,6 +34,7 @@ export const homepagePeople = {photo: valentina,},teo: { name: 'Teo', shortName: 'Teo', initials: 'T', photo: teo },+ macro: { name: 'Macro', shortName: 'Macro', initials: 'M', photo: macro },claude: { name: 'Claude', shortName: 'Claude', initials: 'C', photo: claude },cursor: { name: 'Cursor', shortName: 'Cursor', initials: 'C', photo: cursor },} as const;diff --git a/apps/marketing/src/features/marketing/core/workspace-fixtures.ts b/apps/marketing/src/features/marketing/core/workspace-fixtures.tsindex bbb1fb2585..bfc08989cd 100644--- a/apps/marketing/src/features/marketing/core/workspace-fixtures.ts+++ b/apps/marketing/src/features/marketing/core/workspace-fixtures.ts@@ -1,14 +1,58 @@-import type { WorkspaceComment } from './dummy-workspace';+import type {+ TaskPriority,+ TaskStatus,+ WorkspaceComment,+} from './dummy-workspace';import type { HomepagePersonId } from './homepage-demo-people';+/** The app's default deal stages, in board order, plus its "No stage" column. */export const dealStages = ['Lead',+ 'Qualified','Demo',+ 'Trial',+ 'Negotiation','Customer','Churned','No stage',] as const;export type DealStage = (typeof dealStages)[number];+/** A row in a company's Emails tab. */+export type CompanyEmail = {+ id: string;+ sender: string;+ subject: string;+ snippet: string;+ time: string;+ /** Shown under Signal; everything shows under All. */+ signal?: boolean;+ /** Your own thread, shown under Me; the team sees every thread. */+ mine?: boolean;+ unread?: boolean;+};+export type CompanyCall = {+ id: string;+ title: string;+ time: string;+ duration: string;+ people: HomepagePersonId[];+ guests: string[];+};+export type CompanyFile = {+ id: string;+ title: string;+ time: string;+ kind: 'document' | 'pdf';+ /** A workspace document the row opens. */+ documentId?: string;+};+export type CompanyTask = {+ id: string;+ title: string;+ status: TaskStatus;+ priority: TaskPriority;+ owner: HomepagePersonId;+};export type SampleCompany = {id: string;name: string;@@ -19,7 +63,19 @@ export type SampleCompany = {revenue: string;contacts: { name: string; email: string }[];comments: WorkspaceComment[];+ /** Workspace emails (by id) exchanged with this company. */emailIds: string[];+ /** Board card time: the last interaction, formatted like the app's rows. */+ updated?: string;+ /** Relative time for the "Last interacted" pill. */+ lastInteracted?: string;+ emails?: CompanyEmail[];+ calls?: CompanyCall[];+ files?: CompanyFile[];+ tasks?: CompanyTask[];+ lists?: string[];+ /** New since you last looked: the list's unread indicator. */+ unread?: boolean;};export type SampleEvent = {id: string;@@ -30,90 +86,374 @@ export type SampleEvent = {calendar: 'work' | 'personal';description: string;};++/** formatRelativeTimestamp for a sample day whose clock reads 10:10 AM. */+function relative(updated: string) {+ const time = /^(\d+):(\d+) AM$/.exec(updated);+ if (!time) return updated === 'Sep 28' ? '5:40PM yesterday' : updated;+ const minutes = 610 - (Number(time[1]) * 60 + Number(time[2]));+ return minutes < 60+ ? `${minutes} minutes ago`+ : `${Math.floor(minutes / 60)} hour${minutes < 120 ? '' : 's'} ago`;+}++const company = (+ id: string,+ name: string,+ stage: DealStage,+ owner: HomepagePersonId | '',+ updated: string,+ description: string,+ revenue = ''+): SampleCompany => ({+ id,+ name,+ domain: `${id}.example`,+ description,+ stage,+ owner,+ revenue,+ updated,+ lastInteracted: relative(updated),+ contacts: [],+ comments: [],+ emailIds: [],+});++/** The Meadow carries the full record; the rest fill out a team's pipeline. */export function sampleCompanies(): SampleCompany[] {return [+ company(+ 'northstar',+ 'Northstar Design',+ 'Lead',+ 'jacob',+ '8:20 AM',+ 'Northstar Design is a product design and research consultancy for fintech and healthcare companies, with studios in Austin and Denver.'+ ),+ company(+ 'harbor',+ 'Harbor Analytics',+ 'Lead',+ 'julia',+ 'Sep 28',+ 'Harbor Analytics builds sales forecasting dashboards for regional grocery chains and independent retailers.'+ ),+ company(+ 'ridgeline',+ 'Ridgeline Outdoor',+ 'Lead',+ '',+ 'Sep 26',+ 'Ridgeline Outdoor is a direct-to-consumer maker of camping and climbing gear based in Boulder, Colorado.'+ ),+ company(+ 'copperleaf',+ 'Copperleaf',+ 'Lead',+ 'teo',+ 'Sep 25',+ 'Copperleaf is a bookkeeping and tax firm for restaurants and small retailers in the Pacific Northwest.'+ ),+ company(+ 'orbit',+ 'Orbit Labs',+ 'Qualified',+ 'teo',+ '10:05 AM',+ 'Orbit Labs makes scheduling and dispatch software for field service teams.',+ '6,000'+ ),+ company(+ 'tidewater',+ 'Tidewater Health',+ 'Qualified',+ 'jacob',+ 'Sep 28',+ 'Tidewater Health runs a network of physical therapy clinics across coastal Virginia and North Carolina.'+ ),+ company(+ 'fernway',+ 'Fernway Travel',+ 'Qualified',+ 'julia',+ 'Sep 27',+ 'Fernway plans group trips and company offsites for remote teams.'+ ),{- id: 'meadow',- name: 'The Meadow',- domain: 'meadow.example',- description: 'A shared workspace for the Meadow team.',- stage: 'Customer',- owner: 'julia',- revenue: '12,000',+ ...company(+ 'meadow',+ 'The Meadow',+ 'Demo',+ 'jacob',+ '9:41 AM',+ 'The Meadow is a Brooklyn design studio that builds brands, websites, and packaging for consumer companies. Its team of about 40 designers and strategists works with founders from naming through launch, and runs a small in-house print shop for packaging prototypes and limited-run merchandise.',+ '18,000'+ ),contacts: [{ name: 'Dana Whitfield', email: '[email protected]' },{ name: 'Alex Chen', email: '[email protected]' },+ { name: 'Priya Raman', email: '[email protected]' },],comments: [{- id: 'company-comment',+ id: 'meadow-pricing',person: 'julia',- body: 'The rollout plan is ready for Thursday. Dana will introduce the rest of the team.',- time: '9:45 AM',+ body: 'Dana asked about pricing for 12 seats now and the studio team in November. I quoted the annual team rate. @[Jacob](demo-mention:jacob) can we hold it through the end of the year?',+ time: '8:47 AM',+ },+ {+ id: 'meadow-pricing-hold',+ person: 'jacob',+ body: 'Yes, if they start with 12 before Thursday’s demo.',+ time: '8:58 AM',+ replyTo: 'meadow-pricing',+ },+ {+ id: 'meadow-pricing-sent',+ person: 'julia',+ body: 'Sent. Order form is in Files.',+ time: '9:12 AM',+ replyTo: 'meadow-pricing',},],emailIds: ['dana'],+ emails: [+ {+ id: 'meadow-seats',+ sender: 'Alex Chen',+ subject: 'Seats for the studio team',+ snippet: 'We’d start with 12 and add the print shop in November.',+ time: 'Sep 28',+ signal: true,+ },+ {+ id: 'meadow-order',+ sender: 'Julia Westphal',+ subject: 'Re: Pricing for 12 seats',+ snippet: 'Attached is the order form with the annual team rate.',+ time: 'Sep 27',+ signal: true,+ },+ {+ id: 'meadow-invite',+ sender: 'Dana Whitfield',+ subject: 'Invitation: The Meadow · Demo',+ snippet: 'Thursday, October 1 · 9:00 – 10:00 AM',+ time: 'Sep 26',+ mine: true,+ },+ {+ id: 'meadow-security',+ sender: 'Priya Raman',+ subject: 'Security questionnaire',+ snippet: 'Our IT contractor sent over a few questions about SSO.',+ time: 'Sep 25',+ signal: true,+ },+ {+ id: 'meadow-recap',+ sender: 'Jacob Beckerman',+ subject: 'Recap from today',+ snippet: 'Thanks for the time, Dana. Here’s what we covered.',+ time: 'Sep 22',+ signal: true,+ mine: true,+ },+ {+ id: 'meadow-intro',+ sender: 'Dana Whitfield',+ subject: 'Intro from Sam',+ snippet:+ 'Sam mentioned you’re building something for studios like ours.',+ time: 'Sep 19',+ signal: true,+ mine: true,+ },+ ],+ calls: [+ {+ id: 'meadow-checkin',+ title: 'Rollout check-in with The Meadow',+ time: 'Sep 28',+ duration: '18m 40s',+ people: ['jacob', 'julia'],+ guests: ['Dana Whitfield', 'Alex Chen'],+ },+ {+ id: 'meadow-pricing-call',+ title: 'Pricing questions',+ time: 'Sep 25',+ duration: '12m 4s',+ people: ['julia'],+ guests: ['Dana Whitfield'],+ },+ {+ id: 'meadow-design-review',+ title: 'Studio workflow walkthrough',+ time: 'Sep 24',+ duration: '46m 31s',+ people: ['jacob', 'teo'],+ guests: ['Alex Chen', 'Priya Raman'],+ },+ {+ id: 'meadow-intro-call',+ title: 'Intro call: The Meadow',+ time: 'Sep 22',+ duration: '31m 12s',+ people: ['jacob'],+ guests: ['Dana Whitfield'],+ },+ ],+ files: [+ {+ id: 'meadow-rollout',+ title: 'Team rollout plan',+ time: '9:30 AM',+ kind: 'document',+ documentId: 'rollout',+ },+ {+ id: 'meadow-notes',+ title: 'Demo call notes',+ time: 'Sep 28',+ kind: 'document',+ documentId: 'notes',+ },+ {+ id: 'meadow-order-form',+ title: 'The Meadow order form.pdf',+ time: 'Sep 27',+ kind: 'pdf',+ },+ ],+ tasks: [+ {+ id: 'meadow-demo-prep',+ title: 'Prep Thursday’s demo for the studio',+ status: 'In Progress',+ priority: 'High',+ owner: 'jacob',+ },+ {+ id: 'meadow-order-task',+ title: 'Get the order form signed',+ status: 'Not Started',+ priority: 'Medium',+ owner: 'julia',+ },+ {+ id: 'meadow-invites',+ title: 'Invite the print shop in November',+ status: 'Not Started',+ priority: 'Low',+ owner: 'teo',+ },+ ],+ lists: ['Q4 pipeline'],},- {- id: 'northstar',- name: 'Northstar Design',- domain: 'northstar.example',- description: 'Product design and research.',- stage: 'Lead',- owner: 'jacob',- revenue: '',- contacts: [{ name: 'Jamie Park', email: '[email protected]' }],- comments: [],- emailIds: [],- },- {- id: 'orbit',- name: 'Orbit Labs',- domain: 'orbit.example',- description: 'Tools for distributed teams.',- stage: 'Demo',- owner: 'teo',- revenue: '6,000',- contacts: [],- comments: [],- emailIds: [],- },- {- id: 'cedar',- name: 'Cedar Studio',- domain: 'cedar.example',- description: 'Independent creative studio.',- stage: 'Churned',- owner: 'jacob',- revenue: '',- contacts: [],- comments: [],- emailIds: [],- },- {- id: 'fieldwork',- name: 'Fieldwork',- domain: 'fieldwork.example',- description: 'Research that connects people.',- stage: 'No stage',- owner: '',- revenue: '',- contacts: [],- comments: [],- emailIds: [],- },- {- id: 'lumen',- name: 'Lumen Works',- domain: 'lumen.example',- description: 'Software for small businesses.',- stage: 'No stage',- owner: '',- revenue: '',- contacts: [],- comments: [],- emailIds: [],- },+ company(+ 'bluebird',+ 'Bluebird Logistics',+ 'Demo',+ 'julia',+ 'Sep 28',+ 'Bluebird Logistics is a freight brokerage that matches small carriers with regional shippers.'+ ),+ company(+ 'sable',+ 'Sable & Co',+ 'Demo',+ 'teo',+ 'Sep 26',+ 'Sable & Co is a brand and packaging agency for food and beverage startups.'+ ),+ company(+ 'lumen',+ 'Lumen Works',+ 'Trial',+ 'julia',+ '8:52 AM',+ 'Lumen Works builds point-of-sale and inventory software for independent bookstores.',+ '9,000'+ ),+ company(+ 'foxglove',+ 'Foxglove Studio',+ 'Trial',+ 'jacob',+ 'Sep 27',+ 'Foxglove is an architecture and interiors studio that designs restaurants and boutique hotels.'+ ),+ company(+ 'northwind',+ 'Northwind',+ 'Negotiation',+ 'jacob',+ 'Sep 28',+ 'Northwind is a commercial HVAC contractor serving offices and schools in the Twin Cities.',+ '32,000'+ ),+ company(+ 'granite',+ 'Granite Legal',+ 'Negotiation',+ 'valentina',+ 'Sep 24',+ 'Granite Legal is a 25-attorney firm focused on employment law and startup financings.',+ '14,400'+ ),+ company(+ 'relay',+ 'Relay',+ 'Customer',+ 'julia',+ 'Sep 28',+ 'Relay makes customer support software for e-commerce brands.',+ '24,000'+ ),+ company(+ 'pallet',+ 'Pallet Coffee',+ 'Customer',+ 'teo',+ 'Sep 23',+ 'Pallet roasts and wholesales specialty coffee to cafés and offices in Portland, Oregon.',+ '6,000'+ ),+ company(+ 'fieldnote',+ 'Fieldnote',+ 'Customer',+ 'jacob',+ 'Sep 22',+ 'Fieldnote runs user research studies and recruits interview participants for product teams.',+ '9,600'+ ),+ company(+ 'cedar',+ 'Cedar Studio',+ 'Churned',+ 'jacob',+ 'Aug 30',+ 'Cedar Studio is an independent animation studio that makes commercials and explainer videos.'+ ),+ company(+ 'fieldwork',+ 'Fieldwork',+ 'No stage',+ '',+ 'Sep 21',+ 'Fieldwork operates coworking spaces in three Chicago neighborhoods.'+ ),+ company(+ 'brightline',+ 'Brightline Tutoring',+ 'No stage',+ '',+ 'Sep 20',+ 'Brightline offers online math and science tutoring for middle and high school students.'+ ),];}export const sampleToday = '2026-09-29';diff --git a/apps/marketing/src/features/marketing/primitives/createEmailWalkthrough.ts b/apps/marketing/src/features/marketing/primitives/createEmailWalkthrough.tsindex c1a93e43ef..2c3f3fd288 100644--- a/apps/marketing/src/features/marketing/primitives/createEmailWalkthrough.ts+++ b/apps/marketing/src/features/marketing/primitives/createEmailWalkthrough.ts@@ -7,6 +7,8 @@ export function createEmailWalkthrough(options: {advance: (step: number) => void;reset: () => void;reduced: () => void;+ /** Milliseconds before the given step; defaults to 1400ms per step. */+ delay?: (step: number) => number;}) {const [playing, setPlaying] = createSignal(true);const [reducedMotion, setReducedMotion] = createSignal(false);@@ -24,11 +26,14 @@ export function createEmailWalkthrough(options: {const schedule = () => {clear();if (!visible || !playing() || reducedMotion() || document.hidden) return;- timer = setTimeout(() => {- options.advance(++step);- if (step >= options.steps) pause();- else schedule();- }, 1400);+ timer = setTimeout(+ () => {+ options.advance(++step);+ if (step >= options.steps) pause();+ else schedule();+ },+ options.delay?.(step + 1) ?? 1400+ );};const replay = () => {step = 0;diff --git a/apps/marketing/src/features/marketing/views/ProductAgentsPage.tsx b/apps/marketing/src/features/marketing/views/ProductAgentsPage.tsxindex 55b6211ef8..66d357f756 100644--- a/apps/marketing/src/features/marketing/views/ProductAgentsPage.tsx+++ b/apps/marketing/src/features/marketing/views/ProductAgentsPage.tsx@@ -6,17 +6,16 @@ import { setPageSeo } from '../../../app/utils/utilSeo';import HermesIcon from '../assets/hermes.svg';import OpenClawIcon from '../assets/openclaw.svg';import {- AgentArtifactDemo,- AgentContextDemo,- AgentEmailReviewDemo,- AgentRequestDemo,- AgentTaskResultDemo,+ AgentMcpDemo,+ AgentMemoryDemo,+ AgentModelsDemo,+ AgentSearchDemo,} from '../components/agents/AgentStories';import { FeaturePageFaq, FeaturePageSection } from '../components/FeaturePage';import { HomepageClosing } from '../components/HomepageClosing';import {ContextGraphic,- EditingGraphic,+ DiffGraphic,LinkedWorkGraphic,ThreadGraphic,} from '../components/product/ProductGraphics';@@ -28,49 +27,97 @@ import {import { WorkspaceDesktopDemo } from '../components/WorkspaceDesktopDemo';import './agents-page.css';+/** Clients the app's MCP settings and Bring your own agent card name. */const existingAgents = [- { name: 'Hermes', icon: HermesIcon },- { name: 'OpenClaw', icon: OpenClawIcon },- { name: 'ChatGPT', icon: ChatGPTIcon },{ name: 'Claude', icon: ClaudeIcon },+ { name: 'ChatGPT', icon: ChatGPTIcon },{ name: 'Cursor', icon: CursorIcon },+ { name: 'Hermes', icon: HermesIcon },+ { name: 'OpenClaw', icon: OpenClawIcon },+];++const agentsFaq = [+ {+ q: 'What does Macro’s memory actually remember?',+ a: 'Who works on what, what you’ve promised customers, and who knows the most about a topic. We rebuild it every night from your team’s email, channels, docs, tasks, calls, and CRM. When an agent needs the latest details, it searches for them. It only uses what the person asking is allowed to see.',+ },+ {+ q: 'What can agents do in Macro?',+ a: 'Most of what you can. They search and read email, chat, docs, tasks, and calls. They write and edit docs, create and assign tasks, update customers in the CRM, post in channels, and draft email. The results land in the same workspace your team already uses.',+ },+ {+ q: 'Which models can I use?',+ a: 'The latest from Anthropic, OpenAI, and Google. The model is a dropdown in the composer, and you can switch in the middle of a conversation if you want a second opinion. Memory and tools work the same with every model, so you’re never locked into one lab.',+ },+ {+ q: 'Can an agent see things I can’t?',+ a: 'No. An agent runs with the permissions of the person using it. If a doc, channel, or email isn’t shared with you, your agent can’t read it either.',+ },+ {+ q: 'Will an agent send email without asking me?',+ a: 'No. The agent drafts the email in the conversation, and it only goes out after you’ve checked the recipients and the wording. Other changes, like doc edits and new tasks, happen right away, the same way a teammate’s would.',+ },+ {+ q: 'Can I edit what an agent makes?',+ a: 'Yes. A doc or task an agent creates is an ordinary Macro doc or task. Edit it, reassign it, or ask another agent to pick it up.',+ },+ {+ q: 'Does a doc have to be open for an agent to edit it?',+ a: 'No. Agents edit through the same sync service your teammates use, so the doc can be closed. If you have it open, you’ll see the edits arrive live and can keep typing alongside them.',+ },+ {+ q: 'Can I use Macro from Claude Code, ChatGPT, or Cursor?',+ a: (+ <>+ Yes. Our MCP server gives them the same tools our agents use, with your+ permissions. In Claude Code, run{' '}+ <code>+ claude mcp add --transport http macro https://mcp-server.macro.com/mcp+ </code>+ . In Claude.ai, add it under Settings → Connectors. ChatGPT needs+ Developer mode turned on. Cursor and other IDEs take the JSON config+ from the MCP server page in Macro’s settings.+ </>+ ),+ },];export function RouteAgents() {setPageSeo({title: 'Macro Agents — AI With Your Whole Workspace as Context',description:- 'Team-level memory built from email, chat, documents, tasks, and calls. Bring your existing agents, search your workspace, and edit documents live—even when they aren’t open.',+ 'Agents with memory of your team’s email, chat, docs, tasks, and calls. One search across everything, any model, and an MCP server for the agents you already use.',path: '/agents',});return (<ProductPage><ProductHeroproduct="Agents"- title={['One memory for your team', 'and all its agents.']}+ title={['Agents that know what', 'your team is doing.']}description={[- 'Shared memory of what everyone on your team is doing.',- 'Email, chat, docs, tasks, and calls.',+ 'Macro remembers your email, chat, docs, tasks, and calls.',+ 'Use any model, from any device, and pick up where you left off.',]}cta="agents_hero_get_started"/><WorkspaceDesktopDemoview="agents"+ initialAgent="launch-status"label="Explore Macro Agents"- caption="Ask about the launch tasks or create a task in this local sample workspace."+ caption="A sample workspace. Ask about the launch or open a linked task."/><nav class="feature-page-jump-links" aria-label="On this page">- <a href="#agent-request">+ <a href="#agent-memory"><ThreadGraphic />- <span>Team-level memory</span>+ <span>Team memory</span></a>- <a href="#agent-context">+ <a href="#agent-search"><ContextGraphic />- <span>Full workspace context</span>+ <span>One search</span></a>- <a href="#agent-edits">- <EditingGraphic />- <span>Live document editing</span>+ <a href="#agent-models">+ <DiffGraphic />+ <span>Any model</span></a><a href="#existing-agents"><LinkedWorkGraphic />@@ -78,188 +125,112 @@ export function RouteAgents() {</a></nav><FeaturePageSection- id="agent-request"- title="Memory of what your whole team is doing."- description={- 'Who owns this project? What did we promise the customer? Who can help?\nYour agents remember the work, the decisions, and the people involved.'- }- >- <div class="feature-page-visual">- <AgentRequestDemo />- </div>- <ProductProse>- <p>- Macro builds memory from your team’s emails, channel conversations,- documents, tasks, and calls. It develops a shared understanding of- active projects, who is responsible for what, and the decisions your- team has made. That understanding carries across people, agents, and- model providers. An agent can identify the right task owner, find- the person who knows a customer, or pick up work another agent- started. Search retrieves the latest details, with your sharing- permissions determining what each agent can access.- </p>- </ProductProse>- </FeaturePageSection>- <FeaturePageSection- id="agent-context"- title="Your entire workspace is context."+ id="agent-memory"+ title="Memory for the whole team."description={- 'Email, messages, documents, images, PDFs, tasks, and call transcripts.\nOne search tool. Full content. References back to the source.'+ 'ChatGPT remembers your chats. Macro remembers your company.\nAsk who owns something, what you promised a customer, or who to ask.'}><div class="feature-page-visual">- <AgentContextDemo />+ <AgentMemoryDemo /></div><ProductProse><p>- Macro gives agents multimodal context: text, images, files, and the- transcripts of your team’s calls. Unified search finds related work- across these sources, and reading tools retrieve the content the- agent needs to answer or take action. @mention an item to give the- agent a starting point, or let it find the relevant sources itself.- Follow the references to inspect the email, document, conversation,- or task behind its answer.- </p>- </ProductProse>- </FeaturePageSection>- <FeaturePageSection- id="existing-agents"- title="Bring the agents you already use."- description={- 'Give your agents tools to read, search, and edit your Macro workspace.\nHermes, OpenClaw, ChatGPT, Claude, and Cursor.'- }- >- <ul class="agents-page-providers" aria-label="Existing agents">- <For each={existingAgents}>- {(agent) => (- <li>- <span class="agents-page-provider-icon">- <agent.icon aria-hidden="true" />- </span>- <span>{agent.name}</span>- </li>- )}- </For>- </ul>- <ProductProse>- <p>- Connect an MCP-compatible agent to Macro’s MCP server. It can search- the workspace, read and edit native documents, and update properties- using your access permissions. The agent you use for coding can also- read the brief, check a customer conversation, and update the- document your team is working on. Macro’s built-in agents also let- you choose the model. Your team’s memory and workspace tools carry- across model providers.+ ChatGPT and Claude build memory from your conversations with them.+ Macro builds it from everything your team does: email, channels,+ docs, tasks, calls, and the CRM, refreshed every night. It learns+ who works on what, so it can assign a task to the right person,+ route a customer issue, or tell you who knows the most about+ something. It only uses what you’re allowed to see.</p></ProductProse></FeaturePageSection><FeaturePageSection- id="agent-edits"- title="Agents edit documents—even when they’re closed."+ id="agent-search"+ title="One search across everything."description={- 'Ask an agent to update any native Markdown document it has access to.\nIt joins the same live collaboration system as your teammates.'+ 'Agents search email, chat, docs, tasks, and calls with one tool.\nNo stitching together five integrations that each return half the answer.'}><div class="feature-page-visual">- <AgentArtifactDemo />+ <AgentSearchDemo /></div><ProductProse><p>- Agents read the current document and apply edits through Macro’s- CRDT sync service. A CRDT is a data structure that merges concurrent- changes, so a person and an agent can write in the same document at- the same time. The editing tool connects to the document on the- server. You don’t have to open it or keep an editor tab running.- When you are in the document, you can watch the agent’s edits arrive- live and keep writing alongside it. Its changes remain editable by- your team.+ Plug Claude into Slack, Notion, Linear, and Gmail and it has to+ search each one, dedupe the results, and guess what happened in what+ order. We built Macro’s tools the way we built the app: one search+ across everything, one way to read any item, and links back to the+ source. Your agent spends its time on your question instead of on+ plumbing.</p></ProductProse></FeaturePageSection><FeaturePageSection- id="agent-email-review"- title="Draft from your actual conversations."+ id="agent-models"+ title="Any model. Same memory."description={- 'Ask for a reply using the email thread, meeting transcript, and relevant files.\nReview the recipient, attachments, and wording before sending.'+ 'Switch between the latest models from Anthropic, OpenAI, and Google.\nYour memory and tools come with you.'}><div class="feature-page-visual">- <AgentEmailReviewDemo />+ <AgentModelsDemo /></div><ProductProse><p>- Agents can search past emails, read the thread, and draft with- information from your documents and calls. They can prepare the- recipients, subject, body, and requested attachments. The email- tools ask for confirmation before sending. You can edit the draft- and check who will receive it before approving the send.+ Models leapfrog each other every few months, and you shouldn’t have+ to move your company’s memory every time they do. In Macro, the+ model is a dropdown, and everything the agent knows about your team+ works the same whichever one you pick. Agents run in the cloud, too,+ so you can start something on your laptop, close it, and check the+ result on your phone.</p></ProductProse></FeaturePageSection><FeaturePageSection- id="agent-result"- title="Agents create real tasks."+ id="existing-agents"+ title="Bring Claude, ChatGPT, or Cursor."description={- 'Ask an agent to create a task, assign an owner, or update a brief.\nIts tools make those changes directly in your workspace.'+ 'Connect any MCP client and it gets the same tools our agents use.\nOne command for Claude Code, or a connector for Claude.ai and ChatGPT.'}>- <div class="feature-page-visual">- <AgentTaskResultDemo />+ <ul+ class="agents-page-providers"+ aria-label="Agents that connect to Macro"+ >+ <For each={existingAgents}>+ {(agent) => (+ <li data-agent={agent.name}>+ <span class="agents-page-provider-icon">+ <agent.icon aria-hidden="true" />+ </span>+ <span>{agent.name}</span>+ </li>+ )}+ </For>+ </ul>+ <div class="feature-page-visual agents-page-mcp">+ <AgentMcpDemo /></div><ProductProse><p>- Task tools create and update workspace items, including their- descriptions, status, priority, and assignees. The result opens in- the task list and can be linked in a document or channel. People and- agents use the same tasks. Assign the next step, edit the checklist,- or ask another agent to continue from the brief.+ Our MCP server gets the same care as the app. Point Claude Code,+ Cursor, Claude.ai, or ChatGPT at it and your agent can search the+ workspace, read and edit docs, and update tasks and customers, all+ with your permissions.</p></ProductProse></FeaturePageSection><FeaturePageFaqid="agents-faq-title"- eyebrow="Search, memory, and tools"- title="How agents work in Macro."+ title="Questions about Macro agents"introduction={<p>- Agents read and change workspace items through tools that follow- your access permissions.+ Agents in Macro use the same permissions you do. Here are the+ details.</p>}- items={[- {- q: 'What does team-level memory include?',- a: 'Macro builds a shared understanding of projects, responsibilities, and decisions from your team’s email, messages, documents, tasks, and calls. Agents use that memory and search for current details. Access to workspace items still follows your sharing permissions.',- },- {- q: 'What can agents do in Macro?',- a: 'Agents can search and read your email, chat, docs, tasks, and calls; edit native Markdown documents; create and update tasks; and prepare emails. Available tools and connected accounts determine what each conversation can do.',- },- {- q: 'Can I choose the model?',- a: 'The agent composer includes a model picker. The available models depend on your account and current product configuration.',- },- {- q: 'Do agents bypass sharing permissions?',- a: 'No. Workspace tools operate with the permissions of the user who runs the agent.',- },- {- q: 'Does every action require approval?',- a: 'No. Approval depends on the action and tool. Email tools can ask for confirmation before sending; document edits can appear directly in the working document.',- },- {- q: 'Can I edit the result myself?',- a: 'Yes. Generated documents and tasks remain ordinary workspace items, and email drafts can be reviewed and edited before sending.',- },- {- q: 'Does a document need to be open for an agent to edit it?',- a: 'No. Agents edit native Markdown documents through the server’s collaboration service, even when the document is closed. The same CRDT system merges their changes with live edits from people. Uploaded PDFs, images, and other files can be read as sources; direct document editing applies to native Markdown documents.',- },- {- q: 'Can I use Macro with an external agent?',- a: 'Yes. Macro’s MCP server exposes workspace search, document reading and editing, and property updates to external agents. Tools use your access permissions.',- },- ]}+ items={agentsFaq}/><HomepageClosing /></ProductPage>diff --git a/apps/marketing/src/features/marketing/views/ProductCallsPage.tsx b/apps/marketing/src/features/marketing/views/ProductCallsPage.tsxindex f8af6940c3..ab355377f3 100644--- a/apps/marketing/src/features/marketing/views/ProductCallsPage.tsx+++ b/apps/marketing/src/features/marketing/views/ProductCallsPage.tsx@@ -1,8 +1,9 @@import { setPageSeo } from '../../../app/utils/utilSeo';import {- CallArchiveDemo,+ CallDefaultDemo,CallFollowupDemo,- CallSharingDemo,+ CallHeroDemo,+ CallStartDemo,CallTranscriptDemo,} from '../components/calls/CallStories';import { FeaturePageFaq, FeaturePageSection } from '../components/FeaturePage';@@ -20,74 +21,114 @@ import {} from '../components/product/ProductPage';import { WorkspaceDesktopDemo } from '../components/WorkspaceDesktopDemo';+const callsFaq = [+ {+ q: 'Are all calls recorded?',+ a: 'Yes. Calls in Macro are recorded and transcribed for the organizer and Macro participants, and the recording, transcript, and summary are saved with the call.',+ },+ {+ q: 'Who can see a recording?',+ a: 'Members of the channel it started in. Use Share to give anyone else access.',+ },+ {+ q: 'Do I need to install anything?',+ a: 'No. Calls run in the browser on desktop and mobile.',+ },+ {+ q: 'Can agents read my calls?',+ a: (+ <>+ Yes, the ones you have access to. Agents read the summary first and the+ full transcript when they need detail. More on{' '}+ <a href="/agents">agents in Macro</a>.+ </>+ ),+ },+ {+ q: 'Can I share a call with my team?',+ a: 'Yes. Turn on Share with team and your team can see the chat, transcript, and AI summary once the call ends.',+ },+ {+ q: 'Is there a free plan?',+ a: (+ <>+ Yes, for email, chat, docs, and agents. Calls, recording, and+ transcription are on the paid plan. See <a href="/pricing">pricing</a>{' '}+ for what each plan includes.+ </>+ ),+ },+];+export function RouteCalls() {setPageSeo({title: 'Macro Calls — Recordings, Transcripts, and Agent Tools',description:- 'Browser-based video calls with recordings, speaker transcripts, and summaries. Search the conversation and ask agents to update tasks from the call.',+ 'Start a call from any channel. Macro records, transcribes, and summarizes it by default, so your team and your agents know what was decided.',path: '/calls',});return (<ProductPage><ProductHeroproduct="Calls"- title={['Record the conversation.', 'Search every word.']}+ title={['Every call, recorded', 'and searchable.']}description={[- 'Video calls, transcripts, and summaries.',- 'Available to your team and your agents.',+ 'Start a call from any channel. It’s transcribed and summarized automatically,',+ 'so your team and your agents know what was decided.',]}cta="calls_hero_get_started"/><WorkspaceDesktopDemoview="messages"label="Explore Macro Calls"- caption="Open the launch check-in to read its summary and transcript. This sample has no live audio or video."+ caption="A sample call. Click a transcript line to jump to that moment.">- <CallArchiveDemo />+ <CallHeroDemo /></WorkspaceDesktopDemo><nav class="feature-page-jump-links" aria-label="On this page">- <a href="#call-context">- <CallGraphic />- <span>Call records</span>+ <a href="#call-default">+ <ContextGraphic />+ <span>On by default</span></a><a href="#call-transcript"><ThreadGraphic />- <span>Transcripts</span>+ <span>Who said what</span></a><a href="#call-followup"><LinkedWorkGraphic />- <span>Agent tools</span>+ <span>Summaries for agents</span></a>- <a href="#call-sharing">- <ContextGraphic />- <span>Sharing</span>+ <a href="#call-start">+ <CallGraphic />+ <span>Calls in channels</span></a></nav><FeaturePageSection- id="call-context"- title="Call directly from a channel or DM."+ id="call-default"+ title="Recorded by default."description={- 'Start a browser-based call where your team is already talking.\nRecorded calls appear in the conversation’s Calls tab.'+ 'No bot to invite and no record button to forget.\nEvery call gets a recording, a transcript, and a summary.'}><div class="feature-page-visual">- <CallArchiveDemo animate />+ <CallDefaultDemo /></div><ProductProse><p>- Channel and DM call controls let you start a conversation in the- browser. Share a call link with someone outside your workspace so- they can join too. A processed recording has its own workspace- record with participants, a summary, and a transcript. Open previous- calls from the channel’s Calls tab.+ Granola, meeting bots, and the record button in Zoom all have the+ same problem: someone has to remember to use them, and then remember+ to share the notes. Usually nobody does, and the decision lives in+ three people’s heads. Macro flips it. Calls are recorded and+ transcribed by default and saved to the channel they started in. It+ feels a little strange at first. Then you stop losing decisions.</p></ProductProse></FeaturePageSection><FeaturePageSectionid="call-transcript"- title="A transcript tied to the recording."+ title="Knows who said what."description={- 'Read who said what, with timestamps for each segment.\nSelect a line to jump to that moment in the recording.'+ 'Each person’s audio is transcribed on its own, so every line has the right name on it.\nClick a line to jump to that moment in the recording.'}><div class="feature-page-visual">@@ -95,19 +136,20 @@ export function RouteCalls() {</div><ProductProse><p>- The transcript identifies speakers and timestamps their words. It- gives you a readable record and a direct route back to the audio.- Search call content through Macro, or ask an agent to read the- transcript. Summaries give you a quick overview; the original words- are there when you need the detail.+ When we first rolled out calls to our own team, the transcripts kept+ attributing things to the wrong person, and that’s worse than no+ transcript at all: your agents end up thinking Eric agreed to+ something Seamus said. So Macro transcribes each participant’s audio+ separately and keeps different voices apart. The transcript is lined+ up with the recording, so you can click any line and hear it.</p></ProductProse></FeaturePageSection><FeaturePageSectionid="call-followup"- title="Agents can use what was said."+ title="Summaries your agents can use."description={- 'Ask an agent to read the call and update a task or document.\nMeeting decisions become edits your team can review.'+ 'Every call gets a short summary of what was decided.\nAgents read it first, so they can act on the meeting without rereading an hour of transcript.'}><div class="feature-page-visual">@@ -115,69 +157,44 @@ export function RouteCalls() {</div><ProductProse><p>- Call-reading tools return the summary and transcript to the agent.- Task and document tools let it turn those details into a checklist,- a brief, or an updated task. Ask for a specific follow-up: record an- owner, add a dependency, or draft an email using the agreement from- the call. The agent works from the saved record.+ A transcript is a lot of words. The summary is what you and your+ agents actually want: what got decided, who owns what, and how it+ fits with everything else going on. Ask @Macro to update the task+ from this morning’s call and it reads the summary, pulls details+ from the transcript when it needs them, and makes the change.</p></ProductProse></FeaturePageSection><FeaturePageSection- id="call-sharing"- title="Share the recording and transcript."+ id="call-start"+ title="Start one from any channel."description={- 'Give a teammate access to the call record.\nThey can read the summary and replay the conversation.'+ 'Click Call in a channel or DM, like a Slack huddle.\nIt runs in the browser, so there’s nothing to install.'}><div class="feature-page-visual">- <CallSharingDemo />+ <CallStartDemo /></div><ProductProse><p>- Call records use Macro’s sharing system. Choose a recipient and- access level, or reference the record in a channel you can share- with. The recording, summary, and transcript are parts of that- record. Teammates and agents with access can revisit the discussion.+ We wanted the ease of a Slack huddle with the reliability of Google+ Meet. Click Call in any channel and everyone in it gets a+ notification. It works in the browser on any device, so nobody has+ to install anything five minutes before the meeting. Afterward, the+ recording, transcript, and summary live in the channel’s Calls tab.</p></ProductProse></FeaturePageSection><FeaturePageFaqid="calls-faq-title"- eyebrow="Recording and transcription"- title="How Macro Calls work."+ title="Questions about Macro Calls"introduction={<p>- Browser-based calls with transcripts, summaries, sharing, and agent- reading tools.+ Calls are the one place we made a strong default choice. Here’s how+ it works.</p>}- items={[- {- q: 'Can I start a call from a channel?',- a: 'Yes. Channels and direct conversations include call controls. The marketing previews do not start real calls or request microphone or camera access.',- },- {- q: 'What appears in a call record?',- a: 'The record can contain participants, a summary, a recording, and a transcript. Availability depends on the call and processing state.',- },- {- q: 'Can I return to a moment in the recording?',- a: 'When a recording and transcript are available, selecting a transcript segment seeks to its timestamp.',- },- {- q: 'Can agents read the transcript?',- a: 'Agents have a tool for reading accessible call records, including their summary and transcript. Ask them to find an agreement, update a task, or draft a follow-up from the transcript.',- },- {- q: 'How do I share a call record?',- a: 'Use the call record’s Share control to grant access. Recipients still need the appropriate permissions to open the record.',- },- {- q: 'Does this demo record me?',- a: 'No. It uses fictional local call data and contains no live audio or video connection.',- },- ]}+ items={callsFaq}/><HomepageClosing /></ProductPage>diff --git a/apps/marketing/src/features/marketing/views/ProductChannelsPage.tsx b/apps/marketing/src/features/marketing/views/ProductChannelsPage.tsxindex 66d5625e57..deba0380a5 100644--- a/apps/marketing/src/features/marketing/views/ProductChannelsPage.tsx+++ b/apps/marketing/src/features/marketing/views/ProductChannelsPage.tsx@@ -1,14 +1,14 @@import { setPageSeo } from '../../../app/utils/utilSeo';import {ChannelAgentDemo,- ChannelNavigationDemo,ChannelSharedWorkDemo,- ChannelTaskDemo,ChannelThreadDemo,+ ChatInboxDemo,} from '../components/channels/ChannelStories';import { FeaturePageFaq, FeaturePageSection } from '../components/FeaturePage';import { HomepageClosing } from '../components/HomepageClosing';import {+ ContextGraphic,LinkedWorkGraphic,ThreadGraphic,} from '../components/product/ProductGraphics';@@ -17,58 +17,55 @@ import {ProductPage,ProductProse,} from '../components/product/ProductPage';-import {- TaskAgentsGraphic,- TaskConversationGraphic,-} from '../components/tasks/TasksFeatureGraphics';+import { TaskAgentsGraphic } from '../components/tasks/TasksFeatureGraphics';import { WorkspaceDesktopDemo } from '../components/WorkspaceDesktopDemo';export function RouteChannels() {setPageSeo({title: 'Macro Chat — Team Chat Wired into Everything',description:- 'Macro Chat combines Slack-speed team chat with inline threads, @mention sharing, a unified inbox, and AI agents — all in one workspace with your email, docs, and tasks.',+ 'Team chat where @mentioning a doc shares it with the channel, messages wait in a real inbox until you’re done, threads stay readable, and agents can answer in the conversation.',path: '/channels',});return (<ProductPage><ProductHeroproduct="Chat"- title={['Team chat for humans', 'and agents.']}+ title={['Team chat, wired into', 'everything else.']}description={[- 'Messages, emails, and tasks in one inbox.',- '@mention a document to share it with the channel.',+ '@mention a doc, task, or email and the whole channel can open it.',+ 'Plus a real inbox, so nothing slips through.',]}cta="channels_hero_get_started"/><WorkspaceDesktopDemoview="messages"label="Explore Macro Chat"- caption="Open a thread, share a linked item, or reply. Everything here stays in the sample."+ caption="A sample workspace. Open a thread, click a linked doc, or send a message."/><nav class="feature-page-jump-links" aria-label="On this page"><a href="#shared-work"><LinkedWorkGraphic />- <span>Share the work</span>- </a>- <a href="#conversation-tasks">- <TaskConversationGraphic />- <span>Act on a request</span>+ <span>Share by mention</span></a>- <a href="#channel-agents">- <TaskAgentsGraphic />- <span>Bring in an agent</span>+ <a href="#chat-inbox">+ <ContextGraphic />+ <span>A real inbox</span></a><a href="#channel-threads"><ThreadGraphic />- <span>Keep the thread</span>+ <span>Inline threads</span>+ </a>+ <a href="#channel-agents">+ <TaskAgentsGraphic />+ <span>Agents in channels</span></a></nav><FeaturePageSectionid="shared-work"- title="@mention it. Share it."+ title="@mention it and it’s shared."description={- 'Mention a document, task, or email thread in a channel.\nTeammates can open the item directly from the message.'+ 'Mention a doc, task, or email thread and everyone in the channel can open it.\nJoin the channel and you have access. No access requests.'}><div class="feature-page-visual">@@ -76,58 +73,44 @@ export function RouteChannels() {</div><ProductProse><p>- Macro references are bidirectional. Mention a document in chat, and- the document links back to that conversation. When you have- permission to share the item, a channel mention grants access to the- channel. Shared email threads keep updating as new replies arrive.- </p>- </ProductProse>- </FeaturePageSection>- <FeaturePageSection- id="conversation-tasks"- title="Create a task from a message."- description={- 'Turn a request into a task with a description, owner, and priority.\nThe task links back to the message that created it.'- }- >- <div class="feature-page-visual">- <ChannelTaskDemo />- </div>- <ProductProse>- <p>- Create a task from a channel message or ask an agent to do it. The- source remains linked, so the assignee can read the original request- and replies. Mention the task in another conversation and its- current status appears in the reference. Open it to update the- brief, assign someone, or comment.+ Channels are already where your company runs, whether that’s Slack+ or a group text. The problem is everything else lives somewhere+ else. In Macro, anything you @mention in a channel is shared with+ the people in it, so you never spend the afternoon approving access+ requests. New hires join #launch and can open everything that’s been+ linked there. Links go both ways, too: the doc shows every+ conversation it came up in, and any message can become a task with+ one click.</p></ProductProse></FeaturePageSection><FeaturePageSection- id="channel-agents"- title="Agents are channel participants."+ id="chat-inbox"+ title="Chat with an actual inbox."description={- 'Ask an agent in the conversation where the decision happened.\nIt can read messages, open references, and update the work.'+ 'Messages land in Home next to your email and tasks. Press E when you’re done.\nAnything you haven’t dealt with stays put, so you can leave it for later.'}><div class="feature-page-visual">- <ChannelAgentDemo />+ <ChatInboxDemo /></div><ProductProse><p>- Agents can participate in channels and DMs. @mention an agent with a- question or instruction and give it the relevant documents, tasks,- or emails. Workspace tools let it search for an answer, edit a- document, create a task, or prepare an email. Your team can read the- request and continue the conversation.+ Slack only knows read and unread. Once you’ve glanced at a message,+ it’s gone, and you have to remember to come back to it. Macro treats+ chat like email: mentions, threads you’re in, and DMs land in Home+ next to your email, tasks, and pull requests. Reading something+ doesn’t clear it. Marking it done does. You can answer things when+ you’re ready instead of the second they arrive, and without the+ low-grade anxiety of a dozen unread badges.</p></ProductProse></FeaturePageSection><FeaturePageSectionid="channel-threads"- title="Replies stay inline."+ title="Threads you can actually follow."description={- 'Expand a thread under its original message.\nRead and reply while the rest of the channel stays visible.'+ 'The first replies show right under the message.\nNo side panel, and no hunting for the reply someone said they left.'}><div class="feature-page-visual">@@ -135,52 +118,60 @@ export function RouteChannels() {</div><ProductProse><p>- Threads expand in the message flow, with curved rails connecting- replies to their parent. Questions, answers, reactions, and linked- work stay readable in order. Collapse a thread when you’re finished.- The main conversation stays in view while you catch up or write a- reply.+ We tried every way of doing threads. Slack’s side panel keeps the+ channel tidy but hides the conversation. iMessage and Discord are+ fine for banter and painful for anything technical. Reddit-style+ nesting turns into a forum. We landed on showing the first few+ replies inline, connected to the message they answer, with a pill+ for the rest. It’s the happy medium that’s worked best for our own+ team.</p></ProductProse></FeaturePageSection><FeaturePageSection- id="channel-navigation"- title="Chat with an actual inbox."+ id="channel-agents"+ title="Agents are in the channel too."description={- 'Channel messages and DMs arrive alongside emails, tasks, and agent responses.\nMark an item done when you’ve dealt with it.'+ '@mention Macro, Claude, or Cursor like anyone else.\nThey read the conversation, and their answers stay where the team can see them.'}><div class="feature-page-visual">- <ChannelNavigationDemo />+ <ChannelAgentDemo /></div><ProductProse><p>- Read and done are separate states. Opening a message marks it read;- marking it done clears it from your inbox. Leave it there when it- still needs a response. Use Signal and Noise to prioritize- conversations, and Recent to return to channels and DMs. The- Attachments tab collects the items shared in each conversation.+ Asking an agent in the channel beats pasting the conversation into+ ChatGPT. It already has the thread and everything linked in it, so+ you don’t have to explain. Ask @Macro to catch you up, turn a+ discussion into tasks, or draft the customer email. Hand a bug to+ Claude or Cursor and they come back with a pull request. Either way,+ the answer lands in the channel, so the rest of the team knows what+ happened.</p></ProductProse></FeaturePageSection><FeaturePageFaqid="channels-faq-title"- eyebrow="Channels, threads, and sharing"- title="How Macro Chat works."+ title="Questions about Macro Chat"introduction={<p>- An inbox for conversations, inline replies, and channel access for- shared work.+ If your team lives in Slack, most of this will feel familiar. Here’s+ what’s different.</p>}items={[{- q: 'Can I share documents and email in a channel?',+ q: 'How is this different from Slack?',+ a: 'Three things. Anything you @mention in a channel is shared with it, so there are no access requests. Messages wait in a real inbox you can clear, instead of a wall of unread badges. And channels are connected to your docs, tasks, email, and calls, so the conversation and the work stay together.',+ },+ {+ q: 'Can I share docs and email in a channel?',a: (<>- Yes. Share or mention a workspace item so teammates can open it- from the conversation. Access still follows the item’s sharing- permissions. See <a href="/email">email sharing</a>.+ Yes. @mention a doc or task, or share an email thread from your+ inbox. Everyone in the channel can open it, and shared email+ threads keep updating when new replies come in. See{' '}+ <a href="/email">email sharing</a>.</>),},@@ -188,29 +179,27 @@ export function RouteChannels() {q: 'Can a message become a task?',a: (<>- Yes. Create a task from the message and retain the source- conversation. The assignee can work in{' '}- <a href="/tasks">the task view</a>.+ Yes. Hover the message and click Task, or ask @Macro to make+ tasks for you. See <a href="/tasks">Macro Tasks</a>.</>),},{- q: 'Where do replies appear?',- a: 'Replies stay under their original message. Expand the thread to follow the discussion and reply in place.',+ q: 'Can I quiet a noisy channel?',+ a: 'Yes. Mute or snooze notifications for any channel from its menu.',},{- q: 'Can agents use a channel’s context?',+ q: 'Which agents can I mention?',a: (<>- Yes. Give an agent a clear question or job with the relevant- workspace context. See <a href="/agents">agents in Macro</a> for- concrete examples.+ Macro’s own agent, plus coding agents like Claude and Cursor.+ See <a href="/agents">agents in Macro</a>.</>),},{q: 'Will these examples post to my account?',- a: 'No. These demos use fictional local data. Messages, edits, and task creation never reach your account.',+ a: 'No. Everything on this page is a local sample. Nothing you type here leaves your browser.',},{q: 'Is there a free plan?',diff --git a/apps/marketing/src/features/marketing/views/ProductDocumentsPage.tsx b/apps/marketing/src/features/marketing/views/ProductDocumentsPage.tsxindex c645feb11c..9d273d8331 100644--- a/apps/marketing/src/features/marketing/views/ProductDocumentsPage.tsx+++ b/apps/marketing/src/features/marketing/views/ProductDocumentsPage.tsx@@ -1,9 +1,8 @@import { setPageSeo } from '../../../app/utils/utilSeo';import {DocumentAgentDemo,- DocumentDiscussionDemo,- DocumentEditingDemo,- DocumentLinkedTaskDemo,+ DocumentMentionsDemo,+ DocumentOfflineDemo,DocumentSharingDemo,} from '../components/documents/DocumentStories';import { FeaturePageFaq, FeaturePageSection } from '../components/FeaturePage';@@ -21,21 +20,59 @@ import {} from '../components/product/ProductPage';import { WorkspaceDesktopDemo } from '../components/WorkspaceDesktopDemo';+const documentsFaq = [+ {+ q: 'How is this different from Notion?',+ a: 'Notion is a blank canvas: everything is a page or a database, and you build your own CRM or task tracker out of them. We took the opposite approach. Macro has dedicated tools for email, tasks, chat, and CRM, and docs are just docs. They’re also fast, work offline, merge edits without conflicts, and agents can edit them live.',+ },+ {+ q: 'Can an agent edit my doc directly?',+ a: (+ <>+ Yes. Agents edit native Macro docs in place, with their own cursor, even+ when the doc is closed. PDFs and other uploads can be read, but not+ edited. See <a href="/agents">agents in Macro</a>.+ </>+ ),+ },+ {+ q: 'Can I edit offline?',+ a: 'Yes. Edits save on your device and sync when you reconnect. If someone else changed the doc in the meantime, both sets of edits merge.',+ },+ {+ q: 'What can I @mention?',+ a: 'People, docs, tasks, channels, emails, customers, and dates. Mentions of docs, tasks, and emails link both ways, so the other item lists the doc in its References.',+ },+ {+ q: 'Who can see my doc?',+ a: 'Anyone you share it with, plus everyone in a channel where it’s been mentioned. You can set edit, comment, or view access per person.',+ },+ {+ q: 'Does open source make my documents public?',+ a: (+ <>+ No. Our code is public. Your docs aren’t. See the{' '}+ <a href="/privacy">Privacy Policy</a>.+ </>+ ),+ },+];+export function RouteDocuments() {setPageSeo({title: 'Macro Docs — Markdown Documents, Wired Into Everything',description:- 'Markdown documents built on CRDTs, with offline editing, automatic sync, live agent edits, and bidirectional links to tasks, email, and chat.',+ 'Markdown docs with live agent edits, offline editing that merges cleanly, and @mentions that link to everything in your company.',path: '/documents',});return (<ProductPage><ProductHeroproduct="Docs"- title={['Markdown docs with', 'live agent edits.']}+ title={['Docs your agents', 'can actually edit.']}description={[- 'Local-first. Built on CRDTs.',- 'Write offline. Sync when you’re back.',+ 'Agents type into the live doc with you, cursor and all.',+ 'It’s fast, works offline, and @mentions reach everything in your company.',]}cta="documents_hero_get_started"/>@@ -43,52 +80,31 @@ export function RouteDocuments() {view="documents"initialDocument="plan"label="Explore Macro Docs"- caption="Edit the launch plan, leave a comment, or share it in the sample workspace."+ caption="A sample workspace. Edit the launch plan, leave a comment, or share it."/><nav class="feature-page-jump-links" aria-label="On this page">- <a href="#document-editor">+ <a href="#document-agents"><EditingGraphic />- <span>CRDT editing</span>+ <span>Live agent edits</span></a>- <a href="#document-agents">+ <a href="#document-offline"><ContextGraphic />- <span>Ask for an edit</span>- </a>- <a href="#document-discussion">- <ThreadGraphic />- <span>Comments</span>+ <span>Offline editing</span></a><a href="#document-links"><LinkedWorkGraphic />- <span>Bidirectional links</span>+ <span>@mention anything</span>+ </a>+ <a href="#document-sharing">+ <ThreadGraphic />+ <span>Share by mention</span></a></nav>- <FeaturePageSection- id="document-editor"- title="Built on CRDTs. Ready offline."- description={- 'Edits apply locally as you type.\nConcurrent changes merge automatically when you reconnect.'- }- >- <div class="feature-page-visual">- <DocumentEditingDemo />- </div>- <ProductProse>- <p>- Macro documents use CRDTs: data structures that merge concurrent- edits. Your changes are saved locally, and the sync service combines- them with changes from other editors when you reconnect. The editor- supports Markdown, headings, lists, and rich @mentions. Local- snapshots and an edit log let you keep writing through a dropped- connection.- </p>- </ProductProse>- </FeaturePageSection><FeaturePageSectionid="document-agents"- title="Agents edit the live document."+ title="Agents with a live cursor."description={- 'Ask for a rewrite, a checklist, or a structural change.\nWatch the edit appear in the document you’re already writing.'+ 'Ask for a rewrite and watch Claude make it, right in the doc you have open.\nKeep typing. Your edits and the agent’s merge as you go.'}><div class="feature-page-visual">@@ -96,58 +112,63 @@ export function RouteDocuments() {</div><ProductProse><p>- Agents use the document’s collaboration system to apply edits- directly. You can write alongside them and continue editing the- result. Ask Claude to shorten a section, turn meeting notes into a- brief, or restructure a draft. The agent reads the document and- changes its text and formatting in place.+ Most AI editors hand you a diff or a new version of the file. That’s+ fine for code and annoying for a doc three people are working in. In+ Macro, agents join the document like a teammate, with their own+ cursor. You can watch the edit happen, keep writing somewhere else+ in the doc, and change anything you don’t like. It works when the+ doc is closed, too: ask from a channel, and the edit is there when+ you open it.</p></ProductProse></FeaturePageSection><FeaturePageSection- id="document-discussion"- title="Comments belong to the document."+ id="document-offline"+ title="Offline? Keep writing."description={- 'Ask a question, mention a teammate, and reply in the document’s discussion.\nThe conversation is available to the next editor and to your agents.'+ 'Every doc is one CRDT, so edits from different people merge instead of overwriting.\nLose your connection and keep typing. It syncs when you’re back.'}><div class="feature-page-visual">- <DocumentDiscussionDemo />+ <DocumentOfflineDemo /></div><ProductProse><p>- Each document has its own discussion. Teammates can leave feedback,- reply, and @mention the people responsible for a decision. Agents- can read the discussion as well as the draft. Ask for an edit based- on the feedback your team has already given.+ Notion syncs block by block, so when two people edit the same+ paragraph, the last save wins. Macro stores the whole document as a+ CRDT, a data structure built for merging edits from many people at+ once. Changes save on your device first, then sync to your team.+ Write the whole draft on a plane and it merges cleanly when you+ land.</p></ProductProse></FeaturePageSection><FeaturePageSectionid="document-links"- title="@mentions link in both directions."+ title="@mention anything in your company."description={- 'Mention a task, email, call, or channel inside a document.\nOpen the reference, or follow its backlink to the document.'+ 'People, docs, tasks, channels, emails, and customers.\nMentions link both ways, so the doc knows where it’s referenced too.'}><div class="feature-page-visual">- <DocumentLinkedTaskDemo />+ <DocumentMentionsDemo /></div><ProductProse><p>- A Macro @mention is a reference to a real workspace item. It shows- up in the document and in the referenced item’s backlinks, so you- can navigate in either direction. Link a task to its specification,- a customer to a proposal, or a call to its meeting notes. People and- agents can follow those references to read the source.+ Notion lets you mention other Notion pages. Macro lets you mention+ the stuff your company actually runs on: the customer email, the+ task, the #support thread, the customer record. Mentions of docs,+ tasks, and emails show up in their References, so from a task you+ can see every doc that cites it. Agents follow the same links, which+ is a big part of why they know what you’re talking about.</p></ProductProse></FeaturePageSection><FeaturePageSectionid="document-sharing"- title="Share through your channels."+ title="Share it by mentioning it."description={- 'Mention a document in a channel to share it with that team.\nOr choose individual edit, comment, and view access.'+ '@mention a doc in a channel and everyone in the channel can open it.\nNo access requests, no link settings to get wrong.'}><div class="feature-page-visual">@@ -155,69 +176,23 @@ export function RouteDocuments() {</div><ProductProse><p>- When you have permission to share a document, mentioning it in a- channel grants access to that channel. Membership determines who can- open the shared work. Use Share for individual recipients and access- levels. The document stays live: edits sync to everyone who has- access.+ When you mention a doc in a channel, the channel gets access,+ including people who join later. You can still share with+ individuals and pick edit, comment, or view access. Most of the time+ you won’t need to.</p></ProductProse></FeaturePageSection><FeaturePageFaqid="documents-faq-title"- eyebrow="Under the hood"- title="Markdown, CRDTs, and agents."+ title="Questions about Macro Docs"introduction={<p>- A local-first editor with concurrent editing, rich references, and- direct agent edits.+ If you’re coming from Notion or Google Docs, the editor will feel+ familiar. Here’s what’s different.</p>}- items={[- {- q: 'What kind of documents can I edit?',- a: 'Native Macro documents use Markdown and a collaborative editor. They support familiar headings, lists, links, and rich references to workspace items.',- },- {- q: 'Can an agent edit the document directly?',- a: (- <>- Yes. Agents can apply specific edits to native Markdown- documents. Uploaded files such as PDFs are readable context, but- are not the same editable document type. See{' '}- <a href="/agents">agents in Macro</a>.- </>- ),- },- {- q: 'Can I link tasks and conversations?',- a: (- <>- Yes. Mention workspace items in a document so people can open- the related <a href="/tasks">task</a> or{' '}- <a href="/channels">conversation</a>.- </>- ),- },- {- q: 'Can I choose who can edit?',- a: 'Yes. The Share form lets you choose recipients and access levels. When you have permission to share, a channel @mention can grant access to that channel.',- },- {- q: 'Can I edit offline?',- a: 'Yes. Native documents save edits locally. CRDT sync merges those edits with concurrent changes from other editors when you reconnect.',- },- {- q: 'Does open source make my documents public?',- a: (- <>- No. The application code is open source; document access follows- its sharing permissions. See the{' '}- <a href="/privacy">Privacy Policy</a>.- </>- ),- },- ]}+ items={documentsFaq}/><HomepageClosing /></ProductPage>diff --git a/apps/marketing/src/features/marketing/views/ProductReviewsPage.tsx b/apps/marketing/src/features/marketing/views/ProductReviewsPage.tsxindex a9484b0a91..f6841ce5de 100644--- a/apps/marketing/src/features/marketing/views/ProductReviewsPage.tsx+++ b/apps/marketing/src/features/marketing/views/ProductReviewsPage.tsx@@ -1,9 +1,11 @@+import { lazy } from 'solid-js';import { setPageSeo } from '../../../app/utils/utilSeo';+import { DeferredDemo, DemoPlaceholder } from '../components/DeferredDemo';import { FeaturePageFaq, FeaturePageSection } from '../components/FeaturePage';import { HomepageClosing } from '../components/HomepageClosing';import {ContextGraphic,- DiffGraphic,+ EditingGraphic,LinkedWorkGraphic,ThreadGraphic,} from '../components/product/ProductGraphics';@@ -13,188 +15,197 @@ import {ProductProse,} from '../components/product/ProductPage';import {- ReviewAgentDemo,- ReviewDiffDemo,- ReviewDiscussionDemo,- ReviewLinkedTaskDemo,- ReviewQueueDemo,+ GithubHomeHero,+ PrLinkDemo,+ ReviewInboxDemo,} from '../components/reviews/ReviewStories';+import { TaskGithubDemo } from '../components/tasks/TaskStories';import { WorkspaceDesktopDemo } from '../components/WorkspaceDesktopDemo';+const loadPullRequest = () => import('../components/HomepagePullRequest');+const HomepagePullRequest = lazy(loadPullRequest);++const githubFaq = [+ {+ q: 'Is this a GitHub replacement?',+ a: 'No. Your code, reviews, and CI stay on GitHub. Macro brings the parts your team talks about into the workspace: notifications, PR status, and the link between a pull request and its task.',+ },+ {+ q: 'What shows up in my inbox?',+ a: 'Review requests, comments and reviews on your pull requests, mentions, and status changes on PRs you’re part of.',+ },+ {+ q: 'How do pull requests link to tasks?',+ a: (+ <>+ Put the task ID in the branch name, PR title, or PR description. Macro+ links them and moves the task as the PR opens, merges, or closes. More+ on <a href="/tasks">tasks in Macro</a>.+ </>+ ),+ },+ {+ q: 'Can I review code in Macro?',+ a: 'You can read the PR description and the review discussion in Macro. For the diff and approvals, Open on GitHub takes you there.',+ },+ {+ q: 'Which coding agents work with Macro?',+ a: (+ <>+ You can mention Cursor, Claude Code, and Codex in channels, and connect+ any MCP client to your workspace. See{' '}+ <a href="/agents">agents in Macro</a>.+ </>+ ),+ },+ {+ q: 'Is there a free plan?',+ a: (+ <>+ Yes. See <a href="/pricing">pricing</a> for current limits.+ </>+ ),+ },+];+export function RouteGithub() {setPageSeo({title: 'Macro Reviews — Review PRs in Your Inbox',description:- 'Find pull requests, read GitHub discussion, inspect agent changes, and connect code review to the task behind the work.',+ 'Review requests and PR comments land in your Macro inbox, GitHub links show live status, and tasks update themselves when pull requests open and merge.',path: '/github',});return (<ProductPage><ProductHero- product="Reviews"- title={['GitHub pull requests', 'in your inbox.']}+ product="for GitHub"+ title={['GitHub, wired into', 'your workspace.']}description={[- 'Review comments, mentions, and linked tasks.',- 'Follow the code from request to merge.',+ 'Review requests and PR comments land in your inbox.',+ 'Link a PR to a task and it updates itself.',]}cta="github_hero_get_started"/><WorkspaceDesktopDemo- view="tasks"- label="Explore Macro Reviews"- caption="Find a pull request and open its details. This interactive example uses fictional reviews."+ view="home"+ label="Explore GitHub in Macro"+ caption="A sample inbox. Open a review request to read the PR.">- <ReviewQueueDemo />+ <GithubHomeHero /></WorkspaceDesktopDemo><nav class="feature-page-jump-links" aria-label="On this page">- <a href="#review-queue">- <LinkedWorkGraphic />- <span>Find your review</span>- </a>- <a href="#review-diff">- <DiffGraphic />- <span>Inspect the change</span>- </a>- <a href="#review-discussion">+ <a href="#review-inbox"><ThreadGraphic />- <span>Read the discussion</span>+ <span>Reviews in your inbox</span></a>- <a href="#review-agent">+ <a href="#pr-links"><ContextGraphic />- <span>Ask a precise question</span>+ <span>Live PR links</span>+ </a>+ <a href="#pr-tasks">+ <LinkedWorkGraphic />+ <span>Linked to tasks</span>+ </a>+ <a href="#coding-agents">+ <EditingGraphic />+ <span>Coding agents</span></a></nav><FeaturePageSection- id="review-queue"- title="Your GitHub review queue, in Macro."+ id="review-inbox"+ title="Never miss a review."description={- 'Find pull requests you authored, commented on, or were mentioned in.\nOpen their descriptions, repositories, and review discussion.'+ 'Review requests, comments, and mentions on your pull requests land in Home.\nRight next to your messages, tasks, and email.'}><div class="feature-page-visual">- <ReviewQueueDemo animate />+ <ReviewInboxDemo /></div><ProductProse><p>- GitHub events bring pull requests into Macro. Involving me collects- the reviews you participate in, alongside the rest of your work.- Each pull request retains its author, repository, description, and- status. Search by title or open the GitHub link for repository- actions.+ GitHub notifications are easy to ignore, which is how a PR sits for+ two days waiting on a one-line review. Macro puts review requests,+ comments on your PRs, and mentions in the same inbox as everything+ else, so code review isn’t one more place to check. Press E when+ you’re done, same as everything else.</p></ProductProse></FeaturePageSection><FeaturePageSection- id="review-diff"- title="Read the agent’s diff."+ id="pr-links"+ title="Paste a PR, see its status."description={- 'Open Changes in an agent session to inspect its file edits.\nAdded and removed lines show exactly what it proposes.'+ 'Pull request links turn into pills in docs and messages.\nHover one to see checks, comments, and the size of the change.'}><div class="feature-page-visual">- <ReviewDiffDemo />+ <PrLinkDemo /></div><ProductProse><p>- Coding agent sessions expose proposed file changes in a diff. You- can inspect the implementation alongside the prompt and the agent’s- explanation. A linked pull request opens the GitHub review record.- Its discussion is available in Macro, with a link to GitHub for the- repository diff.+ Paste a pull request into a channel or a doc and Macro shows it with+ its status: open, merged, or closed. Hover it for the repo, the+ title, the line counts, and whether checks passed. No more “is this+ merged yet?” in the channel.</p></ProductProse></FeaturePageSection><FeaturePageSection- id="review-discussion"- title="GitHub comments, with file and line references."+ id="pr-tasks"+ title="Tasks and PRs, linked both ways."description={- 'Read review comments and replies inside the pull request.\nFilter bot messages when you want to focus on the human discussion.'+ 'Put the task ID in a branch or PR title and the PR shows up on the task.\nOpening it moves the task to In Review. Merging it marks it done.'}><div class="feature-page-visual">- <ReviewDiscussionDemo />+ <TaskGithubDemo /></div><ProductProse><p>- Macro imports GitHub discussion, including review threads and author- replies. File and line references show which part of the code a- comment concerns. Comments and mentions appear with the pull request- in your workspace. You can follow the review while reading the task- that prompted the change.+ This is the part our engineers like most. The task shows its pull+ request, the pull request links back to the task, and nobody updates+ status by hand. Opening the PR moves the task to In Review, merging+ marks it Completed, and closing it without merging puts it back in+ Not Started.</p></ProductProse></FeaturePageSection><FeaturePageSection- id="review-agent"- title="Ask the coding agent about its change."+ id="coding-agents"+ title="Coding agents in your channels."description={- 'Question a retry condition, a dependency, or a behavior in the diff.\nThe agent can explain the implementation using the code in its session.'+ 'Hand a bug to Cursor or Claude Code right from the conversation.\nThe agent works on the branch and comes back with a pull request.'}>- <div class="feature-page-visual">- <ReviewAgentDemo />+ {/* dummy-workspace opts the homepage demo's controls out of the+ site-wide button font, as on the homepage. */}+ <div class="feature-page-visual review-agent-demo dummy-workspace">+ <DeferredDemo+ preload={loadPullRequest}+ fallback={<DemoPlaceholder label="Agent session preview" />}+ >+ <HomepagePullRequest />+ </DeferredDemo></div><ProductProse><p>- The coding session contains the request, proposed changes, and agent- conversation. Ask about a specific file or branch of the- implementation and inspect its answer against the diff. Use your- review to decide the next step: request a revision, run a check, or- open the pull request on GitHub.- </p>- </ProductProse>- </FeaturePageSection>- <FeaturePageSection- id="review-task"- title="Task status follows the pull request."- description={- 'Link a task to the code change that implements it.\nOpening the pull request moves it into review; merging completes it.'- }- >- <div class="feature-page-visual">- <ReviewLinkedTaskDemo />- </div>- <ProductProse>- <p>- GitHub events update linked tasks. A new pull request sets In- Review, and a merge sets Completed. The task keeps its brief, owner,- and discussion. Open the pull request from the task, or follow the- reference back to the request behind the code.+ Most bugs start as a message. In Macro, you can @mention Cursor or+ Claude Code in that same thread and hand it off. The agent works on+ the branch, reports back in the channel, and the PR shows up linked+ to the task, ready for review.</p></ProductProse></FeaturePageSection><FeaturePageFaq- id="reviews-faq"- eyebrow="GitHub events and linked work"- title="How Reviews works."+ id="github-faq"+ title="Questions about Macro and GitHub"introduction={<p>- Pull requests and review discussion in Macro, with task updates- driven by GitHub events.+ Your code and CI stay on GitHub. Macro handles the parts your team+ talks about.</p>}- items={[- {- q: 'What does Reviews show?',- a: 'Pull requests with their description, author, repository, status, changes, GitHub discussion, and available check information.',- },- {- q: 'Where can I inspect the diff?',- a: 'Agent sessions show proposed file changes in their Changes surface. The pull-request view links to GitHub for the repository diff and repository actions.',- },- {- q: 'Can I read GitHub comments in Macro?',- a: 'Yes. GitHub discussion is imported into the pull-request view, including review comments and replies.',- },- {- q: 'How do pull requests relate to tasks?',- a: 'Linked pull-request events can move a task into review and complete it when the pull request is merged.',- },- {- q: 'Do these examples use a real repository?',- a: 'No. They use fictional local data and do not run checks, post comments, or merge changes.',- },- ]}+ items={githubFaq}/><HomepageClosing /></ProductPage>diff --git a/apps/marketing/src/features/marketing/views/agents-page.css b/apps/marketing/src/features/marketing/views/agents-page.cssindex 81870450a8..a43bfbfa47 100644--- a/apps/marketing/src/features/marketing/views/agents-page.css+++ b/apps/marketing/src/features/marketing/views/agents-page.css@@ -30,11 +30,16 @@height: 28px;}-.agents-page-providers li:first-child svg {+.agents-page-providers li[data-agent='Hermes'] svg {width: 18px;height: 36px;}+/* The MCP settings window sits under the provider row. */+.agents-page-mcp {+ margin-top: 8px;+}+@media (max-width: 699px) {.agents-page-providers {width: 100%;