+ {!mcpQuery.isLoading && !mcpQuery.isError && !mcpQuery.data?.servers.length && !showEditor ? (
+
MCP servers let the agent call external tools over the Model Context
Protocol.
@@ -180,11 +182,7 @@ export function McpPage() {
{
- setSelectedName(null);
- setDraft(createDraft());
- setShowEditor(true);
- }}
+ onClick={openNewServer}
>
Add your first server
@@ -234,11 +232,7 @@ export function McpPage() {
{
- setSelectedName(null);
- setDraft(createDraft());
- setShowEditor(true);
- }}
+ onClick={openNewServer}
>
Add your first server
diff --git a/console/src/routes/scheduler.tsx b/console/src/routes/scheduler.tsx
index 465c2c8d..81188a2c 100644
--- a/console/src/routes/scheduler.tsx
+++ b/console/src/routes/scheduler.tsx
@@ -1018,15 +1018,12 @@ export function SchedulerPage() {
const toast = useToast();
const queryClient = useQueryClient();
const [selectedId, setSelectedId] = useState(() => {
- const requestedId =
- new URLSearchParams(window.location.search).get('jobId') || '';
- return requestedId.trim() || null;
+ const requestedId = new URLSearchParams(window.location.search).get('jobId')?.trim() ?? '';
+ return requestedId || null;
});
const [draft, setDraft] = useState(createDraft());
const [showEditor, setShowEditor] = useState(() => {
- const requestedId =
- new URLSearchParams(window.location.search).get('jobId') || '';
- return Boolean(requestedId.trim());
+ return Boolean(new URLSearchParams(window.location.search).get('jobId')?.trim());
});
const schedulerQuery = useQuery({
@@ -1154,6 +1151,12 @@ export function SchedulerPage() {
window.history.replaceState({}, '', currentUrl.toString());
}, [selectedId]);
+ const openNewJob = () => {
+ setSelectedId(null);
+ setDraft(createDraft());
+ setShowEditor(true);
+ };
+
return (
{
- setSelectedId(null);
- setDraft(createDraft());
- setShowEditor(true);
- }}
+ onClick={openNewJob}
>
New job
@@ -1220,11 +1219,7 @@ export function SchedulerPage() {
{
- setSelectedId(null);
- setDraft(createDraft());
- setShowEditor(true);
- }}
+ onClick={openNewJob}
>
New job
diff --git a/console/src/styles.css b/console/src/styles.css
index 1c99a650..4d004398 100644
--- a/console/src/styles.css
+++ b/console/src/styles.css
@@ -1882,7 +1882,7 @@ th {
background: var(--jobs-empty);
}
-.jobs-board-empty {
+.page-empty {
display: flex;
flex-direction: column;
align-items: center;
@@ -1892,7 +1892,7 @@ th {
color: var(--muted-foreground);
}
-.jobs-board-empty p {
+.page-empty p {
margin: 0;
max-width: 300px;
}
From 5e3b07c44154d387bb22bfe8b8bbf93c727c0ec3 Mon Sep 17 00:00:00 2001
From: Maximilian Noller
Date: Mon, 13 Apr 2026 03:21:46 +0200
Subject: [PATCH 4/4] fix(console): fix three code review issues
- describeDiscord: replace ineffective `?? false` with explicit `config.discord ? ... : false`
guard so enabled=false (not true) when discord config section is absent
- describeWhatsApp: same fix; without it a linked-but-unconfigured device
showed as active with "groups undefined" in the summary
- mcp.tsx: call setShowEditor(false) in deleteMutation.onSuccess so deleting
the last server collapses back to the full-page empty state
---
console/src/routes/channels-catalog.ts | 14 +-
console/src/routes/mcp.tsx | 403 +++++++++++++------------
2 files changed, 212 insertions(+), 205 deletions(-)
diff --git a/console/src/routes/channels-catalog.ts b/console/src/routes/channels-catalog.ts
index 135b2607..fc8af1a2 100644
--- a/console/src/routes/channels-catalog.ts
+++ b/console/src/routes/channels-catalog.ts
@@ -61,10 +61,9 @@ function describeDiscord(
): ChannelCatalogItem {
const guildCount = countDiscordGuilds(config);
const overrideCount = countDiscordOverrides(config);
- const enabled =
- (config.discord?.commandsOnly ||
- config.discord?.groupPolicy !== 'disabled') ??
- false;
+ const enabled = config.discord
+ ? config.discord.commandsOnly || config.discord.groupPolicy !== 'disabled'
+ : false;
const tokenConfigured = options.discordTokenConfigured === true;
const active = enabled && tokenConfigured;
const configured =
@@ -96,9 +95,10 @@ function describeWhatsApp(
options: ChannelCatalogOptions,
): ChannelCatalogItem {
const linked = options.whatsappLinked === true;
- const enabled =
- config.whatsapp?.dmPolicy !== 'disabled' ||
- config.whatsapp?.groupPolicy !== 'disabled';
+ const enabled = config.whatsapp
+ ? config.whatsapp.dmPolicy !== 'disabled' ||
+ config.whatsapp.groupPolicy !== 'disabled'
+ : false;
const summary = linked
? enabled
? `Linked device · groups ${config.whatsapp?.groupPolicy}`
diff --git a/console/src/routes/mcp.tsx b/console/src/routes/mcp.tsx
index 4e1b4a62..90bc420a 100644
--- a/console/src/routes/mcp.tsx
+++ b/console/src/routes/mcp.tsx
@@ -136,6 +136,7 @@ export function McpPage() {
queryClient.setQueryData(['mcp', auth.token], payload);
setSelectedName(null);
setDraft(createDraft());
+ setShowEditor(false);
toast.success('MCP server deleted.');
},
onError: (error) => {
@@ -173,7 +174,10 @@ export function McpPage() {
}
/>
- {!mcpQuery.isLoading && !mcpQuery.isError && !mcpQuery.data?.servers.length && !showEditor ? (
+ {!mcpQuery.isLoading &&
+ !mcpQuery.isError &&
+ !mcpQuery.data?.servers.length &&
+ !showEditor ? (
MCP servers let the agent call external tools over the Model Context
@@ -188,228 +192,231 @@ export function McpPage() {
) : (
-
-
- {mcpQuery.isLoading ? (
- Loading MCP servers...
- ) : mcpQuery.data?.servers.length ? (
-
- {mcpQuery.data.servers.map((server) => (
+
+
+ {mcpQuery.isLoading ? (
+ Loading MCP servers...
+ ) : mcpQuery.data?.servers.length ? (
+
+ {mcpQuery.data.servers.map((server) => (
+
{
+ setSelectedName(server.name);
+ setShowEditor(true);
+ }}
+ >
+
+ {server.name}
+ {server.summary}
+
+
+
+ ))}
+
+ ) : (
+
+
+ MCP servers let the agent call external tools over the Model
+ Context Protocol.
+
{
- setSelectedName(server.name);
- setShowEditor(true);
- }}
+ onClick={openNewServer}
>
-
- {server.name}
- {server.summary}
-
-
+ Add your first server
- ))}
-
- ) : (
-
-
- MCP servers let the agent call external tools over the Model
- Context Protocol.
-
-
- Add your first server
-
-
- )}
-
-
- {showEditor ? (
-
-
-
-
- Name
-
- setDraft((current) => ({
- ...current,
- name: event.target.value,
- }))
- }
- placeholder="github"
- />
-
-
- Transport
-
- setDraft((current) => ({
- ...current,
- transport: event.target.value as McpDraft['transport'],
- }))
- }
- >
- stdio
- http
- sse
-
-
-
-
-
- setDraft((current) => ({
- ...current,
- enabled,
- }))
- }
- />
+
+ )}
+
- {draft.transport === 'stdio' ? (
- <>
-
- Command
-
- setDraft((current) => ({
- ...current,
- command: event.target.value,
- }))
- }
- placeholder="docker"
- />
-
+ {showEditor ? (
+
+
- Arguments
-
- Working directory
- Transport
+
setDraft((current) => ({
...current,
- cwd: event.target.value,
+ transport: event.target
+ .value as McpDraft['transport'],
}))
}
- placeholder="/workspace"
- />
+ >
+ stdio
+ http
+ sse
+
-
- Environment JSON
-
- >
- ) : (
- <>
-
- URL
-
- setDraft((current) => ({
- ...current,
- url: event.target.value,
- }))
- }
- placeholder="https://example.test/mcp"
- />
-
-
- Headers JSON
-
- >
- )}
-
- saveMutation.mutate()}
- >
- {saveMutation.isPending ? 'Saving...' : 'Save server'}
-
- {selectedServer ? (
- deleteMutation.mutate()}
- >
- {deleteMutation.isPending ? 'Deleting...' : 'Delete server'}
-
- ) : null}
-
+
+ setDraft((current) => ({
+ ...current,
+ enabled,
+ }))
+ }
+ />
- {selectedServer ? (
-
-
Summary
-
{selectedServer.summary}
+ {draft.transport === 'stdio' ? (
+ <>
+
+ Command
+
+ setDraft((current) => ({
+ ...current,
+ command: event.target.value,
+ }))
+ }
+ placeholder="docker"
+ />
+
+
+
+ Arguments
+
+
+ Working directory
+
+ setDraft((current) => ({
+ ...current,
+ cwd: event.target.value,
+ }))
+ }
+ placeholder="/workspace"
+ />
+
+
+
+ Environment JSON
+
+ >
+ ) : (
+ <>
+
+ URL
+
+ setDraft((current) => ({
+ ...current,
+ url: event.target.value,
+ }))
+ }
+ placeholder="https://example.test/mcp"
+ />
+
+
+ Headers JSON
+
+ >
+ )}
+
+
+ saveMutation.mutate()}
+ >
+ {saveMutation.isPending ? 'Saving...' : 'Save server'}
+
+ {selectedServer ? (
+ deleteMutation.mutate()}
+ >
+ {deleteMutation.isPending
+ ? 'Deleting...'
+ : 'Delete server'}
+
+ ) : null}
+
+
+ {selectedServer ? (
+
+
Summary
+
{selectedServer.summary}
+
+ ) : null}
- ) : null}
-
-
- ) : null}
-
+
+ ) : null}
+
)}
);