Skip to content

Commit b16c567

Browse files
icecrasher321claude
andcommitted
feat(slack): loading-modal trigger config and loading_view_id output
Adds the 'Open loading modal' switch plus title/text inputs to the slack_oauth trigger (visible for block_actions; the ingest hook re-checks payload shape), and declares the loading_view_id output shared by both Slack triggers. buildProviderConfig copies subblock values generically, so no deploy changes. The legacy slack_webhook trigger is deliberately left without the option. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 85a76d5 commit b16c567

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

apps/sim/triggers/slack/oauth.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const INTERACTION_FILTER_EVENTS = slackEventsSupportingFilter('interaction')
2020
// Bot/own toggles gate UI visibility only (the route applies them unconditionally),
2121
// so they are not catalog `filters`.
2222
const BOT_FILTER_EVENTS = ['message', 'app_mention']
23+
// Loading-modal opt-in gates UI visibility only; the ingest hook re-checks payload shape.
24+
const LOADING_MODAL_EVENTS = ['block_actions']
2325
const OWN_MESSAGE_EVENTS = ['message', 'app_mention', 'reaction_added', 'reaction_removed']
2426

2527
/**
@@ -171,6 +173,45 @@ export const slackOAuthTrigger: TriggerConfig = {
171173
mode: 'trigger',
172174
condition: { field: 'eventType', value: INTERACTION_FILTER_EVENTS },
173175
},
176+
{
177+
id: 'openLoadingModal',
178+
title: 'Open loading modal',
179+
type: 'switch',
180+
defaultValue: false,
181+
description:
182+
'Immediately open a loading modal when the interaction arrives, before the workflow runs. Slack trigger IDs expire 3 seconds after the click, so opening a modal from inside the workflow is unreliable — update this one via its loading_view_id output instead.',
183+
required: false,
184+
mode: 'trigger',
185+
condition: { field: 'eventType', value: LOADING_MODAL_EVENTS },
186+
},
187+
{
188+
id: 'loadingModalTitle',
189+
title: 'Loading modal title',
190+
type: 'short-input',
191+
placeholder: 'Working on it',
192+
description: 'Title of the loading modal (max 24 characters).',
193+
required: false,
194+
mode: 'trigger',
195+
condition: {
196+
field: 'eventType',
197+
value: LOADING_MODAL_EVENTS,
198+
and: { field: 'openLoadingModal', value: true },
199+
},
200+
},
201+
{
202+
id: 'loadingModalText',
203+
title: 'Loading modal text',
204+
type: 'short-input',
205+
placeholder: 'This will just take a moment…',
206+
description: 'Body text shown in the loading modal.',
207+
required: false,
208+
mode: 'trigger',
209+
condition: {
210+
field: 'eventType',
211+
value: LOADING_MODAL_EVENTS,
212+
and: { field: 'openLoadingModal', value: true },
213+
},
214+
},
174215
{
175216
id: 'filterBotMessages',
176217
title: 'Ignore bot messages',

apps/sim/triggers/slack/shared.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ export const SLACK_TRIGGER_OUTPUTS: Record<string, TriggerOutput> = {
108108
description:
109109
'Short-lived trigger ID used to open a modal in response. Present for interactivity and slash commands',
110110
},
111+
loading_view_id: {
112+
type: 'string',
113+
description:
114+
'View ID of the loading modal opened at ingest when "Open loading modal" is enabled. Pass it to Slack Update View to replace the loading content — view IDs never expire, unlike the 3-second trigger_id. Empty when the option is off or the open failed',
115+
},
111116
callback_id: {
112117
type: 'string',
113118
description:

0 commit comments

Comments
 (0)