From be267c2fc8330789a18673a5631495f2ddd004ca Mon Sep 17 00:00:00 2001 From: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> Date: Mon, 10 Aug 2026 00:02:50 +0000 Subject: [PATCH 1/2] feat(web): automation connection warnings and calmer automations page (#1396) Inline notice with app icons when a channel automation can't use personal-only connections (footer, next to Save), post-save warning toast from the API, templates capped to 3 connection-relevant ideas with a show-all toggle, and New automation promoted to a primary button on the heading row. Pairs with mono #2724; degrades gracefully without it. Fixes ENG-1151 --- apps/web/components/configure-view.tsx | 23 ++- .../settings/company-brain-automations.tsx | 182 +++++++++++++++--- 2 files changed, 172 insertions(+), 33 deletions(-) diff --git a/apps/web/components/configure-view.tsx b/apps/web/components/configure-view.tsx index 83f43c3e2..eaa129ed5 100644 --- a/apps/web/components/configure-view.tsx +++ b/apps/web/components/configure-view.tsx @@ -162,16 +162,19 @@ export function ConfigureView() {
-
-

- {active.label} -

-

- {active.description} -

+
+
+

+ {active.label} +

+

+ {active.description} +

+
+
onDone: () => void onCancelNew?: () => void onCollapse?: () => void @@ -349,9 +358,18 @@ function AutomationCard({ const b = (await res.json().catch(() => ({}))) as { error?: string } throw new Error(b.error ?? "Couldn't save.") } + const b = (await res.json().catch(() => ({}))) as { + warnings?: { app: string }[] + } + return b.warnings ?? [] }, - onSuccess: () => { + onSuccess: (warnings) => { toast.success("Automation saved.") + if (warnings.length) + toast.warning( + `Heads up: ${warnings.map((w) => w.app).join(", ")} ${warnings.length === 1 ? "is" : "are"} connected personally and won't be available to this channel automation. ${isAdmin ? "Reconnect it for the workspace in Connections." : "Ask an admin to connect it for the workspace."}`, + { duration: 10000 }, + ) onDone() }, onError: (err) => @@ -619,6 +637,51 @@ function AutomationCard({ Cancel ) : null} + + {draft.deliverTo === "channel" && personalOnlyApps.length > 0 && ( + + + + {personalOnlyApps.map((app) => ( + + + {appCatalog[app]?.iconDomain ? ( + {appCatalog[app]?.name + ) : ( + + {app.slice(0, 1)} + + )} + + + {appCatalog[app]?.name ?? app} + + + ))} + + + + only connected to you ยท{" "} + {isAdmin ? ( + <> + + Connect for workspace + {" "} + to use here + + ) : ( + "ask an admin to connect it for the workspace" + )} + + + )}
{id ? ( @@ -851,8 +914,14 @@ function PresetCard({ export default function CompanyBrainAutomations() { const isCompanyBrain = useHasCompanyBrain() const { user, org } = useAuth() + const { isAdmin } = useOrgMemberRole(isCompanyBrain) const queryClient = useQueryClient() const [drafts, setDrafts] = useState<{ key: number; draft: Draft }[]>([]) + const [showAllTemplates, setShowAllTemplates] = useState(false) + const [actionSlot, setActionSlot] = useState(null) + useEffect(() => { + setActionSlot(document.getElementById("configure-section-actions")) + }, []) const [openId, setOpenId] = useState(null) const draftKey = useRef(0) const addDraft = (draft: Draft) => @@ -886,11 +955,15 @@ export default function CompanyBrainAutomations() { const res = await fetch(`${BACKEND}/brain/mcp-connections/`, { credentials: "include", }) - if (!res.ok) return [] as string[] + if (!res.ok) return [] as { serverSlug: string; userId: string | null }[] const body = (await res.json()) as { - connections?: { serverSlug: string }[] + connections?: { + serverSlug: string + userId: string | null + status: string + }[] } - return (body.connections ?? []).map((c) => c.serverSlug) + return (body.connections ?? []).filter((c) => c.status === "active") }, enabled: isCompanyBrain, }) @@ -899,7 +972,39 @@ export default function CompanyBrainAutomations() { const channels = channelsQuery.data ?? [] const automations = listQuery.data ?? [] - const presets = sortPresets(new Set(appsQuery.data ?? [])) + const catalogQuery = useQuery({ + queryKey: ["company-brain-automations", "catalog", "v2"], + queryFn: async () => { + const res = await fetch(`${BACKEND}/brain/mcp-connections/catalog`, { + credentials: "include", + }) + if (!res.ok) + return {} as Record + const body = (await res.json()) as { + catalog?: { slug: string; name?: string; iconDomain?: string }[] + } + return Object.fromEntries( + (body.catalog ?? []).map((e) => [ + e.slug, + { name: e.name ?? e.slug, iconDomain: e.iconDomain }, + ]), + ) + }, + enabled: isCompanyBrain, + }) + + const connections = appsQuery.data ?? [] + const presets = sortPresets(new Set(connections.map((c) => c.serverSlug))) + const sharedApps = new Set( + connections.filter((c) => c.userId === null).map((c) => c.serverSlug), + ) + const personalOnlyApps = [ + ...new Set( + connections + .filter((c) => c.userId !== null && !sharedApps.has(c.serverSlug)) + .map((c) => c.serverSlug), + ), + ] const nameFor = (userId: string | null): string | undefined => { if (!userId) return undefined if (userId === user?.id) return "You" @@ -913,10 +1018,34 @@ export default function CompanyBrainAutomations() { } const usedTitles = new Set(automations.map((a) => a.title)) const availablePresets = presets.filter((p) => !usedTitles.has(p.label)) + const shownPresets = showAllTemplates + ? availablePresets + : availablePresets.slice(0, 3) + const hiddenTemplateCount = availablePresets.length - shownPresets.length const hasList = automations.length > 0 || drafts.length > 0 + const newAutomationButton = ( + + ) + const newAutomationPortal = actionSlot ? ( + createPortal(newAutomationButton, actionSlot) + ) : ( +
{newAutomationButton}
+ ) + return (
+ {newAutomationPortal}
{automations.map((a) => openId === a.id ? ( @@ -925,6 +1054,9 @@ export default function CompanyBrainAutomations() { id={a.id} initial={toDraft(a)} channels={channels} + personalOnlyApps={personalOnlyApps} + isAdmin={isAdmin} + appCatalog={catalogQuery.data ?? {}} onDone={() => { setOpenId(null) refresh() @@ -953,6 +1085,9 @@ export default function CompanyBrainAutomations() { id={null} initial={draft} channels={channels} + personalOnlyApps={personalOnlyApps} + isAdmin={isAdmin} + appCatalog={catalogQuery.data ?? {}} onDone={() => { removeDraft(key) refresh() @@ -961,37 +1096,38 @@ export default function CompanyBrainAutomations() { /> ))} - {hasList ? ( -

- Templates -

- ) : null} +

+ {showAllTemplates ? "Templates" : "Ideas for your setup"} +

- {availablePresets.map((p) => ( + {shownPresets.map((p) => ( addDraft(presetToDraft(p))} /> ))} +
+ {hiddenTemplateCount > 0 || showAllTemplates ? ( -
+ ) : null}
) From 59b148e5b2d4f5b4e27c9a6351fb3a0224ed76f2 Mon Sep 17 00:00:00 2001 From: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> Date: Mon, 10 Aug 2026 00:10:46 +0000 Subject: [PATCH 2/2] feat(web): sell Company Brain on Max as well as Scale (#1440) Company Brain workspaces could only buy Scale at $399/mo, which is roughly eight times what the median team uses. Adds the $100/mo Max card to the Company Brain plan picker, notes what a Scale trial loses on the way down, and flags that Scale is cheaper above about $400/mo of credits. --- .../onboarding-brain/step-sources.tsx | 22 +++++-- apps/web/components/settings/billing.tsx | 65 +++++++++++++++++-- apps/web/hooks/use-connector-access.ts | 3 + 3 files changed, 76 insertions(+), 14 deletions(-) diff --git a/apps/web/components/onboarding-brain/step-sources.tsx b/apps/web/components/onboarding-brain/step-sources.tsx index 358597e65..5535392de 100644 --- a/apps/web/components/onboarding-brain/step-sources.tsx +++ b/apps/web/components/onboarding-brain/step-sources.tsx @@ -97,7 +97,7 @@ type SourceId = | "raycast" type SourceState = "idle" | "connecting" | "connected" | "waitlist" type DriveScope = "selective" | "full" -type RequiredPlan = "pro" | "max" +type RequiredPlan = "pro" | "max" | "scale" const PROVIDER_TO_SOURCE: Record = { "google-drive": "drive", @@ -116,6 +116,7 @@ const SOURCE_LABEL: Partial> = { const PLAN_LABELS: Record = { pro: "Pro", max: "Max", + scale: "Scale", } const BOOK_CALL_HREF = "https://cal.com/maheshthedev/15min" @@ -277,7 +278,12 @@ export function StepSources({ const [granolaOpen, setGranolaOpen] = useState(false) const [requestedPlan, setRequestedPlan] = useState("pro") const [requestedConnector, setRequestedConnector] = useState("This connector") - const { hasMax, connectorAccess, loading: planLoading } = useConnectorAccess() + const { + hasMax, + hasScale, + connectorAccess, + loading: planLoading, + } = useConnectorAccess() const { org, isRestoring } = useAuth() useEffect(() => { @@ -362,10 +368,12 @@ export function StepSources({ } }, [connectedParam]) - // company_brain unlocks pro connectors; max stays gated + // company_brain unlocks pro connectors; max and scale stay gated, and a + // higher tier satisfies a lower requirement. const isLocked = (plan?: RequiredPlan) => { if (!plan || planLoading) return false - if (plan === "max") return !hasMax + if (plan === "scale") return !hasScale + if (plan === "max") return !(hasMax || hasScale) return !connectorAccess } @@ -1185,14 +1193,14 @@ function MoreSourcesGrid({ icon={} state={values.connected.github ?? "idle"} ctaLabel="Connect" - locked={isLocked("max")} - requiredPlan="max" + locked={isLocked("scale")} + requiredPlan="scale" perks={[ "PRs and issues parsed", "READMEs and docs indexed", "Stays in sync with new activity", ]} - onConnect={guard("max", "GitHub", () => requestWaitlist("github"))} + onConnect={guard("scale", "GitHub", () => requestWaitlist("github"))} /> {mode === "personal" ? ( handleUpgrade("api_max")} + disabled={disabled} + className={cn( + dmSans125ClassName(), + PLAN_CARD_ACTION_CLASS, + "bg-[#0054AD] text-[#FAFAFA] hover:bg-[#0B65C9]", + )} + > + {disabled ? : null} + Activate Max + + ) + } + // Trial Scale: primary CTA is activate paid Scale (not a dead "current" state). if (plan.id === "scale" && (isOnTrial || isBrainTrialEnded)) { return ( @@ -1471,6 +1508,20 @@ export default function Billing() { } /> ))} +
+ {isOnTrial ? ( +

+ Your trial runs on Scale. Moving to Max keeps the agent, + shared memory and unlimited seats, and drops the GitHub, S3 + and Web Crawler connectors, restricted access and container + tags, and User Insights. +

+ ) : null} +

+ Using more than about $400 of credits a month? Scale works out + cheaper than Max plus top-ups. +

+
) : ( <> diff --git a/apps/web/hooks/use-connector-access.ts b/apps/web/hooks/use-connector-access.ts index 9f2599c3c..d597ee1a8 100644 --- a/apps/web/hooks/use-connector-access.ts +++ b/apps/web/hooks/use-connector-access.ts @@ -9,9 +9,12 @@ export function useConnectorAccess(opts?: { enabled?: boolean }) { const hasCompanyBrain = useHasCompanyBrain() const hasPro = enabled && hasActivePlan(autumn.data?.subscriptions, "api_pro") const hasMax = enabled && hasActivePlan(autumn.data?.subscriptions, "api_max") + const hasScale = + enabled && hasActivePlan(autumn.data?.subscriptions, "api_scale") return { hasPro, hasMax, + hasScale, hasCompanyBrain, connectorAccess: hasPro || hasCompanyBrain, loading: enabled && autumn.isLoading,