authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-05 23:52:14-08:00
committergravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-05 23:52:26-08:00
log0f208447ed78ba3bc7a3d7cee17f516bd18a67f2
tree464153b9b2c4b6782800727ca183940b4ef0b858
parent71e057345902d9301f9b9d8956f4cf764a6d7fd8

Prefer base HTML icon for .html files

- Override `.html` language mapping to use the generic HTML icon - Add test coverage asserting `index.html` resolves to `file_type_html.svg`

2 files changed, 5 insertions(+), 0 deletions(-)

apps/web/src/vscode-icons.test.ts+2
...@@ -30,12 +30,14 @@ describe("getVscodeIconUrlForEntry", () => {...@@ -30,12 +30,14 @@ describe("getVscodeIconUrlForEntry", () => {
30 const tsxUrl = getVscodeIconUrlForEntry("checkbox.tsx", "file", "light");30 const tsxUrl = getVscodeIconUrlForEntry("checkbox.tsx", "file", "light");
31 const dockerfileUrl = getVscodeIconUrlForEntry("Dockerfile", "file", "dark");31 const dockerfileUrl = getVscodeIconUrlForEntry("Dockerfile", "file", "dark");
32 const shellUrl = getVscodeIconUrlForEntry("entrypoint.sh", "file", "dark");32 const shellUrl = getVscodeIconUrlForEntry("entrypoint.sh", "file", "dark");
33 const htmlUrl = getVscodeIconUrlForEntry("index.html", "file", "dark");
33 const cursorRulesUrl = getVscodeIconUrlForEntry("general.mdc", "file", "dark");34 const cursorRulesUrl = getVscodeIconUrlForEntry("general.mdc", "file", "dark");
34 const githubWorkflowUrl = getVscodeIconUrlForEntry(".github/workflows/ci.yml", "file", "light");35 const githubWorkflowUrl = getVscodeIconUrlForEntry(".github/workflows/ci.yml", "file", "light");
3536
36 assert.isTrue(tsxUrl.endsWith("/file_type_reactts.svg"));37 assert.isTrue(tsxUrl.endsWith("/file_type_reactts.svg"));
37 assert.isTrue(dockerfileUrl.endsWith("/file_type_docker.svg"));38 assert.isTrue(dockerfileUrl.endsWith("/file_type_docker.svg"));
38 assert.isTrue(shellUrl.endsWith("/file_type_shell.svg"));39 assert.isTrue(shellUrl.endsWith("/file_type_shell.svg"));
40 assert.isTrue(htmlUrl.endsWith("/file_type_html.svg"));
39 assert.isTrue(cursorRulesUrl.endsWith("/file_type_markdown.svg"));41 assert.isTrue(cursorRulesUrl.endsWith("/file_type_markdown.svg"));
40 assert.isTrue(githubWorkflowUrl.endsWith("/file_type_light_yaml.svg"));42 assert.isTrue(githubWorkflowUrl.endsWith("/file_type_light_yaml.svg"));
41 });43 });
apps/web/src/vscode-icons.ts+3
...@@ -45,6 +45,9 @@ const languageIdByFileName = toLowercaseLookup(languageAssociations.fileNameToLa...@@ -45,6 +45,9 @@ const languageIdByFileName = toLowercaseLookup(languageAssociations.fileNameToLa
45const localLanguageIdByExtensionOverrides = {45const localLanguageIdByExtensionOverrides = {
46 // Cursor rules files (*.mdc) are commonly treated as markdown in VSCode/Cursor.46 // Cursor rules files (*.mdc) are commonly treated as markdown in VSCode/Cursor.
47 mdc: "markdown",47 mdc: "markdown",
48 // Upstream languages.ts currently maps .html to django-html before html.
49 // Prefer the base HTML icon for standalone HTML files.
50 html: "html",
48 // Upstream languages.ts maps yml/yaml to specialized language ids that can produce51 // 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 icon52 // 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.53 // unless a more specific basename/extension match (e.g. azure-pipelines.yml) is found.