Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
feat(control-ui): say where each Slack credential actually lives
Jose Ramirezb31aa297b876
diff --git a/control-ui/components/ChannelCredentialsPanel/constants.ts b/control-ui/components/ChannelCredentialsPanel/constants.tsindex def79d0c5..3e4fae521 100644--- a/control-ui/components/ChannelCredentialsPanel/constants.ts+++ b/control-ui/components/ChannelCredentialsPanel/constants.ts@@ -20,7 +20,11 @@ export const CHANNEL_CREDENTIAL_FIELDS: CredentialField[] = [key: 'slack-signing-secret',label: 'Slack Signing Secret',placeholder: 'signing secret',- helpText: 'Required for Slack Events and Interactivity signature verification.',+ // The one value operators cannot find. Slack never shows it during install,+ // so the dialog that hands over the bot token looks complete when it is not.+ // Naming the page beats describing what the secret does.+ helpText:+ 'In your Slack app: Basic Information → App Credentials → Signing Secret, then Show. It is not in the dialog shown after you install the app — that one only carries the bot token. Used to verify that Events and Interactivity requests really came from Slack.',},{channelType: 'slack',@@ -28,7 +32,7 @@ export const CHANNEL_CREDENTIAL_FIELDS: CredentialField[] = [label: 'Slack Bot User OAuth Token',placeholder: 'xoxb-…',helpText:- 'Required after the app is installed in the workspace. Used to read and send messages.',+ 'In your Slack app: OAuth & Permissions → Bot User OAuth Token, and it only exists once you have installed the app to the workspace. Starts xoxb-, not xapp-. Used to read and send messages.',},{channelType: 'teams',diff --git a/control-ui/components/ChannelCredentialsPanel/index.tsx b/control-ui/components/ChannelCredentialsPanel/index.tsxindex e54a3a3e8..2306e9fe1 100644--- a/control-ui/components/ChannelCredentialsPanel/index.tsx+++ b/control-ui/components/ChannelCredentialsPanel/index.tsx@@ -35,8 +35,13 @@ const STORED_KEYS_ERROR =* Secret is filed next to a Client Secret on a page the dialog never links to,* so both wrong values are the easy ones to grab.*/+/**+ * Only the "ignore these" half. Where each value lives now sits on the field that+ * asks for it, which is where someone hunting for it is actually looking -- this+ * note is a paragraph under both inputs and is easy to skip.+ */const SLACK_CREDENTIAL_NOTE =- 'You do not need the App-Level Token (xapp-) or the Client Secret. Slack hands out the xapp- token beside the xoxb- one, and the Signing Secret is not in that dialog at all: find it on Basic Information, under App Credentials.'+ 'You do not need the App-Level Token (xapp-) or the Client Secret. Slack offers the xapp- token right beside the xoxb- one, so it is easy to copy the wrong value.'/*** Per-CommunicationChannel provider credential form.diff --git a/control-ui/components/__tests__/ChannelCredentialsPanel.test.tsx b/control-ui/components/__tests__/ChannelCredentialsPanel.test.tsxindex 3540b6157..49d411488 100644--- a/control-ui/components/__tests__/ChannelCredentialsPanel.test.tsx+++ b/control-ui/components/__tests__/ChannelCredentialsPanel.test.tsx@@ -431,10 +431,10 @@ describe('ChannelCredentialsPanel — failed stored-key read', () => {/** The Slack note, written out rather than imported: this copy IS the feature,* so a reworded panel must fail here instead of quietly passing. */const SLACK_CREDENTIAL_NOTE =- 'You do not need the App-Level Token (xapp-) or the Client Secret. Slack hands out the xapp- token beside the xoxb- one, and the Signing Secret is not in that dialog at all: find it on Basic Information, under App Credentials.'+ 'You do not need the App-Level Token (xapp-) or the Client Secret. Slack offers the xapp- token right beside the xoxb- one, so it is easy to copy the wrong value.'describe('ChannelCredentialsPanel — Slack credential note', () => {- it('tells the operator which Slack values are NOT needed and where the Signing Secret is', () => {+ it('tells the operator which Slack values are NOT needed', () => {// Slack's "app is ready" dialog hands out xoxb- and xapp- side by side, and// the Signing Secret sits next to a Client Secret on another page entirely.// Without this note the operator pastes the wrong two values.@@ -457,3 +457,34 @@ describe('ChannelCredentialsPanel — Slack credential note', () => {expect(screen.queryByText(SLACK_CREDENTIAL_NOTE)).not.toBeInTheDocument()})})++describe('ChannelCredentialsPanel — where the Slack credentials live', () => {+ // Both Slack values are on different pages of the Slack app, and the signing+ // secret is the one people cannot find: it is absent from the "app is ready"+ // dialog that hands over the bot token, so the natural assumption is that the+ // dialog showed everything. Naming the page is the whole value of this hint --+ // asserting on the location, not the phrasing, so copy can be reworded freely.+ /** The hint rendered directly under a given credential input, not the panel note. */+ function hintFor(label: string): string {+ const input = screen.getByLabelText(label, { exact: true })+ const row = input.closest('.cu-field') ?? input.parentElement?.parentElement+ return row?.querySelector('.cu-field__hint')?.textContent ?? ''+ }++ it('names the Slack page holding the signing secret, on the field itself', () => {+ renderPanel({ ccName: 'cc-slack', visibleChannelTypes: ['slack'] })+ // Must be on the field, not only in the panel note below it: the note is a+ // paragraph people skip, and this is the value they cannot locate.+ expect(hintFor('Slack Signing Secret')).toMatch(/Basic Information/i)+ })++ it('warns the signing secret is absent from the post-install dialog', () => {+ renderPanel({ ccName: 'cc-slack', visibleChannelTypes: ['slack'] })+ expect(hintFor('Slack Signing Secret')).toMatch(/dialog|install/i)+ })++ it('names the Slack page holding the bot token, on the field itself', () => {+ renderPanel({ ccName: 'cc-slack', visibleChannelTypes: ['slack'] })+ expect(hintFor('Slack Bot User OAuth Token')).toMatch(/OAuth & Permissions/i)+ })+})diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex b7e9ac144..2c27cfbca 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.408",+ "version": "0.1.409","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.408",+ "version": "0.1.409","dependencies": {"@clerum/llm-providers": "file:../packages/llm-providers","@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",diff --git a/control-ui/package.json b/control-ui/package.jsonindex ada0c958f..558010d1b 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.408",+ "version": "0.1.409","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",