From 60ed67e5e1e5b983c0d6f0315baeb98b6372daea 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 6103aaaae7f031dbb0a1ef2ac26586b789c9634d..991e27cd10577625b7f8bcec984a680d40819dce 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 085edf3665806b82ffa72a627155c9f012fc9d6c..b00cf0cdc0933706b751c085b8e11f6a90679f8e 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 8acd6bbcf5a8e430393c05275bc5b30b9bab7ee4..696e5b23dc80caeb1f9d93644a30d5210b406336 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"; -- 2.54.0