Skip to content

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

fix(console): match switch-buddy's welcome to the agent page without tabs (#923)

Louis Amaudruza4f556039989
diff --git a/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/buddy-welcome-message.ts b/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/buddy-welcome-message.ts
index d84619068..8c6a52471 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/buddy-welcome-message.ts
+++ b/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/buddy-welcome-message.ts
@@ -26,7 +26,7 @@ export function buddyWelcomeMessage({
'Some tips:',
'',
'**👫 If you want your team to talk to me**',
- '- In my Settings tab, set “Who can talk to this agent” to “Anyone”.',
+ '- In my Agent settings, set “Who can talk to your agent” to “Anyone”.',
'- Then invite your team members to the channel I’m in.',
'',
'**➕ If you want to add me to another channel**',
diff --git a/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/buddy-welcome.tsx b/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/buddy-welcome.tsx
index 6ece16c47..880a413a2 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/buddy-welcome.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/buddy-welcome.tsx
@@ -16,9 +16,14 @@ export function BuddyWelcome({
}) {
return (
<div className="flex gap-3" data-testid="buddy-welcome">
- <BuddyAvatar size={28} shape="round" className="mt-0.5" />
- <div className="min-w-0 flex-1 text-sm leading-relaxed">
- <ChatMarkdown>{buddyWelcomeMessage({ firstName, agentName })}</ChatMarkdown>
+ <BuddyAvatar size={28} shape="round" className="self-start" />
+ <div className="flex min-w-0 flex-1 flex-col">
+ <span className="mb-1 text-xs leading-4 font-semibold text-foreground-muted">
+ {agentName}
+ </span>
+ <div className="text-sm leading-relaxed">
+ <ChatMarkdown>{buddyWelcomeMessage({ firstName, agentName })}</ChatMarkdown>
+ </div>
</div>
</div>
);
diff --git a/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/switch-buddy-view.tsx b/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/switch-buddy-view.tsx
index ea696d105..00f08a212 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/switch-buddy-view.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/switch-buddy-view.tsx
@@ -1,4 +1,4 @@
-import { MessageSquare } from 'lucide-react';
+import { ChevronDown, MessageSquare } from 'lucide-react';
import { observer } from 'mobx-react-lite';
import { type ReactNode, useEffect } from 'react';
import type { GuardResult, ViewDefinition } from '@renderer/app/view-registry';
@@ -10,7 +10,6 @@ import { Titlebar } from '@renderer/lib/components/titlebar/Titlebar';
import { TitlebarBreadcrumb } from '@renderer/lib/components/titlebar/titlebar-breadcrumb';
import { useParams } from '@renderer/lib/layout/navigation-provider';
import { showModal } from '@renderer/lib/modal/modal-provider';
-import { SegmentedControl } from '@renderer/lib/ui/segmented-control';
import { BuddyAvatar } from './buddy-avatar';
import { expectedBuddyName, firstNameOf, isBuddy } from './buddy-identity';
import { reportBuddyStep } from './buddy-telemetry';
@@ -19,37 +18,27 @@ import { BUDDY_CHAT_NAME, openBuddyChat } from './open-buddy';
type SwitchBuddyParams = { serverId: string };
-const TABS = [{ value: 'chats', label: 'Chats' }] as const;
-
-/** The agent page's title bar, for an agent that has only its Chats tab so far. */
+/** The agent page's title bar, as it will be with the Welcome chat open. */
const SwitchBuddyTitlebar = observer(function SwitchBuddyTitlebar() {
const { params } = useParams('switchBuddy');
const user = switchServersStore.statusFor(params.serverId)?.user ?? null;
return (
<Titlebar
- className="border-b border-border"
- leftClassName="w-[300px] shrink-0 self-stretch border-r border-border"
+ className="border-b border-border pr-[7px]"
+ leftClassName="w-[300px] shrink-0 self-stretch border-r border-border [-webkit-app-region:drag]"
leftSlot={
- <div className="flex min-w-0 items-center gap-3">
- <TitlebarBreadcrumb
- crumbs={[
- {
- key: 'agent',
- icon: <BuddyAvatar size={16} shape="round" />,
- label: expectedBuddyName(user),
- maxWidthClassName: 'max-w-40',
- },
- ]}
- />
- <SegmentedControl
- value="chats"
- onChange={() => {}}
- options={TABS}
- ariaLabel="Agent view"
- />
- </div>
+ <TitlebarBreadcrumb
+ crumbs={[
+ {
+ key: 'agent',
+ icon: <BuddyAvatar size={16} shape="round" />,
+ label: expectedBuddyName(user),
+ maxWidthClassName: 'max-w-none',
+ },
+ ]}
+ />
}
- rightClassName="min-w-0 flex-1 justify-between gap-3 pl-4"
+ rightClassName="min-w-0 flex-1 justify-between gap-3 pl-4 [-webkit-app-region:drag]"
rightSlot={<span className="truncate text-sm font-medium">{BUDDY_CHAT_NAME}</span>}
/>
);
@@ -58,7 +47,10 @@ const SwitchBuddyTitlebar = observer(function SwitchBuddyTitlebar() {
function Section({ title, children }: { title: string; children: ReactNode }) {
return (
<section aria-label={title} className="flex flex-col gap-[2px] pb-3">
- <p className="px-1 pb-1 text-xs font-medium text-foreground-muted">{title}</p>
+ <p className="flex items-center gap-1 pb-1 text-xs font-medium text-foreground-muted">
+ <ChevronDown className="size-3.5" />
+ {title}
+ </p>
{children}
</section>
);
diff --git a/core/switch_core/official_templates/switch-buddy/AGENT.md b/core/switch_core/official_templates/switch-buddy/AGENT.md
index 7cf13dcca..136eb939d 100644
--- a/core/switch_core/official_templates/switch-buddy/AGENT.md
+++ b/core/switch_core/official_templates/switch-buddy/AGENT.md
@@ -197,7 +197,7 @@ link [Connectors](switchdash://open/connections) to connect it. Once it's
plain words (which agent, which service, read or write) and wait for a yes to
that question. A request made earlier in the chat is not a yes.
For a service that needs their choice, such as which GitHub repositories, link
-the agent's Connections tab instead:
+the agent's Connections instead:
`switchdash://open/agent/<agent-id>?tab=connections`.
**Which server they're on** changes the advice:
@@ -253,8 +253,8 @@ Where each kind of answer comes from:
Things people ask for that you should know:
- **"I want my team to talk to you" / to another agent.** A new agent answers only its
- owner. The setting is "Who can talk to this agent", in the agent's settings in Switch
- Console; "Anyone" admits anyone in the rooms the agent is in. You can change it for an
+ owner. The setting is "Who can talk to your agent", in the agent's Agent settings in
+ Switch Console; "Anyone" admits anyone in the rooms the agent is in. You can change it for an
agent with `update_agent_detail` once they say so. Warn them: a person whose chat account
is not linked to Switch is not recognised, and the agent will not answer them.
- **"Put you (or an agent) in a channel."** In a channel bridged to Switch, typing