Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

feat(control-ui): explain the Slack credentials, the empty conversation list, and thread mentions

Jose Ramirez2091e62db41d
diff --git a/control-ui/app/communication-channels/[name]/edit/page.tsx b/control-ui/app/communication-channels/[name]/edit/page.tsx
index c59d8b978..98e7ad333 100644
--- a/control-ui/app/communication-channels/[name]/edit/page.tsx
+++ b/control-ui/app/communication-channels/[name]/edit/page.tsx
@@ -365,36 +365,47 @@ export default function EditCommunicationChannelPage() {
</p>
</div>
</div>
- <label className="cu-toggle-row">
- <input
- type="checkbox"
- checked={
- activeTab === 'telegram'
- ? draft.telegramReplyOnlyWhenMentioned
- : activeTab === 'slack'
- ? draft.slackReplyOnlyWhenMentioned
- : draft.teamsReplyOnlyWhenMentioned
- }
- disabled={saving}
- onChange={event =>
- setDraft(current =>
- current
- ? activeTab === 'telegram'
- ? {
- ...current,
- telegramReplyOnlyWhenMentioned: event.target.checked,
- }
- : activeTab === 'slack'
- ? { ...current, slackReplyOnlyWhenMentioned: event.target.checked }
- : { ...current, teamsReplyOnlyWhenMentioned: event.target.checked }
- : current
- )
- }
- />
- <span>
- Answer only when the {activeTab === 'slack' ? 'app' : 'bot'} is mentioned
- </span>
- </label>
+ <div className="cu-toggle-field">
+ <label className="cu-toggle-row">
+ <input
+ type="checkbox"
+ checked={
+ activeTab === 'telegram'
+ ? draft.telegramReplyOnlyWhenMentioned
+ : activeTab === 'slack'
+ ? draft.slackReplyOnlyWhenMentioned
+ : draft.teamsReplyOnlyWhenMentioned
+ }
+ disabled={saving}
+ onChange={event =>
+ setDraft(current =>
+ current
+ ? activeTab === 'telegram'
+ ? {
+ ...current,
+ telegramReplyOnlyWhenMentioned: event.target.checked,
+ }
+ : activeTab === 'slack'
+ ? { ...current, slackReplyOnlyWhenMentioned: event.target.checked }
+ : { ...current, teamsReplyOnlyWhenMentioned: event.target.checked }
+ : current
+ )
+ }
+ />
+ <span>
+ Answer only when the {activeTab === 'slack' ? 'app' : 'bot'} is mentioned
+ </span>
+ </label>
+ {activeTab === 'slack' ? (
+ // Operators assume a thread is an implicit mention. It is not:
+ // with "Reply in threads" on, the app answers in a thread and
+ // then drops every unmentioned follow-up posted there.
+ <p className="cu-field__hint cu-toggle-row__hint">
+ Replies inside a thread still require a mention: even in a thread the app
+ started, a follow-up that does not mention the app is ignored.
+ </p>
+ ) : null}
+ </div>
{activeTab === 'slack' ? (
<label className="cu-toggle-row">
<input
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.css
index f335cccb8..d72d00381 100644
--- a/control-ui/app/globals.css
+++ b/control-ui/app/globals.css
@@ -4637,6 +4637,10 @@ textarea.cu-input {
color: var(--cu-text-soft);
}
+.cu-channel-credentials__note {
+ margin: 0;
+}
+
.cu-channel-credentials__actions {
display: flex;
justify-content: flex-end;
@@ -9671,6 +9675,18 @@ textarea.cu-input {
accent-color: var(--cu-accent);
}
+/* A cu-toggle-row plus its note, kept together so the surrounding panel gap
+ does not separate the note from the control it explains. */
+.cu-toggle-field {
+ display: grid;
+ gap: var(--cu-space-1);
+}
+
+/* Indented past the checkbox so the note reads as that control's, not a new row. */
+.cu-toggle-row__hint {
+ margin: 0 0 0 calc(1rem + var(--cu-space-2));
+}
+
.cu-credential-field {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
diff --git a/control-ui/components/ChannelCredentialsPanel/index.tsx b/control-ui/components/ChannelCredentialsPanel/index.tsx
index b405bf6b4..f6a9879b2 100644
--- a/control-ui/components/ChannelCredentialsPanel/index.tsx
+++ b/control-ui/components/ChannelCredentialsPanel/index.tsx
@@ -19,6 +19,14 @@ const MASKED_VALUE = '**********'
/** Shown while `storedKeys` is unknown. Distinct from the per-field placeholder
* so a page load cannot flash "nothing stored" before the answer arrives. */
const PENDING_PLACEHOLDER = 'Checking stored credentials…'
+/**
+ * Slack offers four secrets and this platform uses two of them. The "app is
+ * ready" dialog puts the App-Level Token next to the bot token, and the Signing
+ * 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.
+ */
+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.'
/**
* Per-CommunicationChannel provider credential form.
@@ -339,6 +347,11 @@ export function ChannelCredentialsPanel({
</div>
)
})}
+ {fields.some(field => field.channelType === 'slack') ? (
+ <p className="cu-field__hint cu-channel-credentials__note">
+ {SLACK_CREDENTIAL_NOTE}
+ </p>
+ ) : null}
</div>
)}
</>
diff --git a/control-ui/components/CommunicationChannelConversations/index.tsx b/control-ui/components/CommunicationChannelConversations/index.tsx
index 2bcc391a5..6ddb416c2 100644
--- a/control-ui/components/CommunicationChannelConversations/index.tsx
+++ b/control-ui/components/CommunicationChannelConversations/index.tsx
@@ -48,9 +48,17 @@ function conversationKey(conversation: CommunicationChannelConversation, index:
].join(':')
}
+/**
+ * An empty list is the normal state of a channel that was just set up, and the
+ * step that fills it belongs to the end user, not the operator reading this
+ * page. Saying only "none confirmed" made a working channel read as broken.
+ */
+const EMPTY_CONVERSATIONS_LABEL =
+ 'No conversations confirmed yet. Each user links their own by sending the verify command from their profile page in the conversation they want to link.'
+
export function CommunicationChannelConversationsTable({
conversations,
- emptyLabel = 'No conversations have been confirmed yet.',
+ emptyLabel = EMPTY_CONVERSATIONS_LABEL,
onDelete,
showUserColumn = false,
userLabelsById = {},
diff --git a/control-ui/components/__tests__/ChannelCredentialsPanel.test.tsx b/control-ui/components/__tests__/ChannelCredentialsPanel.test.tsx
index 84280325a..f899fac68 100644
--- a/control-ui/components/__tests__/ChannelCredentialsPanel.test.tsx
+++ b/control-ui/components/__tests__/ChannelCredentialsPanel.test.tsx
@@ -293,3 +293,33 @@ describe('ChannelCredentialsPanel — per-key stored state', () => {
expect(signingSecret).not.toBeDisabled()
})
})
+
+/** 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.'
+
+describe('ChannelCredentialsPanel — Slack credential note', () => {
+ it('tells the operator which Slack values are NOT needed and where the Signing Secret is', () => {
+ // 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.
+ renderPanel({ ccName: 'cc-slack', visibleChannelTypes: ['slack'] })
+ expect(screen.getByText(SLACK_CREDENTIAL_NOTE)).toBeInTheDocument()
+ })
+
+ it('shows the Slack note on the create (pending) panel too', () => {
+ renderPanel({ ccName: 'cc-slack-new', pending: true, visibleChannelTypes: ['slack'] })
+ expect(screen.getByText(SLACK_CREDENTIAL_NOTE)).toBeInTheDocument()
+ })
+
+ it('does not show the Slack note on a panel with no Slack fields', () => {
+ renderPanel({ ccName: 'cc-tg', visibleChannelTypes: ['telegram'] })
+ expect(screen.queryByText(SLACK_CREDENTIAL_NOTE)).not.toBeInTheDocument()
+ })
+
+ it('does not show the Slack note when no provider is selected', () => {
+ renderPanel({ ccName: 'cc-empty', visibleChannelTypes: [] })
+ expect(screen.queryByText(SLACK_CREDENTIAL_NOTE)).not.toBeInTheDocument()
+ })
+})
diff --git a/control-ui/components/__tests__/EditCommunicationChannelPage.test.tsx b/control-ui/components/__tests__/EditCommunicationChannelPage.test.tsx
index fe6c5d3df..5088061f3 100644
--- a/control-ui/components/__tests__/EditCommunicationChannelPage.test.tsx
+++ b/control-ui/components/__tests__/EditCommunicationChannelPage.test.tsx
@@ -240,6 +240,44 @@ describe('EditCommunicationChannelPage channel credentials', () => {
})
})
+/** Both strings are written out rather than imported: this copy IS the feature,
+ * so a reworded page must fail here instead of quietly passing. */
+const EMPTY_CONVERSATIONS_COPY =
+ 'No conversations confirmed yet. Each user links their own by sending the verify command from their profile page in the conversation they want to link.'
+const THREAD_MENTION_COPY =
+ 'Replies inside a thread still require a mention: even in a thread the app started, a follow-up that does not mention the app is ignored.'
+
+describe('EditCommunicationChannelPage setup guidance', () => {
+ it('reads an empty conversation list as the next step, not a broken setup', async () => {
+ // A bare "No conversations have been confirmed yet." looks like the channel
+ // is broken. Only the end user can confirm one, and nothing on this page
+ // used to say so.
+ mockChannel('slack-channel', SLACK_CHANNEL_SPEC)
+ await renderLoadedPage()
+
+ expect(screen.getByText(EMPTY_CONVERSATIONS_COPY)).toBeInTheDocument()
+ })
+
+ it('warns that a thread does not exempt a follow-up from the mention rule', async () => {
+ // With "Reply in threads" on, the app answers inside a thread and then
+ // ignores every unmentioned follow-up there, which reads as the app
+ // breaking mid-conversation.
+ mockChannel('slack-channel', SLACK_CHANNEL_SPEC)
+ await renderLoadedPage()
+
+ expect(screen.getByText('Answer only when the app is mentioned')).toBeInTheDocument()
+ expect(screen.getByText(THREAD_MENTION_COPY)).toBeInTheDocument()
+ })
+
+ it('keeps the Slack thread warning off a Telegram channel', async () => {
+ mockChannel(LABELLED_TELEGRAM_CHANNEL, LABELLED_TELEGRAM_SPEC, STALE_SLACK_LABEL)
+ await renderLoadedPage()
+
+ expect(screen.getByText('Answer only when the bot is mentioned')).toBeInTheDocument()
+ expect(screen.queryByText(THREAD_MENTION_COPY)).not.toBeInTheDocument()
+ })
+})
+
describe('EditCommunicationChannelPage Slack app manifest', () => {
it('renders the manifest with both request URLs when the webhook is publicly reachable', async () => {
vi.stubEnv('NEXT_PUBLIC_WORKFLOW_APPROVAL_READER_BASE_URL', 'https://webhook.example.com')
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 84c97e1af..fabedfd53 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.402",
+ "version": "0.1.403",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.402",
+ "version": "0.1.403",
"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.json
index 7c16d87fa..8de9692d9 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.402",
+ "version": "0.1.403",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",