feat(web): Company Brain proactiveness (automations) settings (#1207)

Adds the **Proactiveness** settings tab for Company Brain channel/DM automations.

- Accordion list of automations — collapsed rows with an instant enable toggle + **Run now**, expand to edit.
- Two-column editor: prompt (left) / deliver-to channel or DM, frequency, day, time (right), with local-timezone-aware cron.
- Preset gallery (connection-first, category-diverse) for empty state + a New-automation menu.
- DM delivery option with a tooltip explaining channel visibility + personal-connection fallback.
- Profile-menu entry (gated on Company Brain).

Pairs with the API automations work: **supermemoryai/mono#2480**.
This commit is contained in:
MaheshtheDev 2026-07-07 21:20:50 +00:00
parent af61880da1
commit 97888ce859
6 changed files with 1170 additions and 1 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,29 @@
export function ProactivenessIcon({ className }: { className?: string }) {
return (
<svg
className={className}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth={1.5}
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<path
d="M18.8284 18.8284C17.6569 20 15.7712 20 12 20C8.22876 20 6.34315 20 5.17157 18.8284C4 17.6569 4 15.7712 4 12C4 8.22876 4 6.34315 5.17157 5.17157C6.34315 4 8.22876 4 12 4C15.7712 4 17.6569 4 18.8284 5.17157C20 6.34315 20 8.22876 20 12C20 15.7712 20 17.6569 18.8284 18.8284Z"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M8 2V4M16 2V4M12 2V4M8 20V22M12 20V22M16 20V22M22 16H20M4 8H2M4 16H2M4 12H2M22 8H20M22 12H20"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M11.4802 7.86193C11.6587 7.37936 12.3413 7.37936 12.5198 7.86193L13.3202 10.0248C13.4325 10.3283 13.6717 10.5675 13.9752 10.6798L16.1381 11.4802C16.6206 11.6587 16.6206 12.3413 16.1381 12.5198L13.9752 13.3202C13.6717 13.4325 13.4325 13.6717 13.3202 13.9752L12.5198 16.1381C12.3413 16.6206 11.6587 16.6206 11.4802 16.1381L10.6798 13.9752C10.5675 13.6717 10.3283 13.4325 10.0248 13.3202L7.86193 12.5198C7.37936 12.3413 7.37936 11.6587 7.86193 11.4802L10.0248 10.6798C10.3283 10.5675 10.5675 10.3283 10.6798 10.0248L11.4802 7.86193Z"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
)
}

View file

@ -0,0 +1,26 @@
"use client"
import { cn } from "@lib/utils"
import { useHasCompanyBrain } from "@/hooks/use-company-brain"
import { dmSans125ClassName } from "@/lib/fonts"
import CompanyBrainAutomations from "./company-brain-automations"
export default function Proactiveness() {
const isCompanyBrain = useHasCompanyBrain()
if (!isCompanyBrain) {
return (
<div className="px-1 pt-2">
<p className={cn(dmSans125ClassName(), "text-[13px] text-[#6B6B6B]")}>
Company Brain isn't enabled for this organization.
</p>
</div>
)
}
return (
<div className="flex flex-col gap-6">
<CompanyBrainAutomations />
</div>
)
}

View file

@ -11,12 +11,15 @@ import Billing from "@/components/settings/billing"
import Integrations from "@/components/settings/integrations"
import ConnectionsMCP from "@/components/settings/connections-mcp"
import CompanyBrainConnections from "@/components/settings/company-brain-connections"
import { ProactivenessIcon } from "@/components/settings/proactiveness-icon"
import Proactiveness from "@/components/settings/proactiveness"
import Support from "@/components/settings/support"
import { ErrorBoundary } from "@/components/error-boundary"
import { useRouter } from "next/navigation"
import { useQuery } from "@tanstack/react-query"
import { useIsMobile } from "@hooks/use-mobile"
import { useLocalStorageUsername } from "@hooks/use-local-storage-username"
import { useHasCompanyBrain } from "@/hooks/use-company-brain"
import {
LogOut,
RotateCcw,
@ -52,6 +55,7 @@ export const TABS = [
"integrations",
"connections",
"company-brain",
"proactiveness",
"support",
] as const
export type SettingsTab = (typeof TABS)[number]
@ -94,6 +98,12 @@ const NAV_ITEMS: NavItem[] = [
description: "Connect apps to your brain — org and personal",
icon: <Building2 className="size-[18px]" />,
},
{
id: "proactiveness",
label: "Proactiveness",
description: "Scheduled digests and unprompted actions",
icon: <ProactivenessIcon className="size-[18px]" />,
},
{
id: "support",
label: "Support & Help",
@ -154,6 +164,14 @@ export function SettingsContent({
showIdentity?: boolean
}) {
const { user, org, organizations, setActiveOrg, clearActiveOrg } = useAuth()
const isCompanyBrain = useHasCompanyBrain()
// Company Brain orgs manage tools inside Company Brain; hide the generic tabs.
const navItems = isCompanyBrain
? NAV_ITEMS.filter(
(item) => item.id !== "integrations" && item.id !== "connections",
)
: NAV_ITEMS
const router = useRouter()
const isMobile = useIsMobile()
const localStorageUsername = useLocalStorageUsername()
@ -307,7 +325,7 @@ export function SettingsContent({
dmSansClassName(),
)}
>
{NAV_ITEMS.map((item) => {
{navItems.map((item) => {
const isExternal = item.id === "integrations"
const isActive = !isExternal && activeTab === item.id
return (
@ -481,6 +499,7 @@ export function SettingsContent({
{activeTab === "integrations" && <Integrations />}
{activeTab === "connections" && <ConnectionsMCP />}
{activeTab === "company-brain" && <CompanyBrainConnections />}
{activeTab === "proactiveness" && <Proactiveness />}
{activeTab === "support" && <Support />}
</ErrorBoundary>
</section>

View file

@ -26,6 +26,7 @@ import { dmSansClassName } from "@/lib/fonts"
import { useOrgOnboarding } from "@hooks/use-org-onboarding"
import { useTokenUsage } from "@/hooks/use-token-usage"
import { useSettingsModal } from "@/components/settings/settings-modal"
import { ProactivenessIcon } from "@/components/settings/proactiveness-icon"
import { useHasCompanyBrain } from "@/hooks/use-company-brain"
import { useViewMode } from "@/lib/view-mode-context"
@ -171,6 +172,15 @@ export function UserProfileMenu({
<Building2 className="size-4 text-[#737373]" />
Company Brain
</DropdownMenuItem>
{isCompanyBrain ? (
<DropdownMenuItem
onClick={() => openSettings("proactiveness")}
className="gap-2.5 rounded-lg px-2.5 py-2 text-sm font-medium text-white/85 hover:bg-white/[0.06] focus:bg-white/[0.06] focus:text-white cursor-pointer"
>
<ProactivenessIcon className="size-4 text-[#737373]" />
Proactiveness
</DropdownMenuItem>
) : null}
{isCompanyBrain ? (
<DropdownMenuItem
onClick={() => void setViewMode("integrations")}

View file

@ -228,6 +228,7 @@ export const analytics = {
| "integrations"
| "connections"
| "company-brain"
| "proactiveness"
| "support"
}) => safeCapture("settings_tab_changed", props),