Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(web): align CRM mobile layout (#6609)

dev-rb246a1ec14a44
diff --git a/apps/web/src/components/app/split-layout/componentRegistry.tsx b/apps/web/src/components/app/split-layout/componentRegistry.tsx
index 1daf2f5e42..e613195035 100644
--- a/apps/web/src/components/app/split-layout/componentRegistry.tsx
+++ b/apps/web/src/components/app/split-layout/componentRegistry.tsx
@@ -613,6 +613,12 @@ registerComponent(
return <RedirectSplit to={{ type: 'component', id: 'inbox' }} />;
}
usePageViewTracking('companies');
+ const panel = useSplitPanelOrThrow();
+ createRenderEffect(() => {
+ panel.handle.updateMeta?.({
+ splitPanelLayout: isTouchDevice() ? 'legacy' : 'composable',
+ });
+ });
const preset = getViewPreset('companies');
// Share links land here as `/companies?crmView=<encoded config>` — the
// param carries the full view state (never data), decoded client-side.
@@ -631,8 +637,7 @@ registerComponent(
initialCrmView={initialCrmView}
/>
);
- }),
- { splitPanelLayout: 'composable' }
+ })
);
registerComponent(
diff --git a/apps/web/src/features/companies/views/CrmWorkspace.tsx b/apps/web/src/features/companies/views/CrmWorkspace.tsx
index f6c7643b0e..b3e683cb95 100644
--- a/apps/web/src/features/companies/views/CrmWorkspace.tsx
+++ b/apps/web/src/features/companies/views/CrmWorkspace.tsx
@@ -24,6 +24,7 @@ import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
import { enableCrmLists } from '@core/constant/featureFlags';
import { useSettingsState } from '@core/constant/SettingsState';
import { useUserId } from '@core/context/user';
+import { isTouchDevice } from '@core/mobile/isTouchDevice';
import { type EntityData, isCrmCompanyEntity } from '@entity';
import ListIcon from '@phosphor/list.svg';
import { fetchCrmExportCompanies } from '@queries/crm/export';
@@ -73,9 +74,11 @@ function NavigationToggle(props: {
<Dropdown.Trigger
variant="ghost"
size="icon-sm"
+ depth={isTouchDevice() ? 3 : undefined}
+ class="touch:island touch:pointer-events-auto touch:size-10 touch:shrink-0 touch:rounded-full touch:bg-chrome"
aria-label="Show CRM navigation"
>
- <ListIcon class="size-4" />
+ <ListIcon class="size-4 touch:size-6" />
</Dropdown.Trigger>
</Tooltip>
<Dropdown.Content class="w-55 max-h-[80vh] overflow-auto p-0">
@@ -153,7 +156,10 @@ function CrmFilterChips(props: { onReset: () => void }) {
}
export function CrmWorkspace(props: {
- children: (onOpenEntity: (entity: EntityData) => boolean) => JSX.Element;
+ children: (options: {
+ onOpenEntity?: (entity: EntityData) => boolean;
+ mobileHeaderLeading?: JSX.Element;
+ }) => JSX.Element;
}) {
const view = useSoupView();
const panel = useSplitPanelOrThrow();
@@ -284,11 +290,7 @@ export function CrmWorkspace(props: {
/>
);
return (
- <ViewShell.Root
- class="touch:pt-(--safe-top) touch:pb-(--mobile-content-inset-bottom)"
- aside={collapsed() ? false : {}}
- main={{ min: 320 }}
- >
+ <ViewShell.Root aside={collapsed() ? false : {}} main={{ min: 320 }}>
<ViewShell.Aside>
<Suspense
fallback={<div class="p-4 text-sm text-ink-muted">Loading CRM…</div>}
@@ -312,53 +314,62 @@ export function CrmWorkspace(props: {
)}
</Show>
<Show when={!selectedCompany()}>
- <div class="flex h-12 shrink-0 items-center gap-3 border-b border-edge-muted px-4">
- <NavigationToggle onExpand={() => setCollapsed(false)}>
- <Suspense>{sidebar()}</Suspense>
- </NavigationToggle>
- <h1
- class="flex h-7 min-w-0 flex-1 items-center px-1 text-sm font-semibold tracking-[-0.03em]"
- title={title()}
- >
- <span class="truncate">{title()}</span>
- </h1>
- </div>
- <ViewShell.Header>
- <div class="flex min-w-0 items-center justify-between gap-3">
- <CrmSearchBar />
- <div class="ml-auto flex shrink-0 items-center gap-2 [&_button]:h-8 [&_button]:min-w-8 [&_button]:rounded-lg [&_button>svg]:size-4!">
- <SoupViewContextSort />
- <SoupViewContextGroup hideLabel />
- <UnifiedFilterDropdown hideLabel />
- <CompanyDisplayMenu />
- <Suspense>
- <CompanyViewsMenu hideLabel />
- </Suspense>
- <Show when={listsFlag().enabled && activeList()}>
- {(list) => (
- <Button
- variant="ghost"
- size="sm"
- onClick={() =>
- setEditing({
- id: list().id,
- name: list().name,
- companyIds: [...list().config.companyIds],
- })
- }
- >
- Edit list
- </Button>
- )}
- </Show>
- </div>
+ <Show when={!isTouchDevice()}>
+ <div class="flex h-12 shrink-0 items-center gap-3 border-b border-edge-muted px-4">
+ <NavigationToggle onExpand={() => setCollapsed(false)}>
+ <Suspense>{sidebar()}</Suspense>
+ </NavigationToggle>
+ <h1
+ class="flex h-7 min-w-0 flex-1 items-center px-1 text-sm font-semibold tracking-[-0.03em]"
+ title={title()}
+ >
+ <span class="truncate">{title()}</span>
+ </h1>
</div>
- </ViewShell.Header>
- <Suspense>
- <CrmFilterChips onReset={() => navigate(active())} />
- </Suspense>
+ <ViewShell.Header>
+ <div class="flex min-w-0 items-center justify-between gap-3">
+ <CrmSearchBar />
+ <div class="ml-auto flex shrink-0 items-center gap-2 [&_button]:h-8 [&_button]:min-w-8 [&_button]:rounded-lg [&_button>svg]:size-4!">
+ <SoupViewContextSort />
+ <SoupViewContextGroup hideLabel />
+ <UnifiedFilterDropdown hideLabel />
+ <CompanyDisplayMenu />
+ <Suspense>
+ <CompanyViewsMenu hideLabel />
+ </Suspense>
+ <Show when={listsFlag().enabled && activeList()}>
+ {(list) => (
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() =>
+ setEditing({
+ id: list().id,
+ name: list().name,
+ companyIds: [...list().config.companyIds],
+ })
+ }
+ >
+ Edit list
+ </Button>
+ )}
+ </Show>
+ </div>
+ </div>
+ </ViewShell.Header>
+ <Suspense>
+ <CrmFilterChips onReset={() => navigate(active())} />
+ </Suspense>
+ </Show>
<div class="min-h-0 min-w-0 flex-1">
- {props.children(openCompany)}
+ {props.children({
+ onOpenEntity: isTouchDevice() ? undefined : openCompany,
+ mobileHeaderLeading: isTouchDevice() ? (
+ <NavigationToggle onExpand={() => setCollapsed(false)}>
+ <Suspense>{sidebar()}</Suspense>
+ </NavigationToggle>
+ ) : undefined,
+ })}
</div>
</Show>
</ViewShell.Main>
diff --git a/apps/web/src/features/next-soup/soup-view/soup-view-tabs.tsx b/apps/web/src/features/next-soup/soup-view/soup-view-tabs.tsx
index 9072e68cbe..7b11df7529 100644
--- a/apps/web/src/features/next-soup/soup-view/soup-view-tabs.tsx
+++ b/apps/web/src/features/next-soup/soup-view/soup-view-tabs.tsx
@@ -31,7 +31,15 @@ import { TabsInsetDropdown } from '@core/component/TabsInsetDropdown';
import { enableReminders } from '@core/constant/featureFlags';
import { useUserContext } from '@core/context/user';
import { useIsTeamAdmin } from '@queries/team/teams';
-import { batch, createMemo, For, Match, Show, Switch } from 'solid-js';
+import {
+ batch,
+ createMemo,
+ For,
+ type JSX,
+ Match,
+ Show,
+ Switch,
+} from 'solid-js';
const useCurrentListView = () => {
const panel = useSplitPanelOrThrow();
@@ -314,7 +322,7 @@ export const CollapsedSoupViewTabs = () => {
* the scroll content. The drawer button leads the strip and scrolls along
* with the pills.
*/
-export const MobileSoupViewTabs = () => {
+export const MobileSoupViewTabs = (props: { leading?: JSX.Element } = {}) => {
const listView = useCurrentListView();
return (
@@ -326,7 +334,7 @@ export const MobileSoupViewTabs = () => {
<MobileSearchFilterDrawer />
</Match>
<Match when={listView() === 'companies'}>
- <MobileCompanyModeTabs />
+ <MobileCompanyModeTabs leading={props.leading} />
</Match>
<For
each={Object.keys(VIEW_TAB_LISTS) as (keyof typeof VIEW_TAB_LISTS)[]}
@@ -352,7 +360,7 @@ const MOBILE_TAB_STRIP_CLASS =
'-ml-(--mobile-chrome-gutter) w-[100cqw] max-w-none flex-none';
const MOBILE_TAB_CONTENT_CLASS = 'px-(--mobile-chrome-gutter)';
-const MobileCompanyModeTabs = () => {
+const MobileCompanyModeTabs = (props: { leading?: JSX.Element }) => {
const { viewMode, setViewMode } = useSoupView();
return (
@@ -360,7 +368,12 @@ const MobileCompanyModeTabs = () => {
scrollable
class={MOBILE_TAB_STRIP_CLASS}
contentClass={MOBILE_TAB_CONTENT_CLASS}
- leading={<MobileFilterDrawer />}
+ leading={
+ <>
+ {props.leading}
+ <MobileFilterDrawer />
+ </>
+ }
items={COMPANY_MODE_TABS}
value={viewMode()}
onChange={(value) => setViewMode(value as SoupViewMode)}
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.tsx
index c0e10d04d5..6249d6a622 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
@@ -584,12 +584,15 @@ export const SoupView = (props: SoupViewProps) => {
},
});
- const content = (onOpenEntity?: (entity: EntityData) => boolean) => (
+ const content = (
+ onOpenEntity?: (entity: EntityData) => boolean,
+ mobileHeaderLeading?: JSX.Element
+ ) => (
<div
class="size-full flex flex-col @container"
data-list-view={activeListView()}
>
- <Show when={!isComponentListView('companies')}>
+ <Show when={!isComponentListView('companies') || isTouchDevice()}>
<div class="flex flex-col w-full">
<SplitHeaderLeft>
<div
@@ -606,7 +609,7 @@ export const SoupView = (props: SoupViewProps) => {
the view title (the bottom accessory region now belongs to the
global views row). */}
<Show when={isTouchDevice()}>
- <MobileSoupViewTabs />
+ <MobileSoupViewTabs leading={mobileHeaderLeading} />
</Show>
<Show when={!isTouchDevice() && !narrowSearchExpanded()}>
<div class="flex items-center gap-1">
@@ -797,7 +800,11 @@ export const SoupView = (props: SoupViewProps) => {
<CrmDefaultViewLoader />
</Show>
<Show when={isComponentListView('companies')} fallback={content()}>
- <CrmWorkspace>{(onOpenEntity) => content(onOpenEntity)}</CrmWorkspace>
+ <CrmWorkspace>
+ {(options) =>
+ content(options.onOpenEntity, options.mobileHeaderLeading)
+ }
+ </CrmWorkspace>
</Show>
</>
);
diff --git a/docs/AGENT_GUIDE/surfaces.md b/docs/AGENT_GUIDE/surfaces.md
index 306ec5e1bc..248c6e904a 100644
--- a/docs/AGENT_GUIDE/surfaces.md
+++ b/docs/AGENT_GUIDE/surfaces.md
@@ -557,7 +557,7 @@ Team sharing is independent of channel access and of link sharing.
## Customers (CRM) — `/app/component/companies`
-The 216px local sidebar uses the same navigation primitives as Email and Tasks.
+On desktop, the local sidebar uses the same navigation primitives as Email and Tasks.
Board and List share a horizontal segmented toggle at the top of the sidebar; the
main header has no layout toggle. People is not available. Views include All companies, My companies
(Owner = current user), Needs follow-up (has a stage other than Churned and last
@@ -573,7 +573,14 @@ View descriptions appear in sidebar tooltips, not above the main board or list.
The `Search companies` field uses the shared Email/Tasks search bar. Command-F
focuses it, `Clear search` resets it, and Escape leaves the field.
-Clicking a company in Board or List (or pressing Enter on a focused list row)
+On touch devices, Customers uses the same full-frame list layout as the other
+mobile views: floating CRM-navigation and filter buttons with Board/List pills,
+List as the fresh default, and the global **+ Company** action above the dock.
+The navigation button opens the CRM views and lists; the desktop toolbar and
+embedded detail stack stay out of the mobile flow, so selecting a row navigates
+in place.
+
+On desktop, clicking a company in Board or List (or pressing Enter on a focused list row)
opens its details inside the CRM workspace, keeping the left navigation visible.
The top breadcrumb reads `<current view or list> > <company>`; click the first
segment to return with the same filters, layout, and list scroll position. Selecting