Skip to content

fix(web): a disabled Push names the real reason when there are local changes - #36786

Merged
juliusmarminge merged 3 commits into
mainfrom
factory/pr-29866-a1794667227
Nov 14, 2026
Merged

juliusmarminge merged 3 commits into
mainfrom
factory/pr-29866-a1794667227

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

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:

  1. Clone on 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.

State Before c666345bb9 After 48483d6c9f
In sync, dirty Before: in sync, dirty After: in sync, dirty
Behind 1, dirty Before: behind, dirty After: behind, dirty
Ahead 1/behind 1, dirty Before: diverged, dirty After: diverged, dirty
Ahead 1, dirty: Push enabled Before: Push enabled After: Push enabled
Interaction recordings, trimmed with final frames held Before recording After recording

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

  • packages/client-runtime/src/state/gitActions.ts (mobile) keeps 'Commit or stash local changes before pushing.'; it is correct there because mobile's canPush still requires a clean worktree. Whether mobile should match web's push availability is a separate product decision.
  • packages/client-runtime/src/state/gitActions.ts (mobile) keeps 'Commit or stash local changes before pushing.'; it is correct there because mobile's canPush still requires a clean worktree.

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Nov 14, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 48483d6

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.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The disabled-action reason helper moved from GitActionsControl.tsx to GitActionsControl.logic.ts. The component now uses the extracted helper, and tests cover push-disabled messages for a branch with no local commits and a branch behind upstream.

Changes: Git action disabled reasons

Layer / File(s) Summary
Extract and validate disabled-action reasons
apps/web/src/components/GitActionsControl.logic.ts, apps/web/src/components/GitActionsControl.tsx, apps/web/src/components/GitActionsControl.logic.test.ts
The logic module now provides explanations for disabled commit, push, and change-request actions. The component uses the helper, and tests check two push-disabled reasons.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: t3dotgg, only21mil

Merge Risk: Minimal · up to 48483

This change shows a more accurate reason when Push is disabled on a branch with local changes. Push behavior itself is unchanged. The change is low risk and ready to merge.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description contains substantial, relevant evidence: a clear reproduction on main, a problem statement (Push tooltip blames local changes), before/after screenshots, interaction recordings, and te… 1) Restructure the description to match the template: add '## Problem', '## Change', '## Scope', and '## Verification' headings. 2) In Scope, link the issue that shows the bug, or explain why a small obvious fix needs no issue. Link PR #367…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the change: a disabled Push now gives the real reason when local changes exist. It follows the conventional commit form and matches the PR's stated objective and the logic change in Gi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: a disabled Push now gives the real reason when local changes exist. It follows the conventional commit form and matches the PR's stated objective and the logic change in GitActionsControl.logic.ts and GitActionsControl.tsx.

Full details: Description check

Explanation

The description contains substantial, relevant evidence: a clear reproduction on main, a problem statement (Push tooltip blames local changes), before/after screenshots, interaction recordings, and test results. However, it fails the template's core structure. It has no '## Problem', '## Change', '## Scope', or '## Verification' headings. The Scope section is missing: there is no linked issue that shows the bug, and no statement on why no issue is needed. Instead, the author links PR #36786 and says it supersedes #29866. The PR also says the head is unchanged and that CI and Macroscope checks were still running at handback, so the verification status is unclear. The description also has an unclear or duplicated bullet under 'Not in this change'. It also omits the conventional commit title. The author's own note says the watch was not completed. The 'Tests' section lists earlier runs on the same head, which is acceptable, but it does not match the template's requirement to describe the focused checks and observed results for the changed behavior. The description also includes a process narrative about a VM and GitHub credentials that does not belong in a PR description.

Resolution

  1. Restructure the description to match the template: add '## Problem', '## Change', '## Scope', and '## Verification' headings. 2) In Scope, link the issue that shows the bug, or explain why a small obvious fix needs no issue. Link PR #36786 only if a maintainer requested it. 3) Use a conventional commit title in plain language, for example 'fix(web): disabled Push shows the correct reason'. 4) In Verification, state the focused test commands and results for the changed behavior. Remove the notes about the failed PR watch and VM credentials, or move them out of the PR description. Clearly state which checks are still pending. 5) Remove the duplicated 'Not in this change' bullet. 6) Keep the before/after screenshots and recordings, and confirm the links resolve. 7) Keep the model and harness attribution at the end, as the template asks.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4747472 and 48483d6.

Files selected for processing: 3

  • apps/web/src/components/GitActionsControl.logic.test.ts
  • apps/web/src/components/GitActionsControl.logic.ts
  • apps/web/src/components/GitActionsControl.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@juliusmarminge
juliusmarminge merged commit 732198d into main Nov 14, 2026
38 checks passed
@juliusmarminge
juliusmarminge deleted the factory/pr-29866-a1794667227 branch November 14, 2026 15:22
kylebegeman pushed a commit to kylebegeman/loom that referenced this pull request Nov 14, 2026
…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.
Pipyakas pushed a commit to Pipyakas/t3code that referenced this pull request Nov 15, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants