From 798993550b90620dfe5678edfb6ffdcf0d2570d3 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Tue, 17 Feb 2026 12:33:44 -0800 Subject: [PATCH] Use bot icon for slash commands and normalize YAML file icons - Replace slash-command menu glyph in ChatView with `BotIcon` - Map `yml`/`yaml` to base YAML language id to avoid overly specific icons - Add test coverage for GitHub workflow YAML icon selection --- apps/web/src/components/ChatView.tsx | 3 ++- apps/web/src/vscode-icons.test.ts | 2 ++ apps/web/src/vscode-icons.ts | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 6f4bc97bf7..b0d51c15a1 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -75,6 +75,7 @@ import ThreadTerminalDrawer from "./ThreadTerminalDrawer"; import { useNativeApi } from "../hooks/useNativeApi"; import { Alert, AlertAction, AlertDescription, AlertTitle } from "./ui/alert"; import { + BotIcon, ChevronDownIcon, CircleAlertIcon, FileIcon, @@ -259,7 +260,7 @@ const ComposerCommandMenuItem = memo(function ComposerCommandMenuItem(props: { /> ) : null} {props.item.type === "slash-command" ? ( - + ) : null} {props.item.type === "model" ? ( diff --git a/apps/web/src/vscode-icons.test.ts b/apps/web/src/vscode-icons.test.ts index 085edf3665..b00cf0cdc0 100644 --- a/apps/web/src/vscode-icons.test.ts +++ b/apps/web/src/vscode-icons.test.ts @@ -31,11 +31,13 @@ describe("getVscodeIconUrlForEntry", () => { const dockerfileUrl = getVscodeIconUrlForEntry("Dockerfile", "file", "dark"); const shellUrl = getVscodeIconUrlForEntry("entrypoint.sh", "file", "dark"); const cursorRulesUrl = getVscodeIconUrlForEntry("general.mdc", "file", "dark"); + const githubWorkflowUrl = getVscodeIconUrlForEntry(".github/workflows/ci.yml", "file", "light"); assert.isTrue(tsxUrl.endsWith("/file_type_reactts.svg")); assert.isTrue(dockerfileUrl.endsWith("/file_type_docker.svg")); assert.isTrue(shellUrl.endsWith("/file_type_shell.svg")); assert.isTrue(cursorRulesUrl.endsWith("/file_type_markdown.svg")); + assert.isTrue(githubWorkflowUrl.endsWith("/file_type_light_yaml.svg")); }); it("falls back to defaults when there is no match", () => { diff --git a/apps/web/src/vscode-icons.ts b/apps/web/src/vscode-icons.ts index 8acd6bbcf5..696e5b23dc 100644 --- a/apps/web/src/vscode-icons.ts +++ b/apps/web/src/vscode-icons.ts @@ -45,6 +45,11 @@ const languageIdByFileName = toLowercaseLookup(languageAssociations.fileNameToLa const localLanguageIdByExtensionOverrides = { // Cursor rules files (*.mdc) are commonly treated as markdown in VSCode/Cursor. mdc: "markdown", + // Upstream languages.ts maps yml/yaml to specialized language ids that can produce + // non-generic YAML icons (for example cloudfoundry/esphome). Prefer the base YAML icon + // unless a more specific basename/extension match (e.g. azure-pipelines.yml) is found. + yml: "yaml", + yaml: "yaml", } as const; const defaultDarkFileIconDefinition = manifest.file ?? "_file";