feat: Redesign git changes to split stage/unstaged files. (#1359)

* feat: Redesign git changes to split stage/unstaged files.

Signed-off-by: Paolo Insogna <paolo@cowtech.it>

* fixup

Signed-off-by: Paolo Insogna <paolo@cowtech.it>

* fixup

Signed-off-by: Paolo Insogna <paolo@cowtech.it>

* refactor: streamline git changes panel

* fix: label staged and working diff tabs

* fix: isolate staged and working diff files

* fix: scope staged and working diff updates

* fix: scope git row revert to working changes

---------

Signed-off-by: Paolo Insogna <paolo@cowtech.it>
Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
Paolo Insogna
2026-05-24 00:49:38 +03:00
committed by GitHub
co-authored by Bohdan Triapitsyn
parent 9af0de0056
commit e16097b05d
42 changed files with 2987 additions and 923 deletions
+68
View File
@@ -0,0 +1,68 @@
import { describe, expect, it, vi } from 'vitest';
vi.mock('@openchamber/ui/lib/gitApiHttp', () => ({
checkIsGitRepository: vi.fn(),
getGitStatus: vi.fn(),
getGitDiff: vi.fn(),
getGitFileDiff: vi.fn(),
revertGitFile: vi.fn(),
stageGitFile: vi.fn(),
stageGitFiles: vi.fn(),
unstageGitFile: vi.fn(),
unstageGitFiles: vi.fn(),
isLinkedWorktree: vi.fn(),
getGitBranches: vi.fn(),
deleteGitBranch: vi.fn(),
deleteRemoteBranch: vi.fn(),
removeRemote: vi.fn(),
generateCommitMessage: vi.fn(),
generatePullRequestDescription: vi.fn(),
listGitWorktrees: vi.fn(),
validateGitWorktree: vi.fn(),
createGitWorktree: vi.fn(),
deleteGitWorktree: vi.fn(),
validateWorktreeDirectory: vi.fn(),
canonicalizeWorktreeState: vi.fn(),
createGitCommit: vi.fn(),
gitPush: vi.fn(),
gitPull: vi.fn(),
gitFetch: vi.fn(),
listGitStashes: vi.fn(),
countGitStashFiles: vi.fn(),
stashGitChanges: vi.fn(),
applyGitStash: vi.fn(),
popGitStash: vi.fn(),
dropGitStash: vi.fn(),
checkoutBranch: vi.fn(),
createBranch: vi.fn(),
renameBranch: vi.fn(),
getGitLog: vi.fn(),
getCommitFiles: vi.fn(),
getCurrentGitIdentity: vi.fn(),
hasLocalIdentity: vi.fn(),
setGitIdentity: vi.fn(),
getGitIdentities: vi.fn(),
createGitIdentity: vi.fn(),
updateGitIdentity: vi.fn(),
deleteGitIdentity: vi.fn(),
getRemotes: vi.fn(),
rebase: vi.fn(),
abortRebase: vi.fn(),
continueRebase: vi.fn(),
merge: vi.fn(),
abortMerge: vi.fn(),
continueMerge: vi.fn(),
stash: vi.fn(),
stashPop: vi.fn(),
getConflictDetails: vi.fn(),
}));
describe('createWebGitAPI', () => {
it('exposes bulk stage and unstage methods', async () => {
const { createWebGitAPI } = await import('./git');
const api = createWebGitAPI();
expect(typeof api.stageGitFiles).toBe('function');
expect(typeof api.unstageGitFiles).toBe('function');
});
});