Skip to content

The agent that grows with you

fix(desktop): label the messaging platform enable switch

Adolana88dce6e2da9
diff --git a/apps/desktop/src/app/messaging/index.test.tsx b/apps/desktop/src/app/messaging/index.test.tsx
index d1511dac959..392064dd8b1 100644
--- a/apps/desktop/src/app/messaging/index.test.tsx
+++ b/apps/desktop/src/app/messaging/index.test.tsx
@@ -141,6 +141,17 @@ describe('MessagingView profile scope', () => {
})
})
+describe('MessagingView enable switch', () => {
+ it('labels the enable switch with the platform state', async () => {
+ getMessagingPlatforms.mockResolvedValue({ platforms: [platform({ enabled: true })] })
+
+ await renderMessaging()
+
+ const toggle = await screen.findByRole('switch', { name: 'Disable Microsoft Teams' })
+ expect(toggle.closest('label')?.textContent).toBe('Enabled')
+ })
+})
+
describe('MessagingView setup-guide link', () => {
it('hides the setup-guide button for a plugin platform with no docs URL', async () => {
// Teams (and other plugin platforms) ship an empty docs_url. Rendering an
diff --git a/apps/desktop/src/app/messaging/index.tsx b/apps/desktop/src/app/messaging/index.tsx
index c08d629ea40..f0a4086c23b 100644
--- a/apps/desktop/src/app/messaging/index.tsx
+++ b/apps/desktop/src/app/messaging/index.tsx
@@ -910,13 +910,16 @@ function PlatformActionBar({
return (
<>
- <Switch
- aria-label={platform.enabled ? m.disableAria(platform.name) : m.enableAria(platform.name)}
- checked={platform.enabled}
- disabled={saving === `enabled:${platform.id}`}
- onCheckedChange={onToggle}
- size="xs"
- />
+ <label className="flex cursor-pointer items-center gap-2 text-xs text-muted-foreground">
+ <Switch
+ aria-label={platform.enabled ? m.disableAria(platform.name) : m.enableAria(platform.name)}
+ checked={platform.enabled}
+ disabled={saving === `enabled:${platform.id}`}
+ onCheckedChange={onToggle}
+ size="xs"
+ />
+ {platform.enabled ? m.enabled : m.disabled}
+ </label>
<div className="ml-auto flex items-center gap-2">
{hasEdits && <span className="text-xs text-muted-foreground">{m.unsavedChanges}</span>}