fix(dashboard): persist Discord toolsets to Discord platform

This commit is contained in:
Shannon Sands 2026-07-16 13:46:51 +10:00 committed by Teknium
parent c80b244b52
commit 3ffd8b3da0
6 changed files with 105 additions and 19 deletions

View file

@ -211,6 +211,7 @@ export function ToolsetConfigDrawer({ toolset, profile, onClose, onChanged }: Pr
};
const labelText = toolset.label?.trim() || toolset.name;
const platformText = toolset.platform_label?.trim() || toolset.platform;
return createPortal(
<div
@ -253,10 +254,12 @@ export function ToolsetConfigDrawer({ toolset, profile, onClose, onChanged }: Pr
checked={enabled}
onCheckedChange={(v) => void handleToggle(v)}
disabled={toggling}
aria-label="Enable toolset"
aria-label={`Enable toolset for ${platformText}`}
/>
<span className="text-xs text-muted-foreground">
{enabled ? "Enabled for the agent" : "Disabled"}
{enabled
? `Enabled for ${platformText}`
: `Disabled for ${platformText}`}
</span>
</div>
</header>

View file

@ -732,7 +732,7 @@ export const api = {
getToolsets: (profile?: string) =>
fetchJSON<ToolsetInfo[]>(`/api/tools/toolsets${profileQuery(profile)}`),
toggleToolset: (name: string, enabled: boolean, profile?: string) =>
fetchJSON<{ ok: boolean; name: string; enabled: boolean }>(
fetchJSON<{ ok: boolean; name: string; platform: string; enabled: boolean }>(
`/api/tools/toolsets/${encodeURIComponent(name)}`,
{
method: "PUT",
@ -2205,6 +2205,8 @@ export interface ToolsetInfo {
name: string;
label: string;
description: string;
platform: string;
platform_label: string;
enabled: boolean;
configured: boolean;
tools: string[];

View file

@ -201,7 +201,7 @@ export default function SkillsPage() {
/* ---- Refresh toolsets after a config change ---- */
const refreshToolsets = async () => {
try {
const tsets = await api.getToolsets();
const tsets = await api.getToolsets(selectedProfile || undefined);
setToolsets(tsets);
} catch {
/* non-fatal: the drawer already toasted on the failing write */