Skip to content

Make Source Control default to Commit and Push, with Publish Branch support #14

Description

@badcuban

Priority: P2

User request

In the Source Control panel, make "Commit and Push" the default action/button. Keep separate "Commit only" and "Push only" actions available as secondary options, likely in a dropdown or split-button menu.

Also consider the merge flow: when a user merges from the Source Control page, BadCode may need to automatically push the merge commit by default. This probably belongs behind a setting like "push after source-control actions" / "auto-push after merge" for users who prefer manual push control. We should brainstorm the exact product behavior when implementing this issue.

Follow-up observed on May 26, 2026:

  • The user was on a new local branch, qol-updater, created outside Source Control.
  • The Source Control panel showed the local branch but did not present an obvious way to publish the branch upstream.
  • The UI should expose a clear publish-branch path when the current branch has no upstream, rather than requiring the user to know the right terminal command.

Why

Most source-control flows should optimize for the common case: commit local changes and push them. Separate commit/push actions are still useful, but they should not dominate the primary path. Merge behavior should follow the same philosophy: if the app helps create a merge commit, the user should not be left with a local-only state unless they explicitly prefer that workflow.

For new local branches, publishing the branch is a core source-control action. A visible Publish branch action is clearer than a generic disabled or ambiguous Push button when hasUpstream is false.

Starting points

  • apps/web/src/components/GitActionsControl.logic.ts owns quick-action and menu action selection.
  • buildMenuItems() currently builds separate Commit, Push, and PR items.
  • resolveQuickAction() already has commit_push and commit_push_pr action paths.
  • apps/web/src/components/GitActionsControl.tsx renders the action UI and dialogs.
  • apps/web/src/components/source-control/SourceControlPanel.tsx has source-control panel commit UI, branch UI, and push mutation wiring.
  • packages/contracts/src/git.ts exposes branch/upstream status such as hasUpstream.
  • apps/server/src/vcs/GitVcsDriverCore.ts already has push paths for branches without upstream, so this may be mostly a UI labeling/gating issue.
  • Merge actions should be checked wherever the Source Control page wires branch/merge operations.

Acceptance criteria

  • Primary source-control action is "Commit and Push" when local changes can be committed and pushed.
  • Secondary menu exposes "Commit only" and "Push only" where each action is valid.
  • When the current local branch has no upstream and a push remote exists, Source Control shows a clear Publish branch action.
  • Publishing a branch pushes HEAD to the selected/default remote branch and sets upstream tracking.
  • The publish action updates source-control status so the branch no longer appears unpublished after completion.
  • Commit-and-push uses the publish-branch path when committing on a new local branch with no upstream.
  • If no push remote exists, Source Control explains the missing remote and routes to repository publishing/setup instead of silently disabling the action.
  • Decide whether auto-push after merge is default behavior, a user setting, or both.
  • If enabled, Source Control merge actions push the resulting merge commit automatically after a successful merge.
  • Users who prefer manual push can disable auto-push behavior.
  • Disabled and default-branch confirmation behavior remains correct.
  • PR/create-PR flows still make sense when a PR exists or can be created.
  • Update GitActionsControl.logic tests, SourceControlPanel coverage, and relevant browser/UI tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequested improvement or new capability.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions