Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

Settings' messaging apps keep the workspace's settings out of the row menu

Simon Flackf5056604ef4c
diff --git a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/MessagingAppsCard.tsx b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/MessagingAppsCard.tsx
index f1b5e5f81..8d36d6a79 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/MessagingAppsCard.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/MessagingAppsCard.tsx
@@ -416,6 +416,7 @@ export const MessagingAppsCard = observer(function MessagingAppsCard({
}
showBundledSignIn={isManaged && bridge.type === 'mattermost'}
isAdmin={isAdmin}
+ personal={personal}
savingChannelCreation={savingBridgeId === bridge.id}
onToggleChannelCreation={(enabled) =>
void handleToggleChannelCreation(bridge, enabled)
@@ -516,6 +517,7 @@ export function MessagingAppRow({
olderLinks,
showBundledSignIn,
isAdmin,
+ personal = false,
savingChannelCreation,
onToggleChannelCreation,
onConnectChat,
@@ -539,6 +541,8 @@ export function MessagingAppRow({
olderLinks: { count: number; onRequireConfirmation: () => void } | null;
showBundledSignIn: boolean;
isAdmin: boolean;
+ /** Only your own side of the app, as Settings shows it: no workspace settings in the menu. */
+ personal?: boolean;
savingChannelCreation: boolean;
onToggleChannelCreation: (enabled: boolean) => void;
/** Set on a connection whose chats are connected one at a time, for a user
@@ -845,27 +849,30 @@ export function MessagingAppRow({
</>
)}
- <DropdownMenuSeparator />
- {/* "Off" and "this platform has no such thing" are different claims,
+ {!personal && (
+ <>
+ <DropdownMenuSeparator />
+ {/* "Off" and "this platform has no such thing" are different claims,
and an unticked box makes them look the same (CHOO-2137). A
platform that cannot do it at all gets a plain disabled line
saying so, never an unchecked box. */}
- {bridge.channelCreationSupported ? (
- <DropdownMenuCheckboxItem
- checked={bridge.canCreateChannels}
- disabled={!isAdmin || savingChannelCreation}
- onCheckedChange={(next) => onToggleChannelCreation(next)}
- >
- Create channels on {platform}
- </DropdownMenuCheckboxItem>
- ) : (
- <DropdownMenuItem disabled>Channels not supported on {platform}</DropdownMenuItem>
- )}
- {channelsLockedReason !== null && (
- <p className="px-2 py-1 text-xs text-foreground-muted">{channelsLockedReason}</p>
+ {bridge.channelCreationSupported ? (
+ <DropdownMenuCheckboxItem
+ checked={bridge.canCreateChannels}
+ disabled={!isAdmin || savingChannelCreation}
+ onCheckedChange={(next) => onToggleChannelCreation(next)}
+ >
+ Create channels on {platform}
+ </DropdownMenuCheckboxItem>
+ ) : (
+ <DropdownMenuItem disabled>Channels not supported on {platform}</DropdownMenuItem>
+ )}
+ {channelsLockedReason !== null && (
+ <p className="px-2 py-1 text-xs text-foreground-muted">{channelsLockedReason}</p>
+ )}
+ </>
)}
-
- {bridge.receivesWebhooks && (
+ {!personal && bridge.receivesWebhooks && (
<>
<DropdownMenuSeparator />
{/* The address the platform delivers this connection's events
diff --git a/console/apps/switch-console-desktop/src/renderer/tests/browser/messaging-app-row.test.tsx b/console/apps/switch-console-desktop/src/renderer/tests/browser/messaging-app-row.test.tsx
index 212f2e02f..48f33fe09 100644
--- a/console/apps/switch-console-desktop/src/renderer/tests/browser/messaging-app-row.test.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/tests/browser/messaging-app-row.test.tsx
@@ -116,6 +116,7 @@ function row(
onReleased?: () => void;
olderLinks?: { count: number; onRequireConfirmation: () => void } | null;
isAdmin?: boolean;
+ personal?: boolean;
onConnectChat?: (() => void) | null;
onDisconnect?: () => void;
} = {}
@@ -132,6 +133,7 @@ function row(
olderLinks={overrides.olderLinks ?? null}
showBundledSignIn={false}
isAdmin={overrides.isAdmin ?? false}
+ personal={overrides.personal ?? false}
savingChannelCreation={false}
onToggleChannelCreation={() => {}}
onConnectChat={overrides.onConnectChat ?? null}
@@ -406,6 +408,25 @@ describe('the row menu', () => {
expect(await openMenu(el)).not.toContain('Disconnect app…');
});
+ it('keeps the workspace’s settings out of Settings, where only your own account is shown', async () => {
+ const el = await render(
+ row({
+ personal: true,
+ identities: [IDENTITY],
+ bridge: bridge({
+ receivesWebhooks: true,
+ webhookUrl: 'https://switch.example/messaging/bridges/b-1/events',
+ }),
+ })
+ );
+
+ const items = await openMenu(el);
+ expect(items).toContain('Unlink @amaudruz.louis');
+ expect(items.some((item) => item.startsWith('Create channels'))).toBe(false);
+ expect(items).not.toContain('Copy webhook address');
+ expect(items).not.toContain('Disconnect app…');
+ });
+
it('opens on a platform that cannot create channels at all', async () => {
// Telegram. The explanation used to be a menu *label*, which Base UI
// requires to sit inside a group — so opening this menu threw and took the