From 39d2ca2ba3169ea27f17c5fb0a05b92b47ee317a Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Wed, 27 Aug 2025 18:04:54 -0600 Subject: [PATCH] style(webview): replace remaining inline styles in FilesChangedOverview with CSS utility classes where feasible; keep dynamic styles for virtualization --- .../file-changes/FilesChangedOverview.tsx | 133 +++--------------- 1 file changed, 18 insertions(+), 115 deletions(-) diff --git a/webview-ui/src/components/file-changes/FilesChangedOverview.tsx b/webview-ui/src/components/file-changes/FilesChangedOverview.tsx index 5bdc144665..7b3e2cc118 100644 --- a/webview-ui/src/components/file-changes/FilesChangedOverview.tsx +++ b/webview-ui/src/components/file-changes/FilesChangedOverview.tsx @@ -203,27 +203,11 @@ const FilesChangedOverview: React.FC = () => { return (
+ className="files-changed-overview border border-vscode-panel-border rounded p-3 my-2 bg-vscode-editor-background" + data-testid="files-changed-overview"> {/* Collapsible header */}
setIsCollapsed(!isCollapsed)} onKeyDown={(e) => { if (e.key === "Enter" || e.key === " ") { @@ -241,15 +225,11 @@ const FilesChangedOverview: React.FC = () => { : 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, @@ -259,7 +239,7 @@ const FilesChangedOverview: React.FC = () => { {/* Action buttons always visible for quick access */}
e.stopPropagation()} // Prevent collapse toggle when clicking buttons > @@ -285,16 +256,7 @@ const FilesChangedOverview: React.FC = () => { disabled={isProcessing} tabIndex={0} data-testid="accept-all-button" - style={{ - backgroundColor: "var(--vscode-button-background)", - color: "var(--vscode-button-foreground)", - border: "none", - borderRadius: "3px", - padding: "4px 8px", - fontSize: "12px", - cursor: isProcessing ? "not-allowed" : "pointer", - opacity: isProcessing ? 0.6 : 1, - }} + className={`bg-vscode-button-background text-vscode-button-foreground border border-vscode-button-border rounded px-2 py-1 text-xs ${isProcessing ? "opacity-60 cursor-not-allowed" : "cursor-pointer"}`} title={t("file-changes:actions.accept_all")}> {t("file-changes:actions.accept_all")} @@ -304,13 +266,7 @@ const FilesChangedOverview: React.FC = () => { {/* Collapsible content area */} {!isCollapsed && (
{shouldVirtualize && (
@@ -382,56 +338,23 @@ const FileItem: React.FC = React.memo( ({ file, formatLineChanges, onViewDiff, onAcceptFile, onRejectFile, handleWithDebounce, isProcessing, t }) => (
-
-
+ className="flex justify-between items-center px-2 py-1.5 mb-1 bg-vscode-list-hoverBackground rounded text-[13px] min-h-[60px]"> +
+
{file.uri}
-
+
{t(`file-changes:file_types.${file.type}`)} • {formatLineChanges(file)}
-
+