Compare commits

..

3 Commits

Author SHA1 Message Date
Waleed
7ecd377c41 fix(tasks-ui): update in progress to be amber, added status to dropdown menu, fixed scheduled tasks modal (#3597)
* fix(tasks-ui): update in progress to be amber, added status to dropdownmenu

* fix play button, scheduled tasks modal
2026-03-14 23:56:18 -07:00
Theodore Li
743742d058 Show rendered md by default (#3594)
* Show rendered md by default

* Lint fix

* chore(file-viewer): remove dead PREVIEW_ONLY_EXTENSIONS export

Co-authored-by: Theodore Li <TheodoreSpeaks@users.noreply.github.com>

* Fix new file logic to default to text

---------

Co-authored-by: Theodore Li <theo@sim.ai>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Theodore Li <TheodoreSpeaks@users.noreply.github.com>
2026-03-14 22:17:40 -04:00
Theodore Li
b7b575c4d2 fix(ui) reduce redundant rerenders (#3593)
* Improve rerendering of resource view

* Lint fix

* Remove console log

* Fix panel logic

---------

Co-authored-by: Theodore Li <theo@sim.ai>
2026-03-14 22:02:21 -04:00
23 changed files with 89 additions and 271 deletions

View File

@@ -98,7 +98,7 @@ export function FileViewer({
file={file}
workspaceId={workspaceId}
canEdit={canEdit}
previewMode={previewMode ?? (showPreview ? 'split' : 'editor')}
previewMode={previewMode ?? (showPreview ? 'preview' : 'editor')}
autoFocus={autoFocus}
onDirtyChange={onDirtyChange}
onSaveStatusChange={onSaveStatusChange}

View File

@@ -1,3 +1,3 @@
export type { PreviewMode } from './file-viewer'
export { FileViewer, isPreviewable, isTextEditable } from './file-viewer'
export { PREVIEW_ONLY_EXTENSIONS, RICH_PREVIEWABLE_EXTENSIONS } from './preview-panel'
export { RICH_PREVIEWABLE_EXTENSIONS } from './preview-panel'

View File

@@ -23,9 +23,6 @@ const PREVIEWABLE_EXTENSIONS: Record<string, PreviewType> = {
svg: 'svg',
}
/** Extensions that should default to rendered preview (no raw editor). */
export const PREVIEW_ONLY_EXTENSIONS = new Set(['html', 'htm', 'svg'])
/** All extensions that have a rich preview renderer. */
export const RICH_PREVIEWABLE_EXTENSIONS = new Set(Object.keys(PREVIEWABLE_EXTENSIONS))

View File

@@ -476,10 +476,11 @@ export function Files() {
}, [closeListContextMenu])
useEffect(() => {
if (justCreatedFileIdRef.current && selectedFileId !== justCreatedFileIdRef.current) {
const isJustCreated = selectedFileId != null && justCreatedFileIdRef.current === selectedFileId
if (justCreatedFileIdRef.current && !isJustCreated) {
justCreatedFileIdRef.current = null
}
setShowPreview(true)
setShowPreview(!isJustCreated)
}, [selectedFileId])
useEffect(() => {
@@ -521,8 +522,8 @@ export function Files() {
...(canPreview
? [
{
label: showPreview ? 'Hide Preview' : 'Preview',
icon: Eye,
label: showPreview ? 'Edit' : 'Preview',
icon: showPreview ? Pencil : Eye,
onClick: handleTogglePreview,
},
]

View File

@@ -1,6 +1,6 @@
'use client'
import { lazy, Suspense, useCallback, useEffect, useMemo } from 'react'
import { lazy, memo, Suspense, useCallback, useEffect, useMemo } from 'react'
import { createLogger } from '@sim/logger'
import { Square } from 'lucide-react'
import { useRouter } from 'next/navigation'
@@ -51,7 +51,11 @@ interface ResourceContentProps {
* Handles table, file, and workflow resource types with appropriate
* embedded rendering for each.
*/
export function ResourceContent({ workspaceId, resource, previewMode }: ResourceContentProps) {
export const ResourceContent = memo(function ResourceContent({
workspaceId,
resource,
previewMode,
}: ResourceContentProps) {
switch (resource.type) {
case 'table':
return <Table key={resource.id} workspaceId={workspaceId} tableId={resource.id} embedded />
@@ -84,7 +88,7 @@ export function ResourceContent({ workspaceId, resource, previewMode }: Resource
default:
return null
}
}
})
interface ResourceActionsProps {
workspaceId: string
@@ -303,10 +307,12 @@ interface EmbeddedWorkflowProps {
function EmbeddedWorkflow({ workspaceId, workflowId }: EmbeddedWorkflowProps) {
const workflowExists = useWorkflowRegistry((state) => Boolean(state.workflows[workflowId]))
const hydrationPhase = useWorkflowRegistry((state) => state.hydration.phase)
const hydrationWorkflowId = useWorkflowRegistry((state) => state.hydration.workflowId)
const isMetadataLoaded = hydrationPhase !== 'idle' && hydrationPhase !== 'metadata-loading'
const hasLoadError = hydrationPhase === 'error' && hydrationWorkflowId === workflowId
const isMetadataLoaded = useWorkflowRegistry(
(state) => state.hydration.phase !== 'idle' && state.hydration.phase !== 'metadata-loading'
)
const hasLoadError = useWorkflowRegistry(
(state) => state.hydration.phase === 'error' && state.hydration.workflowId === workflowId
)
if (!isMetadataLoaded) return LOADING_SKELETON

View File

@@ -8,7 +8,7 @@ import {
useState,
} from 'react'
import { Button, Tooltip } from '@/components/emcn'
import { Columns3, Eye, PanelLeft, Rows3 } from '@/components/emcn/icons'
import { Columns3, Eye, PanelLeft, Pencil } from '@/components/emcn/icons'
import { cn } from '@/lib/core/utils/cn'
import type { PreviewMode } from '@/app/workspace/[workspaceId]/files/components/file-viewer'
import { AddResourceDropdown } from '@/app/workspace/[workspaceId]/home/components/mothership-view/components/add-resource-dropdown'
@@ -36,9 +36,9 @@ const EDGE_ZONE = 40
const SCROLL_SPEED = 8
const PREVIEW_MODE_ICONS = {
editor: Rows3,
split: Columns3,
preview: Eye,
editor: Columns3,
split: Eye,
preview: Pencil,
} satisfies Record<PreviewMode, (props: ComponentProps<typeof Eye>) => ReactNode>
/**

View File

@@ -1,13 +1,10 @@
'use client'
import { useCallback, useEffect, useState } from 'react'
import { memo, useCallback, useEffect, useState } from 'react'
import { cn } from '@/lib/core/utils/cn'
import { getFileExtension } from '@/lib/uploads/utils/file-utils'
import type { PreviewMode } from '@/app/workspace/[workspaceId]/files/components/file-viewer'
import {
PREVIEW_ONLY_EXTENSIONS,
RICH_PREVIEWABLE_EXTENSIONS,
} from '@/app/workspace/[workspaceId]/files/components/file-viewer'
import { RICH_PREVIEWABLE_EXTENSIONS } from '@/app/workspace/[workspaceId]/files/components/file-viewer'
import type {
MothershipResource,
MothershipResourceType,
@@ -34,7 +31,7 @@ interface MothershipViewProps {
className?: string
}
export function MothershipView({
export const MothershipView = memo(function MothershipView({
workspaceId,
chatId,
resources,
@@ -49,12 +46,11 @@ export function MothershipView({
}: MothershipViewProps) {
const active = resources.find((r) => r.id === activeResourceId) ?? resources[0] ?? null
const [previewMode, setPreviewMode] = useState<PreviewMode>('split')
const [previewMode, setPreviewMode] = useState<PreviewMode>('preview')
const handleCyclePreview = useCallback(() => setPreviewMode((m) => PREVIEW_CYCLE[m]), [])
useEffect(() => {
const ext = active?.type === 'file' ? getFileExtension(active.title) : ''
setPreviewMode(PREVIEW_ONLY_EXTENSIONS.has(ext) ? 'preview' : 'split')
setPreviewMode('preview')
}, [active?.id])
const isActivePreviewable =
@@ -99,4 +95,4 @@ export function MothershipView({
</div>
</div>
)
}
})

View File

@@ -167,7 +167,6 @@ export function Home({ chatId }: HomeProps = {}) {
const handleResourceEvent = useCallback(() => {
if (isResourceCollapsedRef.current) {
/** Auto-collapse sidebar to give resource panel maximum width for immersive experience */
const { isCollapsed, toggleCollapsed } = useSidebarStore.getState()
if (!isCollapsed) toggleCollapsed()
setIsResourceCollapsed(false)

View File

@@ -682,8 +682,7 @@ export function useChat(
readArgs?.path as string | undefined,
tc.result.output
)
if (resource) {
addResource(resource)
if (resource && addResource(resource)) {
onResourceEventRef.current?.()
}
}
@@ -694,12 +693,21 @@ export function useChat(
case 'resource_added': {
const resource = parsed.resource
if (resource?.type && resource?.id) {
addResource(resource)
const wasAdded = addResource(resource)
invalidateResourceQueries(queryClient, workspaceId, resource.type, resource.id)
if (!wasAdded && activeResourceIdRef.current !== resource.id) {
setActiveResourceId(resource.id)
}
onResourceEventRef.current?.()
if (resource.type === 'workflow') {
if (ensureWorkflowInRegistry(resource.id, resource.title, workspaceId)) {
const wasRegistered = ensureWorkflowInRegistry(
resource.id,
resource.title,
workspaceId
)
if (wasAdded && wasRegistered) {
useWorkflowRegistry.getState().setActiveWorkflow(resource.id)
} else {
useWorkflowRegistry.getState().loadWorkflowState(resource.id)

View File

@@ -57,7 +57,7 @@ export const STATUS_CONFIG: Record<
> = {
error: { variant: 'red', label: 'Error', color: 'var(--text-error)' },
pending: { variant: 'amber', label: 'Pending', color: '#f59e0b' },
running: { variant: 'green', label: 'Running', color: '#22c55e' },
running: { variant: 'amber', label: 'Running', color: '#f59e0b' },
cancelled: { variant: 'orange', label: 'Cancelled', color: '#f97316' },
info: { variant: 'gray', label: 'Info', color: 'var(--terminal-status-info-color)' },
}

View File

@@ -249,7 +249,11 @@ export function ScheduledTasks() {
>
Cancel
</Button>
<Button variant='default' onClick={handleDelete} disabled={deleteSchedule.isPending}>
<Button
variant='destructive'
onClick={handleDelete}
disabled={deleteSchedule.isPending}
>
{deleteSchedule.isPending ? 'Deleting...' : 'Delete'}
</Button>
</ModalFooter>

View File

@@ -14,18 +14,11 @@ import { useSubBlockStore } from '@/stores/workflows/subblock/store'
import { useWorkflowStore } from '@/stores/workflows/workflow/store'
/**
* Dropdown option type - can be a simple string or an object with label, id, and optional icon.
* Options with `hidden: true` are excluded from the picker but still resolve for label display,
* so existing workflows that reference them continue to work.
* Dropdown option type - can be a simple string or an object with label, id, and optional icon
*/
type DropdownOption =
| string
| {
label: string
id: string
icon?: React.ComponentType<{ className?: string }>
hidden?: boolean
}
| { label: string; id: string; icon?: React.ComponentType<{ className?: string }> }
/**
* Props for the Dropdown component
@@ -192,12 +185,13 @@ export const Dropdown = memo(function Dropdown({
return fetchedOptions.map((opt) => ({ label: opt.label, id: opt.id }))
}, [fetchedOptions])
const allOptions = useMemo(() => {
const availableOptions = useMemo(() => {
let opts: DropdownOption[] =
fetchOptions && normalizedFetchedOptions.length > 0
? normalizedFetchedOptions
: evaluatedOptions
// Merge hydrated option if not already present
if (hydratedOption) {
const alreadyPresent = opts.some((o) =>
typeof o === 'string' ? o === hydratedOption.id : o.id === hydratedOption.id
@@ -210,12 +204,11 @@ export const Dropdown = memo(function Dropdown({
return opts
}, [fetchOptions, normalizedFetchedOptions, evaluatedOptions, hydratedOption])
const selectableOptions = useMemo(() => {
return allOptions.filter((opt) => typeof opt === 'string' || !opt.hidden)
}, [allOptions])
/**
* Convert dropdown options to Combobox format
*/
const comboboxOptions = useMemo((): ComboboxOption[] => {
return selectableOptions.map((opt) => {
return availableOptions.map((opt) => {
if (typeof opt === 'string') {
return { label: opt.toLowerCase(), value: opt }
}
@@ -225,16 +218,11 @@ export const Dropdown = memo(function Dropdown({
icon: 'icon' in opt ? opt.icon : undefined,
}
})
}, [selectableOptions])
}, [availableOptions])
const optionMap = useMemo(() => {
return new Map(
allOptions.map((opt) => {
if (typeof opt === 'string') return [opt, opt.toLowerCase()]
return [opt.id, opt.label.toLowerCase()]
})
)
}, [allOptions])
return new Map(comboboxOptions.map((opt) => [opt.value, opt.label]))
}, [comboboxOptions])
const defaultOptionValue = useMemo(() => {
if (multiSelect) return undefined

View File

@@ -138,9 +138,12 @@ const SidebarTaskItem = memo(function SidebarTaskItem({
{task.id !== 'new' && (
<div className='relative flex h-[18px] w-[18px] flex-shrink-0 items-center justify-center'>
{isActive && !isCurrentRoute && (
<span className='absolute h-[7px] w-[7px] animate-ping rounded-full bg-[#33C482] opacity-30 group-hover:hidden' />
<span className='absolute h-[7px] w-[7px] animate-ping rounded-full bg-amber-400 opacity-30 group-hover:hidden' />
)}
{(isActive || isUnread) && !isCurrentRoute && (
{isActive && !isCurrentRoute && (
<span className='absolute h-[7px] w-[7px] rounded-full bg-amber-400 group-hover:hidden' />
)}
{!isActive && isUnread && !isCurrentRoute && (
<span className='absolute h-[7px] w-[7px] rounded-full bg-[#33C482] group-hover:hidden' />
)}
<button
@@ -1096,7 +1099,15 @@ export const Sidebar = memo(function Sidebar() {
tasks.map((task) => (
<DropdownMenuItem key={task.id} asChild>
<Link href={task.href}>
<Blimp className='h-[16px] w-[16px]' />
<span className='relative flex-shrink-0'>
<Blimp className='h-[16px] w-[16px]' />
{task.isActive && (
<span className='-bottom-[1px] -right-[1px] absolute h-[6px] w-[6px] rounded-full border border-[var(--surface-1)] bg-amber-400' />
)}
{!task.isActive && task.isUnread && (
<span className='-bottom-[1px] -right-[1px] absolute h-[6px] w-[6px] rounded-full border border-[var(--surface-1)] bg-[#33C482]' />
)}
</span>
<span>{task.name}</span>
</Link>
</DropdownMenuItem>

View File

@@ -268,17 +268,15 @@ Return ONLY the search term - no explanations, no quotes, no extra text.`,
type: 'dropdown',
mode: 'trigger',
options: grainTriggerOptions,
value: () => 'grain_item_added',
value: () => 'grain_webhook',
required: true,
},
...getTrigger('grain_item_added').subBlocks,
...getTrigger('grain_item_updated').subBlocks,
...getTrigger('grain_webhook').subBlocks,
...getTrigger('grain_recording_created').subBlocks,
...getTrigger('grain_recording_updated').subBlocks,
...getTrigger('grain_highlight_created').subBlocks,
...getTrigger('grain_highlight_updated').subBlocks,
...getTrigger('grain_story_created').subBlocks,
...getTrigger('grain_webhook').subBlocks,
],
tools: {
access: [
@@ -449,14 +447,12 @@ Return ONLY the search term - no explanations, no quotes, no extra text.`,
triggers: {
enabled: true,
available: [
'grain_item_added',
'grain_item_updated',
'grain_webhook',
'grain_recording_created',
'grain_recording_updated',
'grain_highlight_created',
'grain_highlight_updated',
'grain_story_created',
'grain_webhook',
],
},
}

View File

@@ -233,14 +233,12 @@ export interface SubBlockConfig {
id: string
icon?: React.ComponentType<{ className?: string }>
group?: string
hidden?: boolean
}[]
| (() => {
label: string
id: string
icon?: React.ComponentType<{ className?: string }>
group?: string
hidden?: boolean
}[])
min?: number
max?: number

View File

@@ -40,7 +40,7 @@ export function PlayOutline(props: SVGProps<SVGSVGElement>) {
xmlns='http://www.w3.org/2000/svg'
{...props}
>
<path d='M6.25 3.9C6.25 3.408 6.799 3.114 7.209 3.399L15.709 9.299C16.063 9.545 16.063 10.069 15.709 10.315L7.209 16.215C6.799 16.5 6.25 16.206 6.25 15.714V3.9Z' />
<path d='M7.5 3.5C7.5 2.672 8.452 2.18 9.128 2.66L18.128 9.16C18.72 9.58 18.72 10.46 18.128 10.88L9.128 17.38C8.452 17.86 7.5 17.368 7.5 16.54V3.5Z' />
</svg>
)
}

View File

@@ -1258,8 +1258,6 @@ export async function createGrainWebhookSubscription(
}
const actionMap: Record<string, Array<'added' | 'updated' | 'removed'>> = {
grain_item_added: ['added'],
grain_item_updated: ['updated'],
grain_recording_created: ['added'],
grain_recording_updated: ['updated'],
grain_highlight_created: ['added'],
@@ -1269,8 +1267,6 @@ export async function createGrainWebhookSubscription(
const eventTypeMap: Record<string, string[]> = {
grain_webhook: [],
grain_item_added: [],
grain_item_updated: [],
grain_recording_created: ['recording_added'],
grain_recording_updated: ['recording_updated'],
grain_highlight_created: ['highlight_added'],

View File

@@ -1,7 +1,5 @@
export { grainHighlightCreatedTrigger } from './highlight_created'
export { grainHighlightUpdatedTrigger } from './highlight_updated'
export { grainItemAddedTrigger } from './item_added'
export { grainItemUpdatedTrigger } from './item_updated'
export { grainRecordingCreatedTrigger } from './recording_created'
export { grainRecordingUpdatedTrigger } from './recording_updated'
export { grainStoryCreatedTrigger } from './story_created'

View File

@@ -1,76 +0,0 @@
import { GrainIcon } from '@/components/icons'
import type { TriggerConfig } from '@/triggers/types'
import { buildGenericOutputs, grainV2SetupInstructions } from './utils'
export const grainItemAddedTrigger: TriggerConfig = {
id: 'grain_item_added',
name: 'Grain Item Added',
provider: 'grain',
description: 'Trigger when a new item is added to a Grain view (recording, highlight, or story)',
version: '1.0.0',
icon: GrainIcon,
subBlocks: [
{
id: 'apiKey',
title: 'API Key',
type: 'short-input',
placeholder: 'Enter your Grain API key (Personal Access Token)',
description: 'Required to create the webhook in Grain.',
password: true,
required: true,
mode: 'trigger',
condition: {
field: 'selectedTriggerId',
value: 'grain_item_added',
},
},
{
id: 'viewId',
title: 'View ID',
type: 'short-input',
placeholder: 'Enter Grain view UUID',
description:
'The view determines which content type fires events (recordings, highlights, or stories).',
required: true,
mode: 'trigger',
condition: {
field: 'selectedTriggerId',
value: 'grain_item_added',
},
},
{
id: 'triggerSave',
title: '',
type: 'trigger-save',
hideFromPreview: true,
mode: 'trigger',
triggerId: 'grain_item_added',
condition: {
field: 'selectedTriggerId',
value: 'grain_item_added',
},
},
{
id: 'triggerInstructions',
title: 'Setup Instructions',
hideFromPreview: true,
type: 'text',
defaultValue: grainV2SetupInstructions('item added'),
mode: 'trigger',
condition: {
field: 'selectedTriggerId',
value: 'grain_item_added',
},
},
],
outputs: buildGenericOutputs(),
webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
},
}

View File

@@ -1,76 +0,0 @@
import { GrainIcon } from '@/components/icons'
import type { TriggerConfig } from '@/triggers/types'
import { buildGenericOutputs, grainV2SetupInstructions } from './utils'
export const grainItemUpdatedTrigger: TriggerConfig = {
id: 'grain_item_updated',
name: 'Grain Item Updated',
provider: 'grain',
description: 'Trigger when an item is updated in a Grain view (recording, highlight, or story)',
version: '1.0.0',
icon: GrainIcon,
subBlocks: [
{
id: 'apiKey',
title: 'API Key',
type: 'short-input',
placeholder: 'Enter your Grain API key (Personal Access Token)',
description: 'Required to create the webhook in Grain.',
password: true,
required: true,
mode: 'trigger',
condition: {
field: 'selectedTriggerId',
value: 'grain_item_updated',
},
},
{
id: 'viewId',
title: 'View ID',
type: 'short-input',
placeholder: 'Enter Grain view UUID',
description:
'The view determines which content type fires events (recordings, highlights, or stories).',
required: true,
mode: 'trigger',
condition: {
field: 'selectedTriggerId',
value: 'grain_item_updated',
},
},
{
id: 'triggerSave',
title: '',
type: 'trigger-save',
hideFromPreview: true,
mode: 'trigger',
triggerId: 'grain_item_updated',
condition: {
field: 'selectedTriggerId',
value: 'grain_item_updated',
},
},
{
id: 'triggerInstructions',
title: 'Setup Instructions',
hideFromPreview: true,
type: 'text',
defaultValue: grainV2SetupInstructions('item updated'),
mode: 'trigger',
condition: {
field: 'selectedTriggerId',
value: 'grain_item_updated',
},
},
],
outputs: buildGenericOutputs(),
webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
},
}

View File

@@ -1,19 +1,15 @@
import type { TriggerOutput } from '@/triggers/types'
/**
* Trigger dropdown options for Grain triggers.
* New options (Item Added / Item Updated / All Events) correctly scope by view_id only.
* Legacy options are hidden from the picker but still resolve for existing workflows.
* Shared trigger dropdown options for all Grain triggers
*/
export const grainTriggerOptions = [
{ label: 'Item Added', id: 'grain_item_added' },
{ label: 'Item Updated', id: 'grain_item_updated' },
{ label: 'All Events', id: 'grain_webhook' },
{ label: 'Recording Created', id: 'grain_recording_created', hidden: true },
{ label: 'Recording Updated', id: 'grain_recording_updated', hidden: true },
{ label: 'Highlight Created', id: 'grain_highlight_created', hidden: true },
{ label: 'Highlight Updated', id: 'grain_highlight_updated', hidden: true },
{ label: 'Story Created', id: 'grain_story_created', hidden: true },
{ label: 'General Webhook (All Events)', id: 'grain_webhook' },
{ label: 'Recording Created', id: 'grain_recording_created' },
{ label: 'Recording Updated', id: 'grain_recording_updated' },
{ label: 'Highlight Created', id: 'grain_highlight_created' },
{ label: 'Highlight Updated', id: 'grain_highlight_updated' },
{ label: 'Story Created', id: 'grain_story_created' },
]
/**
@@ -36,25 +32,6 @@ export function grainSetupInstructions(eventType: string): string {
.join('')
}
/**
* Setup instructions for the v2 triggers that correctly explain view-based scoping.
*/
export function grainV2SetupInstructions(action: string): string {
const instructions = [
'Enter your Grain API Key (Personal Access Token). You can find or create one in Grain at <strong>Workspace Settings &gt; API</strong> under Integrations on <a href="https://grain.com/app/settings/integrations?tab=api" target="_blank" rel="noopener noreferrer">grain.com</a>.',
`Enter a Grain <strong>view ID</strong>. Each view has a type &mdash; <em>recordings</em>, <em>highlights</em>, or <em>stories</em> &mdash; and only items matching that type will fire the <strong>${action}</strong> event.`,
'To find your view IDs, use the <strong>List Views</strong> operation on this block or call <code>GET /_/public-api/views</code> directly.',
'The webhook is created automatically when you save and will be deleted when you remove this trigger.',
]
return instructions
.map(
(instruction, index) =>
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
)
.join('')
}
/**
* Build output schema for recording events
* Webhook payload structure: { type, user_id, data: { ...recording } }

View File

@@ -1,12 +1,12 @@
import { GrainIcon } from '@/components/icons'
import type { TriggerConfig } from '@/triggers/types'
import { buildGenericOutputs, grainV2SetupInstructions } from './utils'
import { buildGenericOutputs, grainSetupInstructions } from './utils'
export const grainWebhookTrigger: TriggerConfig = {
id: 'grain_webhook',
name: 'Grain All Events',
name: 'Grain Webhook',
provider: 'grain',
description: 'Trigger on all actions (added, updated, removed) in a Grain view',
description: 'Generic webhook trigger for all actions in a selected Grain view',
version: '1.0.0',
icon: GrainIcon,
@@ -30,8 +30,7 @@ export const grainWebhookTrigger: TriggerConfig = {
title: 'View ID',
type: 'short-input',
placeholder: 'Enter Grain view UUID',
description:
'The view determines which content type fires events (recordings, highlights, or stories).',
description: 'Required by Grain to create the webhook subscription.',
required: true,
mode: 'trigger',
condition: {
@@ -56,7 +55,7 @@ export const grainWebhookTrigger: TriggerConfig = {
title: 'Setup Instructions',
hideFromPreview: true,
type: 'text',
defaultValue: grainV2SetupInstructions('all'),
defaultValue: grainSetupInstructions('All events'),
mode: 'trigger',
condition: {
field: 'selectedTriggerId',

View File

@@ -89,8 +89,6 @@ import { googleFormsWebhookTrigger } from '@/triggers/googleforms'
import {
grainHighlightCreatedTrigger,
grainHighlightUpdatedTrigger,
grainItemAddedTrigger,
grainItemUpdatedTrigger,
grainRecordingCreatedTrigger,
grainRecordingUpdatedTrigger,
grainStoryCreatedTrigger,
@@ -247,8 +245,6 @@ export const TRIGGER_REGISTRY: TriggerRegistry = {
fathom_webhook: fathomWebhookTrigger,
gmail_poller: gmailPollingTrigger,
grain_webhook: grainWebhookTrigger,
grain_item_added: grainItemAddedTrigger,
grain_item_updated: grainItemUpdatedTrigger,
grain_recording_created: grainRecordingCreatedTrigger,
grain_recording_updated: grainRecordingUpdatedTrigger,
grain_highlight_created: grainHighlightCreatedTrigger,