diff --git a/apps/web/src/components/DiffPanel.tsx b/apps/web/src/components/DiffPanel.tsx index 211df4ef2..daaa64040 100644 --- a/apps/web/src/components/DiffPanel.tsx +++ b/apps/web/src/components/DiffPanel.tsx @@ -14,6 +14,7 @@ import { parseDiffRouteSearch, stripDiffSearchParams } from "../diffRouteSearch" import { useTheme } from "../hooks/useTheme"; import { buildPatchCacheKey } from "../lib/diffRendering"; import { + acceptAllDiffFiles, expandDiffFile, reconcileDiffFileReviewState, setDiffFileContextMode, @@ -512,6 +513,16 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { const activeReviewState = patchReviewSelectionKey ? (reviewStateBySelectionKey[patchReviewSelectionKey] ?? {}) : {}; + const acceptedFileCount = useMemo( + () => + renderableFilePaths.reduce( + (count, filePath) => count + (activeReviewState[filePath]?.accepted ? 1 : 0), + 0, + ), + [activeReviewState, renderableFilePaths], + ); + const hasUnacceptedFiles = + renderableFilePaths.length > 0 && acceptedFileCount < renderableFilePaths.length; useEffect(() => { if (diffOpen && !previousDiffOpenRef.current) { @@ -595,6 +606,12 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { }, [updateActiveReviewState], ); + const onAcceptAllFiles = useCallback(() => { + if (renderableFilePaths.length === 0) { + return; + } + updateActiveReviewState((current) => acceptAllDiffFiles(current, renderableFilePaths)); + }, [renderableFilePaths, updateActiveReviewState]); const onToggleFileCollapsed = useCallback( (filePath: string) => { updateActiveReviewState((current) => toggleDiffFileCollapsed(current, filePath)); @@ -704,6 +721,18 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) {
Slash commands
-/{slashName}
-/skill read {slashName}
++ Slash commands +
++ /{slashName} +
++ /skill read {slashName} +
+Path
-{pathValue}
++ Installed path +
++ {pathValue} +