The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 20:30 UTC
fix(web): show the Docker icon on dockerfile code blocks (#14675)
Chris Deeming committed
Oct 2, 2026 at 00:58 UTC
67f640093ffea1adaa585949d87e4bc2010b0810
2 files changed
+14
-2
apps/web/src/pierre-icons.test.ts
+5
@@ -56,7 +56,12 @@ describe("Pierre file icons", () => {
56
57
it("normalizes common markdown fence language aliases", () => {
58
assert.equal(syntheticFileNameForLanguageId("typescript"), "file.ts");
59
+ assert.equal(syntheticFileNameForLanguageId("dockerfile"), "Dockerfile");
60
assert.equal(syntheticFileNameForLanguageId("shellscript"), "file.sh");
61
assert.equal(syntheticFileNameForLanguageId("python"), "file.py");
62
});
63
+
64
+ it("gives a dockerfile fence the Docker icon", () => {
65
+ assert.isTrue(hasSpecificPierreIconForFileName(syntheticFileNameForLanguageId("dockerfile")));
66
+ });
67
});
apps/web/src/pierre-icons.ts
+9
-2
@@ -51,7 +51,6 @@ const completeIconResolver = createFileTreeIconResolver(T3_PIERRE_ICONS);
51
const LANGUAGE_EXTENSION_ALIASES: Record<string, string> = {
52
bash: "sh",
53
csharp: "cs",
54
- dockerfile: "dockerfile",
54
javascript: "js",
55
jsx: "jsx",
56
markdown: "md",
@@ -79,9 +78,17 @@ export function inferEntryKindFromPath(pathValue: string): "file" | "directory"
78
return base.includes(".") ? "file" : "directory";
79
}
80
81
+/** Languages whose files are recognised by name rather than by extension. */
82
+const LANGUAGE_FILE_NAMES: Record<string, string> = {
83
+ dockerfile: "Dockerfile",
84
+};
85
+
86
export function syntheticFileNameForLanguageId(languageId: string): string {
87
const normalized = languageId.toLowerCase();
84
- return `file.${LANGUAGE_EXTENSION_ALIASES[normalized] ?? normalized}`;
88
+ return (
89
+ LANGUAGE_FILE_NAMES[normalized] ??
90
+ `file.${LANGUAGE_EXTENSION_ALIASES[normalized] ?? normalized}`
91
+ );
92
}
93
94
export function resolvePierreIconForEntry(