From a43942c83e9c9f8a1817c778d76aedbc94c76225 Mon Sep 17 00:00:00 2001 From: Phelipe Lorran <112786693+httpsphl@users.noreply.github.com> Date: Fri, 2 Oct 2026 12:23:45 -0300 Subject: [PATCH] feat(files): a color and an icon per kind of file in the files panel Word documents are blue, sheets green, PDFs red, slides orange, images purple, audio and video pink, archives amber and code teal, each in a tinted tile, so the list reads at a glance. The kind comes from the extension first, since old Office and OpenDocument files arrive as octet-stream. --- app/src/features/files/FilesPanel.tsx | 9 ++- app/src/features/files/kinds.test.ts | 39 +++++++++ app/src/features/files/kinds.ts | 109 +++++++++++++++++++++----- app/src/files.css | 70 +++++++++++++++++ app/src/index.css | 1 + docs/spec.md | 2 +- 6 files changed, 206 insertions(+), 24 deletions(-) create mode 100644 app/src/features/files/kinds.test.ts create mode 100644 app/src/files.css diff --git a/app/src/features/files/FilesPanel.tsx b/app/src/features/files/FilesPanel.tsx index 7e000c53..32226198 100644 --- a/app/src/features/files/FilesPanel.tsx +++ b/app/src/features/files/FilesPanel.tsx @@ -11,7 +11,7 @@ import { Callout } from "../../ui/Callout"; import { SidePanel } from "../../ui/SidePanel"; import { BotAvatar } from "../bots/BotAvatar"; import { FilePreview } from "./FilePreview"; -import { fileIcon } from "./kinds"; +import { fileKind, kindIcon } from "./kinds"; import type { BotFiles } from "./useBotFiles"; export function FilesPanel({ @@ -124,7 +124,8 @@ function FileRow({ onOpen(path: string): void; }) { const t = useT().files; - const Icon = fileIcon(file.mediaType, file.name); + const kind = fileKind(file.mediaType, file.name); + const Icon = kindIcon(kind); return (