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.

feat(settings): simplify Integrations into one searchable list (#9049)

Jacob Beckerman1809cddedac5
diff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.md
index df508027c4..f9f96b0a70 100644
--- a/apps/web/AGENTS.md
+++ b/apps/web/AGENTS.md
@@ -269,8 +269,8 @@ resolved session ID; keep the existing `AgentSessionProvider` subscription to
- Email draft reads compare server generations before choosing cached delivery state over a restored working copy; only a definitive first-submission rejection permits local send recovery without server cancellation.
- Compose settings pages with `features/settings/primitives.tsx` so section headings,
raised composer cards (`SettingsSurface`), row spacing, and control shapes stay
- consistent; never hand-build a flat `bg-ink/*` card. Keep Integrations on the
- shared page width and side padding.
+ consistent; never hand-build a flat `bg-ink/*` card. Integrations is the one
+ settings page that spans nearly the full width, for its list columns.
- Preserve email signature HTML through import, preview, and source editing;
mount Quill only for explicit Rich text editing and confirm custom-layout
conversion. Keep the settings and composer preview on the same sanitized HTML
@@ -280,8 +280,10 @@ resolved session ID; keep the existing `AgentSessionProvider` subscription to
so account-list remounts cannot leave an already-cleared draft behind. Offer
Gmail signature import only when the inbox provider is `GMAIL`, regardless of
its email domain; keep shared signature instructions provider-neutral.
-- Keep personal accounts and agent tool connections together in Settings → Integrations;
- preserve `agent-connections` as an alias for existing links.
+- Keep personal accounts, team imports and agent tool connections together in
+ Settings → Integrations: one searchable list row per integration, styled like
+ the Drive/Tasks lists, custom MCP servers then connected ones first,
+ described by what each does in Macro; preserve `agent-connections` and `team-connections` as aliases for existing links.
- Keep bot setup focused on the token-and-SDK workflow; Agent and Ownership
controls live under collapsed Advanced settings. See the
[Bots walkthrough](../../docs/agent-guide/settings.md#bots).
diff --git a/apps/web/src/components/icon/claude-color.svg b/apps/web/src/components/icon/claude-color.svg
new file mode 100644
index 0000000000..c2d5f6291d
--- /dev/null
+++ b/apps/web/src/components/icon/claude-color.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 257"><path fill="#D97757" d="m50.228 170.321l50.357-28.257l.843-2.463l-.843-1.361h-2.462l-8.426-.518l-28.775-.778l-24.952-1.037l-24.175-1.296l-6.092-1.297L0 125.796l.583-3.759l5.12-3.434l7.324.648l16.202 1.101l24.304 1.685l17.629 1.037l26.118 2.722h4.148l.583-1.685l-1.426-1.037l-1.101-1.037l-25.147-17.045l-27.22-18.017l-14.258-10.37l-7.713-5.25l-3.888-4.925l-1.685-10.758l7-7.713l9.397.649l2.398.648l9.527 7.323l20.35 15.75L94.817 91.9l3.889 3.24l1.555-1.102l.195-.777l-1.75-2.917l-14.453-26.118l-15.425-26.572l-6.87-11.018l-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0l10.63 1.426l4.472 3.888l6.61 15.101l10.694 23.786l16.591 32.34l4.861 9.592l2.592 8.879l.973 2.722h1.685v-1.556l1.36-18.211l2.528-22.36l2.463-28.776l.843-8.1l4.018-9.722l7.971-5.25l6.222 2.981l5.12 7.324l-.713 4.73l-3.046 19.768l-5.962 30.98l-3.889 20.739h2.268l2.593-2.593l10.499-13.934l17.628-22.036l7.778-8.749l9.073-9.657l5.833-4.601h11.018l8.1 12.055l-3.628 12.443l-11.342 14.388l-9.398 12.184l-13.48 18.147l-8.426 14.518l.778 1.166l2.01-.194l30.46-6.481l16.462-2.982l19.637-3.37l8.88 4.148l.971 4.213l-3.5 8.62l-20.998 5.184l-24.628 4.926l-36.682 8.685l-.454.324l.519.648l16.526 1.555l7.065.389h17.304l32.21 2.398l8.426 5.574l5.055 6.805l-.843 5.184l-12.962 6.611l-17.498-4.148l-40.83-9.721l-14-3.5h-1.944v1.167l11.666 11.406l21.387 19.314l26.767 24.887l1.36 6.157l-3.434 4.86l-3.63-.518l-23.526-17.693l-9.073-7.972l-20.545-17.304h-1.36v1.814l4.73 6.935l25.017 37.59l1.296 11.536l-1.814 3.76l-6.481 2.268l-7.13-1.297l-14.647-20.544l-15.1-23.138l-12.185-20.739l-1.49.843l-7.194 77.448l-3.37 3.953l-7.778 2.981l-6.48-4.925l-3.436-7.972l3.435-15.749l4.148-20.544l3.37-16.333l3.046-20.285l1.815-6.74l-.13-.454l-1.49.194l-15.295 20.999l-23.267 31.433l-18.406 19.702l-4.407 1.75l-7.648-3.954l.713-7.064l4.277-6.286l25.47-32.405l15.36-20.092l9.917-11.6l-.065-1.686h-.583L44.07 198.125l-12.055 1.555l-5.185-4.86l.648-7.972l2.463-2.593l20.35-13.999z"/></svg>
diff --git a/apps/web/src/components/icon/gmail-color.svg b/apps/web/src/components/icon/gmail-color.svg
new file mode 100644
index 0000000000..699792339a
--- /dev/null
+++ b/apps/web/src/components/icon/gmail-color.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 193"><path fill="#4285F4" d="M58.182 192.05V93.14L27.507 65.077L0 49.504v125.091c0 9.658 7.825 17.455 17.455 17.455z"/><path fill="#34A853" d="M197.818 192.05h40.727c9.659 0 17.455-7.826 17.455-17.455V49.505l-31.156 17.837l-27.026 25.798z"/><path fill="#EA4335" d="m58.182 93.14l-4.174-38.647l4.174-36.989L128 69.868l69.818-52.364l4.669 34.992l-4.669 40.644L128 145.504z"/><path fill="#FBBC04" d="M197.818 17.504V93.14L256 49.504V26.231c0-21.585-24.64-33.89-41.89-20.945z"/><path fill="#C5221F" d="m0 49.504l26.759 20.07L58.182 93.14V17.504L41.89 5.286C24.61-7.66 0 4.646 0 26.23z"/></svg>
diff --git a/apps/web/src/components/icon/linear-color.svg b/apps/web/src/components/icon/linear-color.svg
new file mode 100644
index 0000000000..e202ed7f39
--- /dev/null
+++ b/apps/web/src/components/icon/linear-color.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><path fill="#5E6AD2" d="m8.174 102.613l145.213 145.213c2.12 2.12 1.097 5.72-1.85 6.27a128 128 0 0 1-15.02 1.896a3.78 3.78 0 0 1-2.92-1.109L1.117 122.403a3.78 3.78 0 0 1-1.109-2.92c.34-5.095.978-10.107 1.896-15.02c.55-2.947 4.15-3.97 6.27-1.85m-4.092 58.796c-.97-3.614 3.3-5.894 5.946-3.248l87.81 87.811c2.647 2.646.367 6.915-3.247 5.946c-44.03-11.805-78.704-46.478-90.51-90.509m12.727-97.245c1.233-2.135 4.147-2.463 5.89-.719L192.556 233.3c1.744 1.744 1.417 4.658-.72 5.891a128 128 0 0 1-11.1 5.705c-1.43.65-3.11.322-4.22-.79L11.893 79.487c-1.111-1.112-1.439-2.79-.79-4.221a128 128 0 0 1 5.706-11.1M127.86 0C198.63 0 256 57.37 256 128.14c0 37.57-16.168 71.362-41.926 94.8c-1.487 1.354-3.768 1.264-5.19-.157L33.217 47.116c-1.421-1.422-1.51-3.703-.158-5.19C56.498 16.168 90.291 0 127.86 0"/></svg>
diff --git a/apps/web/src/components/icon/outlook-color.svg b/apps/web/src/components/icon/outlook-color.svg
new file mode 100644
index 0000000000..f7b21be30c
--- /dev/null
+++ b/apps/web/src/components/icon/outlook-color.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0072c6" d="M19.484 7.937v5.477l1.916 1.205a.5.5 0 0 0 .21 0l8.238-5.554a1.174 1.174 0 0 0-.959-1.128Z"/><path fill="#0072c6" d="m19.484 15.457l1.747 1.2a.52.52 0 0 0 .543 0c-.3.181 8.073-5.378 8.073-5.378v10.066a1.408 1.408 0 0 1-1.49 1.555h-8.874zm-9.044-2.525a1.61 1.61 0 0 0-1.42.838a4.13 4.13 0 0 0-.526 2.218A4.05 4.05 0 0 0 9.02 18.2a1.6 1.6 0 0 0 2.771.022a4 4 0 0 0 .515-2.2a4.37 4.37 0 0 0-.5-2.281a1.54 1.54 0 0 0-1.366-.809"/><path fill="#0072c6" d="M2.153 5.155v21.427L18.453 30V2Zm10.908 14.336a3.23 3.23 0 0 1-2.7 1.361a3.19 3.19 0 0 1-2.64-1.318A5.46 5.46 0 0 1 6.706 16.1a5.87 5.87 0 0 1 1.036-3.616a3.27 3.27 0 0 1 2.744-1.384a3.12 3.12 0 0 1 2.61 1.321a5.64 5.64 0 0 1 1 3.484a5.76 5.76 0 0 1-1.035 3.586"/></svg>
diff --git a/apps/web/src/features/agents-view/views/ComposerAddMenu.test.tsx b/apps/web/src/features/agents-view/views/ComposerAddMenu.test.tsx
index 209afcdfb6..498a58ed22 100644
--- a/apps/web/src/features/agents-view/views/ComposerAddMenu.test.tsx
+++ b/apps/web/src/features/agents-view/views/ComposerAddMenu.test.tsx
@@ -15,7 +15,6 @@ const [savedConnection, setSavedConnection] = createSignal<Leftover>({
kind: 'pipedream',
id: 'pd-slack',
title: 'Slack workspace',
- subtitle: 'Slack',
appSlug: 'slack_v2',
enabled: false,
});
diff --git a/apps/web/src/features/agents-view/views/ComposerAddMenu.tsx b/apps/web/src/features/agents-view/views/ComposerAddMenu.tsx
index 788696c75d..64db0dd596 100644
--- a/apps/web/src/features/agents-view/views/ComposerAddMenu.tsx
+++ b/apps/web/src/features/agents-view/views/ComposerAddMenu.tsx
@@ -223,6 +223,10 @@ export function AgentComposerAddMenu(props: {
setTarget(undefined);
settings.openSettings('Agent');
}}
+ onOpenEmailSettings={() => {
+ setTarget(undefined);
+ settings.openSettings('Email');
+ }}
/>
}
>
diff --git a/apps/web/src/features/connector-import/core/catalog.ts b/apps/web/src/features/connector-import/core/catalog.ts
index 4dfb33c81e..24c66eb1ce 100644
--- a/apps/web/src/features/connector-import/core/catalog.ts
+++ b/apps/web/src/features/connector-import/core/catalog.ts
@@ -19,6 +19,7 @@ import type {
ImportCategory,
ImportCategoryConfig,
ImportIcon,
+ ImportProvider,
} from './providers';
// Order is promotion order: the sidebar card shows these left to right and
@@ -185,3 +186,14 @@ export const IMPORT_CATEGORIES: Record<ImportCategory, ImportCategoryConfig> = {
],
},
};
+
+/** Where Macro can import an app's data from, if it can. */
+export function importSourceFor(
+ appSlug: string
+): { config: ImportCategoryConfig; provider: ImportProvider } | undefined {
+ for (const config of Object.values(IMPORT_CATEGORIES)) {
+ const provider = config.providers.find((row) => row.appSlug === appSlug);
+ if (provider) return { config, provider };
+ }
+ return undefined;
+}
diff --git a/apps/web/src/features/settings/Email.tsx b/apps/web/src/features/settings/Email.tsx
index 44b743d999..6d276e2806 100644
--- a/apps/web/src/features/settings/Email.tsx
+++ b/apps/web/src/features/settings/Email.tsx
@@ -20,47 +20,73 @@ import {
calendarConsentScopes,
reconnectScopes,
} from '@core/email-link/consent';
+import type { EmailProvider } from '@core/email-link/ProviderDialog';
import { fireAndForget } from '@core/util/fireAndForget';
+import GmailIcon from '@icon/gmail-color.svg';
+import OutlookIcon from '@icon/outlook-color.svg';
import ArrowsClockwiseIcon from '@icon/system/regular/arrows-clockwise.svg?component-solid';
import CalendarSlashIcon from '@icon/system/regular/calendar-slash.svg?component-solid';
-import EnvelopeIcon from '@icon/system/regular/envelope.svg?component-solid';
-import GearIcon from '@icon/system/regular/gear.svg';
-import PlusIcon from '@icon/system/regular/plus.svg?component-solid';
+import { Telemetry } from '@macro-inc/observability';
+import { fetchEmailConnectionProviders } from '@queries/auth/outlook-link';
import {
type BackfillProgress,
estimateEtaSeconds,
getBackfillProgress,
- useBackfillJobsQuery,
} from '@queries/email/backfill';
import { useRemoveInboxMutation } from '@queries/email/link';
import {
- type BackfillJob,
type Link as EmailLink,
SyncStatus,
} from '@service-email/generated/schemas';
-import { Dialog, Panel, Tooltip, Button as UiButton } from '@ui';
+import { cn, Dialog, Panel, Tooltip } from '@ui';
import { createMemo, createSignal, For, Match, Show, Switch } from 'solid-js';
import { match } from 'ts-pattern';
-import { isInitialSyncComplete } from './core/initial-sync';
import { InboxSettingsOperations } from './InboxSettingsOperations';
-import { ConnectAction, StatusDot } from './integration-ui';
+import { ConnectAction } from './integration-ui';
import {
SettingsButton as Button,
IntegrationRow,
- SettingsCard,
- SettingsRow,
+ SettingsSurface,
} from './primitives';
import { clearSignatureState } from './SignatureSection';
/**
- * Gmail integration as a single Connected-accounts card: a header row with the
- * connection state/action, and — once connected — a row per inbox plus add /
- * disconnect controls. All the inbox + backfill logic is unchanged; only the
- * surrounding chrome moved from a standalone panel to a shared card.
+ * Starts connecting an inbox. Without a provider, the flow asks which one;
+ * Outlook checks that new connections are open first. Repeated clicks while a
+ * connection is starting are ignored.
*/
-export function EmailCard(
- props: { class?: string; onOpenSettings?: () => void } = {}
-) {
+export function useConnectInbox(): (provider?: EmailProvider) => void {
+ const startAddInbox = useAddInboxFlow();
+ // Not a disabled state: disabling the opener drops focus to <body>, which
+ // is where closing the provider chooser would then return it.
+ let addingInbox = false;
+ const connectEmail = (provider?: EmailProvider) =>
+ Telemetry.span('email.link.connect', async (span) => {
+ span.setAttr('email.link.provider', provider ?? 'choose');
+ try {
+ if (provider === 'OUTLOOK' && !(await outlookAvailable())) {
+ span.setAttr('email.link.outcome', 'outlook_unavailable');
+ toast.failure('New Outlook connections are temporarily unavailable.');
+ return;
+ }
+ await startAddInbox({ provider });
+ span.setAttr('email.link.outcome', 'started');
+ } finally {
+ addingInbox = false;
+ }
+ });
+ return (provider) => {
+ if (addingInbox) return;
+ addingInbox = true;
+ fireAndForget(connectEmail(provider), 'add-inbox');
+ };
+}
+
+/**
+ * Connected inboxes, one row each, followed by rows to connect another Google
+ * Workspace or Outlook account.
+ */
+export function EmailCard(props: { class?: string } = {}) {
const email = useEmail();
const userId = useUserId();
const multiInboxFlag = useFeatureFlag(enableMultiInbox);
@@ -69,27 +95,6 @@ export function EmailCard(
const emailActive = useEmailLinksStatus();
const startAddInbox = useAddInboxFlow();
- // Fires when the Email settings open. Used only to surface the COMPLETED
- // state; in-progress state comes from the live connection-gateway store.
- const backfillJobsQuery = useBackfillJobsQuery();
- // Latest job per link. The query returns newest-first, so the first job seen
- // for a link_id is its latest — we key the settled label off the current job,
- // not any historical completed one (a later fail/cancel must not still read
- // as "complete").
- const latestBackfillByLinkId = createMemo(() => {
- const latest = new Map<string, BackfillJob>();
- for (const job of backfillJobsQuery.isSuccess
- ? backfillJobsQuery.data.jobs
- : []) {
- if (job.link_id && !latest.has(job.link_id)) {
- latest.set(job.link_id, job);
- }
- }
- return latest;
- });
- const initialSyncComplete = (link: EmailLink): boolean =>
- isInitialSyncComplete(link, latestBackfillByLinkId().get(link.id));
-
const removeInboxMutation = useRemoveInboxMutation({
onSuccess: (_data, linkId) => {
clearSignatureState(linkId);
@@ -107,9 +112,6 @@ export function EmailCard(
const [resyncingIds, setResyncingIds] = createSignal<ReadonlySet<string>>(
new Set()
);
- // Not a disabled state: disabling the opener drops focus to <body>, which
- // is where closing the provider chooser would then return it.
- let addingInbox = false;
// The primary inbox is the user's own is_primary link; it sorts to the top
// and is labelled. Everything else (other own inboxes + delegated/shared) follows.
@@ -123,18 +125,11 @@ export function EmailCard(
return { primary, others };
});
- const connectEmail = async () => {
- try {
- await startAddInbox();
- } finally {
- addingInbox = false;
- }
- };
- const onConnectEmail = () => {
- if (addingInbox) return;
- addingInbox = true;
- fireAndForget(connectEmail(), 'add-inbox');
- };
+ const onConnectEmail = useConnectInbox();
+ const hasInbox = () =>
+ Boolean(inboxes().primary) || inboxes().others.length > 0;
+ // Further inboxes are behind multi-inbox; the first is always offered.
+ const canAddInbox = () => !emailActive() || multiInboxFlag().enabled;
const handleResyncInbox = async (linkId: string) => {
setResyncingIds((prev) => new Set(prev).add(linkId));
@@ -164,33 +159,7 @@ export function EmailCard(
return (
<>
- <SettingsCard class={props.class}>
- <IntegrationRow
- icon={<EnvelopeIcon />}
- title="Email"
- status={
- <Show when={emailActive()}>
- <StatusDot state="connected" label="Connected" />
- </Show>
- }
- >
- <Show when={!emailActive()}>
- <ConnectAction label="Connect" onClick={onConnectEmail} />
- </Show>
- <Show when={props.onOpenSettings}>
- <UiButton
- aria-label="Email settings"
- tooltip="Email settings"
- variant="ghost"
- size="icon-md"
- onClick={props.onOpenSettings}
- class="touch:min-h-11 touch:min-w-11"
- >
- <GearIcon class="size-4" />
- </UiButton>
- </Show>
- </IntegrationRow>
-
+ <div class={cn('flex flex-col gap-2', props.class)}>
<Show when={emailActive()}>
<Show when={inboxes().primary}>
{(primary) => (
@@ -198,7 +167,6 @@ export function EmailCard(
link={primary()}
isPrimary
isOwn={primary().macro_id === userId()}
- initialSyncComplete={initialSyncComplete(primary())}
resyncing={resyncingIds().has(primary().id)}
onResync={() => handleResyncInbox(primary().id)}
onReconnect={() =>
@@ -242,7 +210,7 @@ export function EmailCard(
<Show when={!inboxes().primary && email()}>
<DisabledPrimaryRow
email={email() ?? ''}
- onEnable={onConnectEmail}
+ onEnable={() => onConnectEmail()}
/>
</Show>
<For each={inboxes().others}>
@@ -251,7 +219,6 @@ export function EmailCard(
link={link}
isPrimary={false}
isOwn={link.macro_id === userId()}
- initialSyncComplete={initialSyncComplete(link)}
resyncing={resyncingIds().has(link.id)}
onResync={() => handleResyncInbox(link.id)}
onReconnect={() =>
@@ -292,26 +259,40 @@ export function EmailCard(
/>
)}
</For>
- <Show when={multiInboxFlag().enabled}>
- <SettingsRow
- label="Add another inbox"
- description="Connect Gmail, Outlook.com, or Microsoft 365."
+ </Show>
+ <Show when={canAddInbox()}>
+ <SettingsSurface>
+ <IntegrationRow
+ icon={<GmailIcon />}
+ title={
+ hasInbox()
+ ? 'Connect another Google Workspace account'
+ : 'Connect a Google Workspace account'
+ }
+ description="Sync a Gmail or Google Workspace inbox into Macro Email."
>
- <Tooltip label="Add inbox">
- <Button
- variant="secondary"
- size="md"
- aria-label="Add inbox"
- onClick={onConnectEmail}
- >
- <PlusIcon class="size-3.5" />
- Add account
- </Button>
- </Tooltip>
- </SettingsRow>
- </Show>
+ <ConnectAction
+ label="Connect"
+ ariaLabel="Connect a Google Workspace account"
+ onClick={() => onConnectEmail('GMAIL')}
+ />
+ </IntegrationRow>
+ </SettingsSurface>
+ <SettingsSurface>
+ <IntegrationRow
+ icon={<OutlookIcon />}
+ title="Connect an Outlook account"
+ description="Sync an Outlook.com or Microsoft 365 inbox into Macro Email."
+ >
+ <ConnectAction
+ label="Connect"
+ ariaLabel="Connect an Outlook account"
+ onClick={() => onConnectEmail('OUTLOOK')}
+ />
+ </IntegrationRow>
+ </SettingsSurface>
</Show>
- </SettingsCard>
+ </div>
<TurnOffCalendarDialog
target={turnOffCalendarTarget()}
@@ -364,6 +345,15 @@ export function EmailCard(
);
}
+/** Whether new Outlook connections are open; the provider chooser checks the same. */
+async function outlookAvailable(): Promise<boolean> {
+ try {
+ return (await fetchEmailConnectionProviders()).outlook;
+ } catch {
+ return false;
+ }
+}
+
function syncStatusLabel(status: SyncStatus): string {
return match(status)
.with(SyncStatus.SYNCING, () => 'Syncing…')
@@ -436,8 +426,9 @@ function Chip(props: { label: string }) {
// flow, which re-links and backfills.
function DisabledPrimaryRow(props: { email: string; onEnable: () => void }) {
return (
- <div class="flex flex-wrap items-center justify-between gap-3 min-h-14 px-4 py-3">
+ <SettingsSurface class="flex flex-wrap items-center justify-between gap-3 min-h-14 px-4 py-3">
<div class="min-w-0 flex flex-wrap items-center gap-x-3 gap-y-1">
+ <ProviderIcon provider="GMAIL" />
<div class="flex items-center gap-2 min-w-0">
<span class="ph-no-capture text-sm truncate text-ink-muted">
{props.email}
@@ -450,7 +441,20 @@ function DisabledPrimaryRow(props: { email: string; onEnable: () => void }) {
<Button variant="secondary" size="md" onClick={props.onEnable}>
Enable
</Button>
- </div>
+ </SettingsSurface>
+ );
+}
+
+function ProviderIcon(props: { provider: EmailLink['provider'] }) {
+ return (
+ <span
+ aria-hidden="true"
+ class="flex size-9 shrink-0 items-center justify-center [&_svg]:size-6"
+ >
+ <Show when={props.provider === 'OUTLOOK'} fallback={<GmailIcon />}>
+ <OutlookIcon />
+ </Show>
+ </span>
);
}
@@ -458,7 +462,6 @@ function InboxRow(props: {
link: EmailLink;
isPrimary: boolean;
isOwn: boolean;
- initialSyncComplete: boolean;
resyncing: boolean;
onResync: () => void;
onReconnect: () => void;
@@ -468,9 +471,10 @@ function InboxRow(props: {
}) {
const calendarUiEnabled = useCalendarUiFlag();
return (
- <div class="flex flex-col">
+ <SettingsSurface class="flex flex-col">
<div class="flex flex-wrap items-center justify-between gap-3 min-h-14 py-3 px-4">
<div class="min-w-0 flex flex-wrap items-center gap-x-3 gap-y-1">
+ <ProviderIcon provider={props.link.provider} />
<div class="flex items-center gap-2 min-w-0">
<span class="ph-no-capture text-sm truncate">
{props.link.email_address}
@@ -515,11 +519,6 @@ function InboxRow(props: {
<Match when={getBackfillProgress(props.link.id)}>
{(progress) => <BackfillProgressBar progress={progress()} />}
</Match>
- <Match when={props.initialSyncComplete}>
- <span class="text-xs text-ink-muted">
- Initial sync complete
- </span>
- </Match>
</Switch>
</Show>
</div>
@@ -602,6 +601,6 @@ function InboxRow(props: {
</div>
</div>
<InboxSettingsOperations linkId={props.link.id} />
- </div>
+ </SettingsSurface>
);
}
diff --git a/apps/web/src/features/settings/EmailConnectRows.test.tsx b/apps/web/src/features/settings/EmailConnectRows.test.tsx
new file mode 100644
index 0000000000..4e93dcc04a
--- /dev/null
+++ b/apps/web/src/features/settings/EmailConnectRows.test.tsx
@@ -0,0 +1,101 @@
+/** @vitest-environment jsdom */
+import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';
+import { createSignal } from 'solid-js';
+import { afterEach, beforeEach, expect, it, vi } from 'vitest';
+import { EmailCard } from './Email';
+
+const mocks = vi.hoisted(() => ({
+ startAddInbox: vi.fn(async () => {}),
+ providers: vi.fn(async () => ({ outlook: true })),
+ failure: vi.fn(),
+}));
+const [connected, setConnected] = createSignal(false);
+const [multiInbox, setMultiInbox] = createSignal(false);
+
+vi.mock('@core/email-link', () => ({
+ useEmailLinks: () => ({
+ query: { isSuccess: true, data: { links: [] } },
+ resyncInbox: vi.fn(),
+ }),
+ useEmailLinksStatus: () => connected,
+ useAddInboxFlow: () => mocks.startAddInbox,
+}));
+vi.mock('@queries/auth/outlook-link', () => ({
+ fetchEmailConnectionProviders: mocks.providers,
+}));
+vi.mock('@app/lib/analytics/posthog', () => ({
+ useFeatureFlag: () => () => ({ enabled: multiInbox() }),
+}));
+vi.mock('@core/constant/featureFlags', () => ({
+ ENABLE_INBOX_RESYNC: false,
+ ENABLE_INBOX_SYNC_STATUS: false,
+ enableMultiInbox: 'enable-multi-inbox',
+}));
+vi.mock('@core/component/Toast/Toast', () => ({
+ toast: { failure: mocks.failure, success: vi.fn() },
+}));
+vi.mock('@core/context/user', () => ({
+ useEmail: () => () => undefined,
+ useUserId: () => () => 'me',
+}));
+vi.mock('@queries/email/link', () => ({
+ useRemoveInboxMutation: () => ({ mutate: vi.fn() }),
+}));
+vi.mock('@app/features/calendar/components/TurnOffCalendarDialog', () => ({
+ TurnOffCalendarDialog: () => null,
+}));
+vi.mock('@app/features/calendar/hooks/use-calendar-ui-flag', () => ({
+ useCalendarUiFlag: () => () => false,
+}));
+vi.mock('./InboxSettingsOperations', () => ({
+ InboxSettingsOperations: () => null,
+}));
+vi.mock('./SignatureSection', () => ({ clearSignatureState: vi.fn() }));
+
+beforeEach(() => {
+ setConnected(false);
+ setMultiInbox(false);
+ mocks.providers.mockResolvedValue({ outlook: true });
+});
+afterEach(() => {
+ cleanup();
+ vi.clearAllMocks();
+});
+
+it('connects the chosen provider without asking again', async () => {
+ render(() => <EmailCard />);
+ fireEvent.click(
+ screen.getByRole('button', { name: 'Connect a Google Workspace account' })
+ );
+ await vi.waitFor(() =>
+ expect(mocks.startAddInbox).toHaveBeenCalledWith({ provider: 'GMAIL' })
+ );
+ fireEvent.click(
+ screen.getByRole('button', { name: 'Connect an Outlook account' })
+ );
+ await vi.waitFor(() =>
+ expect(mocks.startAddInbox).toHaveBeenCalledWith({ provider: 'OUTLOOK' })
+ );
+});
+
+it('stops before consent when new Outlook connections are closed', async () => {
+ mocks.providers.mockResolvedValue({ outlook: false });
+ render(() => <EmailCard />);
+ fireEvent.click(
+ screen.getByRole('button', { name: 'Connect an Outlook account' })
+ );
+ await vi.waitFor(() => expect(mocks.failure).toHaveBeenCalled());
+ expect(mocks.startAddInbox).not.toHaveBeenCalled();
+});
+
+it('offers another account only with multiple inboxes enabled', () => {
+ setConnected(true);
+ render(() => <EmailCard />);
+ expect(
+ screen.queryByRole('button', { name: 'Connect an Outlook account' })
+ ).toBeNull();
+ setMultiInbox(true);
+ expect(
+ screen.getByRole('button', { name: 'Connect an Outlook account' })
+ ).toBeTruthy();
+});
diff --git a/apps/web/src/features/settings/GitHub.tsx b/apps/web/src/features/settings/GitHub.tsx
index d42ad81a9a..088089f0e4 100644
--- a/apps/web/src/features/settings/GitHub.tsx
+++ b/apps/web/src/features/settings/GitHub.tsx
@@ -1,6 +1,7 @@
import { authorizeGithub } from '@core/auth/authorize-github';
import { toast } from '@core/component/Toast/Toast';
import { SERVER_HOSTS } from '@core/constant/servers';
+import { fireAndForget } from '@core/util/fireAndForget';
import GithubIcon from '@icon/mcp-github.svg';
import ArrowUpRightIcon from '@icon/system/regular/arrow-up-right.svg';
import {
@@ -17,15 +18,17 @@ import {
} from './integration-ui';
import { IntegrationRow, SettingsCard } from './primitives';
-/** GitHub integration as a Connected-accounts card. */
-export function GitHubCard(props: { class?: string } = {}) {
+/** The viewer's GitHub account link and the actions that change it. */
+export function useGithubConnection() {
const githubLink = useGithubLinkStatusQuery();
const initGithubLink = useInitGithubLinkMutation();
const deleteGithubLink = useDeleteGithubLinkMutation();
const reauthenticateGithub = useReauthenticateGithubMutation();
- const status = () => githubLink.data?.status;
- const username = () => githubLink.data?.username;
+ const status = () =>
+ githubLink.isSuccess ? githubLink.data.status : undefined;
+ const username = () =>
+ githubLink.isSuccess ? githubLink.data.username : undefined;
// Drives the account connection dot.
const connectionState = (): ConnectionState | undefined =>
@@ -34,10 +37,8 @@ export function GitHubCard(props: { class?: string } = {}) {
: status() === 'reauthentication_required'
? 'attention'
: undefined;
- const connectionLabel = () =>
- connectionState() === 'attention' ? 'Reconnect required' : 'Connected';
- const handleGithubEnable = async () => {
+ const connect = async () => {
try {
await authorizeGithub(
(callbackUrl) => initGithubLink.mutateAsync(callbackUrl),
@@ -48,7 +49,7 @@ export function GitHubCard(props: { class?: string } = {}) {
}
};
- const handleGithubDisable = async () => {
+ const disconnect = async () => {
try {
await deleteGithubLink.mutateAsync();
} catch {
@@ -56,7 +57,7 @@ export function GitHubCard(props: { class?: string } = {}) {
}
};
- const handleGithubReconnect = async () => {
+ const reconnect = async () => {
try {
await authorizeGithub(
(callbackUrl) => reauthenticateGithub.mutateAsync(callbackUrl),
@@ -67,32 +68,60 @@ export function GitHubCard(props: { class?: string } = {}) {
}
};
+ return {
+ loading: () => githubLink.isLoading,
+ status,
+ username,
+ connectionState,
+ connect,
+ disconnect,
+ reconnect,
+ connecting: () => initGithubLink.isPending,
+ disconnecting: () => deleteGithubLink.isPending,
+ reconnecting: () => reauthenticateGithub.isPending,
+ };
+}
+
+/** Where the viewer installs or configures the GitHub App for their repositories. */
+export const GITHUB_APP_INSTALL_URL = `${SERVER_HOSTS['document-storage-service']}/github/install-sync`;
+
+/** GitHub account link, one row on the Integrations page. */
+export function GitHubCard(props: { class?: string } = {}) {
+ const github = useGithubConnection();
+ const connectionLabel = () =>
+ github.connectionState() === 'attention'
+ ? 'Reconnect required'
+ : 'Connected';
+
return (
<SettingsCard class={props.class}>
<IntegrationRow
icon={<GithubIcon />}
title="GitHub"
+ description="Review your pull requests in Macro, see live pull request status in docs and chats, and let agents work in your repositories."
status={
- <Show when={connectionState()}>
+ <Show when={github.connectionState()}>
{(state) => <StatusDot state={state()} label={connectionLabel()} />}
</Show>
}
>
<Show
- when={!githubLink.isLoading}
+ when={!github.loading()}
fallback={<span class="text-sm text-ink-muted">Loading…</span>}
>
<Switch
fallback={
<ConnectAction
label="Connect"
- onClick={handleGithubEnable}
- disabled={initGithubLink.isPending}
+ onClick={() =>
+ fireAndForget(github.connect(), 'github-settings')
+ }
+ disabled={github.connecting()}
/>
}
>
- <Match when={status() === 'linked'}>
- <Show when={username()}>
+ <Match when={github.status() === 'linked'}>
+ <Show when={github.username()}>
{(name) => (
<span class="ph-no-capture text-sm text-ink-muted">
@{name()}
@@ -102,22 +131,26 @@ export function GitHubCard(props: { class?: string } = {}) {
<ConnectAction
label="Disconnect"
variant="danger"
- onClick={handleGithubDisable}
- disabled={deleteGithubLink.isPending}
+ onClick={() =>
+ fireAndForget(github.disconnect(), 'github-settings')
+ }
+ disabled={github.disconnecting()}
/>
</Match>
- <Match when={status() === 'reauthentication_required'}>
+ <Match when={github.status() === 'reauthentication_required'}>
<ConnectAction
label="Reconnect"
- onClick={handleGithubReconnect}
- disabled={reauthenticateGithub.isPending}
+ onClick={() =>
+ fireAndForget(github.reconnect(), 'github-settings')
+ }
+ disabled={github.reconnecting()}
/>
</Match>
</Switch>
</Show>
- <Show when={status() === 'linked'}>
+ <Show when={github.status() === 'linked'}>
<a
- href={`${SERVER_HOSTS['document-storage-service']}/github/install-sync`}
+ href={GITHUB_APP_INSTALL_URL}
target="_blank"
rel="noopener noreferrer"
class="inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-sm font-medium text-ink-muted outline-none transition-colors hover:bg-ink/4 hover:text-ink focus-visible:bg-ink/6"
diff --git a/apps/web/src/features/settings/Granola.tsx b/apps/web/src/features/settings/Granola.tsx
index 13ae0525e0..f4fe76fb69 100644
--- a/apps/web/src/features/settings/Granola.tsx
+++ b/apps/web/src/features/settings/Granola.tsx
@@ -24,7 +24,7 @@ export function GranolaCard() {
/>
}
title="Granola"
- description="Import your Granola meetings into Calls."
+ description="Import Granola meetings into Calls to make transcripts available to agents and team-level memory."
status={
<Switch>
<Match when={granola.status() === 'connected'}>
diff --git a/apps/web/src/features/settings/IntegrationsPage.test.tsx b/apps/web/src/features/settings/IntegrationsPage.test.tsx
index 2c8f6622ef..b9272f36da 100644
--- a/apps/web/src/features/settings/IntegrationsPage.test.tsx
+++ b/apps/web/src/features/settings/IntegrationsPage.test.tsx
@@ -20,6 +20,15 @@ vi.mock('./Email', () => ({ EmailCard: () => <div>Email</div> }));
vi.mock('./Granola', () => ({ GranolaCard: () => <div>Granola</div> }));
vi.mock('./GitHub', () => ({ GitHubCard: () => <div>GitHub</div> }));
vi.mock('./Integrations', () => ({ IntegrationsSection: () => null }));
+vi.mock('./Team', () => ({
+ useTeamViewer: () => ({ isAdminOrOwner: () => true }),
+}));
+vi.mock('@queries/team/teams', () => ({
+ useUserTeamsQuery: () => ({ isSuccess: true, data: [] }),
+}));
+vi.mock('@app/features/slack-import/slack-import', () => ({
+ SlackImport: () => <div>Slack export</div>,
+}));
vi.mock('./connections/integrations-view', () => ({
IntegrationsView: (props: { onOpenLocalAgents?: () => void }) => (
<div>
diff --git a/apps/web/src/features/settings/IntegrationsPage.tsx b/apps/web/src/features/settings/IntegrationsPage.tsx
index db672a95dd..133f70f4bf 100644
--- a/apps/web/src/features/settings/IntegrationsPage.tsx
+++ b/apps/web/src/features/settings/IntegrationsPage.tsx
@@ -1,7 +1,12 @@
+import { SlackImport } from '@app/features/slack-import/slack-import';
import { ENABLE_EMAIL } from '@core/constant/featureFlags';
import { useSettingsState } from '@core/constant/SettingsState';
import { useSettingsTabAvailable } from '@core/constant/settingsTabsConfig';
import { usePipedreamMcpFlag } from '@core/pipedream/flag';
+import GearIcon from '@icon/system/regular/gear.svg';
+import { useUserTeamsQuery } from '@queries/team/teams';
+import type { Team as TeamSummary } from '@service-auth/generated/schemas/team';
+import { Button } from '@ui';
import { createSignal, Show, Suspense } from 'solid-js';
import { IntegrationsView } from './connections/integrations-view';
import { EmailCard } from './Email';
@@ -9,9 +14,11 @@ import { GitHubCard } from './GitHub';
import { GranolaCard } from './Granola';
import { Harness } from './Harness';
import { IntegrationsSection } from './Integrations';
+import { IntegrationGroup } from './integration-ui';
import { SettingsPage } from './primitives';
+import { useTeamViewer } from './Team';
-/** Personal accounts and agent tools share one Integrations settings page. */
+/** Personal accounts, team imports and agent tools share one Integrations settings page. */
export function IntegrationsPage() {
const pipedreamMcp = usePipedreamMcpFlag();
const isTabAvailable = useSettingsTabAvailable();
@@ -21,7 +28,7 @@ export function IntegrationsPage() {
<Show
when={pipedreamMcp()}
fallback={
- <SettingsPage title="Integrations">
+ <SettingsPage title="Integrations" bodyClass="mt-6 gap-8">
<AccountConnections />
<Suspense>
<IntegrationsSection />
@@ -33,15 +40,14 @@ export function IntegrationsPage() {
when={showLocalAgents() && isTabAvailable('Harness')}
fallback={
<IntegrationsView
+ onOpenEmailSettings={() => openSettings('Email')}
onOpenMacroMcp={() => openSettings('Agent')}
onOpenLocalAgents={
isTabAvailable('Harness')
? () => setShowLocalAgents(true)
: undefined
}
- >
- <AccountConnections />
- </IntegrationsView>
+ />
}
>
<Harness
@@ -56,25 +62,55 @@ export function IntegrationsPage() {
function AccountConnections() {
const { openSettings } = useSettingsState();
return (
- <section
- data-settings-target="accounts"
- tabIndex={-1}
- class="pb-5 outline-none"
- >
- <h2 class="mb-4 text-lg font-medium text-ink">Core Integrations</h2>
- <div class="flex flex-col gap-3">
- <Show when={ENABLE_EMAIL}>
+ <>
+ <Show when={ENABLE_EMAIL}>
+ <IntegrationGroup
+ title="Email"
+ actions={
+ <Button
+ variant="ghost"
+ size="icon-md"
+ aria-label="Email settings"
+ tooltip="Email settings"
+ onClick={() => openSettings('Email')}
+ class="touch:min-h-11 touch:min-w-11"
+ >
+ <GearIcon class="size-4" />
+ </Button>
+ }
+ >
<Suspense>
- <EmailCard onOpenSettings={() => openSettings('Email')} />
+ <EmailCard />
</Suspense>
- </Show>
+ </IntegrationGroup>
+ </Show>
+ <IntegrationGroup title="Accounts">
<Suspense>
<GitHubCard />
</Suspense>
<Suspense>
<GranolaCard />
</Suspense>
- </div>
- </section>
+ <Suspense>
+ <TeamSlackImport />
+ </Suspense>
+ </IntegrationGroup>
+ </>
);
}
+
+/** The team's Slack export import, offered to team admins. */
+function TeamSlackImport() {
+ const teams = useUserTeamsQuery();
+ const team = () => (teams.isSuccess ? teams.data[0] : undefined);
+ return (
+ <Show when={team()} keyed>
+ {(found) => <TeamSlackImportRow team={found} />}
+ </Show>
+ );
+}
+
+function TeamSlackImportRow(props: { team: TeamSummary }) {
+ const { isAdminOrOwner } = useTeamViewer(() => props.team);
+ return <SlackImport teamId={props.team.id} isAdmin={isAdminOrOwner()} />;
+}
diff --git a/apps/web/src/features/settings/SettingsTabContent.tsx b/apps/web/src/features/settings/SettingsTabContent.tsx
index 70710701cc..3c415a0d6a 100644
--- a/apps/web/src/features/settings/SettingsTabContent.tsx
+++ b/apps/web/src/features/settings/SettingsTabContent.tsx
@@ -21,7 +21,6 @@ import { Notifications } from './Notifications';
import { Shortcuts } from './Shortcuts';
import { Tags } from './Tags';
import { TeamPage } from './Team';
-import { TeamConnections } from './TeamConnections';
import { TeamGeneral } from './TeamGeneral';
import { TeamMembers } from './TeamMembers';
@@ -76,9 +75,6 @@ export function SettingsTabContent(props: { tab: SettingsTab }) {
<Show when={isCurrentTab('Team Members')}>
<TeamPage>{(team) => <TeamMembers team={team} />}</TeamPage>
</Show>
- <Show when={isCurrentTab('Team Connections')}>
- <TeamPage>{(team) => <TeamConnections team={team} />}</TeamPage>
- </Show>
<Show when={isCurrentTab('Tags')}>
<Tags />
</Show>
diff --git a/apps/web/src/features/settings/TeamConnections.tsx b/apps/web/src/features/settings/TeamConnections.tsx
deleted file mode 100644
index f7cd644442..0000000000
--- a/apps/web/src/features/settings/TeamConnections.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { SlackImport } from '@app/features/slack-import/slack-import';
-import { useSettingsState } from '@core/constant/SettingsState';
-import { SERVER_HOSTS } from '@core/constant/servers';
-import GithubIcon from '@icon/mcp-github.svg';
-import ArrowUpRightIcon from '@icon/system/regular/arrow-up-right.svg';
-import { useGithubLinkStatusQuery } from '@queries/auth';
-import type { Team as TeamSummary } from '@service-auth/generated/schemas/team';
-import { Show } from 'solid-js';
-import { ConnectAction } from './integration-ui';
-import {
- IntegrationRow,
- SettingsCard,
- SettingsPage,
- SettingsSection,
-} from './primitives';
-import { useTeamViewer } from './Team';
-
-/** Team › Connections: team-wide Slack import and the GitHub App. */
-export function TeamConnections(props: { team: TeamSummary }) {
- const { isAdminOrOwner } = useTeamViewer(() => props.team);
- const githubLink = useGithubLinkStatusQuery();
- const { openSettings } = useSettingsState();
-
- return (
- <SettingsPage title="Team connections">
- <SettingsSection title="Connections">
- <SettingsCard>
- <SlackImport teamId={props.team.id} isAdmin={isAdminOrOwner()} />
- <IntegrationRow
- icon={<GithubIcon />}
- title="GitHub App"
- description="Connect your team's repositories for pull request sync."
- >
- {/* The install callback rejects users without a linked GitHub
- account, so don't offer the flow until they've connected one
- on the Integrations page. */}
- <Show
- when={githubLink.data?.status === 'linked'}
- fallback={
- <Show
- when={!githubLink.isLoading}
- fallback={
- <span class="text-xs text-ink-muted">Loading…</span>
- }
- >
- <ConnectAction
- label="Connect your GitHub account first"
- onClick={() => openSettings('Connected')}
- />
- </Show>
- }
- >
- <a
- href={`${SERVER_HOSTS['document-storage-service']}/github/install-sync`}
- target="_blank"
- rel="noopener noreferrer"
- class="inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-sm font-medium text-ink-muted outline-none transition-colors hover:bg-ink/4 hover:text-ink focus-visible:bg-ink/6"
- >
- Configure app
- <ArrowUpRightIcon class="size-3.5 opacity-70" />
- </a>
- </Show>
- </IntegrationRow>
- </SettingsCard>
- </SettingsSection>
- </SettingsPage>
- );
-}
diff --git a/apps/web/src/features/settings/connections/ConnectedView.tsx b/apps/web/src/features/settings/connections/ConnectedView.tsx
deleted file mode 100644
index f1289991cd..0000000000
--- a/apps/web/src/features/settings/connections/ConnectedView.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-import { DEBUG_SETTING_KEYS, useDebugSetting } from '@app/lib/debugSettings';
-import CaretRightIcon from '@icon/system/regular/caret-right.svg';
-import { For, Show } from 'solid-js';
-import { IntegrationRow, SettingsSurface } from '../primitives';
-import { LeftoverRow } from './leftover-row';
-import type { ConnectionsModel } from './model';
-import { isConnectionsEmpty } from './model';
-import { providerIcon } from './provider-meta';
-import { useConnectionsView } from './view-state';
-
-export function ConnectedView(props: { model: ConnectionsModel }) {
- const view = useConnectionsView();
- const forceEmpty = useDebugSetting(DEBUG_SETTING_KEYS.FORCE_EMPTY_STATES);
- const pipedreamLeftovers = () =>
- props.model.leftovers.filter((row) => row.kind === 'pipedream');
- const customMcps = () =>
- props.model.leftovers.filter((row) => row.kind === 'native-mcp');
- return (
- <Show
- when={!forceEmpty() && !isConnectionsEmpty(props.model)}
- fallback={
- <SettingsSurface class="px-4 py-5 text-sm text-ink-muted">
- No tools connected yet. Choose one of the available apps to get
- started.
- </SettingsSurface>
- }
- >
- <div class="grid grid-cols-1 gap-3 @[440px]/settings-page:grid-cols-2">
- <For each={props.model.providers}>
- {(provider) => (
- <SettingsSurface class="overflow-hidden">
- <button
- type="button"
- class="h-full w-full text-left outline-none not-touch:hover:overlay-hover focus-visible:overlay-hover"
- onClick={() => view.openProvider(provider.id)}
- >
- <IntegrationRow
- icon={providerIcon(provider.id)}
- title={provider.name}
- class="gap-3 px-4 py-3"
- description={
- <span class="text-sm">
- {provider.ready} of {provider.total} active
- </span>
- }
- facts={provider.accounts || undefined}
- >
- <span class="flex size-8 shrink-0 items-center justify-center">
- <CaretRightIcon class="size-4 text-ink-extra-muted" />
- </span>
- </IntegrationRow>
- </button>
- </SettingsSurface>
- )}
- </For>
- <For each={[...pipedreamLeftovers(), ...customMcps()]}>
- {(leftover) => (
- <SettingsSurface class="overflow-hidden">
- <LeftoverRow leftover={leftover} />
- </SettingsSurface>
- )}
- </For>
- </div>
- </Show>
- );
-}
diff --git a/apps/web/src/features/settings/connections/DiscoverView.test.tsx b/apps/web/src/features/settings/connections/DiscoverView.test.tsx
deleted file mode 100644
index de2feb8b4a..0000000000
--- a/apps/web/src/features/settings/connections/DiscoverView.test.tsx
+++ /dev/null
@@ -1,175 +0,0 @@
-/** @vitest-environment jsdom */
-import {
- fireEvent,
- render,
- screen,
- waitFor,
- within,
-} from '@solidjs/testing-library';
-import { createSignal } from 'solid-js';
-import { createStore } from 'solid-js/store';
-import { afterEach, beforeEach, expect, it, vi } from 'vitest';
-import { DiscoverView } from './DiscoverView';
-import { ConnectionsViewProvider } from './view-state';
-
-const sheets = {
- app_slug: 'Sheets',
- display_name: 'Sheets',
- description: 'Read spreadsheets',
- categories: ['Productivity'],
-};
-const airtable = {
- app_slug: 'Airtable',
- display_name: 'Airtable',
- description: 'Read databases',
- categories: ['Databases'],
-};
-const calendar = {
- app_slug: 'Calendar',
- display_name: 'Calendar',
- description: 'Read events',
- categories: ['Productivity'],
-};
-const [state, setState] = createStore({
- entries: [sheets, airtable],
- isFetching: false,
- hasNextPage: true,
- isError: false,
- isFetchNextPageError: false,
-});
-const fetchNextPage = vi.fn();
-const observations: Array<{ intersect: () => void; node: Element }> = [];
-
-vi.mock('@queries/pipedream-connectors', () => ({
- usePipedreamConnectedSlugs: () => ({
- slugs: () => new Set<string>(),
- ready: () => true,
- }),
-}));
-
-vi.mock('@core/pipedream/catalog', () => ({
- createPipedreamCatalogSearch: () => {
- const [search, setSearch] = createSignal('');
- return {
- search,
- searchInput: search,
- onSearchInput: setSearch,
- entries: () => state.entries,
- query: {
- get isFetching() {
- return state.isFetching;
- },
- get hasNextPage() {
- return state.hasNextPage;
- },
- get isError() {
- return state.isError;
- },
- get isFetchNextPageError() {
- return state.isFetchNextPageError;
- },
- fetchNextPage,
- refetch: vi.fn(),
- },
- };
- },
- createPipedreamCatalogConnect: () => ({
- connect: vi.fn(),
- busy: () => false,
- }),
-}));
-vi.mock('@core/component/Toast/Toast', () => ({ toast: { success: vi.fn() } }));
-vi.mock('@core/pipedream/ConnectorIcon', () => ({
- PipedreamConnectorIcon: () => null,
-}));
-vi.mock('./add-custom-mcp-dialog', () => ({ AddCustomMcpDialog: () => null }));
-
-beforeEach(() => {
- observations.length = 0;
- fetchNextPage.mockReset();
- setState({
- entries: [sheets, airtable],
- isFetching: false,
- hasNextPage: true,
- isError: false,
- isFetchNextPageError: false,
- });
- vi.stubGlobal(
- 'IntersectionObserver',
- class {
- constructor(
- private callback: (entries: { isIntersecting: boolean }[]) => void
- ) {}
- observe(node: Element) {
- observations.push({
- node,
- intersect: () => this.callback([{ isIntersecting: true }]),
- });
- }
- disconnect() {}
- }
- );
-});
-afterEach(() => vi.unstubAllGlobals());
-
-function showCatalog() {
- return render(() => (
- <ConnectionsViewProvider>
- <DiscoverView
- model={{ capabilities: [], leftovers: [], providers: [] }}
- />
- </ConnectionsViewProvider>
- ));
-}
-
-it('loads successive pages on intersection and pauses while fetching or exhausted', async () => {
- showCatalog();
- await waitFor(() => expect(observations.length).toBeGreaterThan(0));
- observations.at(-1)?.intersect();
- expect(fetchNextPage).toHaveBeenCalledTimes(1);
- setState('isFetching', true);
- observations.at(-1)?.intersect();
- expect(fetchNextPage).toHaveBeenCalledTimes(1);
- setState('entries', [...state.entries, calendar]);
- setState('isFetching', false);
- await waitFor(() =>
- expect(
- screen.getByRole('button', { name: 'Connect Calendar' })
- ).toBeTruthy()
- );
- observations.at(-1)?.intersect();
- expect(fetchNextPage).toHaveBeenCalledTimes(2);
- expect(
- within(screen.getByRole('region', { name: 'Productivity' })).getAllByRole(
- 'button'
- )
- ).toHaveLength(2);
- setState('hasNextPage', false);
- observations.at(-1)?.intersect();
- expect(fetchNextPage).toHaveBeenCalledTimes(2);
- expect(screen.queryByRole('button', { name: 'Load more' })).toBeNull();
-});
-
-it('keeps loaded apps on a page failure and retries only on request', async () => {
- showCatalog();
- setState({ isError: true, isFetchNextPageError: true });
- expect(screen.getByRole('button', { name: 'Connect Sheets' })).toBeTruthy();
- observations.at(-1)?.intersect();
- expect(fetchNextPage).not.toHaveBeenCalled();
- fireEvent.click(screen.getByRole('button', { name: 'Retry' }));
- expect(fetchNextPage).toHaveBeenCalledTimes(1);
-});
-
-it('searches only the apps catalog and keeps featured integrations visible', () => {
- showCatalog();
- fireEvent.input(screen.getByRole('searchbox', { name: 'Search apps' }), {
- target: { value: 'Airtable' },
- });
- expect(screen.queryByRole('button', { name: 'Connect Sheets' })).toBeNull();
- expect(screen.getByRole('button', { name: 'Connect Airtable' })).toBeTruthy();
- expect(
- within(
- screen.getByRole('region', { name: 'Featured integrations' })
- ).getByText('GitHub')
- ).toBeTruthy();
-});
diff --git a/apps/web/src/features/settings/connections/DiscoverView.tsx b/apps/web/src/features/settings/connections/DiscoverView.tsx
deleted file mode 100644
index 35663ca14c..0000000000
--- a/apps/web/src/features/settings/connections/DiscoverView.tsx
+++ /dev/null
@@ -1,342 +0,0 @@
-import { useInfiniteScrollSentinel } from '@app/lib/primitives/infinite-scroll-sentinel';
-import { toast } from '@core/component/Toast/Toast';
-import { PipedreamConnectorIcon } from '@core/pipedream/ConnectorIcon';
-import {
- createPipedreamCatalogConnect,
- createPipedreamCatalogSearch,
-} from '@core/pipedream/catalog';
-import { fireAndForget } from '@core/util/fireAndForget';
-import CheckIcon from '@icon/system/regular/check.svg';
-import MagnifyingGlassIcon from '@icon/system/regular/magnifying-glass.svg';
-import PlusIcon from '@icon/system/regular/plus.svg';
-import SpinnerIcon from '@icon/system/regular/spinner-gap.svg';
-import { usePipedreamConnectedSlugs } from '@queries/pipedream-connectors';
-import type { PipedreamCatalogEntryResponse } from '@service-cognition/client';
-import { Button, InputGroup, Tooltip } from '@ui';
-import { createMemo, createSignal, For, Show } from 'solid-js';
-import { SettingsSelect } from '../components/settings-select';
-import { IntegrationRow, SettingsSurface } from '../primitives';
-import { AddCustomMcpDialog } from './add-custom-mcp-dialog';
-import { groupCatalogByCategory } from './catalog-categories';
-import type { ConnectionsModel } from './model';
-import {
- EMPTY_STARTERS,
- PIPEDREAM_BROWSE_HIDDEN_SLUGS,
- providerIcon,
-} from './provider-meta';
-import { useConnectionsView } from './view-state';
-
-export function DiscoverView(props: { model: ConnectionsModel }) {
- const view = useConnectionsView();
- // Includes overlaid apps, which are connected as native MCP servers.
- const connected = usePipedreamConnectedSlugs();
- const alreadyHave = createMemo(() => {
- const slugs = new Set<string>(connected.slugs());
- for (const row of props.model.capabilities) {
- if (row.status !== 'not-connected') slugs.add(row.provider);
- }
- for (const leftover of props.model.leftovers) {
- if (leftover.kind === 'pipedream') slugs.add(leftover.appSlug);
- }
- return slugs;
- });
- const catalog = createPipedreamCatalogSearch(
- () => PIPEDREAM_BROWSE_HIDDEN_SLUGS
- );
- const [addingCustom, setAddingCustom] = createSignal(false);
-
- const rest = createMemo(() => {
- const query = catalog.search().trim().toLowerCase();
- return catalog.entries().filter((entry) => {
- if (!query) return true;
- return `${entry.display_name} ${entry.description ?? ''} ${entry.app_slug}`
- .toLowerCase()
- .includes(query);
- });
- });
-
- const categories = createMemo(() => groupCatalogByCategory(rest()));
- const [selectedCategory, setSelectedCategory] = createSignal('all');
- const activeCategory = () =>
- categories().some((category) => category.name === selectedCategory())
- ? selectedCategory()
- : 'all';
- const visibleCategories = createMemo(() =>
- categories().filter(
- (category) =>
- activeCategory() === 'all' || category.name === activeCategory()
- )
- );
- const categoryOptions = createMemo(() => [
- { id: 'all', name: 'All categories' },
- ...categories().map((category) => ({
- id: category.name,
- name: category.name,
- })),
- ]);
-
- const [sentinel, setSentinel] = createSignal<HTMLDivElement>();
- const loadMore = () =>
- fireAndForget(catalog.query.fetchNextPage(), 'connections-settings');
- useInfiniteScrollSentinel({
- sentinel,
- hasNextPage: () => catalog.query.hasNextPage && !catalog.query.isError,
- isFetchingNextPage: () => catalog.query.isFetching,
- fetchNextPage: loadMore,
- });
-
- return (
- <div class="@container/catalog flex flex-col gap-7">
- <section aria-label="Featured integrations">
- <h3 class="mb-2 text-sm font-medium text-ink-muted">Featured</h3>
- <div class="grid grid-cols-1 gap-3 @[440px]/catalog:grid-cols-2">
- <For each={EMPTY_STARTERS}>
- {(item) => (
- <SettingsSurface class="@container overflow-hidden">
- <button
- type="button"
- class="flex h-full w-full flex-col items-stretch text-left outline-none not-touch:hover:overlay-hover focus-visible:overlay-hover"
- onClick={() => view.openProvider(item.id)}
- >
- <IntegrationRow
- icon={providerIcon(item.id)}
- title={item.name}
- class="gap-3 px-4 py-3"
- >
- <Show when={alreadyHave().has(item.id)}>
- <AddedMark />
- </Show>
- <Show when={!alreadyHave().has(item.id)}>
- <AddMark />
- </Show>
- </IntegrationRow>
- </button>
- </SettingsSurface>
- )}
- </For>
- </div>
- </section>
-
- <section aria-label="All integrations">
- <div class="mb-3 flex items-center justify-between gap-3">
- <h3 class="text-base font-medium text-ink">All apps</h3>
- <Button
- variant="secondary"
- size="md"
- onClick={() => setAddingCustom(true)}
- >
- <PlusIcon class="size-4" /> Add Custom
- </Button>
- </div>
- <div class="mb-5 grid grid-cols-1 items-end gap-3 @[560px]/catalog:grid-cols-[minmax(0,1fr)_14rem]">
- <div class="flex min-w-0 flex-col gap-1.5">
- <span class="text-xs font-medium text-ink-muted">Search apps</span>
- <InputGroup size="md">
- <InputGroup.Addon>
- <MagnifyingGlassIcon class="size-4" aria-hidden="true" />
- </InputGroup.Addon>
- <InputGroup.Input
- type="search"
- aria-label="Search apps"
- value={catalog.searchInput()}
- onInput={(event) => {
- setSelectedCategory('all');
- catalog.onSearchInput(event.currentTarget.value);
- }}
- placeholder="Search by name or description"
- />
- <InputGroup.Addon align="inline-end">
- <InputGroup.ClearButton />
- </InputGroup.Addon>
- </InputGroup>
- </div>
- <div class="flex min-w-0 flex-col gap-1.5">
- <span class="text-xs font-medium text-ink-muted">Category</span>
- <SettingsSelect
- label="Filter apps by category"
- options={categoryOptions()}
- value={activeCategory()}
- onChange={setSelectedCategory}
- class="min-w-0 w-full"
- />
- </div>
- </div>
- <div class="grid grid-cols-1 gap-6">
- <Show when={catalog.query.isError && catalog.entries().length === 0}>
- <div class="col-span-full px-6 py-6 text-center text-sm text-ink-muted">
- Couldn't load the connector catalog.
- <Button
- variant="secondary"
- size="sm"
- onClick={() => catalog.query.refetch()}
- class="ml-2"
- >
- Retry
- </Button>
- </div>
- </Show>
- <Show when={!catalog.query.isError || catalog.entries().length > 0}>
- <For each={visibleCategories()}>
- {(category) => (
- <section class="col-span-full" aria-label={category.name}>
- <div class="mb-2 flex items-center justify-between border-b border-edge-muted pb-2">
- <h4 class="text-sm font-medium text-ink">
- {category.name}
- </h4>
- <span
- class="text-sm text-ink-muted"
- aria-label={`${category.entries.length} apps`}
- >
- {category.entries.length}
- </span>
- </div>
- <div class="grid grid-cols-1 gap-3 @[440px]/catalog:grid-cols-2">
- <For each={category.entries}>
- {(entry) => (
- <CatalogRow
- entry={entry}
- added={alreadyHave().has(entry.app_slug)}
- />
- )}
- </For>
- </div>
- </section>
- )}
- </For>
- <Show
- when={
- !catalog.query.isFetching &&
- rest().length === 0 &&
- catalog.search().trim()
- }
- >
- <p class="col-span-full px-6 py-6 text-sm text-ink-muted">
- No Connections match that search.
- </p>
- </Show>
- <Show when={catalog.query.isFetching}>
- <div
- class="col-span-full flex justify-center px-6 py-6"
- role="status"
- aria-label="Loading"
- >
- <SpinnerIcon class="size-4 animate-spin text-ink-muted" />
- </div>
- </Show>
- <Show when={catalog.query.isFetchNextPageError}>
- <div class="col-span-full flex items-center justify-center gap-3 py-4 text-sm text-ink-muted">
- Couldn't load more apps.
- <Button variant="secondary" size="sm" onClick={loadMore}>
- Retry
- </Button>
- </div>
- </Show>
- <Show
- when={
- catalog.query.hasNextPage &&
- !catalog.query.isFetching &&
- !catalog.query.isError
- }
- >
- <div
- ref={setSentinel}
- class="col-span-full h-px"
- aria-hidden="true"
- />
- </Show>
- </Show>
- </div>
- </section>
-
- <AddCustomMcpDialog
- open={addingCustom()}
- onOpenChange={setAddingCustom}
- onAdded={view.showOverview}
- />
- </div>
- );
-}
-
-function AddMark(props: { loading?: boolean }) {
- return (
- <span
- aria-hidden="true"
- class="flex size-8 shrink-0 items-center justify-center rounded-full bg-ink/4 text-ink-muted"
- >
- <Show when={props.loading} fallback={<PlusIcon class="size-4" />}>
- <SpinnerIcon class="size-4 animate-spin" />
- </Show>
- </span>
- );
-}
-
-function AddedMark() {
- return (
- <span
- class="inline-flex shrink-0 items-center gap-1 text-sm text-ink-muted"
- aria-label="Added"
- >
- <CheckIcon class="size-3.5" />
- <span class="hidden @[16rem]:inline" aria-hidden="true">
- Added
- </span>
- </span>
- );
-}
-
-function CatalogRow(props: {
- entry: PipedreamCatalogEntryResponse;
- added: boolean;
-}) {
- const { connect, busy } = createPipedreamCatalogConnect({
- entry: () => props.entry,
- onConnected: (entry) => toast.success(`${entry.display_name} connected`),
- });
-
- const name = () => props.entry.display_name;
- const descriptionId = `discover-connect-${props.entry.app_slug}`;
- const description = props.entry.description ?? props.entry.app_slug;
-
- const row = () => (
- <IntegrationRow
- icon={
- <PipedreamConnectorIcon
- appSlug={props.entry.app_slug}
- iconUrl={props.entry.icon_url}
- class="size-8"
- />
- }
- class="gap-3 px-4 py-3"
- title={name()}
- description={
- <Tooltip label={description}>
- <span id={descriptionId} class="not-touch:line-clamp-1 text-sm">
- {description}
- </span>
- </Tooltip>
- }
- >
- <Show when={props.added} fallback={<AddMark loading={busy()} />}>
- <AddedMark />
- </Show>
- </IntegrationRow>
- );
-
- return (
- <SettingsSurface class="@container overflow-hidden">
- <Show when={!props.added} fallback={row()}>
- <button
- type="button"
- class="h-full w-full text-left outline-none not-touch:hover:overlay-hover focus-visible:overlay-hover"
- aria-label={busy() ? `Connecting ${name()}` : `Connect ${name()}`}
- aria-describedby={descriptionId}
- aria-busy={busy()}
- disabled={busy()}
- onClick={() => fireAndForget(connect(), 'connections-settings')}
- >
- {row()}
- </button>
- </Show>
- </SettingsSurface>
- );
-}
diff --git a/apps/web/src/features/settings/connections/catalog-categories.test.ts b/apps/web/src/features/settings/connections/catalog-categories.test.ts
deleted file mode 100644
index eb7d69a50a..0000000000
--- a/apps/web/src/features/settings/connections/catalog-categories.test.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import { groupCatalogByCategory } from './catalog-categories';
-
-describe('groupCatalogByCategory', () => {
- it('uses the first nonempty Pipedream category without duplicating apps', () => {
- const groups = groupCatalogByCategory([
- {
- app_slug: 'sheets',
- display_name: 'Sheets',
- categories: [' Productivity ', 'Data Analytics'],
- },
- {
- app_slug: 'slack',
- display_name: 'Slack',
- categories: ['', 'Communication'],
- },
- {
- app_slug: 'notion',
- display_name: 'Notion',
- categories: ['Productivity'],
- },
- { app_slug: 'unknown', display_name: 'Unknown' },
- ]);
- expect(groups.map((group) => group.name)).toEqual([
- 'Productivity',
- 'Communication',
- 'More apps',
- ]);
- expect(groups[0].entries.map((entry) => entry.app_slug)).toEqual([
- 'sheets',
- 'notion',
- ]);
- expect(groups.flatMap((group) => group.entries)).toHaveLength(4);
- });
-
- it('puts work categories first, remaining categories alphabetically, and uncategorized apps last', () => {
- const groups = groupCatalogByCategory([
- { app_slug: 'unknown', display_name: 'Unknown' },
- ...[
- 'Travel',
- 'Databases',
- 'Developer Tools',
- 'Security',
- 'Productivity',
- 'Communication',
- 'Artificial Intelligence (AI)',
- 'File Storage',
- 'CRM',
- ].map((category) => ({
- app_slug: category,
- display_name: category,
- categories: [category],
- })),
- ]);
- expect(groups.map((group) => group.name)).toEqual([
- 'Productivity',
- 'Communication',
- 'Developer Tools',
- 'Artificial Intelligence (AI)',
- 'File Storage',
- 'CRM',
- 'Databases',
- 'Security',
- 'Travel',
- 'More apps',
- ]);
- });
-
- it('returns no sections for an empty result', () => {
- expect(groupCatalogByCategory([])).toEqual([]);
- });
-});
diff --git a/apps/web/src/features/settings/connections/catalog-categories.ts b/apps/web/src/features/settings/connections/catalog-categories.ts
deleted file mode 100644
index 931e37560f..0000000000
--- a/apps/web/src/features/settings/connections/catalog-categories.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import type { PipedreamCatalogEntryResponse } from '@service-cognition/client';
-
-const CATEGORY_ORDER = [
- 'Productivity',
- 'Communication',
- 'Developer Tools',
- 'Artificial Intelligence (AI)',
- 'File Storage',
- 'CRM',
- 'Business Management',
- 'Data Analytics',
- 'Databases',
-];
-const UNCATEGORIZED_LABEL = 'More apps';
-
-function categoryRank(name: string) {
- const index = CATEGORY_ORDER.indexOf(name);
- return index < 0 ? CATEGORY_ORDER.length : index;
-}
-
-/** Group each app once, using Pipedream's first category and preserving its ranking. */
-export function groupCatalogByCategory(
- entries: PipedreamCatalogEntryResponse[]
-) {
- const groups = new Map<string, PipedreamCatalogEntryResponse[]>();
- for (const entry of entries) {
- const name =
- entry.categories?.find((category) => category.trim())?.trim() ??
- UNCATEGORIZED_LABEL;
- const group = groups.get(name) ?? [];
- group.push(entry);
- groups.set(name, group);
- }
- return [...groups]
- .map(([name, entries]) => ({ name, entries }))
- .sort((a, b) => {
- return (
- Number(a.name === UNCATEGORIZED_LABEL) -
- Number(b.name === UNCATEGORIZED_LABEL) ||
- categoryRank(a.name) - categoryRank(b.name) ||
- a.name.localeCompare(b.name)
- );
- });
-}
diff --git a/apps/web/src/features/settings/connections/catalog-rows.tsx b/apps/web/src/features/settings/connections/catalog-rows.tsx
new file mode 100644
index 0000000000..8613e49f12
--- /dev/null
+++ b/apps/web/src/features/settings/connections/catalog-rows.tsx
@@ -0,0 +1,125 @@
+import { useInfiniteScrollSentinel } from '@app/lib/primitives/infinite-scroll-sentinel';
+import { toast } from '@core/component/Toast/Toast';
+import { PipedreamConnectorIcon } from '@core/pipedream/ConnectorIcon';
+import {
+ createPipedreamCatalogConnect,
+ type createPipedreamCatalogSearch,
+} from '@core/pipedream/catalog';
+import { fireAndForget } from '@core/util/fireAndForget';
+import SpinnerIcon from '@icon/system/regular/spinner-gap.svg';
+import type { PipedreamCatalogEntryResponse } from '@service-cognition/client';
+import { Button } from '@ui';
+import { type Accessor, createSignal, For, Show } from 'solid-js';
+import { ConnectAction } from '../integration-ui';
+import { connectorDescription, ImportAction } from './import-action';
+import { IntegrationListRow } from './integrations-list';
+
+type CatalogSearch = ReturnType<typeof createPipedreamCatalogSearch>;
+
+/** The directory's categories for an app, at most two. */
+function catalogCategories(entry: PipedreamCatalogEntryResponse): string[] {
+ return (entry.categories ?? [])
+ .map((category) => category.trim())
+ .filter(Boolean)
+ .slice(0, 2);
+}
+
+/** Catalog apps not yet connected, loading more as the list scrolls. */
+export function CatalogRows(props: {
+ catalog: CatalogSearch;
+ entries: Accessor<PipedreamCatalogEntryResponse[]>;
+}) {
+ const [sentinel, setSentinel] = createSignal<HTMLDivElement>();
+ const loadMore = () =>
+ fireAndForget(props.catalog.query.fetchNextPage(), 'connections-settings');
+ useInfiniteScrollSentinel({
+ sentinel,
+ hasNextPage: () =>
+ props.catalog.query.hasNextPage && !props.catalog.query.isError,
+ isFetchingNextPage: () => props.catalog.query.isFetching,
+ fetchNextPage: loadMore,
+ });
+
+ return (
+ <>
+ <For each={props.entries()}>
+ {(entry) => <CatalogRow entry={entry} />}
+ </For>
+ <Show
+ when={
+ props.catalog.query.isError && props.catalog.entries().length === 0
+ }
+ >
+ <div class="flex items-center justify-center gap-3 px-3 py-6 text-sm text-ink-muted">
+ Couldn't load the app catalog.
+ <Button
+ variant="secondary"
+ size="sm"
+ onClick={() => props.catalog.query.refetch()}
+ >
+ Retry
+ </Button>
+ </div>
+ </Show>
+ <Show when={props.catalog.query.isFetching}>
+ <div
+ class="flex justify-center px-3 py-6"
+ role="status"
+ aria-label="Loading"
+ >
+ <SpinnerIcon class="size-4 animate-spin text-ink-muted" />
+ </div>
+ </Show>
+ <Show when={props.catalog.query.isFetchNextPageError}>
+ <div class="flex items-center justify-center gap-3 py-4 text-sm text-ink-muted">
+ Couldn't load more apps.
+ <Button variant="secondary" size="sm" onClick={loadMore}>
+ Retry
+ </Button>
+ </div>
+ </Show>
+ <Show
+ when={
+ props.catalog.query.hasNextPage &&
+ !props.catalog.query.isFetching &&
+ !props.catalog.query.isError
+ }
+ >
+ <div ref={setSentinel} class="h-px" aria-hidden="true" />
+ </Show>
+ </>
+ );
+}
+
+function CatalogRow(props: { entry: PipedreamCatalogEntryResponse }) {
+ const { connect, busy } = createPipedreamCatalogConnect({
+ entry: () => props.entry,
+ onConnected: (entry) => toast.success(`${entry.display_name} connected`),
+ });
+ const name = () => props.entry.display_name;
+
+ return (
+ <IntegrationListRow
+ icon={
+ <PipedreamConnectorIcon
+ appSlug={props.entry.app_slug}
+ iconUrl={props.entry.icon_url}
+ class="size-5"
+ />
+ }
+ name={name()}
+ kind="mcp"
+ description={connectorDescription(props.entry.app_slug, name())}
+ categories={catalogCategories(props.entry)}
+ status="available"
+ >
+ <ImportAction appSlug={props.entry.app_slug} name={name()} />
+ <ConnectAction
+ label="Connect"
+ ariaLabel={busy() ? `Connecting ${name()}` : `Connect ${name()}`}
+ loading={busy()}
+ onClick={() => fireAndForget(connect(), 'connections-settings')}
+ />
+ </IntegrationListRow>
+ );
+}
diff --git a/apps/web/src/features/settings/connections/connection-more.tsx b/apps/web/src/features/settings/connections/connection-more.tsx
index c140a3ece6..e78dcb8ee5 100644
--- a/apps/web/src/features/settings/connections/connection-more.tsx
+++ b/apps/web/src/features/settings/connections/connection-more.tsx
@@ -1,5 +1,7 @@
+import ArrowUpRightIcon from '@icon/system/regular/arrow-up-right.svg';
import ArrowsClockwiseIcon from '@icon/system/regular/arrows-clockwise.svg';
import DotsThreeIcon from '@icon/system/regular/dots-three.svg';
+import GearIcon from '@icon/system/regular/gear.svg';
import LinkBreakIcon from '@icon/system/regular/link-break.svg';
import PencilSimpleIcon from '@icon/system/regular/pencil-simple.svg';
import PowerIcon from '@icon/system/regular/power.svg';
@@ -11,7 +13,9 @@ export type ConnectionMenuIcon =
| 'disable'
| 'rename'
| 'reconnect'
- | 'disconnect';
+ | 'disconnect'
+ | 'settings'
+ | 'external';
export type ConnectionMenuItem = {
label: string;
@@ -27,6 +31,8 @@ function MenuItemIcon(props: { item: ConnectionMenuItem }): JSX.Element {
.with('rename', () => <PencilSimpleIcon class="size-4" />)
.with('reconnect', () => <ArrowsClockwiseIcon class="size-4" />)
.with('disconnect', () => <LinkBreakIcon class="size-4" />)
+ .with('settings', () => <GearIcon class="size-4" />)
+ .with('external', () => <ArrowUpRightIcon class="size-4" />)
.exhaustive();
}
diff --git a/apps/web/src/features/settings/connections/import-action.test.tsx b/apps/web/src/features/settings/connections/import-action.test.tsx
new file mode 100644
index 0000000000..f17d32d012
--- /dev/null
+++ b/apps/web/src/features/settings/connections/import-action.test.tsx
@@ -0,0 +1,36 @@
+/** @vitest-environment jsdom */
+import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';
+import { Show } from 'solid-js';
+import { afterEach, expect, it, vi } from 'vitest';
+import { ImportAction } from './import-action';
+
+// Stands in for the lazily loaded import dialog host.
+vi.mock('@core/util/lazyNamed', () => ({
+ lazyNamed:
+ () =>
+ (props: {
+ open: boolean;
+ config: { action: string; providers: { name: string }[] };
+ }) => (
+ <Show when={props.open}>
+ <div role="dialog" aria-label={props.config.action}>
+ {props.config.providers.map((provider) => provider.name).join(', ')}
+ </div>
+ </Show>
+ ),
+}));
+vi.mock('@app/features/connector-import/connector-import-dialog', () => ({}));
+
+afterEach(cleanup);
+
+it('opens the importer for just the chosen app', async () => {
+ render(() => <ImportAction appSlug="jira" name="Jira" />);
+ fireEvent.click(screen.getByRole('button', { name: 'Import from Jira' }));
+ const dialog = await screen.findByRole('dialog', { name: 'Import tasks' });
+ expect(dialog.textContent).toBe('Jira');
+});
+
+it('offers no import for apps Macro cannot import from', () => {
+ render(() => <ImportAction appSlug="zoom" name="Zoom" />);
+ expect(screen.queryByRole('button', { name: 'Import from Zoom' })).toBeNull();
+});
diff --git a/apps/web/src/features/settings/connections/import-action.tsx b/apps/web/src/features/settings/connections/import-action.tsx
new file mode 100644
index 0000000000..cae2410d41
--- /dev/null
+++ b/apps/web/src/features/settings/connections/import-action.tsx
@@ -0,0 +1,82 @@
+import { importSourceFor } from '@app/features/connector-import/core/catalog';
+import { fireAndForget } from '@core/util/fireAndForget';
+import { lazyNamed } from '@core/util/lazyNamed';
+import { Telemetry } from '@macro-inc/observability';
+import { createSignal, Show, Suspense } from 'solid-js';
+import { match } from 'ts-pattern';
+import { ConnectAction } from '../integration-ui';
+
+const loadDialog = () =>
+ import('@app/features/connector-import/connector-import-dialog');
+const ConnectorImportDialogHost = lazyNamed(
+ loadDialog,
+ 'ConnectorImportDialogHost'
+);
+
+/**
+ * Offers Macro's importer beside Connect for apps it can import from: the
+ * importer copies the app's data into Macro, while Connect only gives agents
+ * the app's tools.
+ */
+export function ImportAction(props: { appSlug: string; name: string }) {
+ const source = () => importSourceFor(props.appSlug);
+ const [open, setOpen] = createSignal(false);
+ // The dialog's code loads on first open.
+ const [opened, setOpened] = createSignal(false);
+ const [opener, setOpener] = createSignal<HTMLElement>();
+
+ return (
+ <Show when={source()}>
+ {(found) => (
+ <>
+ <ConnectAction
+ label="Import"
+ variant="neutral"
+ ariaLabel={`Import from ${props.name}`}
+ onClick={() => {
+ const active = document.activeElement;
+ setOpener(active instanceof HTMLElement ? active : undefined);
+ // Mount only once the dialog's code has loaded, so a failed
+ // chunk load leaves Import available to retry.
+ fireAndForget(
+ Telemetry.span('connector_import.open', async (span) => {
+ span.setAttr('connector.app_slug', props.appSlug);
+ await loadDialog();
+ setOpened(true);
+ setOpen(true);
+ }),
+ 'connections-settings'
+ );
+ }}
+ />
+ <Show when={opened()}>
+ <Suspense>
+ <ConnectorImportDialogHost
+ config={{ ...found().config, providers: [found().provider] }}
+ open={open()}
+ onOpenChange={setOpen}
+ opener={opener()}
+ />
+ </Suspense>
+ </Show>
+ </>
+ )}
+ </Show>
+ );
+}
+
+/** One line on what connecting an app does in Macro, not what the app is. */
+export function connectorDescription(appSlug: string, name: string): string {
+ const found = importSourceFor(appSlug);
+ if (!found) {
+ return `Agents can use ${name} when you ask them to. Nothing is copied into Macro.`;
+ }
+ const destination = match(found.config.category)
+ .with('files', () => 'your Drive')
+ .with('tasks', () => 'Tasks')
+ .with('crm', () => 'the CRM')
+ .with('channels', () => 'Macro')
+ .exhaustive();
+ const items = found.provider.detail;
+ return `Import ${items.charAt(0).toLowerCase()}${items.slice(1)} into ${destination}, or connect so agents can use ${name} without copying anything.`;
+}
diff --git a/apps/web/src/features/settings/connections/integration-items.tsx b/apps/web/src/features/settings/connections/integration-items.tsx
new file mode 100644
index 0000000000..644ed383b3
--- /dev/null
+++ b/apps/web/src/features/settings/connections/integration-items.tsx
@@ -0,0 +1,421 @@
+import { SlackImport } from '@app/features/slack-import/slack-import';
+import { useFeatureFlag } from '@app/lib/analytics/posthog';
+import {
+ ENABLE_EMAIL,
+ enableMultiInbox,
+ enableSlackArchiveImport,
+} from '@core/constant/featureFlags';
+import { useEmailLinks } from '@core/email-link';
+import { PipedreamConnectorIcon } from '@core/pipedream/ConnectorIcon';
+import { fireAndForget } from '@core/util/fireAndForget';
+import { openExternalUrl } from '@core/util/url';
+import ClaudeIcon from '@icon/claude-color.svg';
+import GmailIcon from '@icon/gmail-color.svg';
+import OutlookIcon from '@icon/outlook-color.svg';
+import DesktopIcon from '@icon/system/regular/desktop.svg';
+import { useUserTeamsQuery } from '@queries/team/teams';
+import type { Team as TeamSummary } from '@service-auth/generated/schemas/team';
+import type { Link as EmailLink } from '@service-email/generated/schemas';
+import { type Accessor, Match, Show, Switch } from 'solid-js';
+import { match } from 'ts-pattern';
+import {
+ GRANOLA_APP_SLUG,
+ GRANOLA_ICON_URL,
+} from '../../granola-connect/core/granola';
+import { createGranolaConnection } from '../../granola-connect/primitives/create-granola-connection';
+import { useConnectInbox } from '../Email';
+import { GITHUB_APP_INSTALL_URL, useGithubConnection } from '../GitHub';
+import { ConnectAction } from '../integration-ui';
+import { useTeamViewer } from '../Team';
+import { ConnectionRowActions } from './connection-more';
+import { ImportAction } from './import-action';
+import type { IntegrationItem, IntegrationStatus } from './integrations-list';
+import {
+ type CapabilityStatus,
+ type ConnectionsModel,
+ CURATED_AI,
+ type CuratedAiProvider,
+ capabilitiesFor,
+} from './model';
+import { providerIcon } from './provider-meta';
+import { useConnectionsView } from './view-state';
+
+export type IntegrationItemHosts = {
+ onOpenEmailSettings: () => void;
+ onOpenMacroMcp: () => void;
+ /** Absent when the Runtimes page is unavailable. */
+ onOpenLocalAgents?: () => void;
+};
+
+function capabilityStatus(status: CapabilityStatus): IntegrationStatus {
+ return match(status)
+ .with('connected', () => 'connected' as const)
+ .with('off', () => 'disconnected' as const)
+ .with('action-required', () => 'attention' as const)
+ .with('not-connected', () => 'available' as const)
+ .exhaustive();
+}
+
+function agentToolStatus(
+ model: Accessor<ConnectionsModel>,
+ provider: CuratedAiProvider
+): IntegrationStatus {
+ const capability = capabilitiesFor(model(), provider)[0];
+ return capabilityStatus(capability?.status ?? 'not-connected');
+}
+
+function emailItem(
+ provider: EmailLink['provider'],
+ links: Accessor<EmailLink[]>,
+ actions: IntegrationItem['Actions']
+): IntegrationItem {
+ const outlook = provider === 'OUTLOOK';
+ return {
+ id: outlook ? 'outlook' : 'gmail',
+ name: outlook ? 'Outlook' : 'Gmail',
+ kind: 'native',
+ icon: outlook ? <OutlookIcon /> : <GmailIcon />,
+ get description() {
+ if (links().length > 0)
+ return links()
+ .map((link) => link.email_address)
+ .join(', ');
+ return outlook
+ ? 'Sync Outlook.com or Microsoft 365 inboxes into Email and Calendar.'
+ : 'Sync Gmail or Google Workspace inboxes into Email and Calendar.';
+ },
+ categories: ['Email', 'Calendar'],
+ get status() {
+ if (links().some((link) => link.needs_reauth)) return 'attention';
+ return links().length > 0 ? 'connected' : 'available';
+ },
+ get statusLabel() {
+ return links().length > 1 ? `${links().length} accounts` : undefined;
+ },
+ Actions: actions,
+ };
+}
+
+/** Gmail and Outlook, one row per provider; accounts are managed in Email settings. */
+export function useEmailItems(hosts: IntegrationItemHosts): IntegrationItem[] {
+ const { query } = useEmailLinks();
+ const connectInbox = useConnectInbox();
+ const multiInbox = useFeatureFlag(enableMultiInbox);
+ const links = () => (query.isSuccess ? query.data.links : []);
+ const linksFor = (provider: EmailLink['provider']) =>
+ links().filter((link) =>
+ provider === 'OUTLOOK'
+ ? link.provider === 'OUTLOOK'
+ : link.provider !== 'OUTLOOK'
+ );
+ // Further inboxes are behind multi-inbox; the first is always offered.
+ const canAdd = () => links().length === 0 || multiInbox().enabled;
+
+ const actionsFor = (provider: EmailLink['provider']) => () => (
+ <>
+ <Show when={canAdd()}>
+ <ConnectAction
+ label={linksFor(provider).length > 0 ? 'Add account' : 'Connect'}
+ ariaLabel={
+ provider === 'OUTLOOK'
+ ? 'Connect an Outlook account'
+ : 'Connect a Google Workspace account'
+ }
+ onClick={() => connectInbox(provider)}
+ />
+ </Show>
+ <Show when={linksFor(provider).length > 0}>
+ <ConnectAction
+ label="Manage"
+ variant="neutral"
+ onClick={hosts.onOpenEmailSettings}
+ />
+ </Show>
+ </>
+ );
+ if (!ENABLE_EMAIL) return [];
+ return [
+ emailItem('GMAIL', () => linksFor('GMAIL'), actionsFor('GMAIL')),
+ emailItem('OUTLOOK', () => linksFor('OUTLOOK'), actionsFor('OUTLOOK')),
+ ];
+}
+
+/**
+ * One GitHub row for the account link (pull requests, reviews, repositories)
+ * and the agent tools, which are managed from its menu.
+ */
+export function useGithubItem(
+ model: Accessor<ConnectionsModel>
+): IntegrationItem {
+ const github = useGithubConnection();
+ const view = useConnectionsView();
+ const agentStatus = () => agentToolStatus(model, 'github');
+
+ function Actions() {
+ return (
+ <Switch>
+ <Match when={github.status() === 'linked'}>
+ <ConnectionRowActions
+ items={[
+ {
+ label: 'Configure GitHub App',
+ icon: 'external',
+ onSelect: () => openExternalUrl(GITHUB_APP_INSTALL_URL),
+ },
+ {
+ label: 'Agent tools',
+ icon: 'settings',
+ onSelect: () => view.openProvider('github'),
+ },
+ {
+ label: 'Disconnect',
+ icon: 'disconnect',
+ danger: true,
+ disabled: github.disconnecting(),
+ onSelect: () =>
+ fireAndForget(github.disconnect(), 'github-settings'),
+ },
+ ]}
+ />
+ </Match>
+ <Match when={github.status() === 'reauthentication_required'}>
+ <ConnectAction
+ label="Reconnect"
+ onClick={() => fireAndForget(github.reconnect(), 'github-settings')}
+ disabled={github.reconnecting()}
+ />
+ </Match>
+ <Match when={!github.loading()}>
+ <ConnectAction
+ label="Connect"
+ ariaLabel="Connect GitHub"
+ onClick={() => fireAndForget(github.connect(), 'github-settings')}
+ disabled={github.connecting()}
+ />
+ </Match>
+ </Switch>
+ );
+ }
+
+ return {
+ id: 'github',
+ name: 'GitHub',
+ kind: 'native',
+ icon: providerIcon('github'),
+ get description() {
+ const summary =
+ 'Pull request reviews and status in Macro, and repository access for agents.';
+ const username = github.username();
+ return username ? `@${username} · ${summary}` : summary;
+ },
+ categories: ['Code', 'Agent tools'],
+ get status() {
+ return github.connectionState() ?? agentStatus();
+ },
+ get statusLabel() {
+ return github.connectionState() === 'attention'
+ ? 'Reconnect required'
+ : undefined;
+ },
+ Actions,
+ };
+}
+
+/** Slack export import for team admins, else the agent-led channel import. */
+function SlackImportAction() {
+ const teams = useUserTeamsQuery();
+ const archiveImport = useFeatureFlag(enableSlackArchiveImport);
+ const team = () => (teams.isSuccess ? teams.data[0] : undefined);
+ return (
+ <Show
+ when={archiveImport().enabled && team()}
+ keyed
+ fallback={<ImportAction appSlug="slack" name="Slack" />}
+ >
+ {(found) => <TeamSlackImport team={found} />}
+ </Show>
+ );
+}
+
+function TeamSlackImport(props: { team: TeamSummary }) {
+ const { isAdminOrOwner } = useTeamViewer(() => props.team);
+ return (
+ <Show
+ when={isAdminOrOwner()}
+ fallback={<ImportAction appSlug="slack" name="Slack" />}
+ >
+ <SlackImport
+ teamId={props.team.id}
+ isAdmin
+ trigger={(onOpen) => (
+ <ConnectAction
+ label="Import"
+ variant="neutral"
+ ariaLabel="Import from Slack"
+ onClick={() => {
+ const active = document.activeElement;
+ if (active instanceof HTMLButtonElement) onOpen(active);
+ }}
+ />
+ )}
+ />
+ </Show>
+ );
+}
+
+const AGENT_PROVIDER_CATEGORIES: Record<CuratedAiProvider, string[]> = {
+ github: ['Code', 'Agent tools'],
+ linear: ['Tasks', 'Agent tools'],
+ notion: ['Docs', 'Agent tools'],
+ slack: ['Chat', 'Agent tools'],
+};
+
+/** Slack, Linear and Notion: agent tools with Macro's importer beside them. */
+export function useAgentProviderItem(
+ model: Accessor<ConnectionsModel>,
+ provider: Exclude<CuratedAiProvider, 'github'>
+): IntegrationItem {
+ const view = useConnectionsView();
+ const name = CURATED_AI[provider].title;
+ const status = () => agentToolStatus(model, provider);
+
+ function Actions() {
+ return (
+ <>
+ <Show
+ when={provider === 'slack'}
+ fallback={<ImportAction appSlug={provider} name={name} />}
+ >
+ <SlackImportAction />
+ </Show>
+ <ConnectAction
+ label={status() === 'available' ? 'Connect' : 'Manage'}
+ variant={status() === 'available' ? 'connect' : 'neutral'}
+ ariaLabel={`${status() === 'available' ? 'Connect' : 'Manage'} ${name}`}
+ onClick={() => view.openProvider(provider)}
+ />
+ </>
+ );
+ }
+
+ return {
+ id: provider,
+ name,
+ kind: 'mcp',
+ icon: providerIcon(provider),
+ description: CURATED_AI[provider].outcome,
+ categories: AGENT_PROVIDER_CATEGORIES[provider],
+ get status() {
+ return status();
+ },
+ Actions,
+ };
+}
+
+export function useGranolaItem(): IntegrationItem {
+ const granola = createGranolaConnection();
+
+ function Actions() {
+ return (
+ <Switch>
+ <Match when={granola.status() === 'connected'}>
+ <ConnectAction
+ label="Disconnect"
+ variant="danger"
+ onClick={() =>
+ fireAndForget(granola.disconnect(), 'granola-settings')
+ }
+ disabled={granola.disconnecting()}
+ />
+ </Match>
+ <Match when={granola.status() === 'disabled'}>
+ <ConnectAction
+ label="Resume"
+ onClick={() => fireAndForget(granola.connect(), 'granola-settings')}
+ loading={granola.connecting()}
+ />
+ </Match>
+ <Match when={granola.status() === 'available'}>
+ <ConnectAction
+ label="Connect"
+ ariaLabel="Connect Granola"
+ onClick={() => fireAndForget(granola.connect(), 'granola-settings')}
+ loading={granola.connecting()}
+ />
+ </Match>
+ </Switch>
+ );
+ }
+
+ return {
+ id: 'granola',
+ name: 'Granola',
+ kind: 'native',
+ icon: (
+ <PipedreamConnectorIcon
+ appSlug={GRANOLA_APP_SLUG}
+ iconUrl={GRANOLA_ICON_URL}
+ class="size-5"
+ />
+ ),
+ description:
+ 'Import Granola meetings into Calls to make transcripts available to agents and team-level memory.',
+ categories: ['Meetings'],
+ get status(): IntegrationStatus {
+ const status = granola.status();
+ if (status === 'connected') return 'connected';
+ if (status === 'disabled') return 'disconnected';
+ return 'available';
+ },
+ get statusLabel() {
+ return granola.status() === 'disabled' ? 'Paused' : undefined;
+ },
+ Actions,
+ };
+}
+
+/** Macro MCP setup for AI apps, and local coding agents when available. */
+export function aiAppItems(hosts: IntegrationItemHosts): IntegrationItem[] {
+ const items: IntegrationItem[] = [
+ {
+ id: 'macro-mcp',
+ name: 'Claude Code, Codex, and ChatGPT',
+ kind: 'mcp',
+ icon: <ClaudeIcon />,
+ description:
+ 'Use your Macro workspace from Claude Code, Codex, ChatGPT, Claude.ai, and IDEs through the Macro MCP server.',
+ categories: ['AI apps'],
+ status: 'available',
+ Actions: () => (
+ <ConnectAction
+ label="Set up"
+ variant="neutral"
+ ariaLabel="Set up Macro in AI apps"
+ onClick={hosts.onOpenMacroMcp}
+ />
+ ),
+ },
+ ];
+ const openLocal = hosts.onOpenLocalAgents;
+ if (openLocal) {
+ items.push({
+ id: 'local-agents',
+ name: 'Coding agents on your computer',
+ kind: 'native',
+ icon: <DesktopIcon />,
+ description:
+ 'Pair your computer so Macro agents run on Claude Code, Codex, OpenCode, OpenClaw, or Hermes there, with each session streamed into Macro.',
+ categories: ['AI apps'],
+ status: 'available',
+ Actions: () => (
+ <ConnectAction
+ label="Set up"
+ variant="neutral"
+ ariaLabel="Set up local agents"
+ onClick={openLocal}
+ />
+ ),
+ });
+ }
+ return items;
+}
diff --git a/apps/web/src/features/settings/connections/integrations-list.tsx b/apps/web/src/features/settings/connections/integrations-list.tsx
new file mode 100644
index 0000000000..bcb6cd5a4c
--- /dev/null
+++ b/apps/web/src/features/settings/connections/integrations-list.tsx
@@ -0,0 +1,247 @@
+import { rowPillClasses } from '@app/features/entity/components/row-pill';
+import { TAG_COLORS } from '@app/features/property/tags/tagColors';
+import { Badge, cn, TagDot } from '@ui';
+import { type Component, For, type JSX, Show } from 'solid-js';
+import { match } from 'ts-pattern';
+import { settingsTarget } from '../core/settings-target';
+import { type ConnectionState, StatusDot } from '../integration-ui';
+
+/** Whether an integration is in use; connected rows sort to the top. */
+export type IntegrationStatus = ConnectionState | 'available';
+
+/**
+ * How an integration reaches Macro: built into Macro (`native`), or as tools
+ * agents call through an MCP server (`mcp`).
+ */
+export type IntegrationKind = 'native' | 'mcp';
+
+/** One row of the Integrations list. */
+export type IntegrationItem = {
+ id: string;
+ name: string;
+ kind: IntegrationKind;
+ icon: JSX.Element;
+ /** What it does in Macro, or which accounts are connected. */
+ description: string;
+ categories: string[];
+ status: IntegrationStatus;
+ /** Overrides the status word, e.g. "Reconnect required". */
+ statusLabel?: string;
+ /** Rendered in the row's trailing cell; reads its own reactive state. */
+ Actions: Component;
+};
+
+const CATEGORY_COLORS: Record<string, string> = {
+ Email: TAG_COLORS[0],
+ Calendar: TAG_COLORS[7],
+ Chat: TAG_COLORS[9],
+ Tasks: TAG_COLORS[8],
+ Docs: TAG_COLORS[6],
+ Code: TAG_COLORS[11],
+ Meetings: TAG_COLORS[5],
+ 'AI apps': TAG_COLORS[3],
+ 'Agent tools': TAG_COLORS[2],
+ 'Custom MCP': TAG_COLORS[11],
+};
+
+/** Known categories keep their color; catalog categories get a stable one. */
+function categoryColor(category: string): string {
+ const known = CATEGORY_COLORS[category];
+ if (known) return known;
+ let hash = 0;
+ for (const char of category) hash = (hash * 31 + char.charCodeAt(0)) >>> 0;
+ return TAG_COLORS[hash % TAG_COLORS.length];
+}
+
+function statusWord(
+ status: IntegrationStatus,
+ label: string | undefined
+): string | undefined {
+ if (label) return label;
+ return match(status)
+ .with('connected', () => 'Connected')
+ .with('attention', () => 'Needs attention')
+ .with('disconnected', () => 'Off')
+ .with('available', () => undefined)
+ .exhaustive();
+}
+
+/** Matches the name, description and categories, ignoring case. */
+export function matchesIntegration(
+ item: Pick<IntegrationItem, 'name' | 'description' | 'categories'>,
+ query: string
+): boolean {
+ const needle = query.trim().toLowerCase();
+ if (!needle) return true;
+ return [item.name, item.description, ...item.categories]
+ .join(' ')
+ .toLowerCase()
+ .includes(needle);
+}
+
+export function CategoryTags(props: { categories: string[] }) {
+ return (
+ <div class="flex min-w-0 items-center gap-1 overflow-hidden">
+ <For each={props.categories}>
+ {(category) => (
+ <span title={category} class={rowPillClasses('max-w-full shrink')}>
+ <TagDot fill={categoryColor(category)} size="sm" />
+ <span class="min-w-0 truncate">{category}</span>
+ </span>
+ )}
+ </For>
+ </div>
+ );
+}
+
+/**
+ * The list's columns. Category and status drop out on narrow containers, where
+ * the status dot moves beside the name.
+ */
+function Columns(props: {
+ class?: string;
+ children: JSX.Element;
+ role: 'row';
+ /** Label the settings search reveals this row by. */
+ target?: string;
+}) {
+ return (
+ <div
+ role={props.role}
+ data-settings-target={settingsTarget(props.target)}
+ class={cn(
+ 'grid items-center gap-3 grid-cols-[minmax(0,1fr)_auto]',
+ '@[640px]/integrations:grid-cols-[minmax(0,1fr)_15rem_7rem_12.5rem]',
+ props.class
+ )}
+ >
+ {props.children}
+ </div>
+ );
+}
+
+export function IntegrationsListHeader() {
+ return (
+ <Columns
+ role="row"
+ class="h-8 border-b border-ink/5 px-3 text-xs font-medium text-ink-extra-muted"
+ >
+ <span role="columnheader">Name</span>
+ <span role="columnheader" class="hidden @[640px]/integrations:block">
+ Category
+ </span>
+ <span role="columnheader" class="hidden @[640px]/integrations:block">
+ Status
+ </span>
+ <span role="columnheader" class="sr-only">
+ Actions
+ </span>
+ </Columns>
+ );
+}
+
+export function IntegrationListRow(props: {
+ icon: JSX.Element;
+ name: string;
+ kind: IntegrationKind;
+ description: string;
+ categories: string[];
+ status: IntegrationStatus;
+ statusLabel?: string;
+ /** Soften the row when the integration is paused. */
+ muted?: boolean;
+ children?: JSX.Element;
+}) {
+ const word = () => statusWord(props.status, props.statusLabel);
+ const dotState = () =>
+ props.status === 'available' ? undefined : props.status;
+ return (
+ <Columns
+ role="row"
+ target={props.name}
+ class="min-h-14 rounded-lg px-3 py-2 text-sm not-touch:hover:bg-list-hover focus-within:bg-list-hover"
+ >
+ <div role="cell" class="flex min-w-0 items-center gap-3">
+ <span
+ aria-hidden="true"
+ class={cn(
+ 'flex size-5 shrink-0 items-center justify-center [&_img]:size-5 [&_svg]:size-5',
+ props.muted && 'opacity-50'
+ )}
+ >
+ {props.icon}
+ </span>
+ <div class="flex min-w-0 flex-1 flex-col gap-0.5">
+ <div class="flex min-w-0 items-center gap-2">
+ <span
+ class={cn(
+ 'min-w-0 truncate font-medium',
+ props.muted ? 'text-ink-muted' : 'text-ink'
+ )}
+ >
+ {props.name}
+ </span>
+ <Badge
+ variant="outline"
+ size="xs"
+ class="shrink-0 text-ink-muted"
+ title={
+ props.kind === 'mcp'
+ ? 'Agents use it through an MCP server'
+ : 'Built into Macro'
+ }
+ >
+ {props.kind}
+ </Badge>
+ <Show when={dotState()}>
+ {(state) => (
+ <span class="flex @[640px]/integrations:hidden">
+ <StatusDot state={state()} label={word()} />
+ </span>
+ )}
+ </Show>
+ </div>
+ <span
+ class="ph-no-capture min-w-0 truncate text-xs text-ink-extra-muted"
+ title={props.description}
+ >
+ {props.description}
+ </span>
+ </div>
+ </div>
+ <div role="cell" class="hidden min-w-0 @[640px]/integrations:block">
+ <CategoryTags categories={props.categories} />
+ </div>
+ <div
+ role="cell"
+ class="hidden items-center gap-1.5 text-xs text-ink-muted @[640px]/integrations:flex"
+ >
+ <Show when={dotState()}>
+ {(state) => <StatusDot state={state()} />}
+ </Show>
+ <span>{word() ?? '—'}</span>
+ </div>
+ <div role="cell" class="flex shrink-0 items-center justify-end gap-1">
+ {props.children}
+ </div>
+ </Columns>
+ );
+}
+
+/** Renders an item from the integration sources. */
+export function IntegrationItemRow(props: { item: IntegrationItem }) {
+ return (
+ <IntegrationListRow
+ icon={props.item.icon}
+ name={props.item.name}
+ kind={props.item.kind}
+ description={props.item.description}
+ categories={props.item.categories}
+ status={props.item.status}
+ statusLabel={props.item.statusLabel}
+ muted={props.item.status === 'disconnected'}
+ >
+ <props.item.Actions />
+ </IntegrationListRow>
+ );
+}
diff --git a/apps/web/src/features/settings/connections/integrations-view.test.tsx b/apps/web/src/features/settings/connections/integrations-view.test.tsx
index 023654f423..81f739b6b4 100644
--- a/apps/web/src/features/settings/connections/integrations-view.test.tsx
+++ b/apps/web/src/features/settings/connections/integrations-view.test.tsx
@@ -13,6 +13,7 @@ import {
import { createSignal, type JSX } from 'solid-js';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { IntegrationsView } from './integrations-view';
+import type { Leftover } from './model';
import { useConnectionsView } from './view-state';
const mocks = vi.hoisted(() => ({
@@ -21,6 +22,9 @@ const mocks = vi.hoisted(() => ({
discover: vi.fn(),
importChannels: vi.fn(),
failure: vi.fn(),
+ granolaConnected: false,
+ leftovers: [] as Leftover[],
+ overlaysLoading: false,
}));
const [state, setState] = createSignal<ImportState>({ runs: [], entities: [] });
vi.mock('@core/context/user', () => ({ useUserId: () => () => 'me' }));
@@ -39,10 +43,23 @@ vi.mock('@service-connection/websocket', () => ({
}));
vi.mock('@queries/pipedream-connectors', () => ({
connectPipedreamApp: mocks.connect,
+ usePipedreamConnectedSlugs: () => ({ slugs: () => new Set<string>() }),
+ usePipedreamOverlaysQuery: () => ({
+ isPending: false,
+ data: [],
+ get isPlaceholderData() {
+ return mocks.overlaysLoading;
+ },
+ }),
+ overlaidAppSlug: () => undefined,
}));
vi.mock('./use-connections-model', () => ({
useConnectionsModel: () => ({
- model: () => ({}),
+ model: () => ({
+ capabilities: [],
+ leftovers: mocks.leftovers,
+ providers: [],
+ }),
ready: () => true,
error: () => false,
partialError: () => false,
@@ -53,18 +70,59 @@ vi.mock('./model', () => ({
capabilitiesFor: () =>
mocks.connected ? [{ mechanism: 'pipedream', status: 'connected' }] : [],
}));
-vi.mock('./ConnectedView', () => ({
- ConnectedView: () => {
- const view = useConnectionsView();
- return (
- <button onClick={() => view.openProvider('slack')}>
- Installed Slack
- </button>
- );
- },
+vi.mock('./add-custom-mcp-dialog', () => ({ AddCustomMcpDialog: () => null }));
+// Stand-ins for rows whose real sources read account, team and email queries.
+vi.mock('./integration-items', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('./integration-items')>();
+ const item = (name: string, Actions: () => JSX.Element) => ({
+ id: name,
+ name,
+ icon: null,
+ description: `${name} description`,
+ categories: ['Agent tools'],
+ get status() {
+ return name === 'Granola' && mocks.granolaConnected
+ ? ('connected' as const)
+ : ('available' as const);
+ },
+ Actions,
+ });
+ return {
+ ...actual,
+ useEmailItems: () => [],
+ useGithubItem: () => item('GitHub', () => null),
+ useGranolaItem: () => item('Granola', () => null),
+ useAgentProviderItem: (_model: unknown, provider: 'slack' | 'linear') =>
+ item(provider === 'slack' ? 'Slack' : provider, () => {
+ const view = useConnectionsView();
+ return (
+ <button onClick={() => view.openProvider(provider)}>
+ Manage {provider}
+ </button>
+ );
+ }),
+ };
+});
+// The real row reads connection mutations.
+vi.mock('./leftover-row', async (importOriginal) => ({
+ ...(await importOriginal<typeof import('./leftover-row')>()),
+ LeftoverRow: (props: { leftover: Leftover }) => (
+ <div role="row">
+ <span class="font-medium">{props.leftover.title}</span>
+ </div>
+ ),
}));
-vi.mock('./DiscoverView', () => ({
- DiscoverView: () => <p>Integration catalog</p>,
+vi.mock('./catalog-rows', () => ({
+ CatalogRows: () => <p>Integration catalog</p>,
+}));
+vi.mock('@core/pipedream/catalog', () => ({
+ createPipedreamCatalogSearch: () => ({
+ search: () => '',
+ searchInput: () => '',
+ onSearchInput: vi.fn(),
+ entries: () => [],
+ query: { isFetching: false },
+ }),
}));
vi.mock('./PipedreamAiProvider', () => ({
PipedreamAiProvider: () => {
@@ -118,12 +176,36 @@ vi.mock('../primitives', () => ({
SettingsCard: (props: { children: JSX.Element }) => (
<div>{props.children}</div>
),
+ IntegrationRow: (props: {
+ title: JSX.Element;
+ description?: JSX.Element;
+ children?: JSX.Element;
+ }) => (
+ <div>
+ <span>{props.title}</span>
+ <span>{props.description}</span>
+ {props.children}
+ </div>
+ ),
}));
+const CUSTOM_SERVER: Leftover = {
+ kind: 'native-mcp',
+ id: 'mcp:https://tools.example.com/mcp',
+ title: 'Team tools',
+ subtitle: 'tools.example.com',
+ url: 'https://tools.example.com/mcp',
+ enabled: true,
+ authenticated: true,
+};
+
beforeEach(() => {
vi.clearAllMocks();
clearPendingConnectApp();
mocks.connected = false;
+ mocks.granolaConnected = false;
+ mocks.leftovers = [];
+ mocks.overlaysLoading = false;
setState({ runs: [], entities: [] });
});
afterEach(cleanup);
@@ -131,7 +213,11 @@ afterEach(cleanup);
function startImport() {
requestConnectApp('slack', 'import-slack-channels');
render(() => (
- <IntegrationsView onOpenMacroMcp={() => {}} onOpenLocalAgents={() => {}} />
+ <IntegrationsView
+ onOpenEmailSettings={() => {}}
+ onOpenMacroMcp={() => {}}
+ onOpenLocalAgents={() => {}}
+ />
));
}
@@ -211,6 +297,7 @@ describe('Slack channel import handoff', () => {
requestConnectApp('linear');
render(() => (
<IntegrationsView
+ onOpenEmailSettings={() => {}}
onOpenMacroMcp={() => {}}
onOpenLocalAgents={() => {}}
/>
@@ -224,7 +311,12 @@ describe('Slack channel import handoff', () => {
describe('unified Integrations page', () => {
it('hides local harness setup when no allowed entry point is supplied', () => {
- render(() => <IntegrationsView onOpenMacroMcp={() => {}} />);
+ render(() => (
+ <IntegrationsView
+ onOpenEmailSettings={() => {}}
+ onOpenMacroMcp={() => {}}
+ />
+ ));
expect(
screen.queryByRole('button', { name: 'Set up local agents' })
).toBeNull();
@@ -238,6 +330,7 @@ describe('unified Integrations page', () => {
const onOpenLocalAgents = vi.fn();
render(() => (
<IntegrationsView
+ onOpenEmailSettings={() => {}}
onOpenMacroMcp={onOpenMacroMcp}
onOpenLocalAgents={onOpenLocalAgents}
/>
@@ -252,30 +345,67 @@ describe('unified Integrations page', () => {
);
expect(onOpenLocalAgents).toHaveBeenCalledOnce();
});
- it('shows installed tools and the catalog together and restores both after provider details', () => {
+ it('lists custom servers first, then connected integrations, the rest and the catalog', () => {
+ mocks.granolaConnected = true;
+ mocks.leftovers = [CUSTOM_SERVER];
render(() => (
- <IntegrationsView onOpenMacroMcp={() => {}} onOpenLocalAgents={() => {}}>
- <p>Personal accounts</p>
- </IntegrationsView>
+ <IntegrationsView
+ onOpenEmailSettings={() => {}}
+ onOpenMacroMcp={() => {}}
+ />
));
- expect(screen.getByRole('heading', { name: 'Integrations' })).toBeTruthy();
- expect(screen.getByRole('heading', { name: 'Installed' })).toBeTruthy();
- expect(screen.queryByRole('heading', { name: 'Discover' })).toBeNull();
- expect(
- screen.getByRole('region', { name: 'Available integrations' })
- ).toBeTruthy();
+ const names = screen
+ .getAllByRole('row')
+ .slice(1)
+ .map((row) => row.querySelector('span.font-medium')?.textContent);
+ expect(names.slice(0, 2)).toEqual(['Team tools', 'Granola']);
+ expect(names).toContain('GitHub');
expect(screen.getByText('Integration catalog')).toBeTruthy();
- expect(screen.getByText('Personal accounts')).toBeTruthy();
- expect(screen.queryByRole('tab')).toBeNull();
- fireEvent.click(screen.getByRole('button', { name: 'Installed Slack' }));
+ });
+
+ it('holds native servers back until overlays load', () => {
+ mocks.leftovers = [CUSTOM_SERVER];
+ mocks.overlaysLoading = true;
+ render(() => (
+ <IntegrationsView
+ onOpenEmailSettings={() => {}}
+ onOpenMacroMcp={() => {}}
+ />
+ ));
+ expect(screen.queryByText('Team tools')).toBeNull();
+ expect(screen.getByText('Granola')).toBeTruthy();
+ });
+
+ it('filters every row by search', () => {
+ render(() => (
+ <IntegrationsView
+ onOpenEmailSettings={() => {}}
+ onOpenMacroMcp={() => {}}
+ />
+ ));
+ fireEvent.input(
+ screen.getByRole('searchbox', { name: 'Search integrations' }),
+ { target: { value: 'granola' } }
+ );
+ expect(screen.getByText('Granola')).toBeTruthy();
+ expect(screen.queryByText('GitHub')).toBeNull();
+ expect(
+ screen.queryByRole('button', { name: 'Set up Macro in AI apps' })
+ ).toBeNull();
+ });
+
+ it('returns from provider details to the list', () => {
+ render(() => (
+ <IntegrationsView
+ onOpenEmailSettings={() => {}}
+ onOpenMacroMcp={() => {}}
+ />
+ ));
+ fireEvent.click(screen.getByRole('button', { name: 'Manage slack' }));
expect(screen.queryByText('Integration catalog')).toBeNull();
fireEvent.click(
screen.getByRole('button', { name: 'Back to integrations' })
);
expect(screen.getByText('Integration catalog')).toBeTruthy();
- expect(screen.getByText('Personal accounts')).toBeTruthy();
- expect(
- screen.getByRole('button', { name: 'Installed Slack' })
- ).toBeTruthy();
});
});
diff --git a/apps/web/src/features/settings/connections/integrations-view.tsx b/apps/web/src/features/settings/connections/integrations-view.tsx
index 156190d97f..7a847cf499 100644
--- a/apps/web/src/features/settings/connections/integrations-view.tsx
+++ b/apps/web/src/features/settings/connections/integrations-view.tsx
@@ -1,24 +1,55 @@
+import { SearchBar } from '@app/components/view-shell';
import { toast } from '@core/component/Toast/Toast';
+import { createPipedreamCatalogSearch } from '@core/pipedream/catalog';
import {
clearPendingConnectApp,
pendingConnectApp,
} from '@core/pipedream/pendingConnect';
import { fireAndForget } from '@core/util/fireAndForget';
-import { connectPipedreamApp } from '@queries/pipedream-connectors';
+import PlusIcon from '@icon/system/regular/plus.svg';
+import { queryReadyGate } from '@queries/gate';
+import {
+ connectPipedreamApp,
+ overlaidAppSlug,
+ usePipedreamConnectedSlugs,
+ usePipedreamOverlaysQuery,
+} from '@queries/pipedream-connectors';
import { Button } from '@ui';
import {
+ type Accessor,
createEffect,
+ createMemo,
createSignal,
+ For,
on,
- type ParentProps,
Show,
Suspense,
} from 'solid-js';
-import { SettingsPage, SettingsSurface } from '../primitives';
-import { ConnectedView } from './ConnectedView';
-import { DiscoverView } from './DiscoverView';
-import { capabilitiesFor, type ProviderId } from './model';
+import { SettingsPage } from '../primitives';
+import { AddCustomMcpDialog } from './add-custom-mcp-dialog';
+import { CatalogRows } from './catalog-rows';
+import {
+ aiAppItems,
+ type IntegrationItemHosts,
+ useAgentProviderItem,
+ useEmailItems,
+ useGithubItem,
+ useGranolaItem,
+} from './integration-items';
+import {
+ IntegrationItemRow,
+ IntegrationsListHeader,
+ matchesIntegration,
+} from './integrations-list';
+import { LeftoverRow, leftoverCategories } from './leftover-row';
+import {
+ type ConnectionsModel,
+ capabilitiesFor,
+ type Leftover,
+ type ProviderId,
+} from './model';
import { PipedreamAiProvider } from './PipedreamAiProvider';
+import { PIPEDREAM_BROWSE_HIDDEN_SLUGS } from './provider-meta';
import { SlackChannelImportFlow } from './slack-channel-import/SlackChannelImportFlow';
import { useConnectionsModel } from './use-connections-model';
import {
@@ -27,49 +58,9 @@ import {
useConnectionsView,
} from './view-state';
-function IntegrationSetupCallouts(props: {
- onOpenMacroMcp: () => void;
- onOpenLocalAgents?: () => void;
-}) {
- return (
- <div class="flex flex-col gap-2">
- <SettingsSurface class="flex items-center justify-between gap-4 px-4 py-2">
- <p class="text-base font-medium text-ink">
- Use Macro in your favorite AI harness with the official Macro MCP
- </p>
- <Button
- variant="ghost"
- size="md"
- aria-label="Set up Macro in AI apps"
- onClick={props.onOpenMacroMcp}
- >
- Set up
- </Button>
- </SettingsSurface>
- <Show when={props.onOpenLocalAgents}>
- <SettingsSurface class="flex items-center justify-between gap-4 px-4 py-2">
- <p class="text-base font-medium text-ink">
- Stream sessions from your local AI harness to Macro
- </p>
- <Button
- variant="ghost"
- size="md"
- aria-label="Set up local agents"
- onClick={props.onOpenLocalAgents}
- >
- Set up
- </Button>
- </SettingsSurface>
- </Show>
- </div>
- );
-}
-
-type IntegrationsViewProps = ParentProps<{
- onOpenMacroMcp: () => void;
- onOpenLocalAgents?: () => void;
+type IntegrationsViewProps = IntegrationItemHosts & {
initialProvider?: ProviderId;
-}>;
+};
export function IntegrationsView(props: IntegrationsViewProps) {
const view = createConnectionsViewState({ provider: props.initialProvider });
@@ -120,85 +111,47 @@ function ConnectionsContent(props: IntegrationsViewProps) {
when={importSlackChannels()}
fallback={
<Show
- when={!error()}
+ when={ready() && view.provider()}
+ keyed
fallback={
<SettingsPage
title="Integrations"
- onBack={view.provider() ? view.closeProvider : undefined}
- backLabel="Integrations"
+ bodyClass="mt-6 gap-4"
+ contentClass="max-w-none px-8"
>
- <IntegrationSetupCallouts
- onOpenMacroMcp={props.onOpenMacroMcp}
- onOpenLocalAgents={props.onOpenLocalAgents}
- />
- {props.children}
- <div class="flex items-center gap-3 text-sm text-ink-muted">
- Couldn't load Connections.
- <Button variant="secondary" size="sm" onClick={retry}>
- Retry
- </Button>
- </div>
+ <Show when={error() || partialError()}>
+ <div
+ role="status"
+ class="flex items-center gap-3 text-sm text-ink-muted"
+ >
+ {error()
+ ? "Couldn't load agent tools."
+ : "Some connections couldn't be loaded."}
+ <Button variant="secondary" size="sm" onClick={retry}>
+ Retry
+ </Button>
+ </div>
+ </Show>
+ <Show
+ when={ready() || error()}
+ fallback={
+ <p class="text-sm text-ink-muted">Loading integrations…</p>
+ }
+ >
+ <Suspense>
+ <IntegrationsOverview
+ {...props}
+ model={model}
+ agentToolsAvailable={!error()}
+ />
+ </Suspense>
+ </Show>
</SettingsPage>
}
>
- <Show
- when={ready() && view.provider()}
- keyed
- fallback={
- <SettingsPage title="Integrations" bodyClass="mt-6 gap-6">
- <IntegrationSetupCallouts
- onOpenMacroMcp={props.onOpenMacroMcp}
- onOpenLocalAgents={props.onOpenLocalAgents}
- />
- {props.children}
- <Show when={partialError()}>
- <div
- role="status"
- class="flex items-center gap-3 text-sm text-ink-muted"
- >
- Some connections couldn't be loaded.
- <Button variant="secondary" size="sm" onClick={retry}>
- Retry
- </Button>
- </div>
- </Show>
- <Show
- when={ready()}
- fallback={
- <p class="text-sm text-ink-muted">Loading Connections…</p>
- }
- >
- <section
- aria-label="Agent Integrations"
- class="flex min-w-0 flex-col gap-4"
- >
- <h2 class="text-lg font-medium text-ink">
- Agent Integrations
- </h2>
- <section
- aria-label="Installed integrations"
- class="min-w-0 w-full"
- >
- <h3 class="mb-2 text-base font-medium text-ink">
- Installed
- </h3>
- <ConnectedView model={model()} />
- </section>
- <section
- aria-label="Available integrations"
- class="min-w-0 w-full"
- >
- <DiscoverView model={model()} />
- </section>
- </section>
- </Show>
- </SettingsPage>
- }
- >
- {(provider) => (
- <PipedreamAiProvider model={model()} provider={provider} />
- )}
- </Show>
+ {(provider) => (
+ <PipedreamAiProvider model={model()} provider={provider} />
+ )}
</Show>
}
>
@@ -218,3 +171,187 @@ function ConnectionsContent(props: IntegrationsViewProps) {
</Show>
);
}
+
+function leftoverMatches(
+ leftover: Leftover,
+ overlaidAppSlug: string | undefined,
+ query: string
+): boolean {
+ return matchesIntegration(
+ {
+ name: leftover.title,
+ description: leftover.kind === 'native-mcp' ? leftover.subtitle : '',
+ categories: leftoverCategories(leftover, overlaidAppSlug),
+ },
+ query
+ );
+}
+
+/**
+ * Every integration in one list: custom MCP servers first, then those in use,
+ * then the rest, then the app catalog. One search filters all of them.
+ */
+function IntegrationsOverview(
+ props: IntegrationsViewProps & {
+ model: Accessor<ConnectionsModel>;
+ /** False when connector records failed to load. */
+ agentToolsAvailable: boolean;
+ }
+) {
+ const [query, setQuery] = createSignal('');
+ const [addingCustom, setAddingCustom] = createSignal(false);
+ const view = useConnectionsView();
+ const catalog = createPipedreamCatalogSearch(
+ () => PIPEDREAM_BROWSE_HIDDEN_SLUGS
+ );
+ const search = (value: string) => {
+ setQuery(value);
+ catalog.onSearchInput(value);
+ };
+
+ const agentTools = [
+ useAgentProviderItem(props.model, 'slack'),
+ useAgentProviderItem(props.model, 'linear'),
+ useAgentProviderItem(props.model, 'notion'),
+ ];
+ const items = [
+ ...useEmailItems(props),
+ useGithubItem(props.model),
+ ...agentTools,
+ useGranolaItem(),
+ ...aiAppItems(props),
+ ];
+ // Agent tool rows need connector records; without them their state is unknown.
+ const matching = () =>
+ items.filter(
+ (item) =>
+ (props.agentToolsAvailable || !agentTools.includes(item)) &&
+ matchesIntegration(item, query())
+ );
+ const inUse = () => matching().filter((item) => item.status !== 'available');
+ const available = () =>
+ matching().filter((item) => item.status === 'available');
+ // Overlaid catalog apps connect as native MCP servers; show them as the app.
+ const overlays = usePipedreamOverlaysQuery();
+ const overlaidSlugFor = (leftover: Leftover) =>
+ leftover.kind === 'native-mcp' && queryReadyGate(overlays)
+ ? overlaidAppSlug(overlays.data, leftover.url)
+ : undefined;
+ // Until overlays load, a native server can't be told apart from a custom one;
+ // hold those rows back so an overlaid app doesn't flash at the top.
+ const leftovers = () =>
+ props
+ .model()
+ .leftovers.filter(
+ (row) =>
+ !(row.kind === 'native-mcp' && overlays.isPlaceholderData) &&
+ leftoverMatches(row, overlaidSlugFor(row), query())
+ );
+ // Servers the user added themselves lead the list.
+ const isCustom = (leftover: Leftover) =>
+ leftover.kind === 'native-mcp' && !overlaidSlugFor(leftover);
+ const customLeftovers = () => leftovers().filter(isCustom);
+ const otherLeftovers = () =>
+ leftovers().filter((leftover) => !isCustom(leftover));
+
+ // Includes overlaid apps, which are connected as native MCP servers.
+ const connected = usePipedreamConnectedSlugs();
+ const alreadyHave = createMemo(() => {
+ const slugs = new Set<string>(connected.slugs());
+ for (const row of props.model().capabilities) {
+ if (row.status !== 'not-connected') slugs.add(row.provider);
+ }
+ for (const leftover of props.model().leftovers) {
+ if (leftover.kind === 'pipedream') slugs.add(leftover.appSlug);
+ }
+ return slugs;
+ });
+ const catalogEntries = createMemo(() =>
+ props.agentToolsAvailable
+ ? catalog.entries().filter(
+ (entry) =>
+ !alreadyHave().has(entry.app_slug) &&
+ matchesIntegration(
+ {
+ name: entry.display_name,
+ description: `${entry.description ?? ''} ${entry.app_slug}`,
+ categories: entry.categories ?? [],
+ },
+ query()
+ )
+ )
+ : []
+ );
+ const nothingMatches = () =>
+ matching().length === 0 &&
+ leftovers().length === 0 &&
+ catalogEntries().length === 0 &&
+ !catalog.query.isFetching;
+
+ return (
+ <>
+ <div class="flex items-center gap-2">
+ <SearchBar
+ size="sm"
+ label="Search integrations"
+ placeholder="Search integrations"
+ value={query()}
+ onValueChange={search}
+ onEscape={() => search('')}
+ class="min-w-0 flex-1"
+ />
+ <Show when={props.agentToolsAvailable}>
+ <Button
+ variant="secondary"
+ size="md"
+ onClick={() => setAddingCustom(true)}
+ >
+ <PlusIcon class="size-4" /> Add custom
+ </Button>
+ </Show>
+ </div>
+ <div
+ role="table"
+ aria-label="Integrations"
+ class="@container/integrations -mx-3 flex min-w-0 flex-col"
+ >
+ <IntegrationsListHeader />
+ <div
+ role="rowgroup"
+ class="flex flex-col [&>[role=row]+[role=row]]:border-t [&>[role=row]+[role=row]]:border-ink/5"
+ >
+ <For each={customLeftovers()}>
+ {(leftover) => <LeftoverRow leftover={leftover} />}
+ </For>
+ <For each={inUse()}>
+ {(item) => <IntegrationItemRow item={item} />}
+ </For>
+ <For each={otherLeftovers()}>
+ {(leftover) => (
+ <LeftoverRow
+ leftover={leftover}
+ overlaidAppSlug={overlaidSlugFor(leftover)}
+ />
+ )}
+ </For>
+ <For each={available()}>
+ {(item) => <IntegrationItemRow item={item} />}
+ </For>
+ <Show when={props.agentToolsAvailable}>
+ <CatalogRows catalog={catalog} entries={catalogEntries} />
+ </Show>
+ </div>
+ <Show when={nothingMatches()}>
+ <p class="px-3 py-6 text-sm text-ink-muted">
+ No integrations match “{query().trim()}”.
+ </p>
+ </Show>
+ </div>
+ <AddCustomMcpDialog
+ open={addingCustom()}
+ onOpenChange={setAddingCustom}
+ onAdded={view.showOverview}
+ />
+ </>
+ );
+}
diff --git a/apps/web/src/features/settings/connections/leftover-row.tsx b/apps/web/src/features/settings/connections/leftover-row.tsx
index 770a25cd05..30818781fd 100644
--- a/apps/web/src/features/settings/connections/leftover-row.tsx
+++ b/apps/web/src/features/settings/connections/leftover-row.tsx
@@ -2,6 +2,7 @@ import { toast } from '@core/component/Toast/Toast';
import { PipedreamConnectorIcon } from '@core/pipedream/ConnectorIcon';
import { createPipedreamCatalogConnect } from '@core/pipedream/catalog';
import { fireAndForget } from '@core/util/fireAndForget';
+import PlugIcon from '@icon/system/regular/plug.svg';
import {
useDeletePipedreamConnectionMutation,
useUpdatePipedreamConnectionMutation,
@@ -14,7 +15,6 @@ import {
readMcpAuthAttempted,
writeMcpAuthAttempted,
} from '../mcp-auth-attempt';
-import { IntegrationRow } from '../primitives';
import {
type ConnectionMenuItem,
ConnectionRowActions,
@@ -23,9 +23,23 @@ import {
type DisconnectConfirm,
DisconnectConfirmDialog,
} from './disconnect-confirm';
+import {
+ IntegrationListRow,
+ type IntegrationStatus,
+} from './integrations-list';
import type { Leftover } from './model';
import { useNativeMcpActions } from './native-actions';
+/** Overlaid catalog apps read as agent tools; other native servers are custom. */
+export function leftoverCategories(
+ leftover: Leftover,
+ overlaidAppSlug: string | undefined
+): string[] {
+ return leftover.kind === 'native-mcp' && !overlaidAppSlug
+ ? ['Custom MCP']
+ : ['Agent tools'];
+}
+
function leftoverDisabled(leftover: Leftover): boolean {
return match(leftover)
.with({ kind: 'native-mcp' }, (row) => row.authenticated && !row.enabled)
@@ -33,7 +47,11 @@ function leftoverDisabled(leftover: Leftover): boolean {
.exhaustive();
}
-export function LeftoverRow(props: { leftover: Leftover }) {
+export function LeftoverRow(props: {
+ leftover: Leftover;
+ /** The catalog app a native server stands in for, when it is overlaid. */
+ overlaidAppSlug?: string;
+}) {
const [disconnect, setDisconnect] = createSignal<DisconnectConfirm | null>(
null
);
@@ -281,42 +299,57 @@ export function LeftoverRow(props: { leftover: Leftover }) {
))
.exhaustive();
- const row = (): JSX.Element => {
+ const status = (): IntegrationStatus => {
const leftover = props.leftover;
- const muted = leftoverDisabled(leftover);
- return match(leftover)
+ if (leftover.kind === 'native-mcp' && !leftover.authenticated)
+ return 'attention';
+ return leftoverDisabled(leftover) ? 'disconnected' : 'connected';
+ };
+
+ const row = (): JSX.Element =>
+ match(props.leftover)
.with({ kind: 'native-mcp' }, (item) => (
- <IntegrationRow
- class="gap-3 px-4 py-3"
- title={item.title}
+ <IntegrationListRow
+ icon={
+ <Show when={props.overlaidAppSlug} fallback={<PlugIcon />}>
+ {(appSlug) => (
+ <PipedreamConnectorIcon appSlug={appSlug()} class="size-5" />
+ )}
+ </Show>
+ }
+ name={item.title}
+ kind="mcp"
description={
- <>
- <span class="block truncate">{item.subtitle}</span>
- <Show when={connectionFailed()}>
- <span class="block text-failure">Last attempt failed</span>
- </Show>
- </>
+ connectionFailed()
+ ? `Last attempt failed · ${item.subtitle}`
+ : props.overlaidAppSlug
+ ? 'Agents can use this app when you ask them to. Nothing is copied into Macro.'
+ : item.subtitle
}
- muted={muted}
+ categories={leftoverCategories(item, props.overlaidAppSlug)}
+ status={status()}
+ statusLabel={item.authenticated ? undefined : 'Not connected'}
+ muted={status() === 'disconnected'}
>
{actions()}
- </IntegrationRow>
+ </IntegrationListRow>
))
.with({ kind: 'pipedream' }, (item) => (
- <IntegrationRow
- class="gap-3 px-4 py-3"
+ <IntegrationListRow
icon={
- <PipedreamConnectorIcon appSlug={item.appSlug} class="size-8" />
+ <PipedreamConnectorIcon appSlug={item.appSlug} class="size-5" />
}
- title={item.title}
- description={item.subtitle}
- muted={muted}
+ name={item.title}
+ kind="mcp"
+ description="Agents can use this app when you ask them to. Nothing is copied into Macro."
+ categories={['Agent tools']}
+ status={status()}
+ muted={status() === 'disconnected'}
>
{actions()}
- </IntegrationRow>
+ </IntegrationListRow>
))
.exhaustive();
- };
return (
<>
diff --git a/apps/web/src/features/settings/connections/model.test.ts b/apps/web/src/features/settings/connections/model.test.ts
index d49c1baf51..438229956b 100644
--- a/apps/web/src/features/settings/connections/model.test.ts
+++ b/apps/web/src/features/settings/connections/model.test.ts
@@ -81,7 +81,6 @@ describe('Pipedream connections model', () => {
kind: 'pipedream',
id: 'pipedream:slack_v2',
title: 'slack_v2 account',
- subtitle: 'slack_v2',
appSlug: 'slack_v2',
enabled: slackV2Enabled,
},
@@ -105,7 +104,6 @@ describe('Pipedream connections model', () => {
kind: 'pipedream',
id: 'pipedream:posthog',
title: 'Connected account',
- subtitle: 'posthog',
appSlug: 'posthog',
enabled: false,
},
diff --git a/apps/web/src/features/settings/connections/model.ts b/apps/web/src/features/settings/connections/model.ts
index 9ae90ad692..fa1a18394b 100644
--- a/apps/web/src/features/settings/connections/model.ts
+++ b/apps/web/src/features/settings/connections/model.ts
@@ -48,7 +48,6 @@ export type Leftover =
kind: 'pipedream';
id: string;
title: string;
- subtitle: string;
appSlug: string;
enabled: boolean;
};
@@ -223,7 +222,6 @@ function curatedAiAndLeftovers(input: ConnectionsInput): {
kind: 'pipedream',
id: `pipedream:${row.app_slug}`,
title: row.server_name,
- subtitle: row.app_slug,
appSlug: row.app_slug,
enabled: row.enabled,
});
diff --git a/apps/web/src/features/settings/connections/provider-meta.tsx b/apps/web/src/features/settings/connections/provider-meta.tsx
index fe6a0c5144..43a0fea6a8 100644
--- a/apps/web/src/features/settings/connections/provider-meta.tsx
+++ b/apps/web/src/features/settings/connections/provider-meta.tsx
@@ -1,51 +1,26 @@
import { SLACK_PIPEDREAM_SLUGS } from '@core/pipedream/slugs';
+import LinearIcon from '@icon/linear-color.svg';
import GithubIcon from '@icon/mcp-github.svg';
-import LinearIcon from '@icon/mcp-linear.svg';
import NotionIcon from '@icon/mcp-notion.svg';
-import SlackIcon from '@icon/mcp-slack.svg';
+import SlackIcon from '@icon/slack-color.svg';
import type { JSX } from 'solid-js';
import { match } from 'ts-pattern';
import type { ProviderId } from './model';
-export type FeaturedStarter = {
- id: ProviderId;
- name: string;
- note: string;
-};
-
-export const EMPTY_STARTERS: FeaturedStarter[] = [
- {
- id: 'github',
- name: 'GitHub',
- note: 'Repos, pull requests, and issues for Macro AI',
- },
- {
- id: 'linear',
- name: 'Linear',
- note: 'Issues for Macro AI',
- },
- {
- id: 'notion',
- name: 'Notion',
- note: 'Search pages with Macro AI',
- },
- {
- id: 'slack',
- name: 'Slack',
- note: 'Conversations for Macro AI',
- },
-];
-
export const PIPEDREAM_BROWSE_HIDDEN_SLUGS: ReadonlySet<string> = new Set([
- ...EMPTY_STARTERS.map((item) => item.id),
+ // Featured providers have their own rows.
+ 'github',
+ 'linear',
+ 'notion',
+ 'slack',
...SLACK_PIPEDREAM_SLUGS,
'cursor',
+ // Macro syncs email and calendars natively (Settings → Integrations → Email).
+ 'gmail',
+ 'google_calendar',
+ 'google_sheets',
]);
-export function isPipedreamBrowseHidden(appSlug: string): boolean {
- return PIPEDREAM_BROWSE_HIDDEN_SLUGS.has(appSlug);
-}
-
export function providerIcon(id: ProviderId): JSX.Element {
return match(id)
.with('github', () => <GithubIcon />)
diff --git a/apps/web/src/features/settings/core/initial-sync.test.ts b/apps/web/src/features/settings/core/initial-sync.test.ts
deleted file mode 100644
index 0c12c6f1e7..0000000000
--- a/apps/web/src/features/settings/core/initial-sync.test.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import { isInitialSyncComplete } from './initial-sync';
-
-describe('isInitialSyncComplete', () => {
- it('reports an up-to-date Outlook inbox as synced without a backfill job', () => {
- expect(
- isInitialSyncComplete(
- { provider: 'OUTLOOK', sync_status: 'UP_TO_DATE' },
- undefined
- )
- ).toBe(true);
- });
-
- it('keeps an Outlook inbox that is still importing unfinished', () => {
- expect(
- isInitialSyncComplete(
- { provider: 'OUTLOOK', sync_status: 'SYNCING' },
- undefined
- )
- ).toBe(false);
- });
-
- it('needs a completed backfill job before a Gmail inbox reports as synced', () => {
- const gmail = { provider: 'GMAIL', sync_status: 'UP_TO_DATE' } as const;
- expect(isInitialSyncComplete(gmail, undefined)).toBe(false);
- expect(isInitialSyncComplete(gmail, { status: 'Failed' })).toBe(false);
- expect(isInitialSyncComplete(gmail, { status: 'Complete' })).toBe(true);
- });
-});
diff --git a/apps/web/src/features/settings/core/initial-sync.ts b/apps/web/src/features/settings/core/initial-sync.ts
deleted file mode 100644
index 1ad84d5229..0000000000
--- a/apps/web/src/features/settings/core/initial-sync.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import {
- type BackfillJob,
- BackfillJobStatus,
- type Link,
- SyncStatus,
- UserProvider,
-} from '@service-email/generated/schemas';
-import { match } from 'ts-pattern';
-
-/**
- * Whether an inbox has finished its first full sync. Outlook's sync status
- * comes from its sync streams, so up to date means done. Gmail's also reads up
- * to date when the inbox has no backfill job, so its latest job must be
- * complete too.
- */
-export function isInitialSyncComplete(
- link: Pick<Link, 'provider' | 'sync_status'>,
- latestBackfill: Pick<BackfillJob, 'status'> | undefined
-): boolean {
- if (link.sync_status !== SyncStatus.UP_TO_DATE) return false;
- return match(link.provider)
- .with(UserProvider.OUTLOOK, () => true)
- .with(
- UserProvider.GMAIL,
- () => latestBackfill?.status === BackfillJobStatus.Complete
- )
- .exhaustive(() => false);
-}
diff --git a/apps/web/src/features/settings/core/settings-search.test.ts b/apps/web/src/features/settings/core/settings-search.test.ts
index 7c606f69be..cd28d52097 100644
--- a/apps/web/src/features/settings/core/settings-search.test.ts
+++ b/apps/web/src/features/settings/core/settings-search.test.ts
@@ -88,9 +88,23 @@ describe('individual settings search', () => {
target: 'pending-invites',
});
});
- it('finds team connections apart from personal integrations', () => {
- expect(search('slack import')[0].tab).toBe('Team Connections');
- expect(search('team github')[0].tab).toBe('Team Connections');
+ it('finds team connections on Integrations', () => {
+ expect(search('slack import')[0].tab).toBe('Connected');
+ expect(search('team github')[0].tab).toBe('Connected');
+ });
+ it('finds and targets each integration row by name', () => {
+ expect(search('granola')[0]).toMatchObject({
+ tab: 'Connected',
+ target: 'granola',
+ });
+ expect(search('outlook')[0]).toMatchObject({
+ tab: 'Connected',
+ target: 'outlook',
+ });
+ expect(search('claude code')[0]).toMatchObject({
+ tab: 'Connected',
+ target: 'claude-code-codex-and-chatgpt',
+ });
});
it('has no results for empty or unrelated queries', () => {
expect(search(' ')).toEqual([]);
diff --git a/apps/web/src/features/settings/core/settings-search.ts b/apps/web/src/features/settings/core/settings-search.ts
index e7eed4428e..400a81e0e0 100644
--- a/apps/web/src/features/settings/core/settings-search.ts
+++ b/apps/web/src/features/settings/core/settings-search.ts
@@ -230,18 +230,6 @@ const SETTINGS: Setting[] = [
target: 'Default link sharing',
keywords: 'access public private permission',
},
- {
- tab: 'Team Connections',
- title: 'Team GitHub connection',
- target: 'Connections',
- keywords: 'repository app install integration',
- },
- {
- tab: 'Team Connections',
- title: 'Import from Slack',
- target: 'Connections',
- keywords: 'slack export channels messages history team',
- },
{
tab: 'Tags',
title: 'Personal tags',
@@ -254,16 +242,78 @@ const SETTINGS: Setting[] = [
target: 'Team',
keywords: 'shared label workspace category',
},
+ // Integrations rows are targeted by name.
{
tab: 'Connected',
- title: 'GitHub account',
- target: 'Accounts',
- keywords: 'connect integration repository pull request',
+ title: 'Gmail',
+ target: 'Gmail',
+ keywords: 'email google workspace inbox calendar connect account',
+ },
+ {
+ tab: 'Connected',
+ title: 'Outlook',
+ target: 'Outlook',
+ keywords: 'email microsoft 365 inbox calendar connect account',
+ },
+ {
+ tab: 'Connected',
+ title: 'GitHub',
+ target: 'GitHub',
+ keywords:
+ 'connect integration repository pull request code app install team',
+ },
+ {
+ tab: 'Connected',
+ title: 'Slack',
+ target: 'Slack',
+ keywords: 'chat messages channels agent tools mcp connect',
+ },
+ {
+ tab: 'Connected',
+ title: 'Import from Slack',
+ target: 'Slack',
+ keywords: 'slack export channels messages history team',
+ },
+ {
+ tab: 'Connected',
+ title: 'Linear',
+ target: 'Linear',
+ keywords: 'issues tasks projects agent tools mcp connect import',
+ },
+ {
+ tab: 'Connected',
+ title: 'Notion',
+ target: 'Notion',
+ keywords: 'pages wikis docs agent tools mcp connect import',
+ },
+ {
+ tab: 'Connected',
+ title: 'Granola',
+ target: 'Granola',
+ keywords: 'meetings notes transcripts calls import',
+ },
+ {
+ tab: 'Connected',
+ title: 'Claude Code, Codex, and ChatGPT',
+ target: 'Claude Code, Codex, and ChatGPT',
+ keywords: 'ai apps mcp ide setup',
+ },
+ {
+ tab: 'Connected',
+ title: 'Coding agents on your computer',
+ target: 'Coding agents on your computer',
+ keywords: 'local harness hermes openclaw desktop stream sessions',
+ },
+ {
+ tab: 'Connected',
+ title: 'Custom MCP server',
+ keywords: 'add mcp server url integration',
},
{
tab: 'Connected',
title: 'Agent apps and tools',
- keywords: 'mcp integration connect external services',
+ keywords:
+ 'mcp integration connect external services catalog airtable trello jira asana google drive dropbox',
},
{
tab: 'Agent',
diff --git a/apps/web/src/features/settings/integration-ui.tsx b/apps/web/src/features/settings/integration-ui.tsx
index 1f15ca71b2..ad7d2b13e1 100644
--- a/apps/web/src/features/settings/integration-ui.tsx
+++ b/apps/web/src/features/settings/integration-ui.tsx
@@ -2,6 +2,7 @@ import ArrowUpRightIcon from '@icon/system/regular/arrow-up-right.svg';
import SpinnerIcon from '@icon/system/regular/spinner-gap.svg';
import { cn } from '@ui';
import { type JSX, Show } from 'solid-js';
+import { settingsTarget } from './core/settings-target';
export function HarnessIcon(props: { children: JSX.Element }) {
return (
@@ -45,7 +46,7 @@ export function ConnectAction(props: {
const inert = () => Boolean(props.disabled || props.loading);
const className = () =>
cn(
- 'inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-sm font-medium',
+ 'inline-flex items-center gap-1.5 h-7 touch:min-h-11 px-2 rounded-md text-sm font-medium whitespace-nowrap',
'cursor-default transition-colors',
'outline-none focus-visible:bg-ink/6',
inert() && 'opacity-50 pointer-events-none',
@@ -121,3 +122,37 @@ export function StatusDot(props: { state: ConnectionState; label?: string }) {
/>
);
}
+
+/**
+ * A titled group on the Integrations page: one full-width row per
+ * integration, each on its own surface, so every row reads the same way.
+ */
+export function IntegrationGroup(props: {
+ title: string;
+ description?: string;
+ /** Right-aligned controls beside the heading. */
+ actions?: JSX.Element;
+ children: JSX.Element;
+}) {
+ return (
+ <section
+ aria-label={props.title}
+ data-settings-target={settingsTarget(props.title)}
+ tabIndex={-1}
+ class="flex min-w-0 flex-col gap-3 outline-none"
+ >
+ <div class="flex flex-wrap items-end justify-between gap-3">
+ <div class="flex min-w-0 flex-col gap-1">
+ <h2 class="text-lg font-medium text-ink">{props.title}</h2>
+ <Show when={props.description}>
+ <p class="text-sm text-ink-muted">{props.description}</p>
+ </Show>
+ </div>
+ <Show when={props.actions}>
+ <div class="shrink-0">{props.actions}</div>
+ </Show>
+ </div>
+ <div class="flex flex-col gap-2">{props.children}</div>
+ </section>
+ );
+}
diff --git a/apps/web/src/features/settings/primitives.tsx b/apps/web/src/features/settings/primitives.tsx
index fdd1d2c52c..ec5994ddcc 100644
--- a/apps/web/src/features/settings/primitives.tsx
+++ b/apps/web/src/features/settings/primitives.tsx
@@ -380,7 +380,8 @@ export function IntegrationRow(props: {
{props.icon}
</div>
</Show>
- <div class="flex-1 min-w-0 flex flex-col gap-0.5">
+ {/* The basis wraps actions below the text on narrow screens. */}
+ <div class="flex-1 basis-48 min-w-0 flex flex-col gap-0.5">
<div class="flex items-center gap-2 min-w-0">
<div
class={cn(
diff --git a/apps/web/src/features/settings/teamSettingsGroups.test.ts b/apps/web/src/features/settings/teamSettingsGroups.test.ts
index a1960fbdc8..952339bed7 100644
--- a/apps/web/src/features/settings/teamSettingsGroups.test.ts
+++ b/apps/web/src/features/settings/teamSettingsGroups.test.ts
@@ -31,7 +31,6 @@ describe('team settings group', () => {
expect(group().items.map((item) => item.label)).toEqual([
'General',
'Members',
- 'Connections',
]);
});
@@ -46,7 +45,7 @@ describe('team settings group', () => {
setTeamsQuery({ isSuccess: false, data: undefined });
const group = teamGroup();
expect(group().label).toBe('Team');
- expect(group().items).toHaveLength(3);
+ expect(group().items).toHaveLength(2);
setTeamsQuery({ isSuccess: true, data: [{ name: 'Acme' }] });
expect(group().label).toBe('Team · Acme');
});
diff --git a/apps/web/src/features/slack-import/components/slack-import-card.tsx b/apps/web/src/features/slack-import/components/slack-import-card.tsx
index e142da16dc..ab85d82688 100644
--- a/apps/web/src/features/slack-import/components/slack-import-card.tsx
+++ b/apps/web/src/features/slack-import/components/slack-import-card.tsx
@@ -1,25 +1,27 @@
-import SlackIcon from '@icon/mcp-slack.svg';
+import SlackIcon from '@icon/slack-color.svg';
import { Button } from '@ui';
import type { JSX } from 'solid-js';
-import { IntegrationRow } from '../../settings/primitives';
+import { IntegrationRow, SettingsSurface } from '../../settings/primitives';
type Props = { onOpen(trigger: HTMLButtonElement): void };
-/** The Connections row that opens the importer; the host supplies the card. */
+/** The Integrations row that opens the team's Slack export importer. */
export function SlackImportCard(props: Props): JSX.Element {
return (
- <IntegrationRow
- icon={<SlackIcon />}
- title="Slack"
- description="Import channels and message history from a Slack export."
- >
- <Button
- variant="secondary"
- size="sm"
- onClick={(event) => props.onOpen(event.currentTarget)}
+ <SettingsSurface>
+ <IntegrationRow
+ icon={<SlackIcon />}
+ title="Slack export"
+ description="Import your team's channels and message history from a Slack export into Channels."
>
- Import from Slack
- </Button>
- </IntegrationRow>
+ <Button
+ variant="secondary"
+ size="sm"
+ onClick={(event) => props.onOpen(event.currentTarget)}
+ >
+ Import from Slack
+ </Button>
+ </IntegrationRow>
+ </SettingsSurface>
);
}
diff --git a/apps/web/src/features/slack-import/slack-import.tsx b/apps/web/src/features/slack-import/slack-import.tsx
index b9eac97059..6fe6f8d6b5 100644
--- a/apps/web/src/features/slack-import/slack-import.tsx
+++ b/apps/web/src/features/slack-import/slack-import.tsx
@@ -1,5 +1,8 @@
import { hideImportPromotion } from '@app/features/connector-import/primitives/promotion';
-import { IntegrationRow } from '@app/features/settings/primitives';
+import {
+ IntegrationRow,
+ SettingsSurface,
+} from '@app/features/settings/primitives';
import { useFeatureFlag } from '@app/lib/analytics/posthog';
import { enableSlackArchiveImport } from '@core/constant/featureFlags';
import { useSettingsState } from '@core/constant/SettingsState';
@@ -8,7 +11,7 @@ import { usePipedreamMcpFlag } from '@core/pipedream/flag';
import { requestConnectApp } from '@core/pipedream/pendingConnect';
import { SLACK_CONNECT_SLUG } from '@core/pipedream/slugs';
import { holdAutomaticReload } from '@core/util/reloadForNewerBuild';
-import SlackIcon from '@icon/mcp-slack.svg';
+import SlackIcon from '@icon/slack-color.svg';
import {
invalidateListChannels,
useListChannelsQuery,
@@ -50,12 +53,14 @@ export function SlackImport(props: Props): JSX.Element {
// A host-supplied trigger lives elsewhere (the Chat rail card);
// only the Settings row has a loading placeholder.
props.trigger ? null : (
- <IntegrationRow
- icon={<SlackIcon />}
- title="Slack"
- description="Loading Slack import…"
- muted
- />
+ <SettingsSurface>
+ <IntegrationRow
+ icon={<SlackIcon />}
+ title="Slack export"
+ description="Loading Slack import…"
+ muted
+ />
+ </SettingsSurface>
)
}
>
diff --git a/apps/web/src/lib/core/constant/SettingsState.tsx b/apps/web/src/lib/core/constant/SettingsState.tsx
index 02f52f52a4..82b870fec1 100644
--- a/apps/web/src/lib/core/constant/SettingsState.tsx
+++ b/apps/web/src/lib/core/constant/SettingsState.tsx
@@ -34,7 +34,6 @@ export type SettingsTab =
| 'Bots'
| 'Team'
| 'Team Members'
- | 'Team Connections'
| 'Tags'
| 'CRM'
| 'Connected'
diff --git a/apps/web/src/lib/core/constant/settingsTabsConfig.test.ts b/apps/web/src/lib/core/constant/settingsTabsConfig.test.ts
index fd6f139734..2800c3c0d3 100644
--- a/apps/web/src/lib/core/constant/settingsTabsConfig.test.ts
+++ b/apps/web/src/lib/core/constant/settingsTabsConfig.test.ts
@@ -34,12 +34,12 @@ describe('settings navigation', () => {
expect(SETTINGS_TAB_GROUPS[0].items.map((item) => item.tab)).toEqual([
'Team',
'Team Members',
- 'Team Connections',
]);
// Old team links keep opening the team's general page.
expect(settingsSlugToTab('team')).toBe('Team');
expect(settingsSlugToTab('team-members')).toBe('Team Members');
- expect(settingsSlugToTab('team-connections')).toBe('Team Connections');
+ // Team connections moved into Integrations.
+ expect(settingsSlugToTab('team-connections')).toBe('Connected');
});
it('groups blocks after the team and consolidates account and agent integrations', () => {
diff --git a/apps/web/src/lib/core/constant/settingsTabsConfig.tsx b/apps/web/src/lib/core/constant/settingsTabsConfig.tsx
index 9ac57e45ad..abfe32aacb 100644
--- a/apps/web/src/lib/core/constant/settingsTabsConfig.tsx
+++ b/apps/web/src/lib/core/constant/settingsTabsConfig.tsx
@@ -133,11 +133,6 @@ export const SETTINGS_TAB_GROUPS: SettingsTabGroup[] = [
'seats',
],
}),
- tabItem('tabTeamConnections', {
- tab: 'Team Connections',
- icon: PlugIcon,
- keywords: ['team', 'slack', 'github', 'import', 'app'],
- }),
],
},
{
@@ -239,6 +234,9 @@ export const SETTINGS_TAB_GROUPS: SettingsTabGroup[] = [
'agent',
'tools',
'mcp',
+ 'slack',
+ 'github',
+ 'import',
],
}),
],
@@ -306,7 +304,6 @@ const SETTINGS_TAB_SLUGS: Record<SettingsTab, string> = {
Bots: 'bots',
Team: 'team',
'Team Members': 'team-members',
- 'Team Connections': 'team-connections',
Calendar: 'calendar',
Tags: 'tags',
CRM: 'crm',
@@ -326,6 +323,8 @@ const SETTINGS_SLUG_TO_TAB = new Map<string, SettingsTab>(
SETTINGS_SLUG_TO_TAB.set('harness', 'Harness');
SETTINGS_SLUG_TO_TAB.set('connections', 'Connected');
SETTINGS_SLUG_TO_TAB.set('agent-connections', 'Connected');
+// Team connections (Slack export, GitHub App) moved into Integrations.
+SETTINGS_SLUG_TO_TAB.set('team-connections', 'Connected');
/** The URL slug for a settings tab (e.g. `Connected` → `connections`). */
export const settingsTabToSlug = (tab: SettingsTab): string =>
@@ -369,7 +368,6 @@ export const useSettingsTabAvailable = () => {
return !isMobile();
case 'Team':
case 'Team Members':
- case 'Team Connections':
case 'Tags':
return true;
// CRM is still rolling out (Macro-internal only); keep the settings tab
diff --git a/apps/web/src/lib/i18n/locales/da.ts b/apps/web/src/lib/i18n/locales/da.ts
index 9460f0c35c..6c13509e8d 100644
--- a/apps/web/src/lib/i18n/locales/da.ts
+++ b/apps/web/src/lib/i18n/locales/da.ts
@@ -747,7 +747,6 @@ export default {
groupAdmin: 'Administration',
tabTeamGeneral: 'Generelt',
tabTeamMembers: 'Medlemmer',
- tabTeamConnections: 'Forbindelser',
tabEmail: 'E-mail',
tabCalendar: 'Kalender',
tabAgents: 'Agenter',
diff --git a/apps/web/src/lib/i18n/locales/de.ts b/apps/web/src/lib/i18n/locales/de.ts
index e5fd884b3e..3b773fab68 100644
--- a/apps/web/src/lib/i18n/locales/de.ts
+++ b/apps/web/src/lib/i18n/locales/de.ts
@@ -758,7 +758,6 @@ export default {
groupAdmin: 'Admin',
tabTeamGeneral: 'Allgemein',
tabTeamMembers: 'Mitglieder',
- tabTeamConnections: 'Verbindungen',
tabEmail: 'E-Mail',
tabCalendar: 'Kalender',
tabAgents: 'Agenten',
diff --git a/apps/web/src/lib/i18n/locales/en/settings-nav.ts b/apps/web/src/lib/i18n/locales/en/settings-nav.ts
index 150ed3f546..69213a8b04 100644
--- a/apps/web/src/lib/i18n/locales/en/settings-nav.ts
+++ b/apps/web/src/lib/i18n/locales/en/settings-nav.ts
@@ -10,7 +10,6 @@ export default {
// Settings nav tabs
tabTeamGeneral: 'General',
tabTeamMembers: 'Members',
- tabTeamConnections: 'Connections',
tabEmail: 'Email',
tabCalendar: 'Calendar',
tabAgents: 'Agents',
diff --git a/apps/web/src/lib/i18n/locales/es.ts b/apps/web/src/lib/i18n/locales/es.ts
index aa0f81d800..d9a2f0efbb 100644
--- a/apps/web/src/lib/i18n/locales/es.ts
+++ b/apps/web/src/lib/i18n/locales/es.ts
@@ -777,7 +777,6 @@ export default {
groupAdmin: 'Administración',
tabTeamGeneral: 'General',
tabTeamMembers: 'Miembros',
- tabTeamConnections: 'Conexiones',
tabEmail: 'Correo',
tabCalendar: 'Calendario',
tabAgents: 'Agentes',
diff --git a/apps/web/src/lib/i18n/locales/fi.ts b/apps/web/src/lib/i18n/locales/fi.ts
index 9dcaeaca0f..04eb688e1e 100644
--- a/apps/web/src/lib/i18n/locales/fi.ts
+++ b/apps/web/src/lib/i18n/locales/fi.ts
@@ -748,7 +748,6 @@ export default {
groupAdmin: 'Ylläpito',
tabTeamGeneral: 'Yleiset',
tabTeamMembers: 'Jäsenet',
- tabTeamConnections: 'Yhteydet',
tabEmail: 'Sähköposti',
tabCalendar: 'Kalenteri',
tabAgents: 'Agentit',
diff --git a/apps/web/src/lib/i18n/locales/fr.ts b/apps/web/src/lib/i18n/locales/fr.ts
index 02ff1a0001..d915ca464a 100644
--- a/apps/web/src/lib/i18n/locales/fr.ts
+++ b/apps/web/src/lib/i18n/locales/fr.ts
@@ -780,7 +780,6 @@ export default {
groupAdmin: 'Administration',
tabTeamGeneral: 'Général',
tabTeamMembers: 'Membres',
- tabTeamConnections: 'Connexions',
tabEmail: 'E-mail',
tabCalendar: 'Agenda',
tabAgents: 'Agents',
diff --git a/apps/web/src/lib/i18n/locales/hi.ts b/apps/web/src/lib/i18n/locales/hi.ts
index f2edea9f5d..eec0261190 100644
--- a/apps/web/src/lib/i18n/locales/hi.ts
+++ b/apps/web/src/lib/i18n/locales/hi.ts
@@ -735,7 +735,6 @@ export default {
groupAdmin: 'एडमिन',
tabTeamGeneral: 'सामान्य',
tabTeamMembers: 'सदस्य',
- tabTeamConnections: 'कनेक्शन',
tabEmail: 'ईमेल',
tabCalendar: 'कैलेंडर',
tabAgents: 'एजेंट',
diff --git a/apps/web/src/lib/i18n/locales/id.ts b/apps/web/src/lib/i18n/locales/id.ts
index 2691804612..f99151c32c 100644
--- a/apps/web/src/lib/i18n/locales/id.ts
+++ b/apps/web/src/lib/i18n/locales/id.ts
@@ -725,7 +725,6 @@ export default {
groupAdmin: 'Admin',
tabTeamGeneral: 'Umum',
tabTeamMembers: 'Anggota',
- tabTeamConnections: 'Koneksi',
tabEmail: 'Email',
tabCalendar: 'Kalender',
tabAgents: 'Agen',
diff --git a/apps/web/src/lib/i18n/locales/it.ts b/apps/web/src/lib/i18n/locales/it.ts
index da9e6244cd..6fe7a3b21d 100644
--- a/apps/web/src/lib/i18n/locales/it.ts
+++ b/apps/web/src/lib/i18n/locales/it.ts
@@ -774,7 +774,6 @@ export default {
groupAdmin: 'Amministrazione',
tabTeamGeneral: 'Generale',
tabTeamMembers: 'Membri',
- tabTeamConnections: 'Connessioni',
tabEmail: 'Email',
tabCalendar: 'Calendario',
tabAgents: 'Agenti',
diff --git a/apps/web/src/lib/i18n/locales/ja.ts b/apps/web/src/lib/i18n/locales/ja.ts
index cb4443907d..7427a689f8 100644
--- a/apps/web/src/lib/i18n/locales/ja.ts
+++ b/apps/web/src/lib/i18n/locales/ja.ts
@@ -720,7 +720,6 @@ export default {
groupAdmin: '管理',
tabTeamGeneral: '一般',
tabTeamMembers: 'メンバー',
- tabTeamConnections: '接続',
tabEmail: 'メール',
tabCalendar: 'カレンダー',
tabAgents: 'エージェント',
diff --git a/apps/web/src/lib/i18n/locales/ko.ts b/apps/web/src/lib/i18n/locales/ko.ts
index c3f0e31bf2..5d9f8143ce 100644
--- a/apps/web/src/lib/i18n/locales/ko.ts
+++ b/apps/web/src/lib/i18n/locales/ko.ts
@@ -716,7 +716,6 @@ export default {
groupAdmin: '관리',
tabTeamGeneral: '일반',
tabTeamMembers: '구성원',
- tabTeamConnections: '연결',
tabEmail: '이메일',
tabCalendar: '캘린더',
tabAgents: '에이전트',
diff --git a/apps/web/src/lib/i18n/locales/nb.ts b/apps/web/src/lib/i18n/locales/nb.ts
index 78df086b70..a499fc51c4 100644
--- a/apps/web/src/lib/i18n/locales/nb.ts
+++ b/apps/web/src/lib/i18n/locales/nb.ts
@@ -745,7 +745,6 @@ export default {
groupAdmin: 'Administrator',
tabTeamGeneral: 'Generelt',
tabTeamMembers: 'Medlemmer',
- tabTeamConnections: 'Tilkoblinger',
tabEmail: 'E-post',
tabCalendar: 'Kalender',
tabAgents: 'Agenter',
diff --git a/apps/web/src/lib/i18n/locales/nl.ts b/apps/web/src/lib/i18n/locales/nl.ts
index 03e45ca4da..a999325ecd 100644
--- a/apps/web/src/lib/i18n/locales/nl.ts
+++ b/apps/web/src/lib/i18n/locales/nl.ts
@@ -748,7 +748,6 @@ export default {
groupAdmin: 'Beheer',
tabTeamGeneral: 'Algemeen',
tabTeamMembers: 'Leden',
- tabTeamConnections: 'Koppelingen',
tabEmail: 'E-mail',
tabCalendar: 'Agenda',
tabAgents: 'Agents',
diff --git a/apps/web/src/lib/i18n/locales/pl.ts b/apps/web/src/lib/i18n/locales/pl.ts
index 50c08ada56..9214fb0dcb 100644
--- a/apps/web/src/lib/i18n/locales/pl.ts
+++ b/apps/web/src/lib/i18n/locales/pl.ts
@@ -796,7 +796,6 @@ export default {
groupAdmin: 'Administracja',
tabTeamGeneral: 'Ogólne',
tabTeamMembers: 'Członkowie',
- tabTeamConnections: 'Połączenia',
tabEmail: 'E-mail',
tabCalendar: 'Kalendarz',
tabAgents: 'Agenci',
diff --git a/apps/web/src/lib/i18n/locales/pt-PT.ts b/apps/web/src/lib/i18n/locales/pt-PT.ts
index d24d81095f..2eefb02910 100644
--- a/apps/web/src/lib/i18n/locales/pt-PT.ts
+++ b/apps/web/src/lib/i18n/locales/pt-PT.ts
@@ -778,7 +778,6 @@ export default {
groupAdmin: 'Administração',
tabTeamGeneral: 'Geral',
tabTeamMembers: 'Membros',
- tabTeamConnections: 'Ligações',
tabEmail: 'Email',
tabCalendar: 'Calendário',
tabAgents: 'Agentes',
diff --git a/apps/web/src/lib/i18n/locales/ru.ts b/apps/web/src/lib/i18n/locales/ru.ts
index 4b726f7069..ddc1c8277c 100644
--- a/apps/web/src/lib/i18n/locales/ru.ts
+++ b/apps/web/src/lib/i18n/locales/ru.ts
@@ -801,7 +801,6 @@ export default {
groupAdmin: 'Администрирование',
tabTeamGeneral: 'Общие',
tabTeamMembers: 'Участники',
- tabTeamConnections: 'Подключения',
tabEmail: 'Почта',
tabCalendar: 'Календарь',
tabAgents: 'Агенты',
diff --git a/apps/web/src/lib/i18n/locales/sv.ts b/apps/web/src/lib/i18n/locales/sv.ts
index c6fd406725..6fed87f710 100644
--- a/apps/web/src/lib/i18n/locales/sv.ts
+++ b/apps/web/src/lib/i18n/locales/sv.ts
@@ -748,7 +748,6 @@ export default {
groupAdmin: 'Administration',
tabTeamGeneral: 'Allmänt',
tabTeamMembers: 'Medlemmar',
- tabTeamConnections: 'Anslutningar',
tabEmail: 'E-post',
tabCalendar: 'Kalender',
tabAgents: 'Agenter',
diff --git a/apps/web/src/lib/i18n/locales/th.ts b/apps/web/src/lib/i18n/locales/th.ts
index cecc74318c..c2f4286125 100644
--- a/apps/web/src/lib/i18n/locales/th.ts
+++ b/apps/web/src/lib/i18n/locales/th.ts
@@ -710,7 +710,6 @@ export default {
groupAdmin: 'ผู้ดูแลระบบ',
tabTeamGeneral: 'ทั่วไป',
tabTeamMembers: 'สมาชิก',
- tabTeamConnections: 'การเชื่อมต่อ',
tabEmail: 'อีเมล',
tabCalendar: 'ปฏิทิน',
tabAgents: 'เอเจนต์',
diff --git a/apps/web/src/lib/i18n/locales/translated-from.json b/apps/web/src/lib/i18n/locales/translated-from.json
index 42cb2f60d2..5dd7ad2fa5 100644
--- a/apps/web/src/lib/i18n/locales/translated-from.json
+++ b/apps/web/src/lib/i18n/locales/translated-from.json
@@ -644,7 +644,6 @@
"settingsNav.tabRuntimes": "53cd3be2b0",
"settingsNav.tabShortcuts": "e9bef0b0f3",
"settingsNav.tabTags": "1331275bc5",
- "settingsNav.tabTeamConnections": "dc27311748",
"settingsNav.tabTeamGeneral": "c910d474dc",
"settingsNav.tabTeamMembers": "1044a4c056",
"settingsNav.tabUsage": "8d59829c1e",
diff --git a/apps/web/src/lib/i18n/locales/vi.ts b/apps/web/src/lib/i18n/locales/vi.ts
index 06c45687e7..bcf0a521b3 100644
--- a/apps/web/src/lib/i18n/locales/vi.ts
+++ b/apps/web/src/lib/i18n/locales/vi.ts
@@ -721,7 +721,6 @@ export default {
groupAdmin: 'Quản trị',
tabTeamGeneral: 'Chung',
tabTeamMembers: 'Thành viên',
- tabTeamConnections: 'Kết nối',
tabEmail: 'Email',
tabCalendar: 'Lịch',
tabAgents: 'Tác nhân',
diff --git a/apps/web/src/lib/i18n/locales/zh-Hans.ts b/apps/web/src/lib/i18n/locales/zh-Hans.ts
index 07d3b16871..e5157f44b5 100644
--- a/apps/web/src/lib/i18n/locales/zh-Hans.ts
+++ b/apps/web/src/lib/i18n/locales/zh-Hans.ts
@@ -697,7 +697,6 @@ export default {
groupAdmin: '管理',
tabTeamGeneral: '通用',
tabTeamMembers: '成员',
- tabTeamConnections: '连接',
tabEmail: '邮件',
tabCalendar: '日历',
tabAgents: '智能体',
diff --git a/apps/web/src/lib/i18n/locales/zh-Hant.ts b/apps/web/src/lib/i18n/locales/zh-Hant.ts
index b03774b469..27f3775763 100644
--- a/apps/web/src/lib/i18n/locales/zh-Hant.ts
+++ b/apps/web/src/lib/i18n/locales/zh-Hant.ts
@@ -704,7 +704,6 @@ export default {
groupAdmin: '管理',
tabTeamGeneral: '一般',
tabTeamMembers: '成員',
- tabTeamConnections: '連結',
tabEmail: '電子郵件',
tabCalendar: '行事曆',
tabAgents: '代理程式',
diff --git a/apps/web/src/lib/queries/email/backfill.ts b/apps/web/src/lib/queries/email/backfill.ts
index 444f513fe1..c94d91a4df 100644
--- a/apps/web/src/lib/queries/email/backfill.ts
+++ b/apps/web/src/lib/queries/email/backfill.ts
@@ -1,9 +1,4 @@
-import { throwOnErr } from '@core/util/result';
-import { queryClient } from '@queries/client';
-import { emailClient } from '@service-email/client';
-import { useQuery } from '@tanstack/solid-query';
import { createSignal } from 'solid-js';
-import { emailKeys } from './keys';
/** Most recent progress readings kept per link, for the time-remaining estimate. */
const MAX_PROGRESS_SAMPLES = 5;
@@ -105,32 +100,3 @@ export function estimateEtaSeconds(
const ratePerMs = threadsDone / elapsedMs;
return threadsLeft / ratePerMs / 1000;
}
-
-function fetchBackfillJobs() {
- return throwOnErr(() => emailClient.listBackfillJobs());
-}
-
-/**
- * Lists every backfill job for the user. Fired when the email settings open, to
- * surface COMPLETED backfills. In-progress backfills are driven by the live
- * progress store above (connection-gateway events), not this query — its counts
- * can lag the live counters — so consumers should read this only for terminal
- * (e.g. completed) jobs.
- */
-export function useBackfillJobsQuery() {
- return useQuery(() => ({
- queryKey: emailKeys.backfillJobs.queryKey,
- queryFn: fetchBackfillJobs,
- }));
-}
-
-/**
- * Refetch the backfill jobs list. Call on terminal backfill events so the
- * settled "completed" state updates even while the email settings stay open
- * (the query otherwise only fires on mount).
- */
-export function invalidateBackfillJobs() {
- queryClient.invalidateQueries({
- queryKey: emailKeys.backfillJobs.queryKey,
- });
-}
diff --git a/apps/web/src/lib/queries/email/keys.ts b/apps/web/src/lib/queries/email/keys.ts
index 6ad4d15c19..4e4f19db1f 100644
--- a/apps/web/src/lib/queries/email/keys.ts
+++ b/apps/web/src/lib/queries/email/keys.ts
@@ -9,7 +9,6 @@ export const emailKeys = createQueryKeys('email', {
labels: null,
links: null,
linksHealthProbe: null,
- backfillJobs: null,
threads: null,
thread: (threadId: string) => ({
queryKey: [threadId],
diff --git a/apps/web/src/lib/queries/email/sync.ts b/apps/web/src/lib/queries/email/sync.ts
index 86a263e577..37d984e968 100644
--- a/apps/web/src/lib/queries/email/sync.ts
+++ b/apps/web/src/lib/queries/email/sync.ts
@@ -9,11 +9,7 @@ import {
RefreshEmailEventOneOfOnethreeEvent,
} from '@service-email/generated/schemas';
import { leadingAndTrailing, throttle } from '@solid-primitives/scheduled';
-import {
- clearBackfillProgress,
- invalidateBackfillJobs,
- setBackfillProgress,
-} from './backfill';
+import { clearBackfillProgress, setBackfillProgress } from './backfill';
import { emailKeys } from './keys';
import { invalidateEmailLinks } from './link';
@@ -72,7 +68,6 @@ export function handleRefreshEmail(payload: unknown): void {
clearBackfillProgress(event.link_id);
invalidateAllSoup();
invalidateEmailLinks();
- invalidateBackfillJobs();
return;
}
@@ -89,7 +84,6 @@ export function handleRefreshEmail(payload: unknown): void {
if (event.status === BackfillStatus.failed) {
clearBackfillProgress(event.link_id);
invalidateEmailLinks();
- invalidateBackfillJobs();
if (ENABLE_INBOX_SYNC_STATUS) {
toast.failure('Inbox sync failed');
}
@@ -107,7 +101,6 @@ export function handleRefreshEmail(payload: unknown): void {
if (event.status === BackfillStatus.complete) {
clearBackfillProgress(event.link_id);
invalidateEmailLinks();
- invalidateBackfillJobs();
if (ENABLE_INBOX_SYNC_STATUS) {
toast.success('Inbox synced');
}
diff --git a/apps/web/src/lib/queries/pipedream-connectors.test.ts b/apps/web/src/lib/queries/pipedream-connectors.test.ts
index 662f7ec3b1..bffc992a84 100644
--- a/apps/web/src/lib/queries/pipedream-connectors.test.ts
+++ b/apps/web/src/lib/queries/pipedream-connectors.test.ts
@@ -57,7 +57,7 @@ vi.mock('@service-cognition/client', () => ({
},
}));
-import { connectPipedreamApp } from './pipedream-connectors';
+import { connectPipedreamApp, overlaidAppSlug } from './pipedream-connectors';
beforeEach(() => {
vi.clearAllMocks();
@@ -271,3 +271,19 @@ describe('a backend without overlays', () => {
expect(mocks.token).toHaveBeenCalledOnce();
});
});
+
+describe('overlaidAppSlug', () => {
+ const overlays = [
+ { app_slug: 'sentry', server_url: 'https://mcp.sentry.dev/mcp' },
+ ];
+ it('matches a connected server to its catalog app despite a trailing slash', () => {
+ expect(overlaidAppSlug(overlays, 'https://mcp.sentry.dev/mcp/')).toBe(
+ 'sentry'
+ );
+ });
+ it('leaves custom servers unmatched', () => {
+ expect(
+ overlaidAppSlug(overlays, 'https://example.com/mcp')
+ ).toBeUndefined();
+ });
+});
diff --git a/apps/web/src/lib/queries/pipedream-connectors.ts b/apps/web/src/lib/queries/pipedream-connectors.ts
index cedd28803c..c673e2e83d 100644
--- a/apps/web/src/lib/queries/pipedream-connectors.ts
+++ b/apps/web/src/lib/queries/pipedream-connectors.ts
@@ -110,6 +110,15 @@ function sameEndpoint(a: string, b: string) {
return a.replace(/\/+$/, '') === b.replace(/\/+$/, '');
}
+/** The catalog app a native MCP server stands in for, when it is overlaid. */
+export function overlaidAppSlug(
+ overlays: readonly PipedreamOverlayResponse[],
+ serverUrl: string
+): string | undefined {
+ return overlays.find((overlay) => sameEndpoint(serverUrl, overlay.server_url))
+ ?.app_slug;
+}
+
/**
* The overlaid apps `servers` holds an enabled, authorized native connection
* for, by app slug.
diff --git a/docs/agent-guide/assets/settings-integrations.png b/docs/agent-guide/assets/settings-integrations.png
index a5252ee932..15c5c356bf 100644
Binary files a/docs/agent-guide/assets/settings-integrations.png and b/docs/agent-guide/assets/settings-integrations.png differ
diff --git a/docs/agent-guide/channels.md b/docs/agent-guide/channels.md
index 906f067278..3548ada7a9 100644
--- a/docs/agent-guide/channels.md
+++ b/docs/agent-guide/channels.md
@@ -167,9 +167,9 @@ internal rollout. Model usage continues through the existing session metering.
## Imported Slack history
Import starts from the **Create or import channels** card's **Import Slack**
-button at the bottom of the Chat sidebar, or **Settings → Team → Connections →
-Import from Slack**. The card's **New channel** button beside it opens the new
-channel dialog instead. The card is
+button at the bottom of the Chat sidebar, or **Import** on the Slack row in
+**Settings → Integrations** (team admins). The card's **New channel** button
+beside it opens the new channel dialog instead. The card is
the shared connector-import card (see
[Import from connected apps](setup-cards.md#import-from-connected-apps)) and is
visible to team admins and owners when Slack archive import is enabled. It
diff --git a/docs/agent-guide/settings.md b/docs/agent-guide/settings.md
index e10c02bdd8..aaaabbe369 100644
--- a/docs/agent-guide/settings.md
+++ b/docs/agent-guide/settings.md
@@ -11,7 +11,7 @@ the original byte limit. Cancellation and cleanup still work during recovery.
Deleted or replaced scratch databases fail the old import instead of silently
continuing with incomplete history; its cleanup must leave a replacement intact.
-In **Team → Connections**, **Import from Slack** appears only for team admins
+In **Integrations → Accounts**, the **Slack export** row appears only for team admins
and owners with `enable-slack-archive-import` enabled. Production rollout stays
off until explicitly enabled. Select an export ZIP, filter the grouped conversation
picker, optionally show archived conversations, and use Space to toggle focused
@@ -79,7 +79,9 @@ without a Gmail import action. The import action uses the inbox's provider,
not its email domain. Unsaved drafts
survive switching settings pages. On phones, the signature preview, replies/forwards
toggle, and clear action are available; editing and import remain desktop-only.
-Email accounts can also be managed from **Integrations**. Its **Email settings**
+Accounts list each inbox as its own row, followed by **Connect another Google
+Workspace account** and **Connect an Outlook account**; Integrations shows the
+same rows. Its **Email settings**
gear opens the dedicated page, and Email links to Notifications and Calendar.
With a composer open, save a changed signature or reply-signature preference and
verify its preview updates. Once the account refresh completes, reopen a composer
@@ -276,14 +278,15 @@ Left nav (feature and platform gates still apply):
- **Team · <team name>** (just **Team** without a team): General (name, slug,
GitHub autolink, default link sharing, Delete Team), Members (member list,
roles and seat plans, **Invite**, pending invites, auto-join and
- members-can-invite), Connections (Slack import, GitHub App). Without a team
- only General shows, with pending invitations or **Create Team**. Search
- finds these by `invite`, `members`, `teammates`, `slack`, and similar terms;
- results name their group, e.g. **Team · Members**.
+ members-can-invite). Without a team only General shows, with pending
+ invitations or **Create Team**. Search finds these by `invite`, `members`,
+ `teammates`, and similar terms; results name their group, e.g.
+ **Team · Members**. The team Slack export import and the GitHub App live in
+ Integrations; `/app/settings/team-connections` opens Integrations.
- **Blocks**: Email, Calendar, Agents, CRM. On touch devices, where the Agents
sidebar is hidden, **Routines** (`/app/settings/routines`) follows Agents.
- **Personal**: Account, Appearance, Notifications, Keyboard shortcuts, Usage, Billing, Desktop App, Mobile App.
-- **Workspace**: Tags, Integrations (personal Gmail/GitHub accounts and agent tools).
+- **Workspace**: Tags, Integrations (email, accounts, team Slack export, AI apps and agent tools).
- **Developer**: Runtimes, MCP server, API Keys, Bots.
**Desktop App** (`/app/settings/desktop-app`) is titled
@@ -302,8 +305,9 @@ and the sidebar's **Get the mobile app** button stays hidden.
Search checks individual setting titles and keywords, tolerates common typos,
and shows the parent page below each control result. Selecting a result opens
-that page, scrolls to its section or row, and briefly highlights it. Try
-`singature`, `email digest`, `calendar color`, or `cursor`. Arrow Down from search
+that page, scrolls to its section or row, and briefly highlights it. Each
+built-in integration is a result that highlights its Integrations row. Try
+`singature`, `email digest`, `calendar color`, `granola`, or `cursor`. Arrow Down from search
focuses the first result; Tab moves through controls normally. Escape in the
search field clears the query. Clearing search restores the grouped navigation. Keyboard shortcuts are listed
by category with the action on the left and keys on the right; expand **Keyboard
@@ -567,51 +571,50 @@ available in all channels should refresh there without reloading the channel.
![Integrations overview with example connections](assets/settings-integrations.png)
-With `pipedream-mcp` enabled, Settings → Integrations labels the Email/GitHub
-section Core Integrations and the connector section Agent Integrations, separated
-by spacing without a divider. Core integrations stack in one column, with compact
-GitHub and Granola rows and inline email account details that wrap on narrow screens.
-Installed tools use a two-column card grid (one
-column on narrow screens), followed by Featured and All apps, without a Discover
-heading or a separate installed sidebar. All apps has a gray Add Custom action beside its
-heading. Labelled Search apps and Category controls share a row directly below
-that heading and stack below a 560px catalog width. Both use matching 44px outlined
-frames with a subtle neutral fill; search includes an icon and a clear action.
-Installed, Featured, and All apps use headings above rounded cards. Their cards,
-the empty state, and the setup rows use the same raised composer surface as core
-integrations, with glass in dark mode and soft shadows in light mode.
-Two thin, stacked setup rows appear at the top. “Use Macro in your favorite AI
-harness with the official Macro MCP” opens connection setup; “Stream sessions
-from your local AI harness to Macro” opens Runtimes within Integrations to connect
-a local machine. Its Back button returns to Integrations; opening Runtimes from
-Agents keeps the return to Agents. The local-harness setup row follows the
-Runtimes availability gate and is hidden when that tab is unavailable.
-Email, GitHub, and Granola cards appear next under Core Integrations;
-they use two columns and share a height on wide screens, stacking on narrow screens. A small gear on the Email card opens Email settings;
-Calendar settings remain available from the settings sidebar.
-All apps groups each app under its first nonempty Pipedream category; apps without
-category metadata appear under More apps. Categories lead with Productivity,
-Communication, Developer Tools, AI, File Storage, and CRM; remaining categories
-follow the configured work-app order, then alphabetically, with More apps last.
-Search sits beside the category picker directly above the Pipedream catalog;
-Featured remains visible while searching. Scrolling toward the end loads the next
-page automatically and preserves category groups. A failed next page keeps loaded
-apps visible and offers Retry. Use the category picker below
-All apps to show one group; changing the search returns to all categories. Group
-counts reflect the currently loaded results.
+With `pipedream-mcp` enabled, Settings → Integrations is one searchable list
+styled like the Drive and Tasks lists, spanning nearly the full settings page
+width. Rows are separated by faint dividers and have Name (icon, name, an
+`mcp` or `native` badge, and a smaller, fainter second line on what it does in
+Macro or which accounts are connected), Category (tag pills like email tags; several per row, e.g. Email,
+Calendar), Status, and the row's actions. There is one row per integration; custom MCP
+servers come first, then integrations in use (connected, off, or needing
+attention), then the rest, then the app catalog. Below a 640px list width Category and Status hide and a status
+dot sits beside the name.
+
+- **Gmail** and **Outlook**: one row each; connected accounts appear as the
+ description. **Connect** (or **Add account** with multi-inbox) starts that
+ provider's flow; Outlook checks availability first. **Manage** opens Email
+ settings, where each inbox is managed.
+- **GitHub**: one row for the account link (pull request reviews and status)
+ and agent tools. Its menu has **Configure GitHub App**, **Agent tools** (the
+ GitHub provider page) and **Disconnect**.
+- **Slack**, **Linear**, **Notion**: agent tools, with **Connect**/**Manage**
+ opening the provider page and **Import** beside it. Slack's Import opens the
+ Slack export importer for team admins with archive import enabled, otherwise
+ the connector import dialog.
+- **Granola**, **Claude Code, Codex, and ChatGPT** (Macro MCP setup), and
+ **Coding agents on your computer** (Claude Code, Codex, OpenCode, OpenClaw,
+ Hermes; opens Runtimes within Integrations and follows the Runtimes
+ availability gate; Back returns to Integrations).
+- Installed catalog apps and custom MCP servers, with their More menus.
+- The catalog: every Pipedream app not yet connected, tagged with its directory
+ categories. Apps Macro can import from show **Import** beside **Connect**.
+
+The search filters every row by name, description and category and also searches
+the catalog. **Add custom** sits beside it. Gmail, Google Calendar and Google
+Sheets are hidden from the catalog because Macro syncs email and calendars
+natively. Scrolling toward the end loads the next catalog page; a failed page
+keeps loaded apps and offers Retry.
Overlaid catalog apps (the `mcp_overlays` table, served at
`GET /pipedream/mcp/overlays`) look the same in the catalog but never open
-Pipedream: their plus action opens the vendor's own MCP OAuth consent in a new
-tab (system browser on native) and the card turns connected once that server is
-authorized, after which the app appears with the custom MCP servers under
-Installed. Verify with an overlaid app such as Sentry or Asana; completing a
+Pipedream: their Connect action opens the vendor's own MCP OAuth consent in a new
+tab (system browser on native) and the row turns connected once that server is
+authorized, after which it lists as that catalog app (its icon, Agent tools
+category) among the integrations in use, not with the custom MCP servers at
+the top; native servers wait for the overlay list before rendering so one never
+jumps. Verify with an overlaid app such as Sentry or Asana; completing a
Pipedream connection for one answers 409.
-Featured and catalog cards use two columns on wide screens and one on narrow
-screens, with a plus action for available apps. Featured cards show app names
-without descriptions, and catalog descriptions
-and connection status use readable body-sized text. The Agents workspace opens this same Integrations
-page. Installed groups GitHub, Linear, Notion, and Slack tool grants by provider,
-lists other catalog connections alongside them, and lists custom servers in the same installed grid. The available integrations include featured providers, a searchable catalog,
+The Agents workspace opens this same Integrations page. The list includes featured providers, a searchable catalog,
and `Add Custom`. Pipedream Slack OAuth is available in production and
development from the featured Slack provider. Connecting Slack here grants tool
access; channel import is a separate action where the user chooses channels.
@@ -649,8 +652,8 @@ custom servers. Agents configured with a fixed app selection do not receive the
owner's custom servers.
An agent reply's `Connect <app>` chip still starts that app's connection flow.
Cursor stays in Agents → Runtimes with its API key and default model controls; it is not
-featured or offered in the Connections catalog. Personal Gmail and GitHub account
-links appear above the installed tools and app catalog on Settings → Integrations. The native-only integrations section remains
+featured or offered in the Connections catalog. Settings → Integrations lists
+Email, Accounts and AI apps above the agent tools and app catalog. The native-only integrations section remains
available when `pipedream-mcp` is disabled.
Open Settings with the rail's gear button or `Ctrl+;`; leave it by picking any other rail item.