Remove the commit box and the staging controls - #47
Merged
Conversation
The AI in the terminal does the committing. It runs the user's own git in the user's own worktree, so a stage button in the sidebar is a second writer of the index that the agent cannot see — two tools disagreeing about one repository. CommitBox is gone. ChangesPanel keeps the staged/unstaged grouping, because that is what git status reports whoever put the paths there, but its rows carry no action: each row is now the button that opens its file. BranchBar is untouched — branch switch, pull, push and the ahead/behind counts are what is left, and none of them writes the index. The bound surface is only what the UI calls, so GitStage, GitUnstage and GitCommit go with the controls, and bindings are regenerated. The issue allowed internal/git to keep its three methods for a future diff viewer; nothing calls them, and code that is not wired in is dead code that has to be maintained anyway, so Stage, Unstage and Commit go too, along with everything only they reached: pathspecs, relative, ErrNoPaths, ErrOutsideRoot, ErrEmptyMessage and invocation.stdin. run.go's stdout fallback stays. Its known instance was `git commit` with an empty index, which this package no longer runs, and no remaining subcommand was observed choosing stdout for a failure — but which stream carries the reason is git's decision per subcommand, and the cost of guessing wrong is an error box reading "exit status 1" with no way to find out what happened. Ratchets come down rather than standing still: maxAppMethods 24 -> 21, internal/git 27 -> 21 exported and 1000 -> 900 LOC. DESIGN.md §7 carries the decision so the design document stops describing a commit box. Closes #39.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #47 +/- ##
==========================================
+ Coverage 93.43% 93.50% +0.07%
==========================================
Files 32 32
Lines 1553 1510 -43
==========================================
- Hits 1451 1412 -39
+ Misses 64 62 -2
+ Partials 38 36 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Closes #39. Child of #37 §2.
What changes
The AI in the terminal does the committing. It runs the user's own
gitin the user's own worktree, so a stage button in the sidebar is a second writer of the index that the agent cannot see — two tools disagreeing about one repository.CommitBoxis deleted, along with its test.ChangesPanelkeeps the staged/unstaged grouping and loses every action. The grouping stays because it is whatgit statusreports whoever put the paths there; a path in the index and a path only on disk are different facts. Each row is now simply the button that opens its file, soRowandFileButtoncollapsed into oneChangeRow. The conflict hint drops "then stage them", which named a thing the UI can no longer do.BranchBaris untouched. Branch display and switch, pull, push and the ahead/behind counts are what is left, and none of them writes the index.GitStage,GitUnstageandGitCommitare gone frominternal/app, andfrontend/wailsjsis regenerated.Gitloses three methods,useGitOpsloses three operations (and its internalrunstops returning a success flag that only the commit editor read), andgitOps.tslosesCommitDraft,commitMessage,hasMessage,commitBlockedReason,stagedPaths,pathsOfandpathsOfAll.style.cssloses the.commit*block and the.changes__action/.changes__allrules.The judgment call worth reviewing
The issue said the
internal/gitmethods "can stay if the diff viewer (#35) or status still uses them." Nothing does — #35 is read-only and unbuilt — so under the no-vaporware rule they are not "kept for later", they are unreachable code.Stage,UnstageandCommitare removed, along with everything only they reached:pathspecs,relative,ErrNoPaths,ErrOutsideRoot,ErrEmptyMessage,gitDirandinvocation.stdin.If you want them held for #35 instead, that is a revert of
internal/git/ops.goand its tests plus the two pin changes; the UI half stands either way.One thing deliberately kept
run.go'sexplanationpicks stdout when stderr is blank. Its known instance wasgit commitwith an empty index, which this package no longer runs, and I checked pull, push and checkout — none of them was observed putting a failure reason on stdout only. The branch stays anyway: which stream carries the reason is git's decision per subcommand rather than this package's, and the cost of guessing wrong is an error box readingexit status 1with no way to find out what happened. Five lines and a unit test is the cheaper side of that trade. Its comment now says all of this plainly instead of citing a command m6t runs.Ratchets
All three come down; none goes up.
maxAppMethodsinternal/gitexportedinternal/gitLOC ceilingmaxAppMethodshas never come down before. The #9 note argued each of the eight git bindings was a request with an answer and no throughput, which was true and is not the test these three failed — they failed the older one, that the bound surface is only what the UI calls.Documentation
DESIGN.md described a commit box with a message editor, a
commitbinding and a git service that commits. Left alone it would now be wrong, so §7 carries the decision and its reason, and §3.2, §3.3 and the summary at the top follow. README's feature line follows too.Adversarial review
What I went looking for and what it found:
Commit/Stage/Unstageacross Go, TS, TSX, MD and JSON: nothing left but unrelated words (commitFixture,buildinfo.commit, the tree's inline-renamecommitRename)./^Stage/and/^Unstage/, which match every row's own accessible name (Staged: a.yaml). It passed on the rows rather than on the missing buttons. Both suites now assert exact names, andChangesPaneladditionally pins the full button list per render — that one fails if a control comes back under any name.checkoutBlockedReason's "Commit or stash your changes" still honest? Yes: both happen in the terminal, and the doc comment now says so rather than leaving a reader to wonder which button it means.gitOutputandstagedState(test helpers),fileIn(still used, checked), thechanges__itemclass and thechange:test IDs (nothing read them) — all removed.golangci-lint run ./...over the whole repo, not just the patch scope, reports 0 issues, anddeadcodereports nothing.Gates
make verifygreen.golangci-lint run ./...— 0 issues (full repo, not just patch scope)make bindings-checkgreenmake build-checkgreen;dead-codereports nothing