diff --git a/packages/ui/src/features/canvas/components/WebsiteChannelLoops.tsx b/packages/ui/src/features/canvas/components/WebsiteChannelLoops.tsx index 11a1e9f08f..38231afa59 100644 --- a/packages/ui/src/features/canvas/components/WebsiteChannelLoops.tsx +++ b/packages/ui/src/features/canvas/components/WebsiteChannelLoops.tsx @@ -12,11 +12,14 @@ import { } from "../../loops/components/LoopFallbacks"; import { LoopRow } from "../../loops/components/LoopRow"; import { LoopsEmptyState } from "../../loops/components/LoopsEmptyState"; +import { LoopTemplatesSection } from "../../loops/components/LoopTemplatesSection"; import { useLoopLimits, useLoops } from "../../loops/hooks/useLoops"; import { useLoopDraftStore } from "../../loops/loopDraftStore"; import { defaultLoopContextOutputs } from "../../loops/loopFormTypes"; +import type { LoopTemplate } from "../../loops/loopTemplates"; import { useChannels } from "../hooks/useChannels"; import { useOrgMembers } from "../hooks/useOrgMembers"; +import { PERSONAL_CHANNEL_NAME } from "../hooks/useTaskChannels"; function contextQuickStarts(name: string): { label: string; prompt: string }[] { return [ @@ -52,6 +55,7 @@ export function WebsiteChannelLoops({ channelId }: { channelId: string }) { const { channels } = useChannels(); const channel = channels.find((c) => c.id === channelId); const contextName = channel?.name ?? channelId; + const isPersonal = contextName === PERSONAL_CHANNEL_NAME; useSetHeaderContent( useMemo(() => , [channelId]), @@ -82,13 +86,26 @@ export function WebsiteChannelLoops({ channelId }: { channelId: string }) { navigateToNewLoop(); }; + const startFromTemplate = (template: LoopTemplate) => { + useLoopDraftStore.getState().setPrefill({ + description: template.description, + ...template.build(), + contextTarget: { + folderId: channelId, + name: contextName, + outputs: defaultLoopContextOutputs(), + }, + }); + navigateToNewLoop(); + }; + return (
- Automate #{contextName} + {isPersonal ? "Loops" : `Automate #${contextName}`} - Build a loop that posts its runs to this context's feed, or - keeps its context.md or a canvas up to date. + Put your work on autopilot. Loops run on a schedule, on an API + call, or when something happens on GitHub. You can finally close + the laptop!
@@ -169,7 +191,7 @@ export function WebsiteChannelLoops({ channelId }: { channelId: string }) { -
- +
+