| author | |
| committer | |
| log | 60ed67e5e1e5b983c0d6f0315baeb98b6372daea |
| tree | cabe996b2d94d44ce4934caf90be31daeaa9a40a |
| parent | bd6a5c85e6f873997a3e0fc8dd3f773f9acc7893 |
- 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 selection3 files changed, 9 insertions(+), 1 deletions(-)
apps/web/src/components/ChatView.tsx+2-1| ... | ... | @@ -75,6 +75,7 @@ import ThreadTerminalDrawer from "./ThreadTerminalDrawer"; |
| 75 | 75 | import { useNativeApi } from "../hooks/useNativeApi"; |
| 76 | 76 | import { Alert, AlertAction, AlertDescription, AlertTitle } from "./ui/alert"; |
| 77 | 77 | import { |
| 78 | BotIcon, | |
| 78 | 79 | ChevronDownIcon, |
| 79 | 80 | CircleAlertIcon, |
| 80 | 81 | FileIcon, |
| ... | ... | @@ -259,7 +260,7 @@ const ComposerCommandMenuItem = memo(function ComposerCommandMenuItem(props: { |
| 259 | 260 | /> |
| 260 | 261 | ) : null} |
| 261 | 262 | {props.item.type === "slash-command" ? ( |
| 262 | <CursorIcon className="size-4 text-muted-foreground/80" /> | |
| 263 | <BotIcon className="size-4 text-muted-foreground/80" /> | |
| 263 | 264 | ) : null} |
| 264 | 265 | {props.item.type === "model" ? ( |
| 265 | 266 | <Badge variant="outline" className="px-1.5 py-0 text-[10px]"> |
apps/web/src/vscode-icons.test.ts+2| ... | ... | @@ -31,11 +31,13 @@ describe("getVscodeIconUrlForEntry", () => { |
| 31 | 31 | const dockerfileUrl = getVscodeIconUrlForEntry("Dockerfile", "file", "dark"); |
| 32 | 32 | const shellUrl = getVscodeIconUrlForEntry("entrypoint.sh", "file", "dark"); |
| 33 | 33 | const cursorRulesUrl = getVscodeIconUrlForEntry("general.mdc", "file", "dark"); |
| 34 | const githubWorkflowUrl = getVscodeIconUrlForEntry(".github/workflows/ci.yml", "file", "light"); | |
| 34 | 35 | |
| 35 | 36 | assert.isTrue(tsxUrl.endsWith("/file_type_reactts.svg")); |
| 36 | 37 | assert.isTrue(dockerfileUrl.endsWith("/file_type_docker.svg")); |
| 37 | 38 | assert.isTrue(shellUrl.endsWith("/file_type_shell.svg")); |
| 38 | 39 | assert.isTrue(cursorRulesUrl.endsWith("/file_type_markdown.svg")); |
| 40 | assert.isTrue(githubWorkflowUrl.endsWith("/file_type_light_yaml.svg")); | |
| 39 | 41 | }); |
| 40 | 42 | |
| 41 | 43 | it("falls back to defaults when there is no match", () => { |
apps/web/src/vscode-icons.ts+5| ... | ... | @@ -45,6 +45,11 @@ const languageIdByFileName = toLowercaseLookup(languageAssociations.fileNameToLa |
| 45 | 45 | const localLanguageIdByExtensionOverrides = { |
| 46 | 46 | // Cursor rules files (*.mdc) are commonly treated as markdown in VSCode/Cursor. |
| 47 | 47 | mdc: "markdown", |
| 48 | // Upstream languages.ts maps yml/yaml to specialized language ids that can produce | |
| 49 | // non-generic YAML icons (for example cloudfoundry/esphome). Prefer the base YAML icon | |
| 50 | // unless a more specific basename/extension match (e.g. azure-pipelines.yml) is found. | |
| 51 | yml: "yaml", | |
| 52 | yaml: "yaml", | |
| 48 | 53 | } as const; |
| 49 | 54 | |
| 50 | 55 | const defaultDarkFileIconDefinition = manifest.file ?? "_file"; |