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
This commit is contained in:
Julius Marminge committed 2026-02-17 16:12:16 -08:00
1 parent 1cf5584e4c
commit 00c35dbb1a
3 files changed
+9 -1

No files matched your search

+2 -1
View File
@@ -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" ? (
<CursorIcon className="size-4 text-muted-foreground/80" />
<BotIcon className="size-4 text-muted-foreground/80" />
) : null}
{props.item.type === "model" ? (
<Badge variant="outline" className="px-1.5 py-0 text-[10px]">
+2
View File
@@ -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", () => {
+5
View File
@@ -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";