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
feat(video-tutorials): add a Watch tutorial entry to every block (#9549)
Jacob Beckerman2657ec8ef9d9
diff --git a/apps/web/src/components/list/ListViewport.tsx b/apps/web/src/components/list/ListViewport.tsxindex 7d5416598e..5f915d8930 100644--- a/apps/web/src/components/list/ListViewport.tsx+++ b/apps/web/src/components/list/ListViewport.tsx@@ -1,3 +1,4 @@+import { createElementSize } from '@solid-primitives/resize-observer';import { createSignal, type JSX, Suspense } from 'solid-js';import type { VirtualizerHandle } from 'virtua/solid';import { StickyVirtualizer } from './StickyVirtualizer';@@ -10,9 +11,13 @@ export function ListViewport<T>(props: {viewportRef?: (element: HTMLDivElement) => void;onScroll?: () => void;isSticky?: (item: T) => boolean;+ /** Scrolls above the rows, outside them, so list focus skips it. */+ start?: JSX.Element;children: (item: T) => JSX.Element;}) {const [viewport, setViewport] = createSignal<HTMLDivElement>();+ const [start, setStart] = createSignal<HTMLDivElement>();+ const startSize = createElementSize(start);return (<divref={(element) => {@@ -21,12 +26,14 @@ export function ListViewport<T>(props: {}}class="min-h-0 flex-1 overflow-auto overscroll-none">+ <div ref={setStart}>{props.start}</div><Suspense><StickyVirtualizerref={props.ref}data={props.items}isSticky={props.isSticky}scrollRef={viewport()}+ startMargin={startSize.height ?? 0}bufferSize={240}itemSize={44}keepMounted={diff --git a/apps/web/src/components/list/README.md b/apps/web/src/components/list/README.mdindex 3a3c794ce8..ca01978b31 100644--- a/apps/web/src/components/list/README.md+++ b/apps/web/src/components/list/README.md@@ -72,6 +72,8 @@ mounted, pins the real header with an opaque backing, and pushes it away at thenext group. Header selection uses measured offsets rather than fixed row heights.The exposed scroll handle keeps keyboard targets below the destination header;`stickyInset` reserves persistent chrome separately from `startMargin`.+`ListViewport.start` scrolls above the rows (a block's tutorial row) and+becomes their `startMargin`, so list focus and sticky headers skip it.### Boundary paginationdiff --git a/apps/web/src/features/agents-view/views/AgentsView.test.tsx b/apps/web/src/features/agents-view/views/AgentsView.test.tsxindex 97be461a39..2c262aabdd 100644--- a/apps/web/src/features/agents-view/views/AgentsView.test.tsx+++ b/apps/web/src/features/agents-view/views/AgentsView.test.tsx@@ -35,6 +35,7 @@ vi.mock('@app/features/soup/entity-notifications', () => ({withEntityNotifications: (entity: unknown) => entity,}));vi.mock('@app/features/tours/ViewTour', () => ({ ViewTour: () => null }));+vi.mock('@app/features/video-tutorials', () => ({ TutorialPill: () => null }));vi.mock('@app/lib/analytics/posthog', () => ({useFeatureFlag: () => () => ({ enabled: false, loading: false }),}));diff --git a/apps/web/src/features/agents-view/views/AgentsView.tsx b/apps/web/src/features/agents-view/views/AgentsView.tsxindex eac9f1d11d..0fda728cf0 100644--- a/apps/web/src/features/agents-view/views/AgentsView.tsx+++ b/apps/web/src/features/agents-view/views/AgentsView.tsx@@ -4,6 +4,7 @@ import { AgentSettings } from '@app/features/settings/AgentSettings';import { IntegrationsPage } from '@app/features/settings/IntegrationsPage';import { withEntityNotifications } from '@app/features/soup/entity-notifications';import { ViewTour } from '@app/features/tours/ViewTour';+import { TutorialPill } from '@app/features/video-tutorials';import {useGlobalBlockOrchestrator,useGlobalNotificationSource,@@ -488,6 +489,12 @@ function AgentsWorkspace(props: { route?: AgentsRoute }) {availabilityLoading={rosterSource.availabilityLoading()}onStart={startConversation}onOpenRoster={openRoster}+ belowComposer={+ <TutorialPill+ tutorial="agents"+ class="self-center"+ />+ }/></div></Suspense>diff --git a/apps/web/src/features/agents-view/views/NewChatPage.tsx b/apps/web/src/features/agents-view/views/NewChatPage.tsxindex 9b0803b2a4..755e59f87b 100644--- a/apps/web/src/features/agents-view/views/NewChatPage.tsx+++ b/apps/web/src/features/agents-view/views/NewChatPage.tsx@@ -31,7 +31,7 @@ import { useAiBillingSummaryQuery } from '@queries/auth/ai-billing';import type { PromptAttachment } from '@service-agent-harness/generated/schemas';import { Tabs } from '@ui';import { tourTarget } from '@ui/components/Tour';-import { createMemo, createSignal, Show } from 'solid-js';+import { createMemo, createSignal, type JSX, Show } from 'solid-js';import { AgentUpdatesStack } from '../../agent-updates/views/AgentUpdatesStack';import { EffortSelector } from '../../block-agent/component/EffortSelector';import {@@ -108,6 +108,8 @@ export function NewChatPage(props: {updateSessions?: readonly AgentSessionEntity[];onOpenUpdateSession?: (sessionId: string) => void;showUpdates?: boolean;+ /** Centered under the composer, such as the Agents tutorial pill. */+ belowComposer?: JSX.Element;}) {const userId = useUserId();const billing = useAiBillingSummaryQuery();@@ -605,6 +607,7 @@ export function NewChatPage(props: {{composer()}</div></FloatRegionOrInline>+ {props.belowComposer}<Showwhen={props.showUpdates &&diff --git a/apps/web/src/features/calendar-view/components/CalendarSidebar.tsx b/apps/web/src/features/calendar-view/components/CalendarSidebar.tsxindex 91aaf4fd72..3ee56154e9 100644--- a/apps/web/src/features/calendar-view/components/CalendarSidebar.tsx+++ b/apps/web/src/features/calendar-view/components/CalendarSidebar.tsx@@ -16,7 +16,9 @@ import {} from '@app/features/calendar/hooks/use-team-ooo';import { TEAM_OOO_SOURCE_ID } from '@app/features/calendar/types';import { CalendarSchedulingActions } from '@app/features/scheduling/calendar-actions';+import { TutorialSidebarItem } from '@app/features/video-tutorials';import { ShowFeatureFlag } from '@app/lib/analytics/posthog';+import { t } from '@app/lib/i18n';import { UserIcon } from '@core/component/UserIcon';import { enableCalendarTeamOoo } from '@core/constant/featureFlags';import { isTouchDevice } from '@core/mobile/isTouchDevice';@@ -377,6 +379,12 @@ export function CalendarSidebar() {</CalendarCreateMenu></ViewSidebar.Primary><ViewSidebar.Content class="pt-2">+ <ViewSidebar.Nav+ aria-label={t('tutorials.watchTutorial')}+ class="empty:hidden"+ >+ <TutorialSidebarItem tutorial="calendar" />+ </ViewSidebar.Nav><CalendarMiniCalendar /><Show when={shell.breakpoints.narrow?.()}><CalendarSchedulingActions sidebar />diff --git a/apps/web/src/features/calls-view/views/calls-view.tsx b/apps/web/src/features/calls-view/views/calls-view.tsxindex b2811b3294..6a8e468c7a 100644--- a/apps/web/src/features/calls-view/views/calls-view.tsx+++ b/apps/web/src/features/calls-view/views/calls-view.tsx@@ -4,6 +4,7 @@ import { SoupRowMetadataProvider } from '@app/features/next-soup/soup-view/soup-import { SoupView } from '@app/features/next-soup/soup-view/soup-view';import { callsTour } from '@app/features/next-soup/tour';import { ViewTour } from '@app/features/tours/ViewTour';+import { TutorialRow } from '@app/features/video-tutorials';import {SplitRouter,useNavigate,@@ -50,6 +51,7 @@ export function CallsView() {initialGroupBy={preset?.groupBy}tour={<ViewTour tour={callsTour} />}header={header}+ listStart={<TutorialRow tutorial="calls" />}renderContent={(list) => <SplitRouter.Outlet fallback={list} />}/>);diff --git a/apps/web/src/features/channels-view/channels-view.tsx b/apps/web/src/features/channels-view/channels-view.tsxindex 1edbd18972..f0d1aedd62 100644--- a/apps/web/src/features/channels-view/channels-view.tsx+++ b/apps/web/src/features/channels-view/channels-view.tsx@@ -4,6 +4,7 @@ import { markChannelNotificationsSeenOnOpen } from '@app/features/next-soup/utilimport { MaybeSoupEntityActionDrawerManager } from '@app/features/soup';import { withEntityNotifications } from '@app/features/soup/entity-notifications';import { ViewTour } from '@app/features/tours/ViewTour';+import { TutorialPill } from '@app/features/video-tutorials';import { SplitRouter } from '@app/lib/split-router';import { usePending } from '@app/observability/flow';import { ChannelLoading } from '@channel/Channel/ChannelLoading';@@ -262,6 +263,10 @@ function ChannelsViewRoot() {Choose a channel or person from thesidebar to open the conversation here.</p>+ <TutorialPill+ tutorial="chat"+ class="mt-3 self-center"+ /></div></div></>diff --git a/apps/web/src/features/channels-view/components/ChannelsEmptyState.tsx b/apps/web/src/features/channels-view/components/ChannelsEmptyState.tsxindex 7195a7947f..f79e220b75 100644--- a/apps/web/src/features/channels-view/components/ChannelsEmptyState.tsx+++ b/apps/web/src/features/channels-view/components/ChannelsEmptyState.tsx@@ -8,6 +8,7 @@ import EmptyStateChannelsGraphic from '@design/empty-state-channels.svg';import BookOpenIcon from '@icon/system/regular/book-open.svg';import PlusIcon from '@icon/system/regular/plus.svg';import { type EmptyStateAction, EmptyStatePanel } from '@ui';+import type { JSX } from 'solid-js';import type { ChannelsQueryScope } from '../types';type ChannelsEmptyStateContent = {@@ -57,6 +58,8 @@ function emptyStateContent(export function ChannelsEmptyState(props: {scope: ChannelsQueryScope;topAligned?: boolean;+ /** Below the actions, such as the phone list's tutorial pill. */+ children?: JSX.Element;}) {const isCreatableEnabled = useCreatableEnabled();const content = () => emptyStateContent(props.scope);@@ -80,6 +83,8 @@ export function ChannelsEmptyState(props: {? 'px-4 pt-4 @4xl:px-4 [&>div:first-child]:basis-0': 'px-4 @4xl:px-4'}- />+ >+ {props.children}+ </EmptyStatePanel>);}diff --git a/apps/web/src/features/channels-view/components/ChannelsMobileView.tsx b/apps/web/src/features/channels-view/components/ChannelsMobileView.tsxindex bb6cc682e5..51b7a762eb 100644--- a/apps/web/src/features/channels-view/components/ChannelsMobileView.tsx+++ b/apps/web/src/features/channels-view/components/ChannelsMobileView.tsx@@ -10,6 +10,7 @@ import {} from '@app/features/next-soup/soup-view/views/inbox/inbox-card-layouts';import { openEntityInSplitFromUnifiedList } from '@app/features/next-soup/utils';import { SoupEntityContextMenu } from '@app/features/soup';+import { TutorialPill } from '@app/features/video-tutorials';import { DEBUG_SETTING_KEYS, useDebugSetting } from '@app/lib/debugSettings';import { CHANNEL_ACTION_VIEW_CONTEXT } from '@channel/Channel/channel-actions';import { useGlobalNotificationSource } from '@components/app/GlobalAppState';@@ -253,7 +254,13 @@ export function ChannelsMobileView(props: {><Showwhen={props.searchQuery.trim()}- fallback={<ChannelsEmptyState scope="recents" />}+ fallback={+ // Phones have no conversation pane, so its tutorial pill+ // sits in the empty conversation list instead.+ <ChannelsEmptyState scope="recents">+ <TutorialPill tutorial="chat" />+ </ChannelsEmptyState>+ }>{(query) => (<EmptyStatePaneldiff --git a/apps/web/src/features/crm/views/companies.tsx b/apps/web/src/features/crm/views/companies.tsxindex f9b6752a07..bd5243c923 100644--- a/apps/web/src/features/crm/views/companies.tsx+++ b/apps/web/src/features/crm/views/companies.tsx@@ -1,3 +1,4 @@+import { TutorialRow } from '@app/features/video-tutorials';import { isTouchDevice } from '@core/mobile/isTouchDevice';import { Show, Suspense } from 'solid-js';import { SoupViewList } from '../../next-soup/soup-view/soup-view';@@ -42,6 +43,7 @@ export function Companies() {onOpenEntity={options.onOpenEntity}rowEntry={{ component: CompanyListEntity, family: 'row' }}groupHeader={CompanyGroupHeader}+ listStart={<TutorialRow tutorial="crm" />}listHeader={<Show when={!isTouchDevice()}><ResponsiveCompanyListHeader class="shrink-0" />diff --git a/apps/web/src/features/drive-view/views/drive-list.tsx b/apps/web/src/features/drive-view/views/drive-list.tsxindex f78183da95..5ed4cb501e 100644--- a/apps/web/src/features/drive-view/views/drive-list.tsx+++ b/apps/web/src/features/drive-view/views/drive-list.tsx@@ -8,6 +8,7 @@ import {MaybeSoupEntityActionDrawerManager,SoupEntityContextMenu,} from '@app/features/soup';+import { TutorialRow } from '@app/features/video-tutorials';import { DEBUG_SETTING_KEYS, useDebugSetting } from '@app/lib/debugSettings';import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';import { StaticMarkdownContext } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';@@ -85,6 +86,9 @@ export function DriveList() {createScrollTopFade(viewport);const [virtualizer, setVirtualizer] = createSignal<VirtualizerHandle>();+ // Rows above the virtualized ones (the tutorial row) shift its item offsets.+ const [listStart, setListStart] = createSignal<HTMLDivElement>();+ const listStartSize = createElementSize(listStart);const forceEmptyState = useDebugSetting(DEBUG_SETTING_KEYS.FORCE_EMPTY_STATES@@ -373,8 +377,16 @@ export function DriveList() {<Match when={true}><divref={setViewport}- class="min-h-0 flex-1 overflow-auto overscroll-none"+ // `soup-list` lets the tutorial row above the rows quiet+ // the cursor row while it is hovered (TutorialEntries.css).+ class="soup-list min-h-0 flex-1 overflow-auto overscroll-none">+ {/* Outside the virtualized rows, so list focus skips it. */}+ <div ref={setListStart}>+ <Show when={state.value().location.kind === 'tab'}>+ <TutorialRow tutorial="drive" />+ </Show>+ </div><Suspense><Virtualizerref={(handle) => {@@ -383,6 +395,7 @@ export function DriveList() {}}data={source.items()}scrollRef={viewport()}+ startMargin={listStartSize.height ?? 0}bufferSize={240}itemSize={44}keepMounted={diff --git a/apps/web/src/features/drive-view/views/drive-sidebar.tsx b/apps/web/src/features/drive-view/views/drive-sidebar.tsxindex a2c0c9a11e..f3bbf113aa 100644--- a/apps/web/src/features/drive-view/views/drive-sidebar.tsx+++ b/apps/web/src/features/drive-view/views/drive-sidebar.tsx@@ -9,6 +9,8 @@ import { FavoriteContextMenu } from '@app/features/favorites/FavoriteContextMenuimport { FavoriteIcon } from '@app/features/favorites/FavoriteIcon';import { FavoriteUnreadIndicator } from '@app/features/favorites/FavoriteUnreadIndicator';import { createFolderDropTargets } from '@app/features/next-soup/actions';+import { TutorialSidebarItem } from '@app/features/video-tutorials';+import { t } from '@app/lib/i18n';import { useFavoriteDisplayName } from '@app/util/favorites';import { createScrollTopFade } from '@core/util/createScrollTopFade';import { fireAndForget } from '@core/util/fireAndForget';@@ -319,6 +321,13 @@ export function DriveSidebar() {<DriveCreateMenu /></ViewSidebar.Primary><ViewSidebar.Content ref={setContent}>+ {/* Drive's list carries Drive's tutorial row; Docs, listed in Drive, takes the sidebar. */}+ <ViewSidebar.Nav+ aria-label={t('tutorials.watchTutorial')}+ class="empty:hidden"+ >+ <TutorialSidebarItem tutorial="docs" />+ </ViewSidebar.Nav><DriveSidebarContent /><DriveImportPromotion /></ViewSidebar.Content>diff --git a/apps/web/src/features/email-view/components/EmailList.tsx b/apps/web/src/features/email-view/components/EmailList.tsxindex ac66cbe44b..8087b8c73e 100644--- a/apps/web/src/features/email-view/components/EmailList.tsx+++ b/apps/web/src/features/email-view/components/EmailList.tsx@@ -1,3 +1,4 @@+import { TutorialRow } from '@app/features/video-tutorials';import { usePending } from '@app/observability/flow';import { useGlobalNotificationSource } from '@components/app/GlobalAppState';import { markRowNotificationsSeenOnOpen } from '@notifications/mark-row-seen';@@ -222,8 +223,8 @@ export function EmailList(props: EmailListProps) {const [topSpacer, setTopSpacer] = createSignal<HTMLDivElement>();const topSpacerSize = createElementSize(topSpacer);// The virtualizer's item offsets exclude this; its scroll offset includes it.- const listStartMargin = () =>- isTouchDevice() ? (topSpacerSize.height ?? 0) : 0;+ // The top spacer holds the touch inset and the pinned tutorial row.+ const listStartMargin = () => topSpacerSize.height ?? 0;const [emptyViewport, setEmptyViewport] = createSignal<HTMLDivElement>();const [grid, setGrid] = createSignal<HTMLDivElement>();// Coming back from a thread, or toggling the reading pane, remounts the@@ -775,7 +776,19 @@ export function EmailList(props: EmailListProps) {ref={setEmptyViewport}class="min-h-0 flex-1 overflow-y-auto touch:pb-(--mobile-content-inset-bottom)">- <EmailEmptyState />+ {/* New inboxes start empty, which is when the tutorial+ matters most. The row then takes the touch top inset. */}+ <Show+ when={state.tab === 'important'}+ fallback={<EmailEmptyState />}+ >+ <div class="touch:pt-(--mobile-content-inset-top)">+ <TutorialRow tutorial="mail" />+ </div>+ <div class="contents touch:[--mobile-content-inset-top:0px]">+ <EmailEmptyState />+ </div>+ </Show></div></Match>@@ -788,11 +801,15 @@ export function EmailList(props: EmailListProps) {class="scrollbar-hidden min-h-0 flex-1 overflow-y-auto overscroll-none">{/* Keep insets inside the scroller so rows slide under the floating chrome. */}- <div- ref={setTopSpacer}- aria-hidden="true"- class="h-0 touch:h-(--mobile-content-inset-top)"- />+ <div ref={setTopSpacer}>+ <div+ aria-hidden="true"+ class="h-0 touch:h-(--mobile-content-inset-top)"+ />+ <Show when={state.tab === 'important'}>+ <TutorialRow tutorial="mail" />+ </Show>+ </div>{/* A row subtree that suspends (the project crumb's preview query, say)detaches only itself, not the list and its scroll position. */}<Suspense>diff --git a/apps/web/src/features/external-view/external-view.tsx b/apps/web/src/features/external-view/external-view.tsxindex 9853131862..a846dccc8e 100644--- a/apps/web/src/features/external-view/external-view.tsx+++ b/apps/web/src/features/external-view/external-view.tsx@@ -1,4 +1,5 @@import { ViewShell, ViewSidebar } from '@app/components/view-shell';+import { TutorialSidebarItem } from '@app/features/video-tutorials';import { SplitRouter, useNavigate, useParams } from '@app/lib/split-router';import { externalChatRoute, externalRoute } from '@app/routes/routes';import { useSplitDisplayName } from '@components/app/split-layout/layoutUtils';@@ -110,6 +111,12 @@ export function ExternalView() {<h1 class="hidden px-4 pt-2 text-lg font-semibold text-ink touch:block"></h1>+ {/* Above the chats, so people who haven't linked WhatsApp see it too.+ Its rows are sidebar-style items, so the entry is one, inset to+ line up with the rows below it (In Macro on touch, chats on desktop). */}+ <div class="px-2 pt-2 empty:hidden not-touch:px-4">+ <TutorialSidebarItem tutorial="whatsapp" />+ </div>{/* Touch has no sidebar: the chats in Macro lead the page. */}<Show when={isTouchDevice()}><section aria-labelledby="external-chats" class="px-2">diff --git a/apps/web/src/features/home/components/HomeList.tsx b/apps/web/src/features/home/components/HomeList.tsxindex f2b5dc695a..6f57f63633 100644--- a/apps/web/src/features/home/components/HomeList.tsx+++ b/apps/web/src/features/home/components/HomeList.tsx@@ -1,3 +1,7 @@+import {+ TutorialRow,+ TutorialSidebarItem,+} from '@app/features/video-tutorials';import { usePending } from '@app/observability/flow';import { markRowNotificationsSeenOnOpen } from '@notifications/mark-row-seen';import '@entity/composed/ListEntity.css';@@ -99,6 +103,25 @@ type HomeListProps = {onPreviewActivate?: () => void;};+/**+ * Home's tutorial entry, shaped like the rows under it: desktop Home is a rail+ * of sidebar items, touch Home a list of inbox rows.+ */+function HomeTutorial() {+ return (+ <Show+ when={isTouchDevice()}+ fallback={+ <div class="mx-(--sidebar-gutter) my-(--sidebar-row-gap) empty:hidden">+ <TutorialSidebarItem tutorial="home" />+ </div>+ }+ >+ <TutorialRow tutorial="home" />+ </Show>+ );+}+/** Compact notification list used by the Notifications workspace. */export function HomeList(props: HomeListProps) {const channels = useChannelsContext();@@ -606,7 +629,19 @@ export function HomeList(props: HomeListProps) {ref={setEmptyViewport}class="min-h-0 flex-1 overflow-y-auto pb-[max(1rem,var(--mobile-content-inset-bottom,0px))]">- <HomeEmptyState />+ {/* A new account's Home starts empty, when the tutorial+ matters most. The row then takes the touch top inset. */}+ <Show+ when={state.tab === 'signal'}+ fallback={<HomeEmptyState />}+ >+ <div class="touch:pt-(--mobile-content-inset-top)">+ <HomeTutorial />+ </div>+ <div class="contents touch:[--mobile-content-inset-top:0px]">+ <HomeEmptyState />+ </div>+ </Show></div></Match>@@ -619,19 +654,22 @@ export function HomeList(props: HomeListProps) {class="scrollbar-hidden min-h-0 flex-1 overflow-y-auto overscroll-none pb-[max(0.5rem,var(--mobile-content-inset-bottom,0px))]"onScroll={checkNearEnd}>- {/* The spacer scrolls away; the viewport stays behind the filters. */}- <div- ref={setTopSpacer}- aria-hidden="true"- class="h-0 touch:h-(--mobile-content-inset-top)"- />+ {/* The spacer scrolls away; the viewport stays behind the filters.+ It holds the touch inset and the pinned tutorial row. */}+ <div ref={setTopSpacer}>+ <div+ aria-hidden="true"+ class="h-0 touch:h-(--mobile-content-inset-top)"+ />+ <Show when={state.tab === 'signal'}>+ <HomeTutorial />+ </Show>+ </div><Virtualizerref={registerVirtualizer}data={rows()}scrollRef={viewport()}- startMargin={- isTouchDevice() ? (topSpacerSize.height ?? 0) : 0- }+ startMargin={topSpacerSize.height ?? 0}bufferSize={500}itemSize={isTouchDevice() ? 44 : 36}keepMounted={diff --git a/apps/web/src/features/next-soup/soup-view/soup-view.tsx b/apps/web/src/features/next-soup/soup-view/soup-view.tsxindex f0772e517f..714c310dc7 100644--- a/apps/web/src/features/next-soup/soup-view/soup-view.tsx+++ b/apps/web/src/features/next-soup/soup-view/soup-view.tsx@@ -250,6 +250,8 @@ interface SoupViewProps {header?: JSX.Element;/** Compose a detail outlet while keeping the list's state initialized. */renderContent?: (list: () => JSX.Element) => JSX.Element;+ /** Pinned above the list's rows, such as a block's tutorial row. */+ listStart?: JSX.Element;}export const SoupView = (props: SoupViewProps) => {@@ -516,7 +518,7 @@ export const SoupView = (props: SoupViewProps) => {</Show><div class="relative grow min-h-1 flex max-sm:flex-col flex-row size-full"><Suspense>- <SoupViewList />+ <SoupViewList listStart={props.listStart} /></Suspense></div><Suspense>@@ -544,6 +546,8 @@ export const SoupView = (props: SoupViewProps) => {interface SoupViewListProps {rowEntry?: SoupRowEntry;listHeader?: JSX.Element;+ /** Scrolls above the rows, outside them, so list focus skips it. */+ listStart?: JSX.Element;groupHeader?: import('solid-js').Component<GroupHeaderProps & { highlighted?: boolean }>;@@ -578,6 +582,7 @@ export const SoupViewList = (props: SoupViewListProps) => (<SoupViewListContentrowEntry={props.rowEntry}listHeader={props.listHeader}+ listStart={props.listStart}groupHeader={props.groupHeader}customScrollbarHidden={props.customScrollbarHidden}scopeId={props.scopeId}@@ -1239,6 +1244,7 @@ const SoupViewListContent = (props: SoupViewListProps) => {scrollerRef={setListScrollerRef}virtualizerClass="scrollbar-hidden"class="overflow-hidden flex min-w-0"+ start={props.listStart}virtualizerRef={registerVirtualizerHandler}onScrollBottom={debouncedFetchMore}scrollBottomOffset={300}@@ -1500,6 +1506,8 @@ interface SoupListProps {rows: SoupRow[];isSticky?: (row: SoupRow) => boolean;cache?: CacheSnapshot;+ /** Scrolls above the rows, below the touch inset. */+ start?: JSX.Element;}const SoupList = (props: SoupListProps) => {@@ -1510,12 +1518,16 @@ const SoupList = (props: SoupListProps) => {const [topSpacerRef, setTopSpacerRef] = createSignal<HTMLDivElement>();const topSpacerSize = createElementSize(topSpacerRef);+ const [topInsetRef, setTopInsetRef] = createSignal<HTMLDivElement>();+ const topInsetSize = createElementSize(topInsetRef);// Full-frame touch devices: rows under-scroll the status bar; this in-scroll// spacer is their resting inset (safe-top — list views have no header).// Keyed on touch, not width: an iPad is a full-frame native app but is wider// than the mobile breakpoint, so a width check would leave it at 0.- const topInset = () => (isTouchDevice() ? (topSpacerSize.height ?? 0) : 0);+ const topInset = () => (isTouchDevice() ? (topInsetSize.height ?? 0) : 0);+ // Rows start below the inset and any leading content.+ const startMargin = () => topSpacerSize.height ?? 0;const handleScroll = (offset: number) => {const handle = virtualizerHandle();@@ -1572,15 +1584,18 @@ const SoupList = (props: SoupListProps) => {}}{...soupListContainerAttribute}>- <div- ref={setTopSpacerRef}- aria-hidden- class="h-0 block touch:h-(--mobile-content-inset-top)"- />+ <div ref={setTopSpacerRef}>+ <div+ ref={setTopInsetRef}+ aria-hidden+ class="h-0 block touch:h-(--mobile-content-inset-top)"+ />+ {props.start}+ </div><StickyVirtualizercache={props.cache}ref={registerVirtualizerHandler}- startMargin={topInset()}+ startMargin={startMargin()}data={props.rows}isSticky={props.isSticky}stickyInset={topInset()}diff --git a/apps/web/src/features/reviews-view/components/ReviewsList.tsx b/apps/web/src/features/reviews-view/components/ReviewsList.tsxindex 45d2489f0c..d5896c8ade 100644--- a/apps/web/src/features/reviews-view/components/ReviewsList.tsx+++ b/apps/web/src/features/reviews-view/components/ReviewsList.tsx@@ -4,6 +4,7 @@ import {useEntityActionHotkeys,} from '@app/features/next-soup/actions';import { DateGroupHeading } from '@app/features/next-soup/soup-view/date-group-heading';+import { TutorialRow } from '@app/features/video-tutorials';import { useInfiniteScrollSentinel } from '@app/lib/primitives/infinite-scroll-sentinel';import {type OpenPrLink,@@ -154,6 +155,9 @@ export function ReviewsList(props: ReviewsListProps) {const [sentinel, setSentinel] = createSignal<HTMLDivElement>();const listSize = createElementSize(listElement);const [virtualizer, setVirtualizer] = createSignal<VirtualizerHandle>();+ // The tutorial row above the virtualized rows shifts their offsets.+ const [listStart, setListStart] = createSignal<HTMLDivElement>();+ const listStartSize = createElementSize(listStart);// Date headings sit among the rows like email's; focus and selection keep// counting pull requests, so their indexes map to rows for scrolling.const rows = createMemo(() =>@@ -367,12 +371,17 @@ export function ReviewsList(props: ReviewsListProps) {</Show>}>+ {/* Outside the virtualized rows, so list focus skips it. */}+ <div ref={setListStart}>+ <TutorialRow tutorial="github" />+ </div><ListLayoutProvider ref={listElement}><Virtualizeras={ReviewListElement}item="li"data={rows()}scrollRef={listElement()}+ startMargin={listStartSize.height ?? 0}ref={setVirtualizer}keepMounted={list.focus.index() >= 0diff --git a/apps/web/src/features/scheduling/components/event-types-panel.tsx b/apps/web/src/features/scheduling/components/event-types-panel.tsxindex 76ac0b3485..645559c916 100644--- a/apps/web/src/features/scheduling/components/event-types-panel.tsx+++ b/apps/web/src/features/scheduling/components/event-types-panel.tsx@@ -40,6 +40,8 @@ export function EventTypesPanel(props: {onDelete: (event: EventType) => void;onCopy: (event: EventType) => void;link: (event: EventType) => string;+ /** Pinned above the links, such as the scheduling tutorial row. */+ listStart?: JSX.Element;}) {const [localSearch, setSearch] = createSignal('');const search = () => (props.search ?? localSearch()).trim();@@ -190,6 +192,7 @@ export function EventTypesPanel(props: {class="mb-3 max-w-md"/></Show>+ {props.listStart}<div><Foreach={filtered()}diff --git a/apps/web/src/features/scheduling/views/owner-settings-section.tsx b/apps/web/src/features/scheduling/views/owner-settings-section.tsxindex 67377e13d8..5f7ba26890 100644--- a/apps/web/src/features/scheduling/views/owner-settings-section.tsx+++ b/apps/web/src/features/scheduling/views/owner-settings-section.tsx@@ -1,3 +1,4 @@+import { TutorialRow } from '@app/features/video-tutorials';import { fireAndForget } from '@core/util/fireAndForget';import Copy from '@icon/system/regular/copy.svg';import { CopyButton } from '@ui';@@ -163,6 +164,14 @@ export function OwnerSettingsSection(props: {)}</Show><EventTypesPanel+ listStart={+ // Booking rows lead with their toggle; the inset puts the+ // row's play icon and label over each link's icon and title,+ // while the row's hover still spans the list.+ <div class="[--tutorial-row-inset:1.5rem]">+ <TutorialRow tutorial="scheduling" />+ </div>+ }owner={scope()}search={props.search ?? ''}events={p().eventTypes}diff --git a/apps/web/src/features/tasks-view/components/task-list/TaskList.tsx b/apps/web/src/features/tasks-view/components/task-list/TaskList.tsxindex adcef0d162..19be259475 100644--- a/apps/web/src/features/tasks-view/components/task-list/TaskList.tsx+++ b/apps/web/src/features/tasks-view/components/task-list/TaskList.tsx@@ -91,6 +91,8 @@ export type TaskListProps = {loadingContent?: JSX.Element;errorContent?: JSX.Element;referencePropertyIds?: readonly string[];+ /** Pinned above the rows, such as the main Tasks list's tutorial row. */+ listStart?: JSX.Element;};export function TaskList(props: TaskListProps) {@@ -553,6 +555,7 @@ export function TaskList(props: TaskListProps) {items={visibleRows()}isSticky={(row) => row.kind === 'group-header'}focusedIndex={list.focus.index()}+ start={props.listStart}onScroll={() => {recordScrollAnchor();checkNearEnd();diff --git a/apps/web/src/features/tasks-view/tasks-content.tsx b/apps/web/src/features/tasks-view/tasks-content.tsxindex 5d654ad984..0f94f2a6e3 100644--- a/apps/web/src/features/tasks-view/tasks-content.tsx+++ b/apps/web/src/features/tasks-view/tasks-content.tsx@@ -37,6 +37,7 @@ export function TasksContent(props: TaskListProps) {emptyContent={props.emptyContent}loadingContent={props.loadingContent}errorContent={props.errorContent}+ listStart={props.listStart}/></Match></Switch>diff --git a/apps/web/src/features/tasks-view/tasks-view.tsx b/apps/web/src/features/tasks-view/tasks-view.tsxindex 4d4f77c000..e9710a4621 100644--- a/apps/web/src/features/tasks-view/tasks-view.tsx+++ b/apps/web/src/features/tasks-view/tasks-view.tsx@@ -6,6 +6,7 @@ import {useSavedViews,} from '@app/features/saved-views/queries/saved-views';import { ViewTour, ViewTourAction } from '@app/features/tours/ViewTour';+import { TutorialRow } from '@app/features/video-tutorials';import { SplitRouter, useNavigate, useParams } from '@app/lib/split-router';import { projectDetailRoute } from '@app/routes/routes';import { useSplitLayout } from '@components/app/split-layout/layout';@@ -126,7 +127,18 @@ function TasksViewRoot() {><TaskSavedViewWarning /><div class="min-h-0 flex-1">- <TasksContent ref={setListElement} />+ <TasksContent+ ref={setListElement}+ listStart={+ // Task rows lead with priority and status icons; the inset+ // puts the play icon over the status icon and the label+ // over the task titles, while the row's hover still spans+ // the list like the task rows'.+ <div class="[--tutorial-row-inset:2.25rem]">+ <TutorialRow tutorial="tasks" />+ </div>+ }+ /></div></Show></ViewShell.Content>diff --git a/apps/web/src/features/video-tutorials/BlockTutorial.test.tsx b/apps/web/src/features/video-tutorials/BlockTutorial.test.tsxnew file mode 100644index 0000000000..9ca0a82228--- /dev/null+++ b/apps/web/src/features/video-tutorials/BlockTutorial.test.tsx@@ -0,0 +1,302 @@+import type { ApiChannelWithLatest } from '@service-storage/channel-list-types';+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+} from '@solidjs/testing-library';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { TUTORIALS } from './catalog';+import { TutorialPill, TutorialRow } from './views/BlockTutorial';++const track = vi.hoisted(() => vi.fn());+vi.mock('@app/lib/analytics', () => ({ analytics: { track } }));++// The app's channel list and split router, as the dialog's support link reads them.+const channelList = vi.hoisted(() => ({+ channels: [] as (Pick<ApiChannelWithLatest, 'id' | 'name' | 'owner_id'> &+ Partial<Pick<ApiChannelWithLatest, 'updated_at'>>)[],+}));+vi.mock('@core/context/channels', () => ({+ useChannelsContext: () => ({+ channels: () => channelList.channels,+ isLoading: () => false,+ }),+}));+vi.mock('@core/context/user', () => ({+ useUserId: () => () => 'macro|[email protected]',+}));+const openWithSplit = vi.hoisted(() => vi.fn());+vi.mock('@components/app/split-layout/layout', () => ({+ useSplitLayout: () => ({ openWithSplit }),+}));++const play = vi.fn(() => Promise.resolve());+const pause = vi.fn();++beforeEach(() => {+ localStorage.clear();+ channelList.channels = [];+ openWithSplit.mockClear();+ track.mockClear();+ play.mockClear();+ pause.mockClear();+ // jsdom has no layout observers (the shelf measures its row) or scrolling.+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+ vi.stubGlobal('scrollTo', vi.fn());+ // jsdom has no media playback.+ Object.defineProperty(HTMLMediaElement.prototype, 'play', {+ configurable: true,+ value: play,+ });+ Object.defineProperty(HTMLMediaElement.prototype, 'pause', {+ configurable: true,+ value: pause,+ });+});++afterEach(() => {+ cleanup();+ vi.unstubAllGlobals();+});++const row = () =>+ screen.queryByRole('button', { name: /Learn how to use Macro Mail/ });+const video = () => document.querySelector('video');+const playButton = () => screen.getByRole('button', { name: /^Play / });+// jsdom keeps Kobalte's dialog mounted for its exit; it is closed once marked so.+const dialogClosed = () =>+ screen.queryByRole('dialog')?.hasAttribute('data-closed') ?? true;++describe('block tutorial row', () => {+ it('opens the video paused and plays it only from the play button', async () => {+ render(() => <TutorialRow tutorial="mail" />);++ fireEvent.click(row()!);+ await screen.findByRole('dialog');+ expect(play).not.toHaveBeenCalled();+ // The play pill names the video and shows its presenter and length.+ const pill = screen.getByRole('button', {+ name: 'Play Learn how to use Macro Mail, 1:42',+ });+ expect(pill.textContent).toContain('Jacob Beckerman');+ expect(pill.textContent).toContain('Watch demo · 1:42');+ expect(video()?.autoplay).toBe(false);+ expect(video()?.controls).toBe(false);++ fireEvent.click(pill);+ expect(play).toHaveBeenCalledTimes(1);+ expect(video()?.controls).toBe(true);+ expect(document.activeElement).toBe(video());+ });++ it('counts a play once, when playback really starts', async () => {+ render(() => <TutorialRow tutorial="mail" />);++ fireEvent.click(row()!);+ await screen.findByRole('dialog');+ fireEvent.click(playButton());+ const played = () =>+ track.mock.calls.filter(([, payload]) => payload.action === 'played');+ expect(played()).toHaveLength(0);++ fireEvent.playing(video()!);+ fireEvent.playing(video()!);+ expect(played()).toHaveLength(1);+ });++ it('closes on Escape once playing and pauses the video', async () => {+ render(() => <TutorialRow tutorial="mail" />);++ fireEvent.click(row()!);+ await screen.findByRole('dialog');+ fireEvent.click(playButton());+ fireEvent.keyDown(video()!, { key: 'Escape' });++ expect(pause).toHaveBeenCalled();+ await waitFor(() => expect(dialogClosed()).toBe(true));+ });++ it('stays dismissed on this device', () => {+ const first = render(() => <TutorialRow tutorial="mail" />);+ fireEvent.click(screen.getByRole('button', { name: 'Dismiss' }));+ expect(row()).toBeNull();+ first.unmount();++ render(() => <TutorialRow tutorial="mail" />);+ expect(row()).toBeNull();+ });+});++describe('shelf after a video ends', () => {+ it('offers the other tutorials and switches to one, paused', async () => {+ render(() => <TutorialRow tutorial="mail" />);+ fireEvent.click(row()!);+ const dialog = await screen.findByRole('dialog');+ fireEvent.click(playButton());+ fireEvent.playing(video()!);+ expect(screen.queryByText('More videos from Macro')).toBeNull();++ fireEvent.ended(video()!);++ screen.getByText('More videos from Macro');+ expect(+ screen.queryByRole('button', { name: /^Learn how to use Macro Mail,/ })+ ).toBeNull();+ expect(video()?.controls).toBe(false);++ fireEvent.click(+ screen.getByRole('button', { name: /^Learn how to use Macro CRM,/ })+ );++ expect(screen.queryByText('More videos from Macro')).toBeNull();+ expect(dialog.textContent).toContain('Learn how to use Macro CRM');+ expect(video()?.getAttribute('src')).toBe(TUTORIALS.crm?.videoUrl);+ expect(document.activeElement).toBe(playButton());+ expect(track).toHaveBeenLastCalledWith('tutorial_video', {+ tutorial: 'macro-crm',+ action: 'opened',+ });++ // Plays of the new video count for it.+ fireEvent.click(playButton());+ fireEvent.playing(video()!);+ expect(track).toHaveBeenLastCalledWith('tutorial_video', {+ tutorial: 'macro-crm',+ action: 'played',+ });+ });++ it('replays the video from the start', async () => {+ render(() => <TutorialRow tutorial="mail" />);+ fireEvent.click(row()!);+ await screen.findByRole('dialog');+ fireEvent.click(playButton());+ fireEvent.ended(video()!);+ video()!.currentTime = 80;+ play.mockClear();++ fireEvent.click(screen.getByRole('button', { name: 'Replay' }));++ expect(play).toHaveBeenCalledTimes(1);+ expect(video()?.currentTime).toBe(0);+ expect(screen.queryByText('More videos from Macro')).toBeNull();+ });+});++describe('support link under the video', () => {+ it("opens the person's support channel and closes the dialog", async () => {+ channelList.channels = [+ { id: 'general', name: 'general', owner_id: 'macro|[email protected]' },+ {+ id: 'someone-elses-support',+ name: 'Macro Support x grace',+ owner_id: 'macro|[email protected]',+ },+ {+ id: 'support-ada',+ name: 'Macro Support x ada',+ owner_id: 'macro|[email protected]',+ },+ ];+ render(() => <TutorialPill tutorial="crm" />);+ fireEvent.click(+ screen.getByRole('button', { name: /Learn how to use Macro CRM/ })+ );+ await screen.findByRole('dialog');+ screen.getByText('Have questions about Macro CRM?');++ fireEvent.click(+ screen.getByRole('button', {+ name: 'Talk to us in your support channel →',+ })+ );++ expect(openWithSplit).toHaveBeenCalledWith(+ { type: 'channel', id: 'support-ada' },+ { activate: true }+ );+ expect(track).toHaveBeenCalledWith('tutorial_video', {+ tutorial: 'macro-crm',+ action: 'support_clicked',+ });+ await waitFor(() => expect(dialogClosed()).toBe(true));+ });++ it("opens a Macro team member's most recently active support channel", async () => {+ // A Macro team member is in customers' support channels but owns none.+ channelList.channels = [+ {+ id: 'older-support',+ name: 'Macro Support x grace',+ owner_id: 'macro|[email protected]',+ updated_at: '2026-11-01T10:00:00Z',+ },+ {+ id: 'recent-support',+ name: 'Macro Support x lin',+ owner_id: 'macro|[email protected]',+ updated_at: '2026-11-04T10:00:00Z',+ },+ ];+ render(() => <TutorialRow tutorial="mail" />);+ fireEvent.click(row()!);+ await screen.findByRole('dialog');++ fireEvent.click(+ screen.getByRole('button', {+ name: 'Talk to us in your support channel →',+ })+ );+ expect(openWithSplit).toHaveBeenCalledWith(+ { type: 'channel', id: 'recent-support' },+ { activate: true }+ );+ });++ it('leaves the lip out when the person is in no support channel', async () => {+ channelList.channels = [+ { id: 'general', name: 'general', owner_id: 'macro|[email protected]' },+ ];+ render(() => <TutorialRow tutorial="mail" />);+ fireEvent.click(row()!);+ await screen.findByRole('dialog');++ expect(screen.queryByText('Have questions about Macro Mail?')).toBeNull();+ });+});++describe('block tutorial pill', () => {+ it('opens the same paused video and dismisses separately from other tutorials', async () => {+ render(() => <TutorialPill tutorial="mail" />);+ fireEvent.click(+ screen.getByRole('button', { name: /Learn how to use Macro Mail/ })+ );+ await screen.findByRole('dialog');+ expect(play).not.toHaveBeenCalled();+ expect(track).toHaveBeenCalledWith('tutorial_video', {+ tutorial: 'macro-mail',+ action: 'opened',+ });+ });++ it('renders nothing for a block whose video is not in the catalog yet', () => {+ // Every block gets a video eventually, so take one out for this test.+ const scheduling = TUTORIALS.scheduling;+ delete TUTORIALS.scheduling;+ try {+ render(() => <TutorialPill tutorial="scheduling" />);+ expect(screen.queryByRole('button')).toBeNull();+ } finally {+ TUTORIALS.scheduling = scheduling;+ }+ });+});diff --git a/apps/web/src/features/video-tutorials/assets/agents-poster.jpg b/apps/web/src/features/video-tutorials/assets/agents-poster.jpgnew file mode 100644index 0000000000..1f06ecdca1Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/agents-poster.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/agents.mp4 b/apps/web/src/features/video-tutorials/assets/agents.mp4new file mode 100644index 0000000000..0f54cd9db9Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/agents.mp4 differdiff --git a/apps/web/src/features/video-tutorials/assets/calendar-poster.jpg b/apps/web/src/features/video-tutorials/assets/calendar-poster.jpgnew file mode 100644index 0000000000..f44067beafBinary files /dev/null and b/apps/web/src/features/video-tutorials/assets/calendar-poster.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/calendar.mp4 b/apps/web/src/features/video-tutorials/assets/calendar.mp4new file mode 100644index 0000000000..8b63b83927Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/calendar.mp4 differdiff --git a/apps/web/src/features/video-tutorials/assets/calls-poster.jpg b/apps/web/src/features/video-tutorials/assets/calls-poster.jpgnew file mode 100644index 0000000000..2502359f29Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/calls-poster.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/calls.mp4 b/apps/web/src/features/video-tutorials/assets/calls.mp4new file mode 100644index 0000000000..c798ac6c0fBinary files /dev/null and b/apps/web/src/features/video-tutorials/assets/calls.mp4 differdiff --git a/apps/web/src/features/video-tutorials/assets/chat-poster.jpg b/apps/web/src/features/video-tutorials/assets/chat-poster.jpgnew file mode 100644index 0000000000..0a26ccff4aBinary files /dev/null and b/apps/web/src/features/video-tutorials/assets/chat-poster.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/chat.mp4 b/apps/web/src/features/video-tutorials/assets/chat.mp4new file mode 100644index 0000000000..3fc752d7f3Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/chat.mp4 differdiff --git a/apps/web/src/features/video-tutorials/assets/crm-poster.jpg b/apps/web/src/features/video-tutorials/assets/crm-poster.jpgnew file mode 100644index 0000000000..3f2e9852c7Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/crm-poster.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/crm.mp4 b/apps/web/src/features/video-tutorials/assets/crm.mp4new file mode 100644index 0000000000..b924eeb991Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/crm.mp4 differdiff --git a/apps/web/src/features/video-tutorials/assets/docs-poster.jpg b/apps/web/src/features/video-tutorials/assets/docs-poster.jpgnew file mode 100644index 0000000000..0504c46e5bBinary files /dev/null and b/apps/web/src/features/video-tutorials/assets/docs-poster.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/docs.mp4 b/apps/web/src/features/video-tutorials/assets/docs.mp4new file mode 100644index 0000000000..bf5bc9c9c1Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/docs.mp4 differdiff --git a/apps/web/src/features/video-tutorials/assets/drive-poster.jpg b/apps/web/src/features/video-tutorials/assets/drive-poster.jpgnew file mode 100644index 0000000000..24c6790b7fBinary files /dev/null and b/apps/web/src/features/video-tutorials/assets/drive-poster.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/drive.mp4 b/apps/web/src/features/video-tutorials/assets/drive.mp4new file mode 100644index 0000000000..c19994fe59Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/drive.mp4 differdiff --git a/apps/web/src/features/video-tutorials/assets/github-poster.jpg b/apps/web/src/features/video-tutorials/assets/github-poster.jpgnew file mode 100644index 0000000000..1a76022504Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/github-poster.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/github.mp4 b/apps/web/src/features/video-tutorials/assets/github.mp4new file mode 100644index 0000000000..132da96f27Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/github.mp4 differdiff --git a/apps/web/src/features/video-tutorials/assets/home-poster.jpg b/apps/web/src/features/video-tutorials/assets/home-poster.jpgnew file mode 100644index 0000000000..d97d1354cfBinary files /dev/null and b/apps/web/src/features/video-tutorials/assets/home-poster.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/home.mp4 b/apps/web/src/features/video-tutorials/assets/home.mp4new file mode 100644index 0000000000..824448bfc1Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/home.mp4 differdiff --git a/apps/web/src/features/video-tutorials/assets/mail-poster.jpg b/apps/web/src/features/video-tutorials/assets/mail-poster.jpgnew file mode 100644index 0000000000..473b857a10Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/mail-poster.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/mail.mp4 b/apps/web/src/features/video-tutorials/assets/mail.mp4new file mode 100644index 0000000000..b8f8a2f3e4Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/mail.mp4 differdiff --git a/apps/web/src/features/video-tutorials/assets/presenter.jpg b/apps/web/src/features/video-tutorials/assets/presenter.jpgnew file mode 100644index 0000000000..189c66fbdfBinary files /dev/null and b/apps/web/src/features/video-tutorials/assets/presenter.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/scheduling-poster.jpg b/apps/web/src/features/video-tutorials/assets/scheduling-poster.jpgnew file mode 100644index 0000000000..29baba0baaBinary files /dev/null and b/apps/web/src/features/video-tutorials/assets/scheduling-poster.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/scheduling.mp4 b/apps/web/src/features/video-tutorials/assets/scheduling.mp4new file mode 100644index 0000000000..124729acdbBinary files /dev/null and b/apps/web/src/features/video-tutorials/assets/scheduling.mp4 differdiff --git a/apps/web/src/features/video-tutorials/assets/support-julia.jpg b/apps/web/src/features/video-tutorials/assets/support-julia.jpgnew file mode 100644index 0000000000..e51f56c401Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/support-julia.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/support-teo.jpg b/apps/web/src/features/video-tutorials/assets/support-teo.jpgnew file mode 100644index 0000000000..69e9b11068Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/support-teo.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/tasks-poster.jpg b/apps/web/src/features/video-tutorials/assets/tasks-poster.jpgnew file mode 100644index 0000000000..38b35ec5cbBinary files /dev/null and b/apps/web/src/features/video-tutorials/assets/tasks-poster.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/tasks.mp4 b/apps/web/src/features/video-tutorials/assets/tasks.mp4new file mode 100644index 0000000000..56d4fdd0c3Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/tasks.mp4 differdiff --git a/apps/web/src/features/video-tutorials/assets/whatsapp-poster.jpg b/apps/web/src/features/video-tutorials/assets/whatsapp-poster.jpgnew file mode 100644index 0000000000..61e9a4389aBinary files /dev/null and b/apps/web/src/features/video-tutorials/assets/whatsapp-poster.jpg differdiff --git a/apps/web/src/features/video-tutorials/assets/whatsapp.mp4 b/apps/web/src/features/video-tutorials/assets/whatsapp.mp4new file mode 100644index 0000000000..36c00f1393Binary files /dev/null and b/apps/web/src/features/video-tutorials/assets/whatsapp.mp4 differdiff --git a/apps/web/src/features/video-tutorials/catalog.ts b/apps/web/src/features/video-tutorials/catalog.tsnew file mode 100644index 0000000000..865808e8f1--- /dev/null+++ b/apps/web/src/features/video-tutorials/catalog.ts@@ -0,0 +1,271 @@+import { t } from '@app/lib/i18n';+import agentsVideo from './assets/agents.mp4';+import agentsPoster from './assets/agents-poster.jpg';+import calendarVideo from './assets/calendar.mp4';+import calendarPoster from './assets/calendar-poster.jpg';+import callsVideo from './assets/calls.mp4';+import callsPoster from './assets/calls-poster.jpg';+import chatVideo from './assets/chat.mp4';+import chatPoster from './assets/chat-poster.jpg';+import crmVideo from './assets/crm.mp4';+import crmPoster from './assets/crm-poster.jpg';+import docsVideo from './assets/docs.mp4';+import docsPoster from './assets/docs-poster.jpg';+import driveVideo from './assets/drive.mp4';+import drivePoster from './assets/drive-poster.jpg';+import githubVideo from './assets/github.mp4';+import githubPoster from './assets/github-poster.jpg';+import homeVideo from './assets/home.mp4';+import homePoster from './assets/home-poster.jpg';+import mailVideo from './assets/mail.mp4';+import mailPoster from './assets/mail-poster.jpg';+import schedulingVideo from './assets/scheduling.mp4';+import schedulingPoster from './assets/scheduling-poster.jpg';+import tasksVideo from './assets/tasks.mp4';+import tasksPoster from './assets/tasks-poster.jpg';+import whatsappVideo from './assets/whatsapp.mp4';+import whatsappPoster from './assets/whatsapp-poster.jpg';+import type { TutorialId } from './core/tutorial-id';++export type Tutorial = {+ id: TutorialId;+ /** "Learn how to use Macro Mail" */+ readonly title: string;+ /** The block's name in a sentence, like "Macro Mail". */+ readonly block: string;+ /** One line under the title in a row. */+ readonly snippet: string;+ /** The video's length, like "1:27". */+ readonly length: string;+ videoUrl: string;+ posterUrl: string;+};++/**+ * The tutorials that have a video. A block whose video isn't here yet renders+ * no tutorial entry. Vite emits each video as a hashed asset that loads only+ * when its dialog opens and the person presses play.+ */+export const TUTORIALS: Partial<Record<TutorialId, Tutorial>> = {+ mail: {+ id: 'mail',+ get title() {+ return t('tutorials.mailTitle');+ },+ get block() {+ return t('tutorials.mailBlock');+ },+ get snippet() {+ return t('tutorials.mailSnippet');+ },+ get length() {+ return t('tutorials.mailLength');+ },+ videoUrl: mailVideo,+ posterUrl: mailPoster,+ },+ crm: {+ id: 'crm',+ get title() {+ return t('tutorials.crmTitle');+ },+ get block() {+ return t('tutorials.crmBlock');+ },+ get snippet() {+ return t('tutorials.crmSnippet');+ },+ get length() {+ return t('tutorials.crmLength');+ },+ videoUrl: crmVideo,+ posterUrl: crmPoster,+ },+ github: {+ id: 'github',+ get title() {+ return t('tutorials.githubTitle');+ },+ get block() {+ return t('tutorials.githubBlock');+ },+ get snippet() {+ return t('tutorials.githubSnippet');+ },+ get length() {+ return t('tutorials.githubLength');+ },+ videoUrl: githubVideo,+ posterUrl: githubPoster,+ },+ docs: {+ id: 'docs',+ get title() {+ return t('tutorials.docsTitle');+ },+ get block() {+ return t('tutorials.docsBlock');+ },+ get snippet() {+ return t('tutorials.docsSnippet');+ },+ get length() {+ return t('tutorials.docsLength');+ },+ videoUrl: docsVideo,+ posterUrl: docsPoster,+ },+ tasks: {+ id: 'tasks',+ get title() {+ return t('tutorials.tasksTitle');+ },+ get block() {+ return t('tutorials.tasksBlock');+ },+ get snippet() {+ return t('tutorials.tasksSnippet');+ },+ get length() {+ return t('tutorials.tasksLength');+ },+ videoUrl: tasksVideo,+ posterUrl: tasksPoster,+ },+ chat: {+ id: 'chat',+ get title() {+ return t('tutorials.chatTitle');+ },+ get block() {+ return t('tutorials.chatBlock');+ },+ get snippet() {+ return t('tutorials.chatSnippet');+ },+ get length() {+ return t('tutorials.chatLength');+ },+ videoUrl: chatVideo,+ posterUrl: chatPoster,+ },+ calls: {+ id: 'calls',+ get title() {+ return t('tutorials.callsTitle');+ },+ get block() {+ return t('tutorials.callsBlock');+ },+ get snippet() {+ return t('tutorials.callsSnippet');+ },+ get length() {+ return t('tutorials.callsLength');+ },+ videoUrl: callsVideo,+ posterUrl: callsPoster,+ },+ scheduling: {+ id: 'scheduling',+ get title() {+ return t('tutorials.schedulingTitle');+ },+ get block() {+ return t('tutorials.schedulingBlock');+ },+ get snippet() {+ return t('tutorials.schedulingSnippet');+ },+ get length() {+ return t('tutorials.schedulingLength');+ },+ videoUrl: schedulingVideo,+ posterUrl: schedulingPoster,+ },+ calendar: {+ id: 'calendar',+ get title() {+ return t('tutorials.calendarTitle');+ },+ get block() {+ return t('tutorials.calendarBlock');+ },+ get snippet() {+ return t('tutorials.calendarSnippet');+ },+ get length() {+ return t('tutorials.calendarLength');+ },+ videoUrl: calendarVideo,+ posterUrl: calendarPoster,+ },+ home: {+ id: 'home',+ get title() {+ return t('tutorials.homeTitle');+ },+ get block() {+ return t('tutorials.homeBlock');+ },+ get snippet() {+ return t('tutorials.homeSnippet');+ },+ get length() {+ return t('tutorials.homeLength');+ },+ videoUrl: homeVideo,+ posterUrl: homePoster,+ },+ whatsapp: {+ id: 'whatsapp',+ get title() {+ return t('tutorials.whatsappTitle');+ },+ get block() {+ return t('tutorials.whatsappBlock');+ },+ get snippet() {+ return t('tutorials.whatsappSnippet');+ },+ get length() {+ return t('tutorials.whatsappLength');+ },+ videoUrl: whatsappVideo,+ posterUrl: whatsappPoster,+ },+ agents: {+ id: 'agents',+ get title() {+ return t('tutorials.agentsTitle');+ },+ get block() {+ return t('tutorials.agentsBlock');+ },+ get snippet() {+ return t('tutorials.agentsSnippet');+ },+ get length() {+ return t('tutorials.agentsLength');+ },+ videoUrl: agentsVideo,+ posterUrl: agentsPoster,+ },+ drive: {+ id: 'drive',+ get title() {+ return t('tutorials.driveTitle');+ },+ get block() {+ return t('tutorials.driveBlock');+ },+ get snippet() {+ return t('tutorials.driveSnippet');+ },+ get length() {+ return t('tutorials.driveLength');+ },+ videoUrl: driveVideo,+ posterUrl: drivePoster,+ },+};diff --git a/apps/web/src/features/video-tutorials/components/TutorialEntries.css b/apps/web/src/features/video-tutorials/components/TutorialEntries.cssnew file mode 100644index 0000000000..f7365f5846--- /dev/null+++ b/apps/web/src/features/video-tutorials/components/TutorialEntries.css@@ -0,0 +1,10 @@+/* The tutorial row sits above a list's rows but is not one of them. While the+ pointer is on it, no row may look hovered, so the list's cursor row (which+ follows the pointer, and in Mail rests on the first row) drops its+ highlight. Only the paint changes: the cursor stays where it was, so+ keyboard navigation carries on from it. Scoped to the list root, never the+ document. */+.soup-list:has([data-tutorial-row]:hover) {+ --color-list-highlighted: transparent;+ --color-list-selected-highlighted: var(--color-list-selected);+}diff --git a/apps/web/src/features/video-tutorials/components/TutorialEntries.tsx b/apps/web/src/features/video-tutorials/components/TutorialEntries.tsxnew file mode 100644index 0000000000..bdbf0cebe7--- /dev/null+++ b/apps/web/src/features/video-tutorials/components/TutorialEntries.tsx@@ -0,0 +1,167 @@+import './TutorialEntries.css';+import { ViewSidebar } from '@app/components/view-shell';+import { t } from '@app/lib/i18n';+import { isTouchDevice } from '@core/mobile/isTouchDevice';+import VideoIcon from '@icon/system/regular/video-camera.svg';+import XIcon from '@icon/system/regular/x.svg';+import { Button, cn } from '@ui';++/**+ * The row's icon: an outline play circle on the system icon grid (24 units,+ * 2px stroke), the same size and weight as the envelope and other row icons.+ */+function PlayCircleIcon(props: { class?: string }) {+ return (+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ class={cn('shrink-0', props.class)}+ >+ <circle cx="12" cy="12" r="9" />+ <path+ d="M10.25 9.2v5.6a.6.6 0 0 0 .92.5l4.3-2.8a.6.6 0 0 0 0-1l-4.3-2.8a.6.6 0 0 0-.92.5Z"+ fill="currentColor"+ stroke-width="1"+ />+ </svg>+ );+}++type EntryProps = {+ title: string;+ snippet: string;+ length: string;+ onOpen: () => void;+ onDismiss: () => void;+};++/** Shows the dismiss X on hover on desktop, always on touch (no hover there). */+function DismissButton(props: { onDismiss: () => void }) {+ return (+ <Button+ variant="ghost"+ size="icon-sm"+ aria-label={t('tutorials.dismiss')}+ tooltip={t('tutorials.dismiss')}+ class={cn(+ 'mr-1 shrink-0',+ !isTouchDevice() &&+ 'opacity-0 focus-visible:opacity-100 group-hover/tutorial:opacity-100'+ )}+ onClick={props.onDismiss}+ >+ <XIcon class="size-4 shrink-0" />+ </Button>+ );+}++/**+ * A pinned row at the top of a block's list, on the list rows' own grid+ * (WideLayout and the --soup-row-* geometry in entity/composed/ListEntity.css):+ * a play button in the icon slot, "Watch tutorial" in the sender column, the+ * title and snippet where a row's subject goes, and the length where its date+ * goes, so it lines up with the rows below it. A list whose rows lead with+ * more icons (Tasks, Booking links) sets `--tutorial-row-inset` to push the+ * content over its own, while the row and its hover keep the list's width.+ */+export function TutorialRowView(props: EntryProps) {+ return (+ <div+ data-tutorial-row+ class="soup-row-wide group/tutorial relative mx-(--soup-row-gutter) flex min-h-10 w-[calc(100%-2*var(--soup-row-gutter))] items-center rounded-xl not-touch:hover:bg-list-hover touch:min-h-[44px]"+ >+ <button+ type="button"+ onClick={props.onOpen}+ aria-haspopup="dialog"+ class="grid min-h-[inherit] w-full grid-cols-[var(--soup-row-indicator-width)_minmax(0,1fr)_auto_8ch] items-center gap-x-(--soup-row-column-gap) rounded-xl pr-2 pl-[calc(var(--soup-row-padding-l)+var(--tutorial-row-inset,0px))] text-left text-sm outline-none [--title-width:10rem] focus-visible:bg-list-hover"+ >+ <span aria-hidden="true" />+ {/* On phones the label takes its own width, and the title truncates+ (after the snippet has given up its space) instead of overflowing. */}+ <span class="flex min-w-0 items-center gap-2 font-medium">+ <PlayCircleIcon class="size-4 shrink-0 text-ink-muted" />+ <span class="w-(--title-width) shrink-0 truncate text-ink mobile:w-auto">+ {t('tutorials.watchTutorial')}+ </span>+ <span class="min-w-0 truncate text-ink">{props.title}</span>+ <span class="min-w-0 flex-1 truncate text-ink/50">+ {props.snippet}+ </span>+ </span>+ {/* The dismiss button sits over this column, like a row's hover actions. */}+ <span class="w-7" aria-hidden="true" />+ <span class="flex items-center justify-end gap-1 text-right text-xs font-medium text-ink-extra-muted">+ <VideoIcon class="size-3.5 shrink-0" />+ {props.length}+ </span>+ </button>+ <div class="absolute top-1/2 right-[calc(8ch+0.5rem+var(--soup-row-column-gap))] -translate-y-1/2">+ <DismissButton onDismiss={props.onDismiss} />+ </div>+ </div>+ );+}++/**+ * For an empty state: a standard secondary button ("▷ Watch tutorial 1:27"),+ * with the dismiss X beside it. The empty state around it names the block.+ */+export function TutorialPillView(props: EntryProps & { class?: string }) {+ return (+ <div class={cn('group/tutorial relative flex items-center', props.class)}>+ <Button+ variant="secondary"+ size="md"+ onClick={props.onOpen}+ aria-haspopup="dialog"+ aria-label={`${t('tutorials.watchTutorial')}: ${props.title}, ${props.length}`}+ >+ <PlayCircleIcon class="size-4" />+ {t('tutorials.watchTutorial')}+ <span class="text-ink-extra-muted">{props.length}</span>+ </Button>+ {/* Hangs outside the button, so the button itself stays centered. */}+ <div class="absolute top-1/2 left-full ml-1 -translate-y-1/2">+ <DismissButton onDismiss={props.onDismiss} />+ </div>+ </div>+ );+}++/**+ * For a sidebar: a sidebar item like the block's own (Inbox, Favorites), with+ * the length in the trailing lane, swapped for the dismiss X on hover.+ */+export function TutorialSidebarItemView(props: EntryProps) {+ return (+ <div class="group/tutorial relative">+ <ViewSidebar.Item+ onClick={props.onOpen}+ aria-haspopup="dialog"+ aria-label={`${t('tutorials.watchTutorial')}: ${props.title}, ${props.length}`}+ >+ <ViewSidebar.Icon>+ <PlayCircleIcon />+ </ViewSidebar.Icon>+ <span class="truncate">{t('tutorials.watchTutorial')}</span>+ <span+ class={cn(+ 'ml-auto shrink-0 pr-1 text-xs text-ink-extra-muted',+ isTouchDevice() ? 'invisible' : 'group-hover/tutorial:invisible'+ )}+ >+ {props.length}+ </span>+ </ViewSidebar.Item>+ <div class="absolute top-1/2 right-0 -translate-y-1/2">+ <DismissButton onDismiss={props.onDismiss} />+ </div>+ </div>+ );+}diff --git a/apps/web/src/features/video-tutorials/components/TutorialShelf.tsx b/apps/web/src/features/video-tutorials/components/TutorialShelf.tsxnew file mode 100644index 0000000000..7175694865--- /dev/null+++ b/apps/web/src/features/video-tutorials/components/TutorialShelf.tsx@@ -0,0 +1,205 @@+import { t } from '@app/lib/i18n';+import ArrowCounterClockwiseIcon from '@icon/system/regular/arrow-counter-clockwise.svg';+import BuildingsIcon from '@icon/system/regular/buildings.svg';+import CalendarBlankIcon from '@icon/system/regular/calendar-blank.svg';+import CalendarCheckIcon from '@icon/system/regular/calendar-check.svg';+import CaretLeftIcon from '@icon/system/regular/caret-left.svg';+import CaretRightIcon from '@icon/system/regular/caret-right.svg';+import ChatsCircleIcon from '@icon/system/regular/chats-circle.svg';+import EnvelopeIcon from '@icon/system/regular/envelope.svg';+import FileTextIcon from '@icon/system/regular/file-text.svg';+import FolderSimpleIcon from '@icon/system/regular/folder-simple.svg';+import GitPullRequestIcon from '@icon/system/regular/git-pull-request.svg';+import HouseIcon from '@icon/system/regular/house.svg';+import ListChecksIcon from '@icon/system/regular/list-checks.svg';+import PhoneCallIcon from '@icon/system/regular/phone-call.svg';+import AgentIcon from '@icon/system/regular/sparkle.svg';+import WhatsappIcon from '@phosphor/whatsapp-logo.svg';+import { createElementSize } from '@solid-primitives/resize-observer';+import { Button } from '@ui';+import { type Component, createSignal, For, type JSX, Show } from 'solid-js';+import { Dynamic } from 'solid-js/web';+import type { TutorialId } from '../core/tutorial-id';++export type ShelfTutorial = {+ id: TutorialId;+ title: string;+ /** "Macro Mail" */+ block: string;+ length: string;+};++type Tile = {+ icon: Component<JSX.SvgSVGAttributes<SVGSVGElement>>;+ /** Two of the theme's hue tokens, washed toward white into a pastel. */+ from: string;+ to: string;+};++/** Each block's tile: the icon the app's navigation shows for it, on its own wash. */+const TILES: Record<TutorialId, Tile> = {+ mail: { icon: EnvelopeIcon, from: '--color-blue', to: '--color-cyan' },+ home: { icon: HouseIcon, from: '--color-amber', to: '--color-orange' },+ chat: { icon: ChatsCircleIcon, from: '--color-violet', to: '--color-blue' },+ tasks: { icon: ListChecksIcon, from: '--color-green', to: '--color-teal' },+ docs: { icon: FileTextIcon, from: '--color-blue', to: '--color-violet' },+ drive: {+ icon: FolderSimpleIcon,+ from: '--color-yellow',+ to: '--color-amber',+ },+ crm: { icon: BuildingsIcon, from: '--color-teal', to: '--color-blue' },+ calendar: {+ icon: CalendarBlankIcon,+ from: '--color-red',+ to: '--color-pink',+ },+ calls: { icon: PhoneCallIcon, from: '--color-lime', to: '--color-green' },+ agents: { icon: AgentIcon, from: '--color-purple', to: '--color-pink' },+ github: {+ icon: GitPullRequestIcon,+ from: '--color-purple',+ to: '--color-violet',+ },+ scheduling: {+ icon: CalendarCheckIcon,+ from: '--color-orange',+ to: '--color-pink',+ },+ whatsapp: { icon: WhatsappIcon, from: '--color-green', to: '--color-lime' },+};++function TileArt(props: { tutorial: ShelfTutorial }) {+ const tile = () => TILES[props.tutorial.id];+ return (+ <span+ class="relative flex aspect-video w-full flex-col items-center justify-center gap-1.5 overflow-hidden rounded-xl text-[black]/80 mobile:gap-1 mobile:rounded-lg"+ style={{+ 'background-image': `linear-gradient(135deg, color-mix(in oklch, var(${tile().from}) 38%, white), color-mix(in oklch, var(${tile().to}) 30%, white))`,+ }}+ >+ <Dynamic+ component={tile().icon}+ class="size-7 shrink-0 mobile:size-5"+ aria-hidden="true"+ />+ <span class="truncate px-2 text-sm font-semibold mobile:text-xs">+ {props.tutorial.block}+ </span>+ <span class="absolute right-1.5 bottom-1.5 rounded-md bg-[black]/75 px-1.5 py-0.5 text-[11px] font-medium text-[white] tabular-nums mobile:right-1 mobile:bottom-1 mobile:text-[10px]">+ {props.tutorial.length}+ </span>+ </span>+ );+}++/**+ * Shown over the bottom of the video once it ends: "More videos from Macro",+ * a Replay action, and a row of the other tutorials that scrolls sideways+ * (arrows on desktop when it overflows, a swipe on phones). Arrow keys move+ * between cards.+ */+export function TutorialShelf(props: {+ tutorials: readonly ShelfTutorial[];+ onSelect: (id: TutorialId) => void;+ onReplay: () => void;+ class?: string;+}) {+ const [row, setRow] = createSignal<HTMLDivElement>();+ const rowSize = createElementSize(row);+ const [scroll, setScroll] = createSignal(0);++ // Reads the row's measured width so it updates as the dialog resizes.+ const maxScroll = () => {+ const element = row();+ if (!element || rowSize.width === null) return 0;+ return element.scrollWidth - element.clientWidth;+ };+ const canGoBack = () => scroll() > 1;+ const canGoForward = () => scroll() < maxScroll() - 1;++ const page = (direction: 1 | -1) => {+ const element = row();+ if (!element) return;+ element.scrollBy({+ left: direction * element.clientWidth * 0.8,+ behavior: 'smooth',+ });+ };++ const moveFocus = (event: KeyboardEvent) => {+ if (event.key !== 'ArrowRight' && event.key !== 'ArrowLeft') return;+ const cards = [+ ...(row()?.querySelectorAll<HTMLButtonElement>('[data-shelf-card]') ??+ []),+ ];+ const index = cards.findIndex((card) => card === document.activeElement);+ if (index < 0) return;+ const next = cards[index + (event.key === 'ArrowRight' ? 1 : -1)];+ if (!next) return;+ event.preventDefault();+ next.focus();+ next.scrollIntoView({ block: 'nearest', inline: 'nearest' });+ };++ return (+ <div class={props.class}>+ <div class="flex items-center gap-2 px-5 pb-2 mobile:px-3 mobile:pb-1.5">+ <h3 class="min-w-0 flex-1 truncate text-sm font-semibold text-[white] mobile:text-xs">+ {t('tutorials.moreVideos')}+ </h3>+ <Show when={canGoBack() || canGoForward()}>+ <Button+ variant="secondary"+ size="icon-sm"+ class="mobile:hidden"+ aria-label={t('tutorials.previousVideos')}+ disabled={!canGoBack()}+ onClick={() => page(-1)}+ >+ <CaretLeftIcon class="size-4 shrink-0" />+ </Button>+ <Button+ variant="secondary"+ size="icon-sm"+ class="mobile:hidden"+ aria-label={t('tutorials.nextVideos')}+ disabled={!canGoForward()}+ onClick={() => page(1)}+ >+ <CaretRightIcon class="size-4 shrink-0" />+ </Button>+ </Show>+ <Button variant="secondary" size="sm" onClick={props.onReplay}>+ <ArrowCounterClockwiseIcon class="size-4 shrink-0" />+ {t('tutorials.replay')}+ </Button>+ </div>+ <div+ ref={setRow}+ onScroll={(event) => setScroll(event.currentTarget.scrollLeft)}+ onKeyDown={moveFocus}+ class="scrollbar-hidden flex snap-x gap-3 overflow-x-auto scroll-px-5 px-5 pb-4 mobile:gap-2 mobile:scroll-px-3 mobile:px-3 mobile:pb-3"+ >+ <For each={props.tutorials}>+ {(tutorial) => (+ <button+ type="button"+ data-shelf-card+ aria-label={`${tutorial.title}, ${tutorial.length}`}+ onClick={() => props.onSelect(tutorial.id)}+ class="group/card flex w-44 shrink-0 snap-start flex-col gap-1.5 rounded-xl text-left outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[white] mobile:w-32"+ >+ <span class="block w-full transition-transform not-touch:group-hover/card:-translate-y-0.5">+ <TileArt tutorial={tutorial} />+ </span>+ <span class="line-clamp-2 text-xs font-medium text-[white]/85 mobile:line-clamp-1 mobile:text-[11px]">+ {tutorial.title}+ </span>+ </button>+ )}+ </For>+ </div>+ </div>+ );+}diff --git a/apps/web/src/features/video-tutorials/components/TutorialSupportLip.tsx b/apps/web/src/features/video-tutorials/components/TutorialSupportLip.tsxnew file mode 100644index 0000000000..5837b9d957--- /dev/null+++ b/apps/web/src/features/video-tutorials/components/TutorialSupportLip.tsx@@ -0,0 +1,46 @@+import { t } from '@app/lib/i18n';+import { Avatar, AvatarGroup, Button } from '@ui';+import { For } from 'solid-js';+import presenterPhoto from '../assets/presenter.jpg';+import juliaPhoto from '../assets/support-julia.jpg';+import teoPhoto from '../assets/support-teo.jpg';++/** Three of the Macro team in every support channel, shown as faces only. */+const SUPPORT_TEAM_PHOTOS = [juliaPhoto, teoPhoto, presenterPhoto];++/**+ * The strip under the video, on the dialog's own surface: the faces of+ * people on the Macro team, overlapping like a block's live viewers, then+ * "Have questions about Macro CRM? Talk to us in your support channel."+ */+export function TutorialSupportLip(props: {+ /** The block the video teaches, like "Macro CRM". */+ block: string;+ onSelect: () => void;+}) {+ return (+ <div class="-mt-1 flex min-h-10 shrink-0 flex-wrap items-center justify-center px-4 pb-1 text-center text-sm text-ink-muted mobile:mt-0 mobile:pt-2">+ {/* Decorative: they show there are real people in the channel. The+ separator rings take the dialog's surface, as the live viewers'+ take the header's. */}+ <AvatarGroup+ size="md"+ aria-hidden="true"+ class="mr-2.5 [--avatar-group-separator:var(--color-dialog)]"+ >+ <For each={SUPPORT_TEAM_PHOTOS}>+ {(photo) => (+ <Avatar size="md">+ <Avatar.Image src={photo} alt="" />+ <Avatar.Fallback />+ </Avatar>+ )}+ </For>+ </AvatarGroup>+ <span>{t('tutorials.supportQuestion', { block: props.block })}</span>+ <Button variant="link" size="sm" onClick={props.onSelect}>+ {t('tutorials.supportChannel')}+ </Button>+ </div>+ );+}diff --git a/apps/web/src/features/video-tutorials/components/TutorialVideoDialog.tsx b/apps/web/src/features/video-tutorials/components/TutorialVideoDialog.tsxnew file mode 100644index 0000000000..b70a5f9467--- /dev/null+++ b/apps/web/src/features/video-tutorials/components/TutorialVideoDialog.tsx@@ -0,0 +1,215 @@+import { t } from '@app/lib/i18n';+import { fireAndForget } from '@core/util/fireAndForget';+import XIcon from '@icon/system/regular/x.svg';+import { Button, Dialog } from '@ui';+import { createSignal, type JSX, Show } from 'solid-js';+import presenterPhoto from '../assets/presenter.jpg';+import { TUTORIAL_PRESENTER } from '../core/presenter';+import type { TutorialId } from '../core/tutorial-id';+import { type ShelfTutorial, TutorialShelf } from './TutorialShelf';++/**+ * The pill's play disc: dark grey on the pill's near-black with a solid+ * white triangle. The triangle's centroid sits on the disc's centre, which is+ * where the eye puts a play glyph's middle, so it reads as centred without+ * nudging.+ */+function PlayDisc() {+ return (+ <svg+ viewBox="0 0 96 96"+ aria-hidden="true"+ class="size-12 shrink-0 transition-transform not-touch:group-hover/play:scale-105 mobile:size-10"+ >+ <circle cx="48" cy="48" r="48" fill="white" fill-opacity="0.16" />+ <path+ d="M39 32 L67 48 L39 64 Z"+ fill="white"+ stroke="white"+ stroke-width="6"+ stroke-linejoin="round"+ />+ </svg>+ );+}++/**+ * The tutorial video at 80% of the window, paused behind a play pill (play+ * disc, then the presenter and the video's length): the video never+ * autoplays. On phones the shared Dialog becomes its bottom sheet.+ */+export function TutorialVideoDialog(props: {+ open: boolean;+ onOpenChange: (open: boolean) => void;+ title: string;+ /** The video's length, like "1:11". */+ length: string;+ videoUrl: string;+ posterUrl: string;+ /** Called once per opening, when playback really starts. */+ onPlayStarted: () => void;+ /** The other tutorials, offered on the shelf once this video ends. */+ more: readonly ShelfTutorial[];+ /** Switch the dialog to another tutorial, paused at its play button. */+ onSelectTutorial: (id: TutorialId) => void;+ /**+ * The strip under the video. It gets the dialog's close, so a link in it+ * can leave the video paused and closed behind it.+ */+ footer?: (close: () => void) => JSX.Element;+}) {+ const [started, setStarted] = createSignal(false);+ const [ended, setEnded] = createSignal(false);+ let video: HTMLVideoElement | undefined;+ let playButton: HTMLButtonElement | undefined;+ let playRecorded = false;++ const recordPlay = () => {+ setStarted(true);+ setEnded(false);+ if (playRecorded) return;+ playRecorded = true;+ props.onPlayStarted();+ };++ const play = () => {+ if (!video) return;+ setStarted(true);+ // The play overlay unmounts, so hand focus to the video: Space and Escape keep working.+ video.focus();+ fireAndForget(video.play(), 'video-tutorials');+ };++ const replay = () => {+ if (!video) return;+ setEnded(false);+ video.currentTime = 0;+ video.focus();+ fireAndForget(video.play(), 'video-tutorials');+ };++ const reset = () => {+ video?.pause();+ setStarted(false);+ setEnded(false);+ playRecorded = false;+ };++ const selectTutorial = (id: TutorialId) => {+ reset();+ props.onSelectTutorial(id);+ // The card that was pressed unmounts with the shelf; the next video's play+ // button takes focus, so Enter or Space starts it.+ playButton?.focus();+ };++ const changeOpen = (open: boolean) => {+ if (!open) reset();+ props.onOpenChange(open);+ };++ return (+ <Dialog+ open={props.open}+ onOpenChange={changeOpen}+ position="center"+ animate+ class="w-[80vw] max-w-[80vw] mobile:w-auto mobile:max-w-none"+ >+ <div class="flex h-[80vh] w-full flex-col mobile:h-auto">+ <div class="flex h-12 shrink-0 items-center gap-2 pr-2 pl-4 mobile:hidden">+ <Dialog.Title class="min-w-0 flex-1 truncate text-sm font-medium text-ink">+ {props.title}+ </Dialog.Title>+ <Dialog.CloseButton+ as={Button}+ variant="ghost"+ size="icon-md"+ aria-label={t('tutorials.closeVideo')}+ >+ <XIcon class="size-4 shrink-0" />+ </Dialog.CloseButton>+ </div>+ <div class="relative mx-2 mb-2 flex min-h-0 flex-1 items-center justify-center overflow-hidden rounded-[18px] bg-[black] mobile:m-0 mobile:rounded-none">+ <video+ ref={video}+ src={props.videoUrl}+ poster={props.posterUrl}+ preload="metadata"+ playsinline+ tabIndex={-1}+ controls={started() && !ended()}+ onPlaying={recordPlay}+ onEnded={() => setEnded(true)}+ onKeyDown={(event) => {+ if (event.key === 'Escape') changeOpen(false);+ }}+ class="max-h-full w-full object-contain mobile:aspect-video"+ />+ <Show when={!started()}>+ {/* The dimmed poster also starts the video on a click; the pill+ is the button keyboards and screen readers use. */}+ <button+ type="button"+ tabIndex={-1}+ aria-hidden="true"+ onClick={play}+ class="absolute inset-0 bg-[black]/45"+ />+ <div class="pointer-events-none absolute inset-0 grid place-items-center">+ <button+ ref={playButton}+ type="button"+ onClick={play}+ aria-label={t('tutorials.playTutorial', {+ title: props.title,+ length: props.length,+ })}+ class="group/play pointer-events-auto flex h-16 items-center gap-3 rounded-full border border-[white]/12 bg-[rgb(20_20_20/0.85)] py-2 pr-6 pl-2 whitespace-nowrap text-[white] shadow-2xl outline-none transition-colors not-touch:hover:bg-[rgb(38_38_38/0.9)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[white] mobile:h-12 mobile:gap-2 mobile:py-1 mobile:pr-4 mobile:pl-1"+ >+ <PlayDisc />+ <span+ aria-hidden="true"+ class="h-[60%] w-px shrink-0 bg-[white]/15"+ />+ <img+ src={presenterPhoto}+ alt=""+ class="size-11 shrink-0 rounded-full object-cover mobile:size-9"+ />+ <span class="flex flex-col items-start text-left leading-tight">+ <span class="text-base font-medium mobile:text-sm">+ {TUTORIAL_PRESENTER}+ </span>+ <span class="text-sm text-[white]/60 tabular-nums mobile:text-xs">+ {t('tutorials.watchDemo')} · {props.length}+ </span>+ </span>+ </button>+ </div>+ </Show>+ <Show when={ended()}>+ {/* The last frame stays faintly visible under a dark wash; a+ click on it replays (the shelf's Replay is the keyboard path). */}+ <button+ type="button"+ tabIndex={-1}+ aria-hidden="true"+ onClick={replay}+ class="absolute inset-0 bg-linear-to-t from-[black]/90 via-[black]/65 to-[black]/40 transition-opacity duration-500 starting:opacity-0"+ />+ <TutorialShelf+ tutorials={props.more}+ onSelect={selectTutorial}+ onReplay={replay}+ class="absolute inset-x-0 bottom-0 transition-[opacity,translate] duration-500 starting:translate-y-2 starting:opacity-0"+ />+ </Show>+ </div>+ <Show when={props.footer}>+ {(footer) => footer()(() => changeOpen(false))}+ </Show>+ </div>+ </Dialog>+ );+}diff --git a/apps/web/src/features/video-tutorials/core/presenter.ts b/apps/web/src/features/video-tutorials/core/presenter.tsnew file mode 100644index 0000000000..91c5dd1156--- /dev/null+++ b/apps/web/src/features/video-tutorials/core/presenter.ts@@ -0,0 +1,5 @@+/**+ * Who presents the tutorial videos, shown in each video's byline before it+ * plays. A person's name, so it is not translated.+ */+export const TUTORIAL_PRESENTER = 'Jacob Beckerman';diff --git a/apps/web/src/features/video-tutorials/core/support-channel.ts b/apps/web/src/features/video-tutorials/core/support-channel.tsnew file mode 100644index 0000000000..8aa5d05dcc--- /dev/null+++ b/apps/web/src/features/video-tutorials/core/support-channel.ts@@ -0,0 +1,41 @@+/**+ * Every person who signs up gets a private support channel with the Macro+ * team, owned by them and named `Macro Support x <email local part>`+ * (`support_channel_name` in the authentication service's create-user+ * webhook). Nothing else marks it, so it is found by that name and owner.+ * Macro team members belong to many customers' support channels and own+ * none; for them the link opens the most recently active one, so the team+ * sees what customers see and lands where support is happening.+ */+const SUPPORT_CHANNEL_NAME_PREFIX = 'Macro Support x ';++type ChannelSummary = {+ id: string;+ name?: string | null;+ owner_id: string;+ updated_at?: string;+};++/** The support channel the link opens: the person's own, else their most recently active one. */+export function findSupportChannelId(+ channels: readonly ChannelSummary[],+ userId: string | undefined+): string | undefined {+ if (!userId) return undefined;++ const supportChannels = channels.filter((channel) =>+ channel.name?.startsWith(SUPPORT_CHANNEL_NAME_PREFIX)+ );+ const own = supportChannels.find((channel) => channel.owner_id === userId);+ if (own) return own.id;++ return supportChannels.reduce<ChannelSummary | undefined>(+ (latest, channel) =>+ !latest || updatedAt(channel) > updatedAt(latest) ? channel : latest,+ undefined+ )?.id;+}++function updatedAt(channel: ChannelSummary): number {+ return channel.updated_at ? Date.parse(channel.updated_at) : 0;+}diff --git a/apps/web/src/features/video-tutorials/core/tutorial-id.ts b/apps/web/src/features/video-tutorials/core/tutorial-id.tsnew file mode 100644index 0000000000..ee90ee3e68--- /dev/null+++ b/apps/web/src/features/video-tutorials/core/tutorial-id.ts@@ -0,0 +1,32 @@+/**+ * The blocks that have a "Learn how to use" tutorial video. The id names the+ * block, keys its assets and messages, and is sent with analytics as+ * `macro-<id>`.+ */+export const TUTORIAL_IDS = [+ 'mail',+ 'home',+ 'chat',+ 'tasks',+ 'docs',+ 'drive',+ 'crm',+ 'calendar',+ 'calls',+ 'agents',+ 'github',+ 'scheduling',+ 'whatsapp',+] as const;++export type TutorialId = (typeof TUTORIAL_IDS)[number];++/**+ * Where a tutorial's dismissal is remembered on this device. Mail keeps the+ * key it shipped with, so people who already dismissed it don't see it again.+ */+export function tutorialDismissedKey(id: TutorialId): string {+ return id === 'mail'+ ? 'email-tutorial-row-dismissed'+ : `tutorial-${id}-dismissed`;+}diff --git a/apps/web/src/features/video-tutorials/index.ts b/apps/web/src/features/video-tutorials/index.tsnew file mode 100644index 0000000000..0117a90389--- /dev/null+++ b/apps/web/src/features/video-tutorials/index.ts@@ -0,0 +1,7 @@+export { TUTORIAL_IDS, type TutorialId } from './core/tutorial-id';+export {+ hasTutorial,+ TutorialPill,+ TutorialRow,+ TutorialSidebarItem,+} from './views/BlockTutorial';diff --git a/apps/web/src/features/video-tutorials/primitives/create-support-link.ts b/apps/web/src/features/video-tutorials/primitives/create-support-link.tsnew file mode 100644index 0000000000..fff300acf7--- /dev/null+++ b/apps/web/src/features/video-tutorials/primitives/create-support-link.ts@@ -0,0 +1,25 @@+import { useSplitLayout } from '@components/app/split-layout/layout';+import { useChannelsContext } from '@core/context/channels';+import { useUserId } from '@core/context/user';+import { createMemo } from 'solid-js';+import { findSupportChannelId } from '../core/support-channel';++/**+ * The person's support channel with the Macro team, and how to open it.+ * Unknown while the channel list first loads; absent when they are in none.+ */+export function createSupportLink() {+ const { channels, isLoading } = useChannelsContext();+ const userId = useUserId();+ const { openWithSplit } = useSplitLayout();+ const channelId = createMemo(() =>+ isLoading() ? undefined : findSupportChannelId(channels(), userId())+ );++ return {+ channelId,+ open: (id: string) => {+ openWithSplit({ type: 'channel', id }, { activate: true });+ },+ };+}diff --git a/apps/web/src/features/video-tutorials/primitives/create-tutorial-state.ts b/apps/web/src/features/video-tutorials/primitives/create-tutorial-state.tsnew file mode 100644index 0000000000..38fc463e30--- /dev/null+++ b/apps/web/src/features/video-tutorials/primitives/create-tutorial-state.ts@@ -0,0 +1,66 @@+import { analytics } from '@app/lib/analytics';+import { makePersistedState } from '@app/lib/persistence';+import { createSignal } from 'solid-js';+import { z } from 'zod';+import { type TutorialId, tutorialDismissedKey } from '../core/tutorial-id';++const DISMISSED_VALUE = z.literal('true');++/**+ * One tutorial entry's state: whether its video dialog is open, which video+ * it shows, and whether the person dismissed the entry on this device+ * (remembered until they clear site data).+ */+export function createTutorialState(id: TutorialId) {+ const key = tutorialDismissedKey(id);+ const [open, setOpen] = createSignal(false);+ const [dismissed, setDismissed] = makePersistedState(createSignal(false), {+ storages: {+ restore: () =>+ DISMISSED_VALUE.safeParse(localStorage.getItem(key)).success+ ? true+ : undefined,+ write: (value) => {+ if (value) localStorage.setItem(key, 'true');+ },+ },+ });++ // The video the dialog shows: the entry's own, or another one picked from+ // the shelf after a video ends.+ const [shown, setShown] = createSignal<TutorialId>(id);++ const track = (+ tutorial: TutorialId,+ action: 'opened' | 'played' | 'dismissed' | 'support_clicked'+ ) =>+ analytics.track('tutorial_video', {+ tutorial: `macro-${tutorial}`,+ action,+ });++ return {+ open,+ setOpen,+ dismissed,+ shown,+ openVideo: () => {+ setShown(id);+ track(id, 'opened');+ setOpen(true);+ },+ /** Switch the open dialog to another tutorial. */+ show: (next: TutorialId) => {+ setShown(next);+ track(next, 'opened');+ },+ dismiss: () => {+ track(id, 'dismissed');+ setDismissed(true);+ },+ recordPlay: () => track(shown(), 'played'),+ recordSupportClick: () => track(shown(), 'support_clicked'),+ };+}++export type TutorialState = ReturnType<typeof createTutorialState>;diff --git a/apps/web/src/features/video-tutorials/views/BlockTutorial.tsx b/apps/web/src/features/video-tutorials/views/BlockTutorial.tsxnew file mode 100644index 0000000000..e8777b5c7a--- /dev/null+++ b/apps/web/src/features/video-tutorials/views/BlockTutorial.tsx@@ -0,0 +1,130 @@+import { Match, Show, Switch } from 'solid-js';+import { TUTORIALS, type Tutorial } from '../catalog';+import {+ TutorialPillView,+ TutorialRowView,+ TutorialSidebarItemView,+} from '../components/TutorialEntries';+import { TutorialSupportLip } from '../components/TutorialSupportLip';+import { TutorialVideoDialog } from '../components/TutorialVideoDialog';+import { TUTORIAL_IDS, type TutorialId } from '../core/tutorial-id';+import { createSupportLink } from '../primitives/create-support-link';+import {+ createTutorialState,+ type TutorialState,+} from '../primitives/create-tutorial-state';++/**+ * "Have questions about Macro CRM? Talk to us in your support channel." under+ * the video, when the person has a support channel. Mounts with the open+ * dialog, so the channel list is read only then. Following it closes the+ * dialog.+ */+function SupportLip(props: { block: string; onFollow: () => void }) {+ const support = createSupportLink();+ return (+ <Show when={support.channelId()}>+ {(channelId) => (+ <TutorialSupportLip+ block={props.block}+ onSelect={() => {+ props.onFollow();+ support.open(channelId());+ }}+ />+ )}+ </Show>+ );+}++function Entry(props: {+ tutorial: Tutorial;+ variant: 'row' | 'pill' | 'sidebar';+ class?: string;+}) {+ const state: TutorialState = createTutorialState(props.tutorial.id);+ const shown = () => TUTORIALS[state.shown()] ?? props.tutorial;+ // The shelf after a video ends: every other tutorial, in the blocks' order.+ const more = () =>+ TUTORIAL_IDS.flatMap((id) => {+ const tutorial = TUTORIALS[id];+ return tutorial && id !== state.shown() ? [tutorial] : [];+ });+ const entry = () => ({+ title: props.tutorial.title,+ snippet: props.tutorial.snippet,+ length: props.tutorial.length,+ onOpen: state.openVideo,+ onDismiss: state.dismiss,+ });+ return (+ <Show when={!state.dismissed()}>+ <Switch>+ <Match when={props.variant === 'row'}>+ <TutorialRowView {...entry()} />+ </Match>+ <Match when={props.variant === 'pill'}>+ <TutorialPillView {...entry()} class={props.class} />+ </Match>+ <Match when={props.variant === 'sidebar'}>+ <TutorialSidebarItemView {...entry()} />+ </Match>+ </Switch>+ <TutorialVideoDialog+ open={state.open()}+ onOpenChange={state.setOpen}+ title={shown().title}+ length={shown().length}+ videoUrl={shown().videoUrl}+ posterUrl={shown().posterUrl}+ onPlayStarted={state.recordPlay}+ more={more()}+ onSelectTutorial={state.show}+ footer={(close) => (+ <SupportLip+ block={shown().block}+ onFollow={() => {+ state.recordSupportClick();+ close();+ }}+ />+ )}+ />+ </Show>+ );+}++/**+ * A block's "Learn how to use" row, pinned at the top of its main list. Renders+ * nothing until the block's video exists in the catalog, or once dismissed.+ */+export function TutorialRow(props: { tutorial: TutorialId }) {+ return (+ <Show when={TUTORIALS[props.tutorial]}>+ {(tutorial) => <Entry tutorial={tutorial()} variant="row" />}+ </Show>+ );+}++/** The entry as a button, centered in a block's empty state. */+export function TutorialPill(props: { tutorial: TutorialId; class?: string }) {+ return (+ <Show when={TUTORIALS[props.tutorial]}>+ {(tutorial) => (+ <Entry tutorial={tutorial()} variant="pill" class={props.class} />+ )}+ </Show>+ );+}++/** The entry as a sidebar item, at the top of a block's sidebar. */+export function TutorialSidebarItem(props: { tutorial: TutorialId }) {+ return (+ <Show when={TUTORIALS[props.tutorial]}>+ {(tutorial) => <Entry tutorial={tutorial()} variant="sidebar" />}+ </Show>+ );+}++/** Whether a block has a tutorial video yet (for layouts that reserve space). */+export const hasTutorial = (id: TutorialId) => TUTORIALS[id] !== undefined;diff --git a/apps/web/src/lib/analytics/app-events.ts b/apps/web/src/lib/analytics/app-events.tsindex a3531a7808..346f73f226 100644--- a/apps/web/src/lib/analytics/app-events.ts+++ b/apps/web/src/lib/analytics/app-events.ts@@ -262,6 +262,27 @@ export type AppEvents = {action: 'add' | 'remove';};+ // In-product tutorial videos (the pinned row at the top of an inbox).+ tutorial_video: {+ /** `macro-<id>` for each id in features/video-tutorials/core/tutorial-id.ts. */+ tutorial:+ | 'macro-mail'+ | 'macro-home'+ | 'macro-chat'+ | 'macro-tasks'+ | 'macro-docs'+ | 'macro-drive'+ | 'macro-crm'+ | 'macro-calendar'+ | 'macro-calls'+ | 'macro-agents'+ | 'macro-github'+ | 'macro-scheduling'+ | 'macro-whatsapp';+ /** `support_clicked`: the dialog's "Talk to us" link under the video. */+ action: 'opened' | 'played' | 'dismissed' | 'support_clicked';+ };+// --- Calls ---------------------------------------------------------------// Frontend call interactions only. Recordings, transcripts and summaries// are produced server-side and send no PostHog events yet; the call servicediff --git a/apps/web/src/lib/i18n/locales/en.ts b/apps/web/src/lib/i18n/locales/en.tsindex ddd9b174d0..005fb49c20 100644--- a/apps/web/src/lib/i18n/locales/en.ts+++ b/apps/web/src/lib/i18n/locales/en.ts@@ -21,6 +21,7 @@ import settingsMobileApp from './en/settings-mobile-app';import settingsNav from './en/settings-nav';import splitMenu from './en/split-menu';import tabs from './en/tabs';+import tutorials from './en/tutorials';import viewMenus from './en/view-menus';/**@@ -51,5 +52,6 @@ export default {settingsNav,splitMenu,tabs,+ tutorials,viewMenus,};diff --git a/apps/web/src/lib/i18n/locales/en/tutorials.ts b/apps/web/src/lib/i18n/locales/en/tutorials.tsnew file mode 100644index 0000000000..d5594d386a--- /dev/null+++ b/apps/web/src/lib/i18n/locales/en/tutorials.ts@@ -0,0 +1,78 @@+export default {+ watchTutorial: 'Watch tutorial',+ dismiss: 'Dismiss',+ playTutorial: 'Play {{title}}, {{length}}',+ watchDemo: 'Watch demo',+ closeVideo: 'Close video',+ supportQuestion: 'Have questions about {{block}}?',+ supportChannel: 'Talk to us in your support channel →',+ moreVideos: 'More videos from Macro',+ replay: 'Replay',+ previousVideos: 'Previous videos',+ nextVideos: 'More videos',+ mailTitle: 'Learn how to use Macro Mail',+ mailBlock: 'Macro Mail',+ mailSnippet:+ 'Every account in one inbox, plus channels, tasks, routines and agents',+ mailLength: '1:42',+ crmTitle: 'Learn how to use Macro CRM',+ crmBlock: 'Macro CRM',+ crmSnippet:+ 'A pipeline that updates itself: kanban, routines after calls, AI chat',+ crmLength: '1:26',+ githubTitle: 'Learn how to use Macro with GitHub',+ githubBlock: 'GitHub in Macro',+ githubSnippet:+ 'Pull request previews, coding agents that merge from channels, and PRs in splits',+ githubLength: '1:01',+ docsTitle: 'Learn how to use Macro Docs',+ docsBlock: 'Macro Docs',+ docsSnippet:+ 'Mention anything, edit live with your team, and agents with a live cursor',+ docsLength: '1:46',+ tasksTitle: 'Learn how to use Macro Tasks',+ tasksBlock: 'Macro Tasks',+ tasksSnippet:+ 'List, board and timeline, projects and tags, linked to email, docs and channels',+ tasksLength: '1:57',+ chatTitle: 'Learn how to use Macro Chat',+ chatBlock: 'Macro Chat',+ chatSnippet:+ 'Mention anything, turn messages into tasks, inline replies and a real inbox',+ chatLength: '1:30',+ callsTitle: 'Learn how to use Macro Calls',+ callsBlock: 'Macro Calls',+ callsSnippet:+ 'Calls with transcripts and summaries, shared with your team and its agents',+ callsLength: '1:10',+ schedulingTitle: 'Learn how to use Macro Scheduling',+ schedulingBlock: 'Macro Scheduling',+ schedulingSnippet:+ 'Booking links built into your calendar, created by an agent',+ schedulingLength: '0:44',+ calendarTitle: 'Learn how to use Macro Calendar',+ calendarBlock: 'Macro Calendar',+ calendarSnippet:+ 'Agents that schedule for you, and meetings right in your channels',+ calendarLength: '0:54',+ homeTitle: 'Learn how to use Macro Home',+ homeBlock: 'Macro Home',+ homeSnippet:+ 'One inbox for everything, built for speed, with everything linked together',+ homeLength: '1:00',+ whatsappTitle: 'Learn how to use WhatsApp in Macro',+ whatsappBlock: 'WhatsApp in Macro',+ whatsappSnippet:+ 'Link WhatsApp, bring your chats in, reply, share and mention them in channels',+ whatsappLength: '0:43',+ agentsTitle: 'Learn how to use Macro Agents',+ agentsBlock: 'Macro Agents',+ agentsSnippet:+ 'Agents in your channels, tasks for agents, macroD and unified memory',+ agentsLength: '1:05',+ driveTitle: 'Learn how to use Macro Drive',+ driveBlock: 'Macro Drive',+ driveSnippet:+ 'Files from channels, DMs and email in one place, linked to everything else',+ driveLength: '1:29',+};diff --git a/docs/agent-guide/ai-chat.md b/docs/agent-guide/ai-chat.mdindex deb5c20a9e..5b6bc476f2 100644--- a/docs/agent-guide/ai-chat.md+++ b/docs/agent-guide/ai-chat.md@@ -610,6 +610,7 @@ the shimmer.every card has **Chat about this** (adds a mention of that session to thecomposer draft) and **Open session**. Answered cards leave once the sessionstops waiting. Check with a coding session blocked on a permission prompt.+- The Agents view's New conversation page shows the Agents `TutorialPill` centered under the composer (from `features/video-tutorials`) once that video is in its catalog (Home's agent input does not).- Selecting an agent changes the heading: **What should we work on?** for chatagents and **What should we build?** for coding agents. The draft stays intactwhen changing agents. Unsent New conversation text and attachments also comediff --git a/docs/agent-guide/calendar.md b/docs/agent-guide/calendar.mdindex 40fa08b137..1338c887bd 100644--- a/docs/agent-guide/calendar.md+++ b/docs/agent-guide/calendar.md@@ -2,6 +2,8 @@## Calendar — `/app/calendar/<month-or-week-or-day>`+The top of the Calendar sidebar holds the Calendar `TutorialSidebarItem` (from `features/video-tutorials`) once that video is in its catalog; phones have no Calendar sidebar, so no entry.+Microsoft calendars use the same editor and calendar views after calendar consent.Conference choices follow the selected calendar's capabilities: Microsoft Teamswhere supported and Google Meet for Google calendars. Selecting a calendar that@@ -879,6 +881,7 @@ description, then larger task-style URL-path, duration, and scheduling-type pillwith matching surfaces. Scheduling type reflects the saved link mode: Individual,Collective, or Round robin, with a corresponding icon. Pills wrap on narrow panesand align with the title on touch devices. Row content has no hover tooltips.+The Booking links list, empty or not, starts with the Scheduling `TutorialRow` (from `features/video-tutorials`) once that video is in its catalog.Paused links appear dimmed but remain editable. The URL pill offers Copy link andOpen in new tab. Desktop More and right-click menus share Copy link, Preview,Edit, Duplicate, and Delete. Touch rows hide More; hold a row to open the shareddiff --git a/docs/agent-guide/calls.md b/docs/agent-guide/calls.mdindex 268c1cd3fa..60697e1cb6 100644--- a/docs/agent-guide/calls.md+++ b/docs/agent-guide/calls.md@@ -2,6 +2,8 @@## Calls — `/app/calls`+The Calls list starts with the Calls `TutorialRow` (from `features/video-tutorials`) once that video is in its catalog; it sits below the touch inset, outside the virtualized rows.+On desktop a collapsible sidebar starts with the shared outlined `New` button,with `Search calls` immediately left of collapse. Search reveals its field aboveNew. The sidebar also holdsdiff --git a/docs/agent-guide/channels.md b/docs/agent-guide/channels.mdindex 3ee273e279..1fedc4bf50 100644--- a/docs/agent-guide/channels.md+++ b/docs/agent-guide/channels.md@@ -1025,6 +1025,8 @@ in place until the result arrives.## Chat navigation rail+With no conversation open, the desktop **Select a conversation** pane shows the Chat `TutorialPill` (from `features/video-tutorials`) once that video is in its catalog; touch layouts, which have no detail pane, show it in the empty conversation list.+Following a channel mention or browser notification for the conversation alreadyshown in Chat activates that workspace and jumps to the targeted message or reply.It keeps the shared channel detail mounted and does not show a **Content already open**diff --git a/docs/agent-guide/crm.md b/docs/agent-guide/crm.mdindex 1f459828d1..876728a341 100644--- a/docs/agent-guide/crm.md+++ b/docs/agent-guide/crm.md@@ -11,6 +11,7 @@ Lists follow. Record-detail tabs keep their unprefixed names.There are no built-in company views or Board/List layout. Companies and Peopleare plain soup lists with the shared pagination. Existing personal/team savedviews stay in the toolbar's Views menu.+The Companies list starts with the Customers `TutorialRow` (from `features/video-tutorials`) once that video is in its catalog; it sits outside the virtualized rows.Opening a company or contact row in Companies or People clears its blue unreaddot, including desktop preview activation, keyboard opening, and phone navigation.diff --git a/docs/agent-guide/email.md b/docs/agent-guide/email.mdindex 833c6d22c8..f525ea442e 100644--- a/docs/agent-guide/email.md+++ b/docs/agent-guide/email.md@@ -50,6 +50,14 @@ While the email list itself has focus, `Tab` moves browser focus instead; use`g i` or `g o`. Calendar mail remains available through the calendar filter andexisting Calendar route. Mobile keeps its original tabs and order, includingseparate Signal, Noise, and Calendar tabs, with `Focus` (flagged) first.+The top of Signal shows a pinned **Learn how to use Macro Mail** row+(`TutorialRow` from `features/video-tutorials`, shared by every block). Clicking it opens the tutorial video in a dialog at 80% of+the window (a bottom sheet on phones) that never autoplays: the play pill+(play disc, then the presenter's photo and name over "Watch demo · 1:27")+starts it and brings up the native controls. When it ends, the last frame dims under a shelf, "More videos from Macro", of the other tutorials (each block's nav icon on a pastel tile with its length); a card switches the dialog to that video, paused, and Replay or a click on the frame restarts it. Under the video, three Macro team faces (stacked like a block's live viewers) and "Have questions about Macro Mail? **Talk to us in your support channel →**" open the person's own `Macro Support x …` channel and close the dialog; the line is left out when they own no such channel. The row's X (on hover, always on+touch) hides it on that device for good (`localStorage`+`email-tutorial-row-dismissed`). It is outside the virtualized rows, so list+keyboard focus skips it.Compose via the `Email` button (or `Create` → `Email E`). On a fresh local user itshows `Connect your email`; Gmail/Google Workspace and enabled Outlook connectionsuse provider consent. Most functionality needs a connected account. Search is `Ctrl+F` or `/` within the surface.diff --git a/docs/agent-guide/external.md b/docs/agent-guide/external.mdindex abf43f904c..c98c2e3524 100644--- a/docs/agent-guide/external.md+++ b/docs/agent-guide/external.md@@ -6,6 +6,7 @@ chat). WhatsApp is the only provider today. The view, its rail button, its More-mobile and the `g x` shortcut exist only with the `enable-whatsapp-linked`flag; a deep link with the flag off goes to Home once the flag resolves. Turnit on locally with `VITE_ENABLE_WHATSAPP_LINKED=true`.+The WhatsApp page opens with the WhatsApp `TutorialSidebarItem` (from `features/video-tutorials`, shaped like the page's chat rows) once that video is in its catalog, above the chats whether or not an account is linked.## Where it isdiff --git a/docs/agent-guide/files.md b/docs/agent-guide/files.mdindex e122e735d7..0107328820 100644--- a/docs/agent-guide/files.md+++ b/docs/agent-guide/files.md@@ -15,6 +15,7 @@ viewer identity is available, document inserts into Shared are rejected.Files opens **Drive** using the same shell as Tasks, on desktop and touchdevices alike.+The top of Drive's My Files, Recent and Shared lists (not folders) holds the Drive `TutorialRow`, outside the virtualized rows, and the top of Drive's sidebar (the overlay sidebar on phones) holds the Docs `TutorialSidebarItem` (both from `features/video-tutorials`, each once its video is in the catalog).The document header's **Copy Share Link** and the Share dialog's **Copy Link**copy a standalone link to the selected file, not the current browser URL.diff --git a/docs/agent-guide/home.md b/docs/agent-guide/home.mdindex 27d9432c45..aea4a326bb 100644--- a/docs/agent-guide/home.md+++ b/docs/agent-guide/home.md@@ -7,6 +7,7 @@ pill strip with a leading filter drawer (Status and Type), pull-to-refresh,and swipe-left to mark done. On touch, Signal is a pure notification feed — the viewer's owntouched-by-me recents are not merged in; that merge is desktop Home's Signalonly, so sent mail and AI chats without notifications appear only on desktop.+Signal, including its empty state, starts with the Home tutorial entry (from `features/video-tutorials`) once that video is in its catalog: a `TutorialSidebarItem` in the desktop rail, a `TutorialRow` on touch. It sits outside the virtualized rows, so list keyboard focus skips it.On a cold launch, notification transport follows the GraphQL Soup flag reactively:if the flag arrives after REST starts, the GraphQL notification query must actuallydiff --git a/docs/agent-guide/tasks.md b/docs/agent-guide/tasks.mdindex 81d491ef6d..65ddc32003 100644--- a/docs/agent-guide/tasks.md+++ b/docs/agent-guide/tasks.md@@ -2,6 +2,8 @@## Surface+The main Tasks list (List layout, not project or CRM task lists) starts with the Tasks `TutorialRow` (from `features/video-tutorials`) once that video is in its catalog; it sits outside the virtualized rows, so list keyboard focus skips it.+`Go to Tasks` → `/app/component/tasks`. Task views: `My tasks`, `All tasks`, and `Created by me`.The single-row desktop header contains the title, `Filter`, a separate`Task layout` single-select icon group for `List`, `Board`, and enabled `Gantt`,@@ -629,6 +631,7 @@ It opens a separate `/app/reviews` shell whose sidebar lists `Pull requests`,`Authored by me`, `Assigned to me`, `Involves me`, and `Review requests`;`Involves me` is selected by default. The selected tab is stored in the URL andsurvives opening a PR and returning through the breadcrumb.+The top of the Reviews list (List layout) holds the GitHub `TutorialRow` (from `features/video-tutorials`) once that video is in its catalog.The list contains accessible GitHub pull requests of any status. `Involves me`uses the server's participant filter for your linked GitHub account: author,requested reviewer, assignee, commenter, or reviewer. Participant IDs are retained