Repository navigation
fix(web): a disabled Push names the real reason when there are local changes - #36786
Conversation
…changes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Disabled Push now explains the actual blocker instead of incorrectly blaming local changes. This is a UI-message correction; action availability and Git execution remain unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…5 (Checking that every fork seam survived) Failing check: Checking that every fork seam survived The seam check failed because `apps/web/src/components/GitActionsControl.tsx` had 21 `fork: source-control-cockpit` markers, and `docs/fork/seams.tsv` expects 22. The missing marker had moved, not disappeared. Upstream commit 732198d (pingdotgg#36786) moved `getMenuActionDisabledReason` out of `GitActionsControl.tsx` and into `GitActionsControl.logic.ts`. The merge had already carried the seam over with its marker: the `gitOperationLabel(gitStatus)` early return, which shows an in-progress git operation as the reason an action is disabled. The `gitOperationLabel` import in the logic file is marked too. Only the seams.tsv counts were out of date: that file now has 9 markers where its row said 8, and `GitActionsControl.tsx` has 21 where its row said 22. I moved the seam's row in `docs/fork/seams.tsv` to follow the code: `GitActionsControl.logic.ts` goes from 8 to 9 and `GitActionsControl.tsx` from 22 to 21. I didn't change any code. I reran `check_seams` and it passes.
…changes (pingdotgg#36786) Co-authored-by: Alex Southwell <4596216+saphid@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> (cherry picked from commit 732198d)
Nothing needed changing on this pass, so nothing was pushed and the head is unchanged. PR #36786 is linked to this thread, but I could not stay on it: watch_pull_request failed twice with 'GitHub has no working credential for this host', and gh auth status says the token on this VM is invalid. At handback the PR head was 48483d6, with CI (Build and Typecheck, Lint, the Test Web and Test Server shards) and the Macroscope checks still running or queued. No reviews and no line comments were posted (read over the public REST API without a token). The rest of the watch, meaning failing checks and Macroscope or CodeRabbit findings rated high or above, has to be done by a step with a working GitHub login. Earlier validation of this head still holds: vp run check:changed passed (format, lint, knip, typecheck, tests, react compiler).
Supersedes #29866. The change is @saphid's; their commits are kept.
Reproduction on main
Reproduced on main at cebdf39:
feature, in sync with origin/feature, with an uncommitted edit to tracked README.md. Opened Git action options: Commit enabled, Push disabled, Create PR enabled. Hovering Push showed "Commit or stash local changes before pushing." The correct blocker is that there are no local commits to push. 2) Pushed an empty commit to origin/feature from a second clone and fetched it into the first, keeping the edit (status: behind 1, dirty). Reloaded and reopened the menu: the primary action became Commit, Push and Create PR were disabled. Hovering Create PR showed "Branch is behind upstream. Pull/rebase before creating a pull request." Hovering Push still showed "Commit or stash local changes before pushing." 3) Committed a new file locally (ahead 1, behind 1, still dirty): Push was disabled and its tooltip still blamed local changes. 4) Control: stashed, rebased onto origin/feature, popped the stash (ahead 1, behind 0, same uncommitted edit). Push was enabled. Since Push is available with uncommitted edits, local edits are not a Push blocker, and the tooltip in states 1-3 names the wrong reason. The text comes from the hasChanges check at apps/web/src/components/GitActionsControl.tsx:264, which runs before the isBehind and !isAhead checks.Evidence
Environment: real web client and server, Chromium, 1280×800, light theme, isolated fresh databases, synthetic local bare Git remotes, and free replay provider.
Steps on both commits: create feature tracking origin/feature with an uncommitted tracked README edit; open Git action options and hover Push when in sync, behind 1 after a second clone pushes an empty commit, and ahead 1/behind 1 after committing local.txt. Then stash, rebase onto origin/feature, pop the stash, and verify Push remains enabled with ahead 1/behind 0 and the edit retained. Each state was fully prepared before opening its replay thread to avoid stale status caches.
Proven: base showed “Commit or stash local changes before pushing.” in all three disabled states. Head showed “No local commits to push.” when in sync and “Branch is behind upstream. Pull/rebase before pushing.” when behind or diverged. Push was enabled in the ahead-and-dirty control on both commits.
Scenario and seed driver
Tests
No new commands this pass, since the code did not change. Earlier on this head: vp test run src/components/GitActionsControl.logic.test.ts (18 passed) and vp run check:changed (all passed).
Not in this change
Who did the work
Run by the t3code factory in T3 Code.