fix(webui): use file-type icons in file change activity

This commit is contained in:
chengyongru authored and chengyongru committed 2026-10-17 23:27:00 +08:00
1 parent d076e4ef13
commit 8de03ac0a2
8 files changed
+132 -68

No files matched your search

+7 -1
View File
@@ -31,6 +31,7 @@ interface FileReferenceChipProps {
path: string;
tooltipPath?: string;
display?: "name" | "path";
showIcon?: boolean;
active?: boolean;
className?: string;
textClassName?: string;
@@ -43,6 +44,7 @@ export function FileReferenceChip({
path,
tooltipPath,
display = "name",
showIcon = true,
active = false,
className,
textClassName,
@@ -97,7 +99,7 @@ export function FileReferenceChip({
],
)}
>
<FileReferenceIcon kind={kind} className="translate-y-[0.12em]" />
{showIcon ? <FileReferenceIcon kind={kind} className="translate-y-[0.12em]" /> : null}
<span
data-sheen-text={active ? displayText : undefined}
className={cn(
@@ -258,6 +260,10 @@ const FILE_ICONS = {
video: FileVideo2,
} satisfies Record<FileReferenceKind, LucideIcon>;
export function fileIconForPath(path: string): LucideIcon {
return FILE_ICONS[fileKindForPath(path)];
}
/** The same file silhouette and stroke in replies, tabs, and attachment tiles. */
export function FileReferenceIcon({ kind, className }: { kind: FileReferenceKind; className?: string }) {
const Icon = FILE_ICONS[kind];