fix(canvas): case-insensitive extension lookup in getIcon + topology test fix #697

Merged
devops-engineer merged 1 commits from fix/canvas-geticon-case-insensitive into staging 2026-05-13 11:41:17 +00:00

View File

@ -28,7 +28,8 @@ const FILE_ICONS: Record<string, string> = {
export function getIcon(path: string, isDir: boolean): string {
if (isDir) return "📁";
const ext = "." + (path.split(".").pop() ?? "").toLowerCase();
const parts = path.split(".");
const ext = parts.length > 1 ? "." + parts[parts.length - 1].toLowerCase() : "";
return FILE_ICONS[ext] || "📄";
}