Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/main/frontend/app/components/git/git-changes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,14 @@ function FileSection({
)}
onClick={() => onSelectFile(file)}
>
<IndeterminateCheckbox
checked={checkboxChecked}
indeterminate={checkboxIndeterminate}
onChange={() => onToggleFile(file)}
title={checkboxChecked ? 'Deselect all chunks' : 'Select all chunks'}
/>
<div onClick={(e) => e.stopPropagation()}>
<IndeterminateCheckbox
checked={checkboxChecked}
indeterminate={checkboxIndeterminate}
onChange={() => onToggleFile(file)}
title={checkboxChecked ? 'Deselect all chunks' : 'Select all chunks'}
/>
</div>
<span
className={clsx(
'flex h-4 w-4 flex-shrink-0 items-center justify-center rounded text-[10px] font-bold',
Expand Down
9 changes: 5 additions & 4 deletions src/main/frontend/app/components/git/git-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ export default function GitPanel({ projectName, hasStoredToken }: GitPanelProps)
)

const handleToggleFile = useCallback(
(filePath: string) => {
async (filePath: string) => {
const hunkState = useGitStore.getState().fileHunkStates[filePath]
if (!hunkState || hunkState.totalHunks === 0) {
handleSelectFile(filePath)
return
await handleSelectFile(filePath)
}
if (hunkState.selectedHunks.size === hunkState.totalHunks) {

const updatedState = useGitStore.getState().fileHunkStates[filePath]
if (updatedState.selectedHunks.size === updatedState.totalHunks) {
clearFileHunks(filePath)
} else {
selectAllFileHunks(filePath)
Expand Down
Loading