import { CHAT_FIRST_MODE_CHANGED_EVENT, readChatFirstModeState, writeChatFirstMode, } from "@agent-native/core/client/agent-chat"; import { ChangelogSettingsCard } from "@agent-native/core/client/changelog"; import { LanguagePicker, useT } from "@agent-native/core/client/i18n"; import { TeamPage } from "@agent-native/core/client/org"; import { SettingsTabsPage, useAgentSettingsTabs, } from "@agent-native/core/client/settings"; import { IconShield } from "@tabler/icons-react"; import { useState } from "react"; import { Link } from "react-router"; import changelog from "../../../CHANGELOG.md?raw"; import { DispatchShell } from "../../components/dispatch-shell"; import { Button } from "../../components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "../../components/ui/card"; import { Label } from "../../components/ui/label"; import { Switch } from "../../components/ui/switch"; import { dispatchAccessDescriptor } from "../../shared/app-roles.js"; export function meta() { return [{ title: "Settings - Dispatch" }]; } export default function SettingsRoute() { const t = useT(); const agentSettingsTabs = useAgentSettingsTabs({ usageAppId: "dispatch", usageViewAllHref: "/admin/metrics", organizationContent: (
), }); const settingsTabs = [ ...agentSettingsTabs.filter((tab) => tab.id !== "integrations"), { id: "admin", label: t("dispatch.nav.admin", { defaultValue: "Admin" }), icon: IconShield, group: "Admin", href: "/admin", content: null, }, ]; const [chatFirstModeState] = useState(() => readChatFirstModeState()); const [chatFirstMode, setChatFirstMode] = useState( () => chatFirstModeState.enabled, ); const [chatFirstStorageNotice, setChatFirstStorageNotice] = useState< string | null >( chatFirstModeState.availability === "unavailable" ? "This browser is not allowing local preferences, so Chat-first mode cannot be persisted." : null, ); function updateChatFirstMode(enabled: boolean) { const result = writeChatFirstMode(enabled); if (!result.ok) { setChatFirstStorageNotice( "This browser blocked local preferences, so Chat-first mode was not changed.", ); return; } setChatFirstStorageNotice(null); setChatFirstMode(enabled); window.dispatchEvent( new CustomEvent(CHAT_FIRST_MODE_CHANGED_EVENT, { detail: { enabled }, }), ); } return ( {t("settings.languageTitle")} {t("settings.languageDescription")} Chat-first workspace Keep chats at the center and open workspace apps in a contextual pane beside them.

This preference only changes your local Dispatch shell.

Session watch and follow-up messaging work in this browser pane too. Local CLI subscription detection stays in the Electron app; Dispatch uses workspace/provider credentials.

{chatFirstStorageNotice ? (

{chatFirstStorageNotice}

) : null}
{t("settings.workspaceTitle")} {t("settings.workspaceDescription")} {t("settings.deliveryTitle")} {t("settings.deliveryDescription")} } whatsNew={
} />
); }