feat(git): in-app source control panel#19
Merged
Conversation
Adds a VS Code-style source control MVP for workspaces that are git
repositories. No new runtime dependencies — all git work shells out
via child_process.execFile with array args.
IPC channels (main + preload):
- git:status — parses `git status --porcelain=v1 -b -z`
- git:diff — `git diff` / `git diff --cached`, pseudo-diff for untracked
- git:stage — `git add`
- git:unstage — `git restore --staged` (reset HEAD fallback)
- git:discard — checkout HEAD for tracked / fs unlink for untracked
- git:commit — `git commit -m`
- git:push — `git push`, returns { ok, message }
- git:pull — `git pull --ff-only`, returns { ok, message }
Shared types: GitFileChange, GitFileChangeStatus, GitStatus, GitOpResult
added to ScrapemanBridge. Porcelain parser lives in @scrapeman/http-core
(src/git/porcelain.ts) so it can be unit-tested without electron.
UI:
- New SourceControlPanel component with staged/unstaged sections,
per-row stage/unstage/discard actions, commit message textarea,
commit button, push/pull with ahead/behind counts, refresh, inline
diff viewer with +/- coloring.
- Sidebar gains a Files/Git tab switcher; git tab shows dirty badge.
- File tree shows M/A/D/U/R badges next to modified files.
- Store slice gitStatus/loadGitStatus/stageFile/unstageFile/discardFile/
commitChanges/gitPush/gitPull; saveActive triggers an auto-refresh
so edits show up in the panel immediately.
Tests: 8 new vitest cases for the porcelain parser covering branch
parsing, ahead/behind, renames, untracked, staged+dirty, detached HEAD.
Out of scope (follow-ups): hunk-level staging, merge conflict UI,
branch switching/history, stash/rebase, credential prompts, git init
flow for non-repo workspaces.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kapatır #18.
Workspace bir git reposu olduğunda VS Code tarzı kaynak kontrol panelini çalıştırır. Yeni runtime bağımlılığı yok — tüm git çağrıları
child_process.execFileile array-arg olarak yapılır, shell'den geçmez.Ana eklemeler
git:status,git:diff,git:stage,git:unstage,git:discard,git:commit,git:push,git:pull) — main + preload +ScrapemanBridgetipleri.@scrapeman/http-core/src/git/porcelain.tsiçinde saf fonksiyon olarak; electron olmadan test edilebilir. 8 yeni vitest case (branch, ahead/behind, rename, untracked, staged+dirty, detached HEAD).gitStatus+ tüm aksiyonlar;saveActivesonrası otomatik refresh.git:discardiçin renderer tarafında confirm dialog.Kapsam dışı (V2)
git init+ remote ekleme akışı (issue'daki Mod B)Doğrulama
pnpm -r typechecktemizpnpm -r test— 145 / 145 (yeni 8 parser testi dahil)pnpm --filter=@scrapeman/desktop buildbaşarılı