diff --git a/nanobot/channels/dingtalk/webui/index.ts b/nanobot/channels/dingtalk/webui/index.ts index 0c4bb8f5d..593f65b2e 100644 --- a/nanobot/channels/dingtalk/webui/index.ts +++ b/nanobot/channels/dingtalk/webui/index.ts @@ -3,7 +3,6 @@ import { chatAppGuideUrl } from "@/channel-plugins/catalog"; export default { presentation: { - logoUrl: "https://img.alicdn.com/imgextra/i3/O1CN01WMvMRG1ks3Ixc9x1v_!!6000000004738-55-tps-32-32.svg", displayName: "DingTalk", initials: "DT", color: "#1677FF", diff --git a/nanobot/channels/discord/webui/index.ts b/nanobot/channels/discord/webui/index.ts index 0fa87d0bd..66328bf09 100644 --- a/nanobot/channels/discord/webui/index.ts +++ b/nanobot/channels/discord/webui/index.ts @@ -3,7 +3,7 @@ import { chatAppGuideUrl } from "@/channel-plugins/catalog"; export default { presentation: { - logoUrl: "https://discord.com/favicon.ico", + logoUrl: "/brand/channels/discord.svg", displayName: "Discord", initials: "DC", color: "#5865F2", diff --git a/nanobot/channels/feishu/webui/index.tsx b/nanobot/channels/feishu/webui/index.tsx index 0243c58c5..e9ec26f40 100644 --- a/nanobot/channels/feishu/webui/index.tsx +++ b/nanobot/channels/feishu/webui/index.tsx @@ -18,8 +18,6 @@ export default { }, }, presentation: { - logoUrl: "https://www.larksuite.com/favicon.ico", - logoLayout: "tile", displayName: "Feishu", initials: "FS", color: "#3370FF", diff --git a/nanobot/channels/linear/webui/index.tsx b/nanobot/channels/linear/webui/index.tsx index 86b41a419..a3ea5d5d6 100644 --- a/nanobot/channels/linear/webui/index.tsx +++ b/nanobot/channels/linear/webui/index.tsx @@ -18,8 +18,7 @@ export default { displayName: "Linear", initials: "LI", color: "#5E6AD2", - logoUrl: "https://linear.app/favicon.ico", - logoLayout: "tile", + logoUrl: "/brand/channels/linear.svg", setup: { mode: "connect", docsUrl: chatAppGuideUrl("linear"), diff --git a/nanobot/channels/matrix/webui/index.ts b/nanobot/channels/matrix/webui/index.ts index e7ef2d271..f8c91c39d 100644 --- a/nanobot/channels/matrix/webui/index.ts +++ b/nanobot/channels/matrix/webui/index.ts @@ -3,7 +3,7 @@ import { chatAppGuideUrl } from "@/channel-plugins/catalog"; export default { presentation: { - logoUrl: "https://matrix.org/favicon.ico", + logoUrl: "/brand/channels/matrix.svg", displayName: "Matrix", initials: "MX", color: "#0DBD8B", diff --git a/nanobot/channels/mattermost/webui/index.ts b/nanobot/channels/mattermost/webui/index.ts index 459b69c86..9a9c66765 100644 --- a/nanobot/channels/mattermost/webui/index.ts +++ b/nanobot/channels/mattermost/webui/index.ts @@ -3,7 +3,7 @@ import { chatAppGuideUrl } from "@/channel-plugins/catalog"; export default { presentation: { - logoUrl: "https://mattermost.com/favicon.ico", + logoUrl: "/brand/channels/mattermost.svg", displayName: "Mattermost", initials: "MM", color: "#1C58D9", diff --git a/nanobot/channels/mochat/webui/index.ts b/nanobot/channels/mochat/webui/index.ts index 363a02cb9..e743f1bef 100644 --- a/nanobot/channels/mochat/webui/index.ts +++ b/nanobot/channels/mochat/webui/index.ts @@ -3,7 +3,6 @@ import { chatAppGuideUrl } from "@/channel-plugins/catalog"; export default { presentation: { - logoUrl: "https://mochat.io/favicon.ico", displayName: "MoChat", initials: "MC", color: "#111827", diff --git a/nanobot/channels/msteams/webui/index.ts b/nanobot/channels/msteams/webui/index.ts index a1dfc5b55..b2f270d61 100644 --- a/nanobot/channels/msteams/webui/index.ts +++ b/nanobot/channels/msteams/webui/index.ts @@ -3,7 +3,6 @@ import { chatAppGuideUrl } from "@/channel-plugins/catalog"; export default { presentation: { - logoUrl: "https://teams.public.onecdn.static.microsoft/evergreen-assets/icons/microsoft_teams_logo_refresh_v2025.ico", displayName: "Microsoft Teams", initials: "MS", color: "#6264A7", diff --git a/nanobot/channels/napcat/webui/index.ts b/nanobot/channels/napcat/webui/index.ts index 53e5b0024..415a20492 100644 --- a/nanobot/channels/napcat/webui/index.ts +++ b/nanobot/channels/napcat/webui/index.ts @@ -3,7 +3,6 @@ import { chatAppGuideUrl } from "@/channel-plugins/catalog"; export default { presentation: { - logoUrl: "https://napneko.github.io/assets/newnewlogo.png", displayName: "NapCat", initials: "NC", color: "#F97316", diff --git a/nanobot/channels/qq/webui/index.tsx b/nanobot/channels/qq/webui/index.tsx index 8e221a16e..a65ac2c2b 100644 --- a/nanobot/channels/qq/webui/index.tsx +++ b/nanobot/channels/qq/webui/index.tsx @@ -11,8 +11,7 @@ export default { ConnectFlow: QQConnectFlow, canConnectBeforeConfigured: true, presentation: { - logoUrl: "https://static-res.qq.com/static-res/imqq/qq-logo.png", - logoFallbackUrl: "https://im.qq.com/favicon.ico", + logoUrl: "/brand/channels/qq.svg", displayName: "QQ", initials: "QQ", color: "#12B7F5", diff --git a/nanobot/channels/signal/webui/index.ts b/nanobot/channels/signal/webui/index.ts index a2d40a562..6b1fdc1be 100644 --- a/nanobot/channels/signal/webui/index.ts +++ b/nanobot/channels/signal/webui/index.ts @@ -3,7 +3,7 @@ import { chatAppGuideUrl } from "@/channel-plugins/catalog"; export default { presentation: { - logoUrl: "https://signal.org/favicon.ico", + logoUrl: "/brand/channels/signal.svg", displayName: "Signal", initials: "SG", color: "#3A76F0", diff --git a/nanobot/channels/slack/webui/index.ts b/nanobot/channels/slack/webui/index.ts index c60a819bd..cf410d27a 100644 --- a/nanobot/channels/slack/webui/index.ts +++ b/nanobot/channels/slack/webui/index.ts @@ -40,7 +40,6 @@ settings: export default { presentation: { - logoUrl: "https://slack.com/favicon.ico", displayName: "Slack", initials: "SL", color: "#4A154B", diff --git a/nanobot/channels/telegram/webui/index.ts b/nanobot/channels/telegram/webui/index.ts index 0da0429c1..2f7186497 100644 --- a/nanobot/channels/telegram/webui/index.ts +++ b/nanobot/channels/telegram/webui/index.ts @@ -3,7 +3,7 @@ import { chatAppGuideUrl } from "@/channel-plugins/catalog"; export default { presentation: { - logoUrl: "https://telegram.org/favicon.ico", + logoUrl: "/brand/channels/telegram.svg", displayName: "Telegram", initials: "TG", color: "#229ED9", diff --git a/nanobot/channels/wecom/webui/index.ts b/nanobot/channels/wecom/webui/index.ts index 099406f77..364a2b157 100644 --- a/nanobot/channels/wecom/webui/index.ts +++ b/nanobot/channels/wecom/webui/index.ts @@ -3,7 +3,6 @@ import { chatAppGuideUrl } from "@/channel-plugins/catalog"; export default { presentation: { - logoUrl: "https://work.weixin.qq.com/favicon.ico", displayName: "WeCom", initials: "WC", color: "#2F7DFF", diff --git a/nanobot/channels/weixin/webui/index.tsx b/nanobot/channels/weixin/webui/index.tsx index 415f3910e..e05b2d6b4 100644 --- a/nanobot/channels/weixin/webui/index.tsx +++ b/nanobot/channels/weixin/webui/index.tsx @@ -25,7 +25,7 @@ export default { wechat: {}, }, presentation: { - logoUrl: "https://weixin.qq.com/favicon.ico", + logoUrl: "/brand/channels/wechat.svg", displayName: "WeChat", initials: "WX", color: "#07C160", diff --git a/nanobot/channels/whatsapp/webui/index.tsx b/nanobot/channels/whatsapp/webui/index.tsx index d965f4255..5006dc30e 100644 --- a/nanobot/channels/whatsapp/webui/index.tsx +++ b/nanobot/channels/whatsapp/webui/index.tsx @@ -7,7 +7,7 @@ import { WhatsAppConnectFlow } from "./WhatsAppConnectFlow"; export default { presentation: { - logoUrl: "https://static.whatsapp.net/rsrc.php/y1/r/FJbTMJqMap7.svg", + logoUrl: "/brand/channels/whatsapp.svg", displayName: "WhatsApp", initials: "WA", color: "#25D366", diff --git a/nanobot/channels/whatsapp_agent/webui/index.ts b/nanobot/channels/whatsapp_agent/webui/index.ts index 4b9bcd9eb..32f775346 100644 --- a/nanobot/channels/whatsapp_agent/webui/index.ts +++ b/nanobot/channels/whatsapp_agent/webui/index.ts @@ -5,7 +5,7 @@ import { chatAppGuideUrl } from "@/channel-plugins/catalog"; export default { presentation: { - logoUrl: "https://static.whatsapp.net/rsrc.php/y1/r/FJbTMJqMap7.svg", + logoUrl: "/brand/channels/whatsapp.svg", displayName: "WhatsApp Agent Platform", initials: "WA", color: "#25D366", diff --git a/webui/COMPONENTS.md b/webui/COMPONENTS.md index fad90463b..9b1615ab9 100644 --- a/webui/COMPONENTS.md +++ b/webui/COMPONENTS.md @@ -29,6 +29,8 @@ Every channel registration has a preview. Channels with shared configuration for Channel fixture fields, defaults, and requirements come from the Python channel setup contracts. Regenerate `src/dev/gallery/channel-fixtures.ts` with `python webui/src/dev/gallery/generate_channel_fixtures.py` from the repository root after changing those contracts; add `--check` to verify the snapshot. This developer command loads channel descriptors without starting a gateway. Running the gallery uses the committed snapshot and requires no Python process. +Bundled channel marks in `public/brand/channels/` use the SVG paths and brand colors from [Simple Icons v16.38.0](https://github.com/simple-icons/simple-icons/tree/16.38.0) ([CC0](https://github.com/simple-icons/simple-icons/blob/16.38.0/LICENSE.md); trademarks belong to their respective owners). Channel packages select a bundled mark or keep their built-in icon or initials. Channel branding does not fetch remote favicons; account avatars supplied by a connected service are separate. + ## Where components belong | Location | Ownership | Examples | diff --git a/webui/browser/apps-fixture.tsx b/webui/browser/apps-fixture.tsx index 084560db0..bcc0a0f40 100644 --- a/webui/browser/apps-fixture.tsx +++ b/webui/browser/apps-fixture.tsx @@ -45,7 +45,7 @@ export function AppsFixture() { return
{}; const names = ["Search documentation", "Read repository", "List projects", "Inspect changes", "Review results", "Write notes"]; @@ -24,6 +26,9 @@ const preset: McpPresetInfo = { export function SkeletonFixture({ surface, loading }: { surface: string; loading: boolean }) { useReadingTypography(); + const { t } = useTranslation(); + const [query, setQuery] = useState(""); + const [provider, setProvider] = useState("all"); const [model, setModel] = useState(""); const [previewLoading, setPreviewLoading] = useState(loading); const feature: NanobotFeatureInfo = { @@ -42,7 +47,7 @@ export function SkeletonFixture({ surface, loading }: { surface: string; loading available: false, status: "not_installed", skill_installed: false, })) : [], installed_count: 0 }} mcpPresets={loading ? null : { presets: names.map((name, index) => ({ ...preset, name: `docs-${index}`, display_name: name })), installed_count: 6 }} - cliAppsLoading={loading} mcpPresetsLoading={loading} query="" filter={surface === "cli" ? "cli" : "mcp"} + cliAppsLoading={loading} mcpPresetsLoading={loading} query="" filter={{ kind: surface === "cli" ? "cli" : "mcp", status: "all" }} cliActionKey={null} mcpActionKey={null} mcpOAuthFlow={null} mcpOAuthPopupBlocked={false} mcpOAuthCallbackUrl="" mcpOAuthCompleting={false} mcpOAuthCallbackError={null} cliMessage={null} cliError={null} cliFocusName={null} mcpMessage={null} mcpError={null} @@ -53,13 +58,21 @@ export function SkeletonFixture({ surface, loading }: { surface: string; loading onMcpOAuthCallbackUrlChange={noop} onMcpOAuthComplete={noop} onDismissStatus={noop} onBackToChat={noop} onMcpFieldChange={noop} onCustomMcpFormChange={noop} onMcpConfigImportChange={noop} onSaveCustomMcp={noop} onImportMcpConfig={noop} onMcpToolsChange={noop} - /> : surface === "channels" ? ({ ...feature, name: `channel-${index}`, display_name: name })), enabled_count: 6, requires_restart: false }} - loading={loading} actionKey={null} showBrandLogos={false} error={null} requiresRestartPending={false} - onAction={noop} onFeaturesUpdate={noop} onDismissStatus={noop} - /> : surface === "skills" ? ({ + /> : surface === "channels" ?
+ setQuery(event.target.value)} placeholder={t("settings.channels.search")} /> + ({ ...feature, name: `channel-${index}`, display_name: name })), enabled_count: 6, requires_restart: false }} + loading={loading} actionKey={null} showBrandLogos={false} error={null} requiresRestartPending={false} + onAction={noop} onFeaturesUpdate={noop} onDismissStatus={noop} + /> +
: surface === "skills" ? ({ name, description: "Search, inspect and maintain the project.", source: "builtin", available: true, enabled: true, - }))} /> : surface === "marketplace" ? + }))} /> : surface === "marketplace" ?
+ setQuery(event.target.value), placeholder: t("settings.skills.marketplaceSearchPlaceholder") }}> + + + +
: surface === "models" || surface === "models-compact" ? provider.name === "openai" ? { ...provider, model_catalog: "official" } : provider) }} provider={surface === "models-compact" ? "openai" : "anthropic"} diff --git a/webui/browser/skeleton-layout.spec.ts b/webui/browser/skeleton-layout.spec.ts index c66e283d5..0ccf88f89 100644 --- a/webui/browser/skeleton-layout.spec.ts +++ b/webui/browser/skeleton-layout.spec.ts @@ -51,6 +51,9 @@ for (const width of [390, 1440]) { for (const [surface, [loadedSelector, loadingSelector]] of Object.entries(catalogRows)) { await page.goto(fixture(surface)); const loaded = page.locator(loadedSelector).first(); + const search = await box(page.locator(".catalog-search input")); + const toolbarControls = page.locator(".catalog-controls"); + const controls = await box(toolbarControls); const row = await box(loaded); const icon = await box(surface === "channels" ? loaded.locator('[data-testid^="channel-logo"]') : loaded.locator(surface === "apps" ? ":scope > :first-child > :first-child" : ":scope > :first-child")); @@ -58,6 +61,8 @@ for (const width of [390, 1440]) { const action = width === 1440 || surface !== "skills" ? await box(loaded.locator(":scope > :last-child")) : null; await page.goto(fixture(surface, true)); const skeleton = status(page).locator(loadingSelector).first(); + sameBox(await box(page.locator(".catalog-search input")), search); + sameBox(await box(toolbarControls), controls); sameBox(await box(skeleton), row); sameBox(await box(skeleton.locator(surface === "apps" ? ":scope > :first-child > :first-child" : ":scope > :first-child")), icon); const placeholder = await box(skeleton.locator(surface === "apps" @@ -88,8 +93,10 @@ for (const width of [390, 1440]) { const requested = page.waitForRequest(view === "search" ? "**/api/webui/skills/search?**" : "**/api/webui/skills/trending?**"); try { await page.goto(fixture("marketplace")); - if (view === "single") await page.getByRole("tab", { name: "skills.sh", exact: true }).click(); - if (view === "search") await page.locator("input").fill("project"); + if (view === "single") { + await page.getByRole("radio", { name: "skills.sh", exact: true }).locator("..").click(); + } + if (view === "search") await page.getByRole("textbox").fill("project"); await requested; const skeletons = status(page).locator(".py-3\\.5"); const count = view === "single" ? 5 : 10; diff --git a/webui/browser/startup-shell.spec.ts b/webui/browser/startup-shell.spec.ts index 8de56f620..b4b674d74 100644 --- a/webui/browser/startup-shell.spec.ts +++ b/webui/browser/startup-shell.spec.ts @@ -3,16 +3,27 @@ import { expect, test } from "@playwright/test"; for (const width of [412, 1440]) { test.describe(`${width}px document startup skeleton`, () => { test.use({ viewport: { width, height: 922 }, reducedMotion: "reduce" }); - for (const surface of ["skills", "apps", "channels", "automations", "settings", "chat"]) { - test(`${surface} paints before the application and stylesheet download`, async ({ page }) => { + for (const route of ["skills", "apps", "channels", "apps?section=skills", "apps?section=channels", "automations", "settings", "chat"]) { + const surface = route.includes("section=") ? route.split("section=")[1] : route; + test(`${route} paints before the application and stylesheet download`, async ({ page }) => { await page.addInitScript(() => localStorage.setItem("nanobot.locale", "en")); // Neither React nor the app stylesheet may supply this first paint. await page.route(/\/(?:src\/main\.tsx|assets\/index-[^/]+\.(?:js|css))$/, (route) => route.abort()); - await page.goto(`/#/${surface === "chat" ? "chat/websocket%3Aexample" : surface}`, { waitUntil: "domcontentloaded" }); + await page.goto(`/#/${surface === "chat" ? "chat/websocket%3Aexample" : route}`, { waitUntil: "domcontentloaded" }); const shell = page.locator(".startup-shell"); await expect(shell).toHaveAttribute("data-startup-surface", surface); await expect(shell).toHaveAttribute("aria-busy", "true"); await expect(shell.locator(surface === "chat" ? ".startup-composer" : ".startup-page")).toBeVisible(); + if (["apps", "skills", "channels"].includes(surface)) { + const search = (await shell.locator(".startup-search").boundingBox())!; + const controls = (await shell.locator(".startup-controls").boundingBox())!; + const tabs = (await shell.locator(".startup-tabs").boundingBox())!; + expect(search.x).toBe(tabs.x); + expect(search.y).toBe(controls.y + controls.height + (width === 1440 ? 12 : 8)); + expect(search.width).toBe(controls.x + controls.width - tabs.x); + if (width === 1440) expect(controls.y).toBe(tabs.y); + else expect(tabs.width).toBe(search.width); + } const blocks = shell.locator(".startup-block:visible"); expect(await blocks.count()).toBeGreaterThan(5); const box = await blocks.first().boundingBox(); diff --git a/webui/browser/theme-toggle-fixture.tsx b/webui/browser/theme-toggle-fixture.tsx index 6b8419da8..60e382439 100644 --- a/webui/browser/theme-toggle-fixture.tsx +++ b/webui/browser/theme-toggle-fixture.tsx @@ -63,11 +63,11 @@ function ThemeChatFixture({ theme, toggle }: { theme: "light" | "dark"; toggle: if (new URLSearchParams(location.search).has("split")) panes.push({ key: "theme-secondary", title: "Secondary chat" }); return
- + const params = new URLSearchParams(location.search); + const requested = params.get("section"); + const section = requested === "skills" || requested === "channels" || requested === "automations" ? requested : "apps"; + if (params.has("startup")) return ; + return
+ {!params.has("layout") && } {open && {}} onModelNameChange={() => {}} + onStartAutomationChat={section === "automations" ? () => {} : undefined} onBackToChat={() => setOpen(false)} />}
; diff --git a/webui/browser/tools-catalog.spec.ts b/webui/browser/tools-catalog.spec.ts index c620f8df9..7167f6b2f 100644 --- a/webui/browser/tools-catalog.spec.ts +++ b/webui/browser/tools-catalog.spec.ts @@ -1,6 +1,25 @@ -import { expect, test } from "@playwright/test"; +import { expect, test, type Page } from "@playwright/test"; + +async function selectRadio(page: Page, group: string, name: string) { + const radio = page.getByRole("radiogroup", { name: group }).getByRole("radio", { name, exact: true }); + await radio.locator("..").click(); + await expect(radio).toBeChecked(); + await expect(radio).toBeFocused(); +} + +async function selectToolType(page: Page, name: string) { + await selectRadio(page, "Tool type", name); +} + +async function showAllTools(page: Page) { + const readyOnly = page.getByRole("switch", { name: "Ready only" }); + if (await readyOnly.isChecked()) await readyOnly.click(); + await expect(readyOnly).not.toBeChecked(); +} test("settings reentry reuses tools immediately and refreshes expired catalogs without hiding rows", async ({ page }) => { + const clockStart = Date.now(); + await page.clock.setFixedTime(clockStart); const counts = { cli: 0, mcp: 0 }; let refresh = false; let release!: () => void; @@ -26,57 +45,126 @@ test("settings reentry reuses tools immediately and refreshes expired catalogs w }); await page.goto("/browser/fixture.html?case=tools-catalog"); await expect(page.getByRole("heading", { name: "Fixture CLI", exact: true })).toBeVisible(); - await expect(page.getByRole("button", { name: "Ready", exact: true })).toHaveAttribute("aria-pressed", "true"); + await expect(page.getByRole("switch", { name: "Ready only" })).toBeChecked(); await expect(page.getByRole("heading", { name: "Fixture plugin", exact: true })).toHaveCount(0); - await page.getByRole("button", { name: "CLI Apps", exact: true }).click(); + await selectToolType(page, "CLI Apps"); await expect(page.getByRole("heading", { name: "Fixture CLI", exact: true })).toBeVisible(); await expect(page.getByRole("heading", { name: "Fixture plugin", exact: true })).toHaveCount(0); - await page.getByRole("button", { name: "Agent Plugins", exact: true }).click(); + await selectToolType(page, "Agent Plugins"); + await showAllTools(page); await expect(page.getByRole("heading", { name: "Fixture plugin", exact: true })).toBeVisible(); await expect(page.getByRole("heading", { name: "Fixture CLI", exact: true })).toHaveCount(0); + expect(counts).toEqual({ cli: 1, mcp: 1 }); await page.getByRole("button", { name: "Leave settings", exact: true }).click(); await page.getByRole("button", { name: "Open settings", exact: true }).click(); - await page.getByRole("button", { name: "Agent Plugins", exact: true }).click(); + await selectToolType(page, "Agent Plugins"); + await showAllTools(page); await expect(page.getByRole("heading", { name: "Fixture plugin", exact: true })).toBeVisible(); expect(counts).toEqual({ cli: 1, mcp: 1 }); await page.getByRole("button", { name: "Leave settings", exact: true }).click(); refresh = true; - await page.clock.setFixedTime(new Date(Date.now() + 31_000)); + await page.clock.setFixedTime(clockStart + 31_000); await page.getByRole("button", { name: "Open settings", exact: true }).click(); - await page.getByRole("button", { name: "Agent Plugins", exact: true }).click(); + await selectToolType(page, "Agent Plugins"); + await showAllTools(page); await expect.poll(() => counts).toEqual({ cli: 2, mcp: 2 }); await expect(page.getByRole("heading", { name: "Fixture plugin", exact: true })).toBeVisible(); await expect(page.getByRole("status", { name: "Loading apps…", exact: true })).toHaveCount(0); release(); await expect(page.getByRole("heading", { name: "Updated plugin", exact: true })).toBeVisible(); - await page.getByRole("button", { name: "CLI Apps", exact: true }).click(); + await selectToolType(page, "CLI Apps"); await expect(page.getByRole("heading", { name: "Updated CLI", exact: true })).toBeVisible(); }); -test("shows all category labels on narrow screens in each locale", async ({ page }) => { - await page.setViewportSize({ width: 320, height: 800 }); +test("reveals MCP tools hidden by Ready only without switching tool type", async ({ page }) => { + await page.route("**/api/settings/cli-apps", route => route.fulfill({ json: { apps: [{ + name: "fixture-cli", display_name: "Fixture CLI", category: "tools", description: "Fixture app", + requires: "", source: "catalog", entry_point: "fixture-cli", install_supported: true, + installed: true, available: true, status: "installed", skill_installed: false, + }], installed_count: 1 } })); + await page.route("**/api/settings/mcp-presets", route => route.fulfill({ json: { presets: [{ + name: "fixture-mcp", display_name: "Fixture MCP", category: "tools", description: "Fixture MCP tool", + requires: "", transport: "stdio", source: "builtin", install_supported: true, + installed: true, configured: true, enabled: false, available: false, status: "disabled", + required_fields: [], docs_url: "", note: "", connection_summary: "", + }], installed_count: 1 } })); + await page.goto("/browser/fixture.html?case=tools-catalog&layout&lang=zh-CN"); + await expect(page.getByRole("heading", { name: "Fixture CLI", exact: true })).toBeVisible(); + const ready = page.getByRole("switch", { name: "仅显示就绪" }); + await expect(ready).toBeChecked(); + await selectRadio(page, "工具类型", "MCP"); + await expect(page.getByText("还没有就绪的工具", { exact: true })).toBeVisible(); + const search = page.getByRole("textbox", { name: "搜索工具" }); + await search.fill("fixture"); + await ready.click(); + await expect(search).toHaveValue("fixture"); + await expect(ready).not.toBeChecked(); + await expect(page.getByRole("radio", { name: "MCP", exact: true })).toBeChecked(); + await expect(page.getByRole("heading", { name: "Fixture MCP", exact: true })).toBeVisible(); + await expect(page.getByRole("heading", { name: "Fixture CLI", exact: true })).toHaveCount(0); +}); + + +test("keeps Apps section controls usable on narrow screens in each locale", async ({ page }) => { + const width = 320; + await page.setViewportSize({ width, height: 800 }); await page.route("**/api/settings/cli-apps", route => route.fulfill({ json: { apps: [], installed_count: 0 } })); await page.route("**/api/settings/mcp-presets", route => route.fulfill({ json: { presets: [], installed_count: 0 } })); - for (const locale of ["en", "es", "fr", "id", "ja", "ko", "pt-BR", "vi", "zh-CN", "zh-TW"]) { - await page.goto(`/browser/fixture.html?case=tools-catalog&lang=${locale}`); - const control = page.locator(".segmented-control").filter({ has: page.getByRole("button", { name: "CLI Apps", exact: true }) }); - await expect(control).toBeVisible(); - const geometry = await control.evaluate(element => { + await page.route("**/api/settings/nanobot-features", route => route.fulfill({ json: { features: [], enabled_count: 0 } })); + await page.route("**/api/webui/skills/trending?**", route => route.fulfill({ json: { skills: [] } })); + const controls = page.locator(".catalog-controls"); + async function expectControlsFit(locale: string, count: number) { + const targets = page.locator(".catalog-tabs > button, .catalog-controls label"); + await expect(targets).toHaveCount(count); + const geometry = await targets.evaluateAll(elements => elements.map(element => { const bounds = element.getBoundingClientRect(); return { + label: element.textContent, left: bounds.left, right: bounds.right, - buttons: Array.from(element.querySelectorAll("button"), button => ({ - text: button.textContent, - fits: button.scrollWidth <= button.clientWidth, - })), + fits: element.scrollWidth <= element.clientWidth + && (!element.matches("button") || element.scrollHeight <= element.clientHeight), }; - }); - expect(geometry.left, locale).toBeGreaterThanOrEqual(0); - expect(geometry.right, locale).toBeLessThanOrEqual(320); - expect(geometry.buttons, locale).toHaveLength(4); - expect(geometry.buttons.every(button => button.fits), locale).toBe(true); + })); + expect(geometry.filter(item => item.left < 0 || item.right > width || !item.fits), locale).toEqual([]); + } + for (const locale of ["en", "es", "fr", "id", "ja", "ko", "pt-BR", "vi", "zh-CN", "zh-TW"]) { + await page.goto(`/browser/fixture.html?case=tools-catalog&lang=${locale}`); + const types = page.getByRole("radiogroup").getByRole("radio"); + const status = controls.getByRole("switch"); + await expect(types).toHaveCount(4); + await expect(status).not.toBeChecked(); + await expectControlsFit(locale, 8); + const cli = types.nth(1); + await cli.locator("..").click(); + await expect(cli).toBeChecked(); + await expect(cli).toBeFocused(); + await page.keyboard.press("ArrowRight"); + await expect(types.nth(2)).toBeChecked(); + await expect(types.nth(2)).toBeFocused(); + await page.keyboard.press("Tab"); + await expect(status).toBeFocused(); + await page.keyboard.press("Space"); + await expect(status).toBeChecked(); + await status.locator("..").locator(":scope > span").click(); + await expect(status).not.toBeChecked(); + await expect(status).toBeFocused(); + + const sections = page.locator(".catalog-tabs").getByRole("button"); + await sections.nth(1).click(); + await expectControlsFit(locale, 8); + const marketplace = controls.getByRole("radio").nth(1); + await marketplace.locator("..").click(); + await expect(marketplace).toBeFocused(); + await expect(marketplace).toBeChecked(); + await expectControlsFit(locale, 8); + + await sections.nth(2).click(); + await expectControlsFit(locale, 4); + await status.locator("..").locator(":scope > span").click(); + await expect(status).toBeChecked(); + await expect(status).toBeFocused(); } }); @@ -100,3 +188,225 @@ test("opens the generated plugin from its CLI app", async ({ page }) => { await expect(page.getByRole("dialog", { name: "Generated plugin" })).toBeVisible(); await expect(page.getByRole("dialog").getByRole("button", { name: "Disable" })).toBeVisible(); }); + + +test("keeps navigation, control slots and full-width search stable when switching Apps sections", async ({ page }) => { + await page.route("**/api/settings/cli-apps", route => route.fulfill({ json: { apps: [], installed_count: 0 } })); + await page.route("**/api/settings/mcp-presets", route => route.fulfill({ json: { presets: [], installed_count: 0 } })); + await page.route("**/api/settings/nanobot-features", route => route.fulfill({ json: { features: [], enabled_count: 0 } })); + await page.goto("/browser/fixture.html?case=tools-catalog"); + await page.route("**/api/webui/skills/trending?**", route => route.fulfill({ json: { skills: [] } })); + const sections = page.getByRole("group", { name: "Apps" }); + const selected = sections.getByRole("button", { pressed: true }); + const tools = sections.getByRole("button", { name: "Tools" }); + await tools.focus(); + for (const key of ["ArrowRight", "ArrowLeft"]) { + await page.keyboard.press(key); + await expect(tools).toBeFocused(); + await expect(tools).toHaveAttribute("aria-pressed", "true"); + } + const field = page.locator(".catalog-search input"); + await expect(field).toBeVisible(); + const searchNode = (await field.elementHandle())!; + for (const width of [1440, 800, 375, 320]) { + await page.setViewportSize({ width, height: 900 }); + await tools.click(); + const wide = width >= 800; + let toolsSearch: Awaited>[0] | undefined; + const names = ["Tools", "Skills", "Channels"]; + for (const [index, name] of names.entries()) { + await expect(selected).toHaveText(name); + await expect(selected).toBeFocused(); + await expect(field).toBeVisible(); + expect(await searchNode.evaluate(element => element === document.querySelector(".catalog-search input"))).toBe(true); + await page.locator("[data-testid=settings-section-transition]").evaluate(async element => { + await Promise.all(element.getAnimations().map(animation => animation.finished)); + }); + const geometry = await catalogGeometry(page); + const [search, controls] = geometry; + const navigation = (await sections.boundingBox())!; + expect(search.x).toBe(navigation.x); + expect(search.x + search.width).toBe(controls.x + controls.width); + expect(search.y).toBe(controls.y + controls.height + (wide ? 12 : 8)); + if (name === "Tools") toolsSearch = search; + else if (wide || name === "Skills") expect(search, `${width}px ${name}`).toEqual(toolsSearch); + else { + expect(controls.height).toBe(36); + expect(search.y).toBeLessThan(toolsSearch!.y); + } + if (wide) expect(controls.y).toBe(navigation.y); + else expect(navigation.width).toBe(search.width); + expect(search.height).toBe(36); + expect(search.radius).toBe("12px"); + expect(geometry.every(control => control.x >= 0 && control.x + control.width <= width)).toBe(true); + if (name === "Skills") { + await selectRadio(page, "Skills views", "Marketplace"); + const sources = page.getByRole("radiogroup", { name: "Skill source" }); + await expect(sources.getByRole("radio", { name: "All", exact: true })).toBeChecked(); + await page.keyboard.press("Tab"); + await expect(sources.getByRole("radio", { name: "All", exact: true })).toBeFocused(); + await page.keyboard.press("ArrowRight"); + await expect(sources.getByRole("radio", { name: "skills.sh" })).toBeFocused(); + await expect(sources.getByRole("radio", { name: "skills.sh" })).toBeChecked(); + await selectRadio(page, "Skill source", "All"); + expect(await catalogGeometry(page)).toEqual(geometry); + expect(await searchNode.evaluate(element => element === document.querySelector(".catalog-search input"))).toBe(true); + await selectRadio(page, "Skills views", "Installed"); + await selected.focus(); + } + const next = names[index + 1]; + if (next) { + await page.keyboard.press("Tab"); + await expect(sections.getByRole("button", { name: next })).toBeFocused(); + await page.keyboard.press("Enter"); + } + } + } +}); + +test("keeps channel names, local marks and click focus on a narrow viewport", async ({ page, baseURL }) => { + await page.setViewportSize({ width: 320, height: 800 }); + const origin = new URL(baseURL!).origin; + const externalImages: string[] = []; + await page.route(url => url.origin !== origin, route => { + if (route.request().resourceType() === "image") externalImages.push(route.request().url()); + return route.abort(); + }); + await page.route("**/api/settings/nanobot-features", route => route.fulfill({ json: { + enabled_count: 1, + features: [{ + name: "whatsapp_agent", display_name: "WhatsApp Agent Platform", type: "channel", + enabled: true, installed: true, runtime_status: "failed", status: "enabled", + install_supported: false, requires_restart: false, + }, { + name: "telegram", display_name: "Telegram", type: "channel", + enabled: false, installed: false, status: "not_installed", + install_supported: true, requires_dependencies: true, requires_restart: false, + }, { + name: "email", display_name: "Email", type: "channel", + enabled: false, installed: true, configured: false, status: "not_enabled", + install_supported: false, requires_restart: false, + }, ...[ + ["linear", "Linear"], ["mattermost", "Mattermost"], ["qq", "QQ"], ["slack", "Slack"], + ].map(([name, display_name]) => ({ + name, display_name, type: "channel", + enabled: false, installed: true, status: "not_enabled", + install_supported: false, requires_restart: false, + }))], + } })); + await page.goto("/browser/fixture.html?case=tools-catalog&layout§ion=channels"); + const name = page.getByRole("heading", { name: "WhatsApp Agent Platform", exact: true }); + await expect(name).toBeVisible(); + const settings = page.getByRole("button", { name: /View WhatsApp Agent Platform/ }); + await expect(settings).toHaveAccessibleDescription("Failed"); + expect(await name.evaluate(element => element.scrollWidth <= element.clientWidth && element.scrollHeight <= element.clientHeight)).toBe(true); + const mark = page.locator("[data-testid=channel-logo-whatsapp_agent] img"); + await expect.poll(() => mark.evaluate(image => (image as HTMLImageElement).naturalWidth)).toBeGreaterThan(0); + + const dialog = page.getByRole("dialog", { name: "Channels" }); + await settings.click(); + await expect(dialog).toBeFocused(); + await dialog.getByRole("button", { name: "Close", exact: true }).click(); + await expect(settings).toBeFocused(); + + const enabledOnly = page.getByRole("switch", { name: "Enabled only" }); + await expect(enabledOnly).toBeChecked(); + await enabledOnly.click(); + await expect(enabledOnly).not.toBeChecked(); + await expect(enabledOnly).toBeFocused(); + for (const channel of ["linear", "mattermost", "qq"]) { + const image = page.getByTestId(`channel-logo-${channel}`).locator("img"); + await image.scrollIntoViewIfNeeded(); + await expect(image).toHaveAttribute("src", `/brand/channels/${channel}.svg`); + await expect.poll(() => image.evaluate(element => (element as HTMLImageElement).naturalWidth)).toBeGreaterThan(0); + } + const slackMark = page.getByTestId("channel-logo-slack"); + await slackMark.scrollIntoViewIfNeeded(); + await expect(slackMark).toHaveText("SL"); + const emailSwitch = page.getByRole("switch", { name: /Email/ }); + await emailSwitch.click(); + await expect(dialog).toBeFocused(); + await page.keyboard.press("Escape"); + await expect(emailSwitch).toBeFocused(); + + const telegram = page.getByRole("button", { name: /View Telegram/ }); + const install = page.getByRole("button", { name: "Install Telegram" }); + await telegram.click(); + await expect(telegram).toBeFocused(); + await page.keyboard.press("Enter"); + await expect(install).toBeFocused(); + + const skills = page.getByRole("group", { name: "Apps" }).getByRole("button", { name: "Skills" }); + await skills.click(); + await expect(page.getByLabel("Search installed skills")).toBeVisible(); + await expect(skills).toBeFocused(); + expect(externalImages).toEqual([]); +}); + +async function catalogGeometry(page: Page, startup = false) { + const selectors = startup + ? [".startup-search", ".startup-controls"] + : [".catalog-search input", ".catalog-controls"]; + return Promise.all(selectors.map(selector => page.locator(selector).evaluate(element => { + const rect = element.getBoundingClientRect(); + return { x: rect.x, y: rect.y, width: rect.width, height: rect.height, radius: getComputedStyle(element).borderRadius }; + }))); +} + +for (const width of [390, 1440]) test(`Apps startup skeleton shares the loaded toolbar geometry at ${width}px`, async ({ page }) => { + await page.setViewportSize({ width, height: 900 }); + await page.emulateMedia({ reducedMotion: "reduce" }); + await page.route("**/api/settings/cli-apps", route => route.fulfill({ json: { apps: [], installed_count: 0 } })); + await page.route("**/api/settings/mcp-presets", route => route.fulfill({ json: { presets: [], installed_count: 0 } })); + await page.route("**/api/settings/nanobot-features", route => route.fulfill({ json: { features: [], enabled_count: 0 } })); + for (const section of ["apps", "skills", "channels"]) { + const url = `/browser/fixture.html?case=tools-catalog&layout§ion=${section}`; + await page.goto(url); + await expect(page.locator(".catalog-search input")).toBeVisible(); + const loaded = await catalogGeometry(page); + await page.goto(`${url}&startup`); + await expect(page.locator(".startup-search")).toBeVisible(); + expect(await catalogGeometry(page, true), section).toEqual(loaded); + } +}); + +for (const width of [390, 1440]) test(`Apps and Automations share the conversation column at ${width}px`, async ({ page }) => { + await page.setViewportSize({ width, height: 900 }); + await page.emulateMedia({ reducedMotion: "reduce" }); + await page.route("**/api/settings/cli-apps", route => route.fulfill({ json: { apps: [], installed_count: 0 } })); + await page.route("**/api/settings/mcp-presets", route => route.fulfill({ json: { presets: [], installed_count: 0 } })); + await page.route("**/api/webui/automations", route => route.fulfill({ json: { jobs: [] } })); + + const bounds = async (selector: string) => { + const target = page.locator(selector); + await expect(target).toBeVisible(); + const { x, width } = (await target.boundingBox())!; + return { x, width }; + }; + const fixture = "/browser/fixture.html?case=tools-catalog&layout"; + await page.goto(fixture); + const apps = await bounds(".catalog-search input"); + await page.goto(`${fixture}§ion=automations`); + expect(await bounds(".automation-panel")).toEqual(apps); + expect(await bounds(".automation-create-composer .thread-composer-surface")).toEqual(apps); + await expect(page.locator(width === 1440 ? ".automation-calendar-grid" : ".automation-calendar-agenda")).toBeVisible(); + await page.goto(`${fixture}§ion=automations&startup`); + expect(await bounds(".startup-calendar")).toEqual(apps); + + if (width === 1440) { + await page.route("**/api/commands", route => route.fulfill({ json: { commands: [] } })); + await page.route("**/api/sessions/*/webui-thread?*", route => route.fulfill({ json: { + schemaVersion: 3, projection: "events", events: [], has_more: false, + } })); + await page.routeWebSocket("**/answer-order-socket", route => route.onMessage(raw => { + const frame = JSON.parse(String(raw)); + if (frame.type !== "attach") return; + route.send(JSON.stringify({ event: "attached", chat_id: frame.chat_id })); + route.send(JSON.stringify({ event: "user_message", chat_id: frame.chat_id, + turn_id: "layout-turn", text: "An existing conversation", starts_turn: true, + })); + })); + await page.goto("/browser/fixture.html?case=answer-order"); + expect(await bounds('[data-layout="thread"] .thread-composer-surface')).toEqual(apps); + } +}); diff --git a/webui/public/brand/channels/discord.svg b/webui/public/brand/channels/discord.svg new file mode 100644 index 000000000..461fafaf8 --- /dev/null +++ b/webui/public/brand/channels/discord.svg @@ -0,0 +1 @@ +Discord diff --git a/webui/public/brand/channels/linear.svg b/webui/public/brand/channels/linear.svg new file mode 100644 index 000000000..ae48558f7 --- /dev/null +++ b/webui/public/brand/channels/linear.svg @@ -0,0 +1 @@ +Linear diff --git a/webui/public/brand/channels/matrix.svg b/webui/public/brand/channels/matrix.svg new file mode 100644 index 000000000..c750230c4 --- /dev/null +++ b/webui/public/brand/channels/matrix.svg @@ -0,0 +1 @@ +Matrix diff --git a/webui/public/brand/channels/mattermost.svg b/webui/public/brand/channels/mattermost.svg new file mode 100644 index 000000000..edeb5f5a0 --- /dev/null +++ b/webui/public/brand/channels/mattermost.svg @@ -0,0 +1 @@ +Mattermost diff --git a/webui/public/brand/channels/qq.svg b/webui/public/brand/channels/qq.svg new file mode 100644 index 000000000..2d47bf56c --- /dev/null +++ b/webui/public/brand/channels/qq.svg @@ -0,0 +1 @@ +QQ diff --git a/webui/public/brand/channels/signal.svg b/webui/public/brand/channels/signal.svg new file mode 100644 index 000000000..c7ea61640 --- /dev/null +++ b/webui/public/brand/channels/signal.svg @@ -0,0 +1 @@ +Signal diff --git a/webui/public/brand/channels/telegram.svg b/webui/public/brand/channels/telegram.svg new file mode 100644 index 000000000..1e4ae58dc --- /dev/null +++ b/webui/public/brand/channels/telegram.svg @@ -0,0 +1 @@ +Telegram diff --git a/webui/public/brand/channels/wechat.svg b/webui/public/brand/channels/wechat.svg new file mode 100644 index 000000000..259f92b2a --- /dev/null +++ b/webui/public/brand/channels/wechat.svg @@ -0,0 +1 @@ +WeChat diff --git a/webui/public/brand/channels/whatsapp.svg b/webui/public/brand/channels/whatsapp.svg new file mode 100644 index 000000000..ae83e4277 --- /dev/null +++ b/webui/public/brand/channels/whatsapp.svg @@ -0,0 +1 @@ +WhatsApp diff --git a/webui/src/App.tsx b/webui/src/App.tsx index 72e79ee2a..caef70008 100644 --- a/webui/src/App.tsx +++ b/webui/src/App.tsx @@ -6,6 +6,7 @@ import { useMemo, useRef, useState, + type CSSProperties, type ReactNode, } from "react"; import { ArrowRight, ChevronDown, Eye, EyeOff } from "lucide-react"; @@ -28,7 +29,7 @@ import { ComposerDraftStore, clearStoredComposerDrafts } from "@/lib/composer-dr import { activateReloadCache, clearReloadCache } from "@/lib/reload-cache"; import { webuiThreadCache } from "@/lib/webui-thread-cache"; import { ThreadVisibilityContext } from "@/hooks/useThreadVisibility"; -import type { SettingsExitGuard, SettingsFocusTarget } from "@/components/settings/contracts"; +import { isAppsSection, type SettingsExitGuard, type SettingsFocusTarget } from "@/components/settings/contracts"; import { PaneWorkbench } from "@/components/workbench/PaneWorkbench"; import { transitionSession } from "@/components/thread/session-transition"; import { @@ -137,7 +138,7 @@ const SIDEBAR_RAIL_WIDTH = 56; const MOBILE_SIDEBAR_WIDTH = `min(${SIDEBAR_WIDTH}px, calc(100vw - 0.75rem))`; const TOKEN_REFRESH_MARGIN_MS = 30_000; const TOKEN_REFRESH_MIN_DELAY_MS = 5_000; -type ShellView = "chat" | "settings" | "apps" | "automations" | "skills" | "channels" | "remote"; +type ShellView = "chat" | "settings" | "apps" | "automations" | "remote"; type ShellRoute = { view: ShellView; activeKey: string | null; @@ -195,7 +196,8 @@ function defaultShellRoute(): ShellRoute { } function shellViewForSettingsSection(section: SettingsSectionKey): ShellView { - if (section === "apps" || section === "automations" || section === "skills" || section === "channels") return section; + if (isAppsSection(section)) return "apps"; + if (section === "automations") return "automations"; return "settings"; } @@ -272,19 +274,19 @@ function readShellRoute(): ShellRoute { }; } if (path === "/apps") { - return { view: "apps", activeKey, temporary, settingsSection: "apps" }; + return { view: "apps", activeKey, temporary, settingsSection: isAppsSection(settingsSection) ? settingsSection : "apps" }; } if (path === "/automations") { return { view: "automations", activeKey, temporary, settingsSection: "automations" }; } if (path === "/channels") { - return { view: "channels", activeKey, temporary, settingsSection: "channels" }; + return { view: "apps", activeKey, temporary, settingsSection: "channels" }; } if (path === "/remote") { return { view: "remote", activeKey, temporary, settingsSection: "overview" }; } if (path === "/skills") { - return { view: "skills", activeKey, temporary, settingsSection: "skills" }; + return { view: "apps", activeKey, temporary, settingsSection: "skills" }; } if (path.startsWith("/temporary/")) { const encoded = path.slice("/temporary/".length); @@ -331,6 +333,9 @@ function shellRouteHash(route: ShellRoute): string { params.set("section", route.settingsSection); if (route.settingsSection === "advanced" && route.settingsFocus) params.set("focus", route.settingsFocus); } + if (route.view === "apps" && route.settingsSection !== "apps") { + params.set("section", route.settingsSection); + } const query = params.toString(); return `#/${route.view}${query ? `?${query}` : ""}`; } @@ -897,8 +902,7 @@ function Shell({ const [settingsInitialSection, setSettingsInitialSection] = useState(initialRouteRef.current.settingsSection); const [settingsFocus, setSettingsFocus] = useState(initialRouteRef.current.settingsFocus); - const [hostSidebarOpen, setHostSidebarOpen] = - useState(readSidebarOpen); + const [preferredSidebarOpen, setPreferredSidebarOpen] = useState(readSidebarOpen); const [sidebarWidth, setSidebarWidth] = useState(readSidebarWidth); const [sidebarDragging, setSidebarDragging] = useState(false); const [mobileSidebarOpen, setMobileSidebarOpen] = useState(false); @@ -988,6 +992,14 @@ function Shell({ )), [temporarySessions], ); + // Start each confirmed empty period collapsed without overwriting the saved preference. + const [emptySidebarOpen, setEmptySidebarOpen] = useState(null); + const hasSessions = sessions.length > 0 || temporarySessionList.length > 0; + if (hasSessions && emptySidebarOpen !== null) setEmptySidebarOpen(null); + if (!hasSessions && sessionsLoaded && emptySidebarOpen === null) setEmptySidebarOpen(false); + const hostSidebarOpen = emptySidebarOpen ?? preferredSidebarOpen; + const setHostSidebarOpen = emptySidebarOpen === null ? setPreferredSidebarOpen : setEmptySidebarOpen; + const temporaryChatIds = useMemo( () => temporarySessionList.map((session) => session.chatId), [temporarySessionList], @@ -1128,7 +1140,7 @@ function Shell({ try { window.localStorage.setItem( SIDEBAR_STORAGE_KEY, - hostSidebarOpen ? "1" : "0", + preferredSidebarOpen ? "1" : "0", ); } catch { // ignore storage errors (private mode, etc.) @@ -1138,7 +1150,7 @@ function Shell({ } catch { // Storage can be unavailable in private browsing. } - }, [hostSidebarOpen, sidebarWidth]); + }, [preferredSidebarOpen, sidebarWidth]); useEffect(() => { writeSessionUpdateChatIds(updatedChatIds); @@ -1329,7 +1341,7 @@ function Shell({ const openHostSidebar = useCallback(() => { setHostSidebarOpen(true); - }, []); + }, [setHostSidebarOpen]); const closeMobileSidebar = useCallback(() => { setMobileSidebarOpen(false); @@ -1340,11 +1352,11 @@ function Shell({ typeof window !== "undefined" && window.matchMedia("(min-width: 1024px)").matches; if (isNativeHost) { - setHostSidebarOpen((v) => !v); + setHostSidebarOpen(!hostSidebarOpen); } else { setMobileSidebarOpen((v) => !v); } - }, []); + }, [hostSidebarOpen, setHostSidebarOpen]); const applyWorkspaceScope = useCallback( (scope: WorkspaceScopePayload) => { @@ -1814,21 +1826,9 @@ function Shell({ setMobileSidebarOpen(false); }, [activeKey, navigate]); - const onOpenChannels = useCallback(() => { - setSessionSearchOpen(false); - navigate({ view: "channels", activeKey, settingsSection: "channels" }); - setMobileSidebarOpen(false); - }, [activeKey, navigate]); - - const onOpenSkills = useCallback(() => { - setSessionSearchOpen(false); - navigate({ view: "skills", activeKey, settingsSection: "skills" }); - setMobileSidebarOpen(false); - }, [activeKey, navigate]); - useEffect(() => { const actions = { newChat: onNewChat, search: onOpenSessionSearch, apps: onOpenApps, - skills: onOpenSkills, automations: onOpenAutomations, channels: onOpenChannels, settings: () => onOpenSettings() }; + automations: onOpenAutomations, settings: () => onOpenSettings() }; const handleKeyDown = (event: globalThis.KeyboardEvent) => { if (!localActive) return; const action = matchSidebarShortcut(event); @@ -1838,7 +1838,7 @@ function Shell({ }; window.addEventListener("keydown", handleKeyDown); return () => window.removeEventListener("keydown", handleKeyDown); - }, [localActive, onNewChat, onOpenSessionSearch, onOpenApps, onOpenSkills, onOpenAutomations, onOpenChannels, onOpenSettings]); + }, [localActive, onNewChat, onOpenSessionSearch, onOpenApps, onOpenAutomations, onOpenSettings]); const onSettingsSectionChange = useCallback( (section: SettingsSectionKey) => { @@ -2317,20 +2317,10 @@ function Shell({ }); return; } - if (view === "channels") { - document.title = t("app.documentTitle.chat", { title: t("settings.nav.channels") }); - return; - } if (view === "remote") { document.title = t("app.documentTitle.chat", { title: t("remote.title") }); return; } - if (view === "skills") { - document.title = t("app.documentTitle.chat", { - title: t("settings.nav.skills", { defaultValue: "Skills" }), - }); - return; - } document.title = activeSession ? t("app.documentTitle.chat", { title: headerTitle }) : t("app.documentTitle.base"); @@ -2364,7 +2354,6 @@ function Shell({ : null, loading: loading || sidebarStateLoading, initialLoading: sessionsInitialLoading || sidebarStateLoading, - newChatActive: !managingConnections && view === "chat" && activeKey === null, onNewChat, onSelect: onSelectSidebarItem, onCloseTemporaryChat, @@ -2393,11 +2382,9 @@ function Shell({ : undefined, onOpenApps, onOpenAutomations, - onOpenChannels, - onOpenSkills, onSettingsIntent, onOpenSearch: onOpenSessionSearch, - activeUtility: !managingConnections && (view === "apps" || view === "automations" || view === "skills" || view === "channels") ? view : null, + activeUtility: !managingConnections && (view === "apps" || view === "automations") ? view : null, onToggleArchived, pinnedKeys: sidebarPinnedTabKeys, archivedKeys: sidebarArchivedTabKeys, @@ -2460,29 +2447,34 @@ function Shell({