setIsCollapsed(!isCollapsed)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter" || e.key === " ") {
+ e.preventDefault()
+ setIsCollapsed(!isCollapsed)
+ }
+ }}
+ tabIndex={0}
+ role="button"
+ aria-expanded={!isCollapsed}
+ aria-label={t("file-changes:accessibility.files_list", {
+ count: files.length,
+ state: isCollapsed
+ ? t("file-changes:accessibility.collapsed")
+ : t("file-changes:accessibility.expanded"),
+ })}
+ title={isCollapsed ? t("file-changes:header.expand") : t("file-changes:header.collapse")}>
+
+
+
+ {t("file-changes:summary.count_with_changes", {
+ count: files.length,
+ changes: totalChanges,
+ })}
+
+
+
+ {/* Action buttons always visible for quick access */}
+
e.stopPropagation()} // Prevent collapse toggle when clicking buttons
+ >
+
+
+
+
+ {shouldVirtualize && (
+
+
+ {visibleItems.map((file: any) => (
+
+ ))}
+
+
+ )}
+ {!shouldVirtualize &&
+ files.map((file: FileChange) => (
+
+ ))}
+