Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bae33c5
fix(git): ask which remote to push to when none is named origin
TonybynMp4 Nov 6, 2026
c74c63c
feat(git): add push remote picker for branches
TonybynMp4 Nov 9, 2026
4907cc0
fix(git): ask for a push remote when upstream is only a base
TonybynMp4 Nov 9, 2026
dbadfb5
fix(web): push remote menu closes after picking a remote
TonybynMp4 Nov 9, 2026
ee465b7
fix(git): validate push remote names and bind PRs to the branch host
TonybynMp4 Nov 9, 2026
686ef3d
fix: Resolve the branch remote when the fallback context is null
TonybynMp4 Nov 9, 2026
06d180e
fix(git): the PR base check uses the chosen push remote
TonybynMp4 Nov 11, 2026
44217bd
fix(git): ignore stale push remotes and unknown branches
TonybynMp4 Nov 11, 2026
5c1f9df
fix(git): read a PR's base from the branch remote when only it has it
TonybynMp4 Nov 11, 2026
a7eecd7
fix(web): picking a push remote no longer skips the default branch pr…
TonybynMp4 Nov 11, 2026
58cdeb0
Merge upstream/main into feat/push-remote-picker
TonybynMp4 Nov 11, 2026
2fa730d
Merge upstream/main into feat/push-remote-picker
TonybynMp4 Nov 13, 2026
a24caba
Merge upstream/main into feat/push-remote-picker
TonybynMp4 Nov 14, 2026
628290f
Merge branch 'main' into feat/push-remote-picker
TonybynMp4 Nov 14, 2026
d0fb290
fix(git): picking a push remote keeps the branch's tracking
TonybynMp4 Nov 15, 2026
12618ca
Merge upstream/main into feat/push-remote-picker
TonybynMp4 Nov 15, 2026
b597057
Merge remote-tracking branch 'origin/feat/push-remote-picker' into fe…
TonybynMp4 Nov 15, 2026
c6bb29a
Merge branch 'main' into feat/push-remote-picker
TonybynMp4 Nov 16, 2026
aa34e2e
Merge upstream/main into feat/push-remote-picker
TonybynMp4 Nov 17, 2026
940987a
Merge remote-tracking branch 'origin/feat/push-remote-picker' into fe…
TonybynMp4 Nov 17, 2026
3aff7c4
merge: integrate main into push remote picker
maria-rcks Nov 18, 2026
9d106d0
Merge upstream/main into feat/push-remote-picker
TonybynMp4 Nov 18, 2026
170971f
fix(git): preserve remote selection across worktrees and hosts
maria-rcks Nov 18, 2026
40ae532
merge: preserve contributor updates to push remote picker
maria-rcks Nov 18, 2026
708ab60
fix(mobile): keep remote selection dismissal on its own sheet
maria-rcks Nov 18, 2026
1afd8ab
fix(git): retain shared remote cache invalidation
maria-rcks Nov 18, 2026
a161d46
Merge upstream/main into feat/push-remote-picker
TonybynMp4 Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/mobile/src/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import { DevicePreviewRouteScreen } from "./features/devices/DevicePreviewRouteS
import { BrowserPreviewRouteScreen } from "./features/browser/BrowserPreviewRouteScreen";
import { LocalPreviewRouteScreen } from "./features/browser/LocalPreviewRouteScreen";
import { GitBranchesSheet } from "./features/threads/git/GitBranchesSheet";
import { GitRemoteSheet } from "./features/threads/git/GitRemoteSheet";
import { GitCommitSheet } from "./features/threads/git/GitCommitSheet";
import { GitConfirmSheet } from "./features/threads/git/GitConfirmSheet";
import { GitOverviewSheet } from "./features/threads/git/GitOverviewSheet";
Expand Down Expand Up @@ -808,6 +809,11 @@ const RootStackConfig = createWorkspaceStackNavigator({
linking: `${THREAD_LINKING_PREFIX}/git/branches`,
options: sheetRoute({ detent: 0.55, androidFit: true }),
}),
GitRemote: createNativeStackScreen({
screen: GitRemoteSheet,
linking: `${THREAD_LINKING_PREFIX}/git/remote`,
options: sheetRoute({ detent: 0.55, androidFit: true }),
}),
GitConfirm: createNativeStackScreen({
screen: GitConfirmSheet,
linking: `${THREAD_LINKING_PREFIX}/git-confirm`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const LISTED_OVERLAY_ROUTES: ReadonlySet<string> = new Set([
"GitBranches",
"GitCommit",
"GitConfirm",
"GitRemote",
"GitOverview",
"NewTaskProject",
"NewTaskFiles",
Expand Down
16 changes: 16 additions & 0 deletions apps/mobile/src/features/threads/git/GitOverviewSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,22 @@ function GitOverviewSheetContent(props: GitOverviewSheetProps) {
)
}
/>
{gitStatus.data?.remotes && gitStatus.data.refName ? (
<ListRow
icon="cloud"
label={gt("Push remote")}
description={gitStatus.data.pushRemote ?? gt("Not chosen")}
disabled={busy}
onPress={() =>
presentRoute(() =>
navigation.navigate("GitRemote", {
environmentId: String(environmentId),
threadId: String(threadId),
}),
)
}
/>
) : null}
{linkedPrActions.canLink ? (
<ListRow
icon="link"
Expand Down
118 changes: 118 additions & 0 deletions apps/mobile/src/features/threads/git/GitRemoteSheet.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import { useRef, useState } from "react";
import { useGT } from "gt-react-native";
import type { GitStackedAction } from "@t3tools/contracts";
import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native";
import { Platform, ScrollView, useWindowDimensions, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";

import { ListChoiceRow } from "../../../components/ui/ListChoiceRow";
import { ListSection } from "../../../components/ui/ListSection";
import { ScreenContent } from "../../../components/ui/ScreenContent";
import { SheetHeader } from "../../../components/ui/SheetHeader";
import { useEnvironmentQuery } from "../../../state/query";
import { useSelectedThreadGitActions } from "../../../state/use-selected-thread-git-actions";
import { useSelectedThreadWorktree } from "../../../state/use-selected-thread-worktree";
import { useThreadSelection } from "../../../state/use-thread-selection";
import { vcsEnvironment } from "../../../state/vcs";

type GitRemoteSheetProps = StaticScreenProps<{
readonly environmentId: string;
readonly threadId: string;
/** Set when a git action is waiting on the choice; it runs once a remote is picked. */
readonly action?: GitStackedAction;
readonly commitMessage?: string;
readonly featureBranch?: string;
readonly filePaths?: string;
}>;

export function GitRemoteSheet(props: GitRemoteSheetProps) {
const { environmentId, threadId, action, commitMessage, featureBranch, filePaths } =
props.route.params;
const gt = useGT();
const navigation = useNavigation();
const insets = useSafeAreaInsets();
const { height: windowHeight } = useWindowDimensions();
const { selectedThread } = useThreadSelection();
const { selectedThreadCwd } = useSelectedThreadWorktree();
const gitActions = useSelectedThreadGitActions();
const gitStatus = useEnvironmentQuery(
selectedThread !== null && selectedThreadCwd !== null
? vcsEnvironment.status({
environmentId: selectedThread.environmentId,
input: { cwd: selectedThreadCwd },
})
: null,
);
const selecting = useRef(false);
const [isSelecting, setIsSelecting] = useState(false);
const remotes = gitStatus.data?.remotes ?? [];
const pushRemote = gitStatus.data?.pushRemote;

const runSelection = async (remoteName: string) => {
if (action) {
navigation.dispatch(StackActions.replace("Thread", { environmentId, threadId }));
await gitActions.onRunSelectedThreadGitAction({
action,
pushRemote: remoteName,
...(commitMessage ? { commitMessage } : {}),
...(featureBranch === "true" ? { featureBranch: true } : {}),
...(filePaths ? { filePaths: JSON.parse(filePaths) as string[] } : {}),
});
return;
}
const result = await gitActions.onSetSelectedThreadPushRemote(remoteName);
if (result !== null && navigation.isFocused()) navigation.goBack();
};
const selectRemote = async (remoteName: string) => {
if (selecting.current) return;
selecting.current = true;
setIsSelecting(true);
await runSelection(remoteName).finally(() => {
selecting.current = false;
setIsSelecting(false);
});
};

return (
<View
collapsable={false}
className="bg-sheet ios:flex-1 android:flex-col-reverse"
style={Platform.OS === "android" ? { maxHeight: windowHeight * 0.92 } : undefined}
>
<ScreenContent fitToContents>
<ScrollView
nestedScrollEnabled
className="android:shrink android:grow-0 ios:flex-1"
contentInsetAdjustmentBehavior="automatic"
showsVerticalScrollIndicator={false}
contentInset={{ bottom: Math.max(insets.bottom, 18) + 18 }}
contentContainerClassName="android:gap-2 android:p-2 ios:gap-4 ios:px-5 ios:pt-2"
>
<ListSection
{...(action
? {
footer: gt(
"This repository has several remotes and the branch has none chosen yet. It will track the one you pick.",
),
}
: {})}
>
{remotes.map((remoteName) => (
<ListChoiceRow
key={remoteName}
label={remoteName}
selected={remoteName === pushRemote}
disabled={isSelecting || !gitActions.canWriteSourceControl}
onPress={() => void selectRemote(remoteName)}
/>
))}
</ListSection>
</ScrollView>
</ScreenContent>
<SheetHeader
title={action ? gt("Push to which remote?") : gt("Push remote")}
onClose={() => navigation.goBack()}
/>
</View>
);
}
5 changes: 5 additions & 0 deletions apps/mobile/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,7 @@
"5521de0732509b7c": "Neueste Änderungen werden gepullt",
"adb9c574404d1db8": "Bereits auf dem neuesten Stand",
"84964b49287ced17": "Neuester Stand auf {branch} gepullt",
"ea8ce1c79f81b25d": "Push-Remote wird geändert",
"439fbd498ad5aba1": "Anhänge sind nicht bereit",
"f928da494821aeb0": "Warte, bis die Uploads abgeschlossen sind, oder wiederhole fehlgeschlagene Uploads.",
"4c7966190fc234b4": "Zu viele Kontextelemente",
Expand Down Expand Up @@ -5258,10 +5259,14 @@
"5c72439f2a8e12bf": "Änderungen, nicht committete Bearbeitungen und Diffs der Runden untersuchen",
"466265a5e2628fb2": "Branch wechseln, Branch erstellen oder in einen Worktree wechseln",
"6ed8a3818ccfda2d": "Branches und Worktrees anzeigen",
"18cf05cd2cd7dd0e": "Push-Remote",
"8ba218cd9a65f767": "Nicht ausgewählt",
"b294ba924b8cd9c1": "{term, select, mr {Einen Merge Request per URL oder Nummer anhängen} cr {Eine Änderungsanfrage per URL oder Nummer anhängen} other {Einen Pull Request per URL oder Nummer anhängen}}",
"518ca475a032d313": "Verknüpfte {terms}",
"28dd3410a8843fed": "Worktree",
"a46d99e72af41cd4": "Repository-Status aktualisieren",
"00c1e5d0b43e70be": "Dieses Repository hat mehrere Remotes und für diesen Branch wurde noch keines ausgewählt. Er wird das ausgewählte Remote verfolgen.",
"db3369af717edbfb": "An welches Remote pushen?",
"cd49e17eaf69eee3": "Branch-Status wird geladen…",
"95be4cac9ca707c4": "Kein Git-Repository",
"d804d85750efb3b8": "{term, select, mr {MR #{number} offen} cr {Änderungsanfrage #{number} offen} other {PR #{number} offen}}",
Expand Down
5 changes: 5 additions & 0 deletions apps/mobile/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,7 @@
"5521de0732509b7c": "Pulling latest changes",
"adb9c574404d1db8": "Already up to date",
"84964b49287ced17": "Pulled latest on {branch}",
"ea8ce1c79f81b25d": "Changing push remote",
"439fbd498ad5aba1": "Attachments are not ready",
"f928da494821aeb0": "Wait for uploads to finish, or retry failed uploads.",
"4c7966190fc234b4": "Too many context items",
Expand Down Expand Up @@ -5259,10 +5260,14 @@
"5c72439f2a8e12bf": "Inspect changes, uncommitted edits, and turn diffs",
"466265a5e2628fb2": "Switch branch, create branch, or move to a worktree",
"6ed8a3818ccfda2d": "View branches and worktrees",
"18cf05cd2cd7dd0e": "Push remote",
"8ba218cd9a65f767": "Not chosen",
"b294ba924b8cd9c1": "{term, select, mr {Attach a merge request by URL or number} cr {Attach a change request by URL or number} other {Attach a pull request by URL or number}}",
"518ca475a032d313": "Linked {terms}",
"28dd3410a8843fed": "Worktree",
"a46d99e72af41cd4": "Refresh repository status",
"00c1e5d0b43e70be": "This repository has several remotes and the branch has none chosen yet. It will track the one you pick.",
"db3369af717edbfb": "Push to which remote?",
"cd49e17eaf69eee3": "Loading branch status…",
"95be4cac9ca707c4": "Not a git repository",
"d804d85750efb3b8": "{term, select, mr {MR #{number} open} cr {change request #{number} open} other {PR #{number} open}}",
Expand Down
5 changes: 5 additions & 0 deletions apps/mobile/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,7 @@
"5521de0732509b7c": "Haciendo pull de los últimos cambios",
"adb9c574404d1db8": "Ya está actualizado",
"84964b49287ced17": "Pull de los últimos cambios en {branch} completado",
"ea8ce1c79f81b25d": "Cambiando remoto de push",
"439fbd498ad5aba1": "Los adjuntos no están listos",
"f928da494821aeb0": "Espera a que terminen las subidas o reintenta las fallidas.",
"4c7966190fc234b4": "Demasiados elementos de contexto",
Expand Down Expand Up @@ -5252,10 +5253,14 @@
"5c72439f2a8e12bf": "Inspecciona los cambios, las ediciones sin commit y los diffs de turnos",
"466265a5e2628fb2": "Cambia de rama, crea una rama o pasa a un worktree",
"6ed8a3818ccfda2d": "Ver ramas y worktrees",
"18cf05cd2cd7dd0e": "Remoto de push",
"8ba218cd9a65f767": "Sin elegir",
"b294ba924b8cd9c1": "{term, select, mr {Adjuntar una merge request por URL o número} cr {Adjuntar una solicitud de cambios por URL o número} other {Adjuntar una pull request por URL o número}}",
"518ca475a032d313": "{terms} vinculadas",
"28dd3410a8843fed": "Worktree",
"a46d99e72af41cd4": "Actualizar el estado del repositorio",
"00c1e5d0b43e70be": "Este repositorio tiene varios remotos y la rama aún no tiene uno elegido. Seguirá al que elijas.",
"db3369af717edbfb": "¿A qué remoto enviar?",
"cd49e17eaf69eee3": "Cargando el estado de la rama…",
"95be4cac9ca707c4": "No es un repositorio git",
"d804d85750efb3b8": "{term, select, mr {MR #{number} abierta} cr {solicitud de cambios #{number} abierta} other {PR #{number} abierta}}",
Expand Down
5 changes: 5 additions & 0 deletions apps/mobile/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,7 @@
"5521de0732509b7c": "Récupération des dernières modifications",
"adb9c574404d1db8": "Déjà à jour",
"84964b49287ced17": "Dernières modifications récupérées sur {branch}",
"ea8ce1c79f81b25d": "Modification du dépôt distant de push",
"439fbd498ad5aba1": "Les pièces jointes ne sont pas prêtes",
"f928da494821aeb0": "Attendez la fin des envois, ou relancez les envois échoués.",
"4c7966190fc234b4": "Trop d’éléments de contexte",
Expand Down Expand Up @@ -5252,10 +5253,14 @@
"5c72439f2a8e12bf": "Inspecter les modifications, les changements non commités et les diffs des tours",
"466265a5e2628fb2": "Changer de branche, créer une branche ou passer à un worktree",
"6ed8a3818ccfda2d": "Voir les branches et worktrees",
"18cf05cd2cd7dd0e": "Dépôt distant de push",
"8ba218cd9a65f767": "Non choisi",
"b294ba924b8cd9c1": "{term, select, mr {Joindre une merge request par URL ou numéro} cr {Joindre une demande de modification par URL ou numéro} other {Joindre une pull request par URL ou numéro}}",
"518ca475a032d313": "{terms} associées",
"28dd3410a8843fed": "Worktree",
"a46d99e72af41cd4": "Actualiser le statut du dépôt",
"00c1e5d0b43e70be": "Ce dépôt a plusieurs dépôts distants et la branche n’en a pas encore choisi. Elle suivra celui que vous choisissez.",
"db3369af717edbfb": "Vers quel dépôt distant pousser ?",
"cd49e17eaf69eee3": "Chargement du statut de la branche…",
"95be4cac9ca707c4": "Pas un dépôt git",
"d804d85750efb3b8": "{term, select, mr {MR #{number} ouverte} cr {demande de modification #{number} ouverte} other {PR #{number} ouverte}}",
Expand Down
5 changes: 5 additions & 0 deletions apps/mobile/src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,7 @@
"5521de0732509b7c": "最新の変更をプルしています",
"adb9c574404d1db8": "すでに最新です",
"84964b49287ced17": "{branch} で最新の変更をプルしました",
"ea8ce1c79f81b25d": "プッシュ先リモートを変更中",
"439fbd498ad5aba1": "添付ファイルの準備ができていません",
"f928da494821aeb0": "アップロードが完了するまで待つか、失敗したアップロードを再試行してください。",
"4c7966190fc234b4": "コンテキストの項目が多すぎます",
Expand Down Expand Up @@ -5234,10 +5235,14 @@
"5c72439f2a8e12bf": "変更、未コミットの編集、ターンの差分を確認",
"466265a5e2628fb2": "ブランチの切り替え・作成、またはワークツリーへの移動",
"6ed8a3818ccfda2d": "ブランチとワークツリーを表示",
"18cf05cd2cd7dd0e": "プッシュ先リモート",
"8ba218cd9a65f767": "未選択",
"b294ba924b8cd9c1": "{term, select, mr {URL または番号でマージリクエストを添付} cr {URL または番号で変更リクエストを添付} other {URL または番号でプルリクエストを添付}}",
"518ca475a032d313": "リンクされた {terms}",
"28dd3410a8843fed": "ワークツリー",
"a46d99e72af41cd4": "リポジトリのステータスを更新",
"00c1e5d0b43e70be": "このリポジトリには複数のリモートがあり、ブランチのリモートは未選択です。選択したリモートを追跡します。",
"db3369af717edbfb": "どのリモートにプッシュしますか?",
"cd49e17eaf69eee3": "ブランチのステータスを読み込んでいます…",
"95be4cac9ca707c4": "Git リポジトリではありません",
"d804d85750efb3b8": "{term, select, mr {MR #{number} オープン} cr {変更リクエスト #{number} オープン} other {PR #{number} オープン}}",
Expand Down
5 changes: 5 additions & 0 deletions apps/mobile/src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,7 @@
"5521de0732509b7c": "최신 변경 사항 가져오는 중",
"adb9c574404d1db8": "이미 최신 상태",
"84964b49287ced17": "{branch}에서 최신 변경 사항을 가져왔습니다",
"ea8ce1c79f81b25d": "푸시 원격 저장소 변경 중",
"439fbd498ad5aba1": "첨부 파일이 준비되지 않았습니다",
"f928da494821aeb0": "업로드가 끝날 때까지 기다리거나 실패한 업로드를 다시 시도하세요.",
"4c7966190fc234b4": "컨텍스트 항목이 너무 많습니다",
Expand Down Expand Up @@ -5238,10 +5239,14 @@
"5c72439f2a8e12bf": "변경 사항, 커밋되지 않은 편집, 턴 변경 사항 검사",
"466265a5e2628fb2": "브랜치 전환, 브랜치 만들기 또는 워크트리로 이동",
"6ed8a3818ccfda2d": "브랜치 및 워크트리 보기",
"18cf05cd2cd7dd0e": "푸시 원격 저장소",
"8ba218cd9a65f767": "선택 안 함",
"b294ba924b8cd9c1": "{term, select, mr {URL이나 번호로 병합 요청 첨부} cr {URL이나 번호로 변경 요청 첨부} other {URL이나 번호로 풀 리퀘스트 첨부}}",
"518ca475a032d313": "연결된 {terms}",
"28dd3410a8843fed": "워크트리",
"a46d99e72af41cd4": "저장소 상태 새로 고침",
"00c1e5d0b43e70be": "이 저장소에는 여러 원격 저장소가 있으며 브랜치에 아직 선택된 원격 저장소가 없습니다. 선택한 원격 저장소를 추적합니다.",
"db3369af717edbfb": "어느 원격 저장소에 푸시할까요?",
"cd49e17eaf69eee3": "브랜치 상태 불러오는 중…",
"95be4cac9ca707c4": "Git 저장소가 아님",
"d804d85750efb3b8": "{term, select, mr {MR #{number} 열림} cr {변경 요청 #{number} 열림} other {PR #{number} 열림}}",
Expand Down
5 changes: 5 additions & 0 deletions apps/mobile/src/i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,7 @@
"5521de0732509b7c": "Fazendo pull das alterações mais recentes",
"adb9c574404d1db8": "Já está atualizado",
"84964b49287ced17": "Pull mais recente feito em {branch}",
"ea8ce1c79f81b25d": "Alterando remoto de push",
"439fbd498ad5aba1": "Os anexos não estão prontos",
"f928da494821aeb0": "Aguarde os envios terminarem ou tente novamente os que falharam.",
"4c7966190fc234b4": "Itens de contexto demais",
Expand Down Expand Up @@ -5252,10 +5253,14 @@
"5c72439f2a8e12bf": "Inspecione alterações, edições sem commit e diffs dos turnos",
"466265a5e2628fb2": "Troque de branch, crie um branch ou mude para um worktree",
"6ed8a3818ccfda2d": "Ver branches e worktrees",
"18cf05cd2cd7dd0e": "Remoto de push",
"8ba218cd9a65f767": "Não escolhido",
"b294ba924b8cd9c1": "{term, select, mr {Anexar um merge request por URL ou número} cr {Anexar uma solicitação de alteração por URL ou número} other {Anexar um pull request por URL ou número}}",
"518ca475a032d313": "{terms} vinculados",
"28dd3410a8843fed": "Worktree",
"a46d99e72af41cd4": "Atualizar status do repositório",
"00c1e5d0b43e70be": "Este repositório tem vários remotos e a branch ainda não tem um escolhido. Ela rastreará o que você escolher.",
"db3369af717edbfb": "Para qual remoto enviar?",
"cd49e17eaf69eee3": "Carregando status do branch…",
"95be4cac9ca707c4": "Não é um repositório git",
"d804d85750efb3b8": "{term, select, mr {MR #{number} aberto} cr {solicitação de alteração #{number} aberta} other {PR #{number} aberto}}",
Expand Down
Loading
Loading