feat(changes): add staging, commit & push and file revert to sidebar#1349
Conversation
jschwxrz
commented
Mar 7, 2026
- reintroduces staging, commit & push and file revert to sidebar
|
@jschwxrz is attempting to deploy a commit to the General Action Team on Vercel. A member of the Team first needs to authorize it. |
|
this draft reintroduces staging, commit & push and file revert to the sidebar. should we keep the commiting, pushing, pulling, undo etc. logic in the diff viewer? Or get rid of that and only keep the minimal staging/commiting/reverting logic in the sidebar? lmk and I will either create the PR or kick that out and then open it |
|
Hey @jschwxrz - I think we can do both. Keep the diff viewer as it is with the commit and push functionalities on the left (which we can also move to the right at some point but thats a different topic) + staging / unstaging and commit + push in the normal right changes panel as well. |
Greptile SummaryThis PR re-introduces inline git workflow controls to the Key observations:
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| src/renderer/components/FileChangesPanel.tsx | Adds per-file stage/unstage, a "Stage All" shortcut, a commit-message input with Commit & Push, and a confirmation-gated file revert. Three issues: isStagingAll omitted from the task-change reset; the revert button is active on already-staged files whose behaviour depends on the (unverified) revertFile IPC implementation; and the onOpenChanges (FileDiff) button is no longer reachable when there are uncommitted changes. |
Sequence Diagram
sequenceDiagram
participant User
participant FileChangesPanel
participant electronAPI
User->>FileChangesPanel: Click stage/unstage button
FileChangesPanel->>FileChangesPanel: setStagingFiles.add(path)
alt stage
FileChangesPanel->>electronAPI: stageFile({taskPath, filePath})
else unstage
FileChangesPanel->>electronAPI: unstageFile({taskPath, filePath})
end
electronAPI-->>FileChangesPanel: result
FileChangesPanel->>FileChangesPanel: setStagingFiles.delete(path)
FileChangesPanel->>FileChangesPanel: refreshChanges()
User->>FileChangesPanel: Click "Stage All"
FileChangesPanel->>FileChangesPanel: setIsStagingAll(true)
FileChangesPanel->>electronAPI: stageAllFiles({taskPath})
electronAPI-->>FileChangesPanel: result
FileChangesPanel->>FileChangesPanel: setIsStagingAll(false) + refreshChanges()
User->>FileChangesPanel: Enter commit message + click "Commit & Push"
FileChangesPanel->>FileChangesPanel: setIsCommitting(true)
FileChangesPanel->>electronAPI: gitCommitAndPush({taskPath, commitMessage})
electronAPI-->>FileChangesPanel: result
alt success
FileChangesPanel->>FileChangesPanel: setCommitMessage('') + refreshChanges()
FileChangesPanel->>electronAPI: refreshPr()
FileChangesPanel->>electronAPI: getBranchStatus()
FileChangesPanel->>FileChangesPanel: setBranchAhead(ahead)
else failure
FileChangesPanel->>User: toast error
end
FileChangesPanel->>FileChangesPanel: setIsCommitting(false)
User->>FileChangesPanel: Click revert button
FileChangesPanel->>FileChangesPanel: setRestoreTarget(path)
User->>FileChangesPanel: Confirm in AlertDialog
FileChangesPanel->>FileChangesPanel: setRestoreTarget(null)
FileChangesPanel->>FileChangesPanel: setRevertingFiles.add(path)
FileChangesPanel->>electronAPI: revertFile({taskPath, filePath})
electronAPI-->>FileChangesPanel: result
FileChangesPanel->>FileChangesPanel: dispatchFileChangeEvent + refreshChanges()
FileChangesPanel->>FileChangesPanel: setRevertingFiles.delete(path)
Last reviewed commit: 90d7cb3
|
Alright, this should do it. I fixed the valid issues greptile found |
|
Thanks man, will check it out |
|
Will review soon, @jschwxrz! |