@agimon-ai/po-git 0.0.0-alpha.195 → 0.0.0-alpha.197
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -4
- package/dist/apiContracts.cjs +41 -8
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.d.mts.map +1 -1
- package/dist/apiContracts.mjs +41 -8
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/extensions/native.mjs +241 -181
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/server.cjs +1222 -453
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.d.mts.map +1 -1
- package/dist/extensions/server.mjs +1169 -400
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +417 -322
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/{worktreeOperations-BEk4VEj3.cjs → gitDependencies-BnNuImZi.cjs} +1432 -170
- package/dist/gitDependencies-BnNuImZi.cjs.map +1 -0
- package/dist/{worktreeOperations-hT6N8oSr.mjs → gitDependencies-DYe8D0VS.mjs} +1373 -183
- package/dist/gitDependencies-DYe8D0VS.mjs.map +1 -0
- package/dist/index.cjs +13 -22
- package/dist/index.d.mts +261 -13
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -22
- package/dist/po-runtime-identity.json +1 -1
- package/llms.txt +3 -3
- package/package.json +12 -8
- package/src/prompts/codemode-how-to-git/SKILL.md +52 -10
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/worktreeOperations-BEk4VEj3.cjs.map +0 -1
- package/dist/worktreeOperations-hT6N8oSr.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createApiClient, defineActivityGroup, defineChannelFile, defineFill, defineHostStore, defineNativePlugin, defineSessionStore, defineWebLifecycle, nativeApiTransport, sessionApiAddress } from "@agimon-ai/po-core/native";
|
|
1
|
+
import { createApiClient, defineActivityGroup, defineChannelFile, defineFill, defineHostStore, defineNativePlugin, defineSessionStore, defineWebLifecycle, nativeApiTransport, sessionApiAddress, t, useT } from "@agimon-ai/po-core/native";
|
|
2
2
|
import { View } from "react-native-unistyles/components/native/View";
|
|
3
3
|
import { Text } from "react-native-unistyles/components/native/Text";
|
|
4
4
|
import { ScrollView } from "react-native-unistyles/components/native/ScrollView";
|
|
5
|
-
import { AlertIcon, Badge, BranchIcon, Button, CheckIcon, ChevronRightIcon, Dot, EmptyState, FileIcon, Input, Label, ListRow, MessageIcon, SegmentedControl, Sheet, SheetBody, SheetContent, SheetHeader, SheetTitle, Spinner, SyntaxLine, Textarea, fontOf } from "@agimon-ai/po-native-components";
|
|
5
|
+
import { AlertIcon, Badge, BranchIcon, Button, CheckIcon, ChevronRightIcon, Dot, EmptyState, FileIcon, Input, Label, ListRow, MessageIcon, SegmentedControl, Select, Sheet, SheetBody, SheetContent, SheetHeader, SheetTitle, Spinner, SyntaxLine, Textarea, fontOf } from "@agimon-ai/po-native-components";
|
|
6
6
|
import { createElement, memo, useCallback, useEffect, useEffectEvent, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
7
7
|
import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -70,13 +70,21 @@ const api = createApiClient({
|
|
|
70
70
|
//#endregion
|
|
71
71
|
//#region src/extensions/workspaces/(frontend)/_lib/newSessionForm.ts
|
|
72
72
|
const MAX_LISTED = 200;
|
|
73
|
+
/** Full checkout is explicit; a locked default remains visible even if absent from the catalog. */
|
|
74
|
+
function sparseOptions(branches) {
|
|
75
|
+
return [.../* @__PURE__ */ new Set([
|
|
76
|
+
"full",
|
|
77
|
+
...branches.sparseProfiles ?? [],
|
|
78
|
+
...branches.defaultSparseProfile === void 0 ? [] : [branches.defaultSparseProfile]
|
|
79
|
+
])];
|
|
80
|
+
}
|
|
73
81
|
/** The last segment of a path: enough to name a checkout without spelling out where it lives. */
|
|
74
82
|
function folderName(path) {
|
|
75
83
|
return path.split(/[\\/]/).filter((part) => part !== "").pop() ?? path;
|
|
76
84
|
}
|
|
77
85
|
/** Where a busy branch is checked out, short enough for one line. */
|
|
78
|
-
function busyNote(busyAt, workspaceRoot) {
|
|
79
|
-
return busyAt === workspaceRoot ? "Checked out here" :
|
|
86
|
+
function busyNote(t, busyAt, workspaceRoot) {
|
|
87
|
+
return busyAt === workspaceRoot ? t("git.ui.checkedOutHere", "Checked out here") : t("git.branch.checkedOutIn", "Checked out in {folder}", { folder: folderName(busyAt) });
|
|
80
88
|
}
|
|
81
89
|
/**
|
|
82
90
|
* Local branches a session can take, then the checked-out ones, then remote-only ones, filtered by a
|
|
@@ -108,22 +116,24 @@ function baseOptions(branches) {
|
|
|
108
116
|
])];
|
|
109
117
|
}
|
|
110
118
|
/** Why the form cannot be submitted yet, or undefined when it can. */
|
|
111
|
-
function formProblem(state) {
|
|
119
|
+
function formProblem(t, state) {
|
|
112
120
|
if (state.mode === "existing") {
|
|
113
|
-
if (state.selected === void 0) return "Pick a branch.";
|
|
114
|
-
if (state.selected.busyAt !== void 0) return
|
|
121
|
+
if (state.selected === void 0) return t("git.ui.pickABranch", "Pick a branch.");
|
|
122
|
+
if (state.selected.busyAt !== void 0) return t("git.branch.busyAt", "That branch is checked out at {path}.", { path: state.selected.busyAt });
|
|
115
123
|
}
|
|
116
|
-
if (state.mode === "new" && state.newBranch.trim() === "") return "Name the new branch.";
|
|
124
|
+
if (state.mode === "new" && state.newBranch.trim() === "") return t("git.ui.nameTheNewBranch", "Name the new branch.");
|
|
117
125
|
}
|
|
118
126
|
/** The launch profile choice for any session kind, or undefined when none was made. */
|
|
119
127
|
function launchSelection(state) {
|
|
120
128
|
return state.profile === void 0 ? void 0 : { profile: state.profile };
|
|
121
129
|
}
|
|
122
130
|
/** The worktree create request for the form, or undefined in plain mode. */
|
|
123
|
-
function createRequest(state) {
|
|
131
|
+
function createRequest(state, branches) {
|
|
124
132
|
const name = state.name.trim();
|
|
125
133
|
const chosen = launchSelection(state);
|
|
134
|
+
const sparseProfile = branches?.defaultSparseProfile ?? state.sparseProfile;
|
|
126
135
|
const named = {
|
|
136
|
+
...sparseProfile === void 0 ? {} : { sparseProfile },
|
|
127
137
|
...name === "" ? {} : { name },
|
|
128
138
|
...chosen === void 0 ? {} : { selection: chosen }
|
|
129
139
|
};
|
|
@@ -145,22 +155,23 @@ function createRequest(state) {
|
|
|
145
155
|
}
|
|
146
156
|
//#endregion
|
|
147
157
|
//#region src/extensions/workspaces/(frontend)/fill/_components/GitNewSessionSheet.native.tsx
|
|
148
|
-
const MODES = [
|
|
149
|
-
{
|
|
150
|
-
value: "existing",
|
|
151
|
-
label: "Existing"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
value: "new",
|
|
155
|
-
label: "New branch"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
value: "plain",
|
|
159
|
-
label: "No branch"
|
|
160
|
-
}
|
|
161
|
-
];
|
|
162
158
|
/** The native twin of GitNewSessionDialogView: the same form state and checks, in sheet parts. */
|
|
163
|
-
function GitNewSessionSheetView({ workspaceRoot, branches, loadError = "", initialForm, busy = false, error = "", onCreate }) {
|
|
159
|
+
function GitNewSessionSheetView({ workspaceRoot, branches, loadError = "", initialForm, busy = false, error = "", sparseCheckout, onCreate }) {
|
|
160
|
+
const t = useT();
|
|
161
|
+
const MODES = [
|
|
162
|
+
{
|
|
163
|
+
value: "existing",
|
|
164
|
+
label: t("git.ui.existing", "Existing")
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
value: "new",
|
|
168
|
+
label: t("git.ui.newBranch", "New branch")
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
value: "plain",
|
|
172
|
+
label: t("git.ui.noBranch", "No branch")
|
|
173
|
+
}
|
|
174
|
+
];
|
|
164
175
|
const [form, setForm] = useState({
|
|
165
176
|
mode: "existing",
|
|
166
177
|
newBranch: "",
|
|
@@ -178,28 +189,28 @@ function GitNewSessionSheetView({ workspaceRoot, branches, loadError = "", initi
|
|
|
178
189
|
mode,
|
|
179
190
|
baseRef: form.baseRef || branches?.defaultBase || ""
|
|
180
191
|
};
|
|
181
|
-
const problem = formProblem(state);
|
|
192
|
+
const problem = formProblem(t, state);
|
|
182
193
|
const update = (patch) => setForm((current) => ({
|
|
183
194
|
...current,
|
|
184
195
|
...patch
|
|
185
196
|
}));
|
|
186
197
|
const options = branches === null ? [] : branchOptions(branches, query);
|
|
187
198
|
const bases = branches === null ? [] : baseOptions(branches);
|
|
188
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: "New session" }) }), /* @__PURE__ */ jsxs(SheetBody, {
|
|
199
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: t("git.ui.newSession", "New session") }) }), /* @__PURE__ */ jsxs(SheetBody, {
|
|
189
200
|
style: styles$3.body,
|
|
190
201
|
children: [
|
|
191
202
|
/* @__PURE__ */ jsx(Text, {
|
|
192
203
|
style: styles$3.root,
|
|
193
204
|
numberOfLines: 1,
|
|
194
|
-
accessibilityLabel:
|
|
205
|
+
accessibilityLabel: t("git.session.workspace", "Workspace {path}", { path: workspaceRoot }),
|
|
195
206
|
children: folderName(workspaceRoot)
|
|
196
207
|
}),
|
|
197
208
|
!ready ? /* @__PURE__ */ jsx(Text, {
|
|
198
209
|
testID: "git-new-session-plain-note",
|
|
199
210
|
style: styles$3.dim,
|
|
200
|
-
children: loading ? "Reading branches..." : loadError || "This workspace is not a git checkout. Start a plain session in this folder."
|
|
211
|
+
children: loading ? t("git.ui.readingBranchesPending", "Reading branches...") : loadError || t("git.ui.thisWorkspaceIsNotAGitCheckoutStartAPlainSessionInThisFolder", "This workspace is not a git checkout. Start a plain session in this folder.")
|
|
201
212
|
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SegmentedControl, {
|
|
202
|
-
accessibilityLabel: "Session kind",
|
|
213
|
+
accessibilityLabel: t("git.ui.sessionKind", "Session kind"),
|
|
203
214
|
options: MODES,
|
|
204
215
|
value: mode,
|
|
205
216
|
disabled: busy,
|
|
@@ -207,11 +218,11 @@ function GitNewSessionSheetView({ workspaceRoot, branches, loadError = "", initi
|
|
|
207
218
|
}), mode === "existing" ? /* @__PURE__ */ jsxs(View, {
|
|
208
219
|
style: styles$3.field,
|
|
209
220
|
children: [
|
|
210
|
-
/* @__PURE__ */ jsx(Label, { children: "Branch" }),
|
|
221
|
+
/* @__PURE__ */ jsx(Label, { children: t("git.ui.branch", "Branch") }),
|
|
211
222
|
/* @__PURE__ */ jsx(Input, {
|
|
212
223
|
testID: "git-new-session-branch-search",
|
|
213
|
-
accessibilityLabel: "Find a branch",
|
|
214
|
-
placeholder: "Find a branch",
|
|
224
|
+
accessibilityLabel: t("git.ui.findABranch", "Find a branch"),
|
|
225
|
+
placeholder: t("git.ui.findABranch", "Find a branch"),
|
|
215
226
|
autoCapitalize: "none",
|
|
216
227
|
autoCorrect: false,
|
|
217
228
|
value: query,
|
|
@@ -221,17 +232,17 @@ function GitNewSessionSheetView({ workspaceRoot, branches, loadError = "", initi
|
|
|
221
232
|
/* @__PURE__ */ jsxs(ScrollView, {
|
|
222
233
|
style: styles$3.list,
|
|
223
234
|
nestedScrollEnabled: true,
|
|
224
|
-
accessibilityLabel: "Branches",
|
|
235
|
+
accessibilityLabel: t("git.ui.branches", "Branches"),
|
|
225
236
|
children: [options.length === 0 ? /* @__PURE__ */ jsx(Text, {
|
|
226
237
|
style: [styles$3.dim, styles$3.pad],
|
|
227
|
-
children: "No matching branches"
|
|
238
|
+
children: t("git.ui.noMatchingBranches", "No matching branches")
|
|
228
239
|
}) : null, options.map((branch, index) => /* @__PURE__ */ jsxs(View, { children: [branch.remote !== void 0 && (index === 0 || options[index - 1]?.remote === void 0) ? /* @__PURE__ */ jsx(Text, {
|
|
229
240
|
style: [
|
|
230
241
|
styles$3.dim,
|
|
231
242
|
styles$3.pad,
|
|
232
243
|
styles$3.divider
|
|
233
244
|
],
|
|
234
|
-
children: "Remote branches"
|
|
245
|
+
children: t("git.ui.remoteBranches", "Remote branches")
|
|
235
246
|
}) : null, /* @__PURE__ */ jsx(ListRow, {
|
|
236
247
|
title: /* @__PURE__ */ jsx(Text, {
|
|
237
248
|
style: styles$3.mono,
|
|
@@ -242,8 +253,8 @@ function GitNewSessionSheetView({ workspaceRoot, branches, loadError = "", initi
|
|
|
242
253
|
description: branch.busyAt !== void 0 ? /* @__PURE__ */ jsx(Text, {
|
|
243
254
|
style: styles$3.dim,
|
|
244
255
|
numberOfLines: 1,
|
|
245
|
-
children: busyNote(branch.busyAt, workspaceRoot)
|
|
246
|
-
}) : branch.current ? "Current" : void 0,
|
|
256
|
+
children: busyNote(t, branch.busyAt, workspaceRoot)
|
|
257
|
+
}) : branch.current ? t("git.ui.current", "Current") : void 0,
|
|
247
258
|
trailing: form.selected?.key === branch.key ? /* @__PURE__ */ jsx(CheckIcon, {
|
|
248
259
|
size: 16,
|
|
249
260
|
color: "green"
|
|
@@ -258,9 +269,9 @@ function GitNewSessionSheetView({ workspaceRoot, branches, loadError = "", initi
|
|
|
258
269
|
]
|
|
259
270
|
}) : mode === "new" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(View, {
|
|
260
271
|
style: styles$3.field,
|
|
261
|
-
children: [/* @__PURE__ */ jsx(Label, { children: "Branch name" }), /* @__PURE__ */ jsx(Input, {
|
|
272
|
+
children: [/* @__PURE__ */ jsx(Label, { children: t("git.ui.branchName", "Branch name") }), /* @__PURE__ */ jsx(Input, {
|
|
262
273
|
testID: "git-new-session-new-branch",
|
|
263
|
-
accessibilityLabel: "Branch name",
|
|
274
|
+
accessibilityLabel: t("git.ui.branchName", "Branch name"),
|
|
264
275
|
placeholder: "feature/my-change",
|
|
265
276
|
autoCapitalize: "none",
|
|
266
277
|
autoCorrect: false,
|
|
@@ -271,14 +282,14 @@ function GitNewSessionSheetView({ workspaceRoot, branches, loadError = "", initi
|
|
|
271
282
|
})]
|
|
272
283
|
}), /* @__PURE__ */ jsxs(View, {
|
|
273
284
|
style: styles$3.field,
|
|
274
|
-
children: [/* @__PURE__ */ jsx(Label, { children: "From" }), /* @__PURE__ */ jsxs(ScrollView, {
|
|
285
|
+
children: [/* @__PURE__ */ jsx(Label, { children: t("git.ui.from", "From") }), /* @__PURE__ */ jsxs(ScrollView, {
|
|
275
286
|
style: styles$3.list,
|
|
276
287
|
nestedScrollEnabled: true,
|
|
277
288
|
children: [/* @__PURE__ */ jsx(ListRow, {
|
|
278
|
-
accessibilityLabel: "From",
|
|
289
|
+
accessibilityLabel: t("git.ui.from", "From"),
|
|
279
290
|
title: /* @__PURE__ */ jsx(Text, {
|
|
280
291
|
style: styles$3.mono,
|
|
281
|
-
children: state.baseRef || "Current branch"
|
|
292
|
+
children: state.baseRef || t("git.ui.currentBranch", "Current branch")
|
|
282
293
|
}),
|
|
283
294
|
disabled: busy,
|
|
284
295
|
onPress: () => setBasesOpen((open) => !open)
|
|
@@ -298,23 +309,43 @@ function GitNewSessionSheetView({ workspaceRoot, branches, loadError = "", initi
|
|
|
298
309
|
})]
|
|
299
310
|
})] }) : /* @__PURE__ */ jsx(Text, {
|
|
300
311
|
style: styles$3.dim,
|
|
301
|
-
children: "Start in this workspace folder, without creating a worktree."
|
|
312
|
+
children: t("git.ui.startInThisWorkspaceFolderWithoutCreatingAWorktree", "Start in this workspace folder, without creating a worktree.")
|
|
302
313
|
})] }),
|
|
303
314
|
/* @__PURE__ */ jsxs(View, {
|
|
304
315
|
style: styles$3.field,
|
|
305
|
-
children: [/* @__PURE__ */ jsx(Label, { children: "Name" }), /* @__PURE__ */ jsx(Input, {
|
|
316
|
+
children: [/* @__PURE__ */ jsx(Label, { children: t("git.ui.name", "Name") }), /* @__PURE__ */ jsx(Input, {
|
|
306
317
|
testID: "new-session-name",
|
|
307
|
-
accessibilityLabel: "Session name",
|
|
308
|
-
placeholder: mode === "plain" ? "Optional" : "Optional, defaults to the branch",
|
|
318
|
+
accessibilityLabel: t("git.ui.sessionName", "Session name"),
|
|
319
|
+
placeholder: mode === "plain" ? t("git.ui.optional", "Optional") : t("git.ui.optionalDefaultsToTheBranch", "Optional, defaults to the branch"),
|
|
309
320
|
value: form.name,
|
|
310
321
|
onChangeText: (name) => update({ name }),
|
|
311
322
|
disabled: busy
|
|
312
323
|
})]
|
|
313
324
|
}),
|
|
325
|
+
mode !== "plain" && sparseCheckout !== void 0 ? /* @__PURE__ */ jsxs(View, {
|
|
326
|
+
style: styles$3.field,
|
|
327
|
+
children: [
|
|
328
|
+
/* @__PURE__ */ jsx(Label, { children: t("git.ui.sparseCheckout", "Sparse checkout") }),
|
|
329
|
+
/* @__PURE__ */ jsx(Select, {
|
|
330
|
+
title: t("git.ui.sparseCheckout", "Sparse checkout"),
|
|
331
|
+
value: sparseCheckout.defaultSparseProfile ?? form.sparseProfile ?? "full",
|
|
332
|
+
onValueChange: (sparseProfile) => update({ sparseProfile }),
|
|
333
|
+
disabled: busy || sparseCheckout.defaultSparseProfile !== void 0,
|
|
334
|
+
options: sparseOptions(sparseCheckout).map((profile) => ({
|
|
335
|
+
value: profile,
|
|
336
|
+
label: profile === "full" ? t("git.ui.fullCheckout", "Full checkout") : profile
|
|
337
|
+
}))
|
|
338
|
+
}),
|
|
339
|
+
sparseCheckout.defaultSparseProfile === void 0 ? null : /* @__PURE__ */ jsx(Text, {
|
|
340
|
+
style: styles$3.dim,
|
|
341
|
+
children: t("git.ui.workspaceSparseDefault", "Set by this workspace")
|
|
342
|
+
})
|
|
343
|
+
]
|
|
344
|
+
}) : null,
|
|
314
345
|
mode !== "plain" ? /* @__PURE__ */ jsx(Text, {
|
|
315
346
|
testID: "new-session-hint",
|
|
316
347
|
style: styles$3.dim,
|
|
317
|
-
children: (loading ? void 0 : problem) ?? "Runs in its own worktree, so this checkout stays as it is."
|
|
348
|
+
children: (loading ? void 0 : problem) ?? t("git.ui.runsInItsOwnWorktreeSoThisCheckoutStaysAsItIs", "Runs in its own worktree, so this checkout stays as it is.")
|
|
318
349
|
}) : null,
|
|
319
350
|
error ? /* @__PURE__ */ jsx(Text, {
|
|
320
351
|
testID: "new-session-error",
|
|
@@ -327,20 +358,21 @@ function GitNewSessionSheetView({ workspaceRoot, branches, loadError = "", initi
|
|
|
327
358
|
variant: "primary",
|
|
328
359
|
size: "lg",
|
|
329
360
|
loading: busy,
|
|
330
|
-
loadingLabel: mode === "plain" ? "Creating session" : "Creating worktree",
|
|
361
|
+
loadingLabel: mode === "plain" ? t("git.ui.creatingSession", "Creating session") : t("git.ui.creatingWorktree", "Creating worktree"),
|
|
331
362
|
disabled: loading || problem !== void 0,
|
|
332
363
|
accessibilityHint: problem,
|
|
333
364
|
onPress: () => onCreate(state),
|
|
334
|
-
children: "Create session"
|
|
365
|
+
children: t("git.ui.createSession", "Create session")
|
|
335
366
|
})
|
|
336
367
|
]
|
|
337
368
|
})] });
|
|
338
369
|
}
|
|
339
370
|
function errorOf(body, status) {
|
|
340
|
-
return typeof body === "object" && body !== null && typeof body.error === "string" ? body.error :
|
|
371
|
+
return typeof body === "object" && body !== null && typeof body.error === "string" ? body.error : t("git.request.status", "The cockpit answered {status}.", { status });
|
|
341
372
|
}
|
|
342
373
|
/** The native new-session sheet when git is installed; mirrors GitNewSessionDialog's calls. */
|
|
343
374
|
function GitNewSessionSheet({ newSession }) {
|
|
375
|
+
const t = useT();
|
|
344
376
|
const [branches, setBranches] = useState(null);
|
|
345
377
|
const [loadError, setLoadError] = useState("");
|
|
346
378
|
const [error, setError] = useState("");
|
|
@@ -356,15 +388,15 @@ function GitNewSessionSheet({ newSession }) {
|
|
|
356
388
|
if (!response.ok) setLoadError(errorOf(body, response.status));
|
|
357
389
|
else setBranches(body);
|
|
358
390
|
}).catch(() => {
|
|
359
|
-
if (!stale) setLoadError("The branches could not be loaded.");
|
|
391
|
+
if (!stale) setLoadError(t("git.ui.theBranchesCouldNotBeLoaded", "The branches could not be loaded."));
|
|
360
392
|
});
|
|
361
393
|
return () => {
|
|
362
394
|
stale = true;
|
|
363
395
|
};
|
|
364
|
-
}, [workspaceId]);
|
|
396
|
+
}, [workspaceId, t]);
|
|
365
397
|
if (newSession === void 0) return null;
|
|
366
398
|
const submit = async (state) => {
|
|
367
|
-
if (busy || formProblem(state) !== void 0) return;
|
|
399
|
+
if (busy || formProblem(t, state) !== void 0) return;
|
|
368
400
|
setBusy(true);
|
|
369
401
|
setError("");
|
|
370
402
|
const body = createRequest(state);
|
|
@@ -381,7 +413,7 @@ function GitNewSessionSheet({ newSession }) {
|
|
|
381
413
|
failure = response.ok ? await newSession.openCreated(answer.sessionId) : errorOf(answer, response.status);
|
|
382
414
|
}
|
|
383
415
|
} catch {
|
|
384
|
-
failure = "The cockpit is unreachable.";
|
|
416
|
+
failure = t("git.ui.theCockpitIsUnreachable", "The cockpit is unreachable.");
|
|
385
417
|
}
|
|
386
418
|
if (failure === void 0) return;
|
|
387
419
|
setError(failure);
|
|
@@ -635,16 +667,17 @@ function useWorktrees(sessionId) {
|
|
|
635
667
|
function worktreesTab() {
|
|
636
668
|
return {
|
|
637
669
|
id: "git-worktrees",
|
|
638
|
-
label: "worktrees",
|
|
670
|
+
label: t("git.tab.worktrees", "worktrees"),
|
|
639
671
|
panel: WorktreesPanel
|
|
640
672
|
};
|
|
641
673
|
}
|
|
642
674
|
function WorktreesHeader({ activity = false, onNew, disabled = false, showNew = true }) {
|
|
675
|
+
const t = useT();
|
|
643
676
|
return /* @__PURE__ */ jsxs(View, {
|
|
644
677
|
style: styles$2.header,
|
|
645
678
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
646
679
|
style: styles$2.title,
|
|
647
|
-
children: activity ? "Activity" : "Worktrees"
|
|
680
|
+
children: activity ? t("git.ui.activity", "Activity") : t("git.ui.worktrees", "Worktrees")
|
|
648
681
|
}), !activity && showNew ? /* @__PURE__ */ jsx(Button, {
|
|
649
682
|
testID: "git-worktree-create",
|
|
650
683
|
variant: "ghost",
|
|
@@ -653,12 +686,13 @@ function WorktreesHeader({ activity = false, onNew, disabled = false, showNew =
|
|
|
653
686
|
onPress: onNew,
|
|
654
687
|
children: /* @__PURE__ */ jsx(Text, {
|
|
655
688
|
style: styles$2.jade,
|
|
656
|
-
children: "+ New"
|
|
689
|
+
children: t("git.ui.new", "+ New")
|
|
657
690
|
})
|
|
658
691
|
}) : null]
|
|
659
692
|
});
|
|
660
693
|
}
|
|
661
694
|
function WorktreeRow({ item, error, compact = false, onClose, onOpen, disabled = false }) {
|
|
695
|
+
const t = useT();
|
|
662
696
|
return /* @__PURE__ */ jsxs(View, {
|
|
663
697
|
style: styles$2.worktree,
|
|
664
698
|
children: [
|
|
@@ -672,7 +706,7 @@ function WorktreeRow({ item, error, compact = false, onClose, onOpen, disabled =
|
|
|
672
706
|
/* @__PURE__ */ jsxs(Pressable, {
|
|
673
707
|
style: styles$2.grow,
|
|
674
708
|
accessibilityRole: onOpen ? "button" : void 0,
|
|
675
|
-
accessibilityLabel: onOpen ?
|
|
709
|
+
accessibilityLabel: onOpen ? t("git.worktree.openSession", "Open session for {branch}", { branch: item.branch }) : void 0,
|
|
676
710
|
onPress: onOpen,
|
|
677
711
|
disabled: !onOpen,
|
|
678
712
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
@@ -682,23 +716,23 @@ function WorktreeRow({ item, error, compact = false, onClose, onOpen, disabled =
|
|
|
682
716
|
children: compact && item.branch.length > 36 ? `${item.branch.slice(0, 19)}…${item.branch.slice(-14)}` : item.branch
|
|
683
717
|
}), !compact ? /* @__PURE__ */ jsx(Text, {
|
|
684
718
|
style: styles$2.dim,
|
|
685
|
-
children: item.orphaned ? "Its folder is missing" : item.unowned ? "Its session has ended" : "Session running"
|
|
719
|
+
children: item.orphaned ? t("git.ui.itsFolderIsMissing", "Its folder is missing") : item.unowned ? t("git.ui.itsSessionHasEnded", "Its session has ended") : t("git.ui.sessionRunning", "Session running")
|
|
686
720
|
}) : null]
|
|
687
721
|
}),
|
|
688
722
|
item.orphaned ? /* @__PURE__ */ jsx(Badge, {
|
|
689
723
|
tone: "yellow",
|
|
690
724
|
style: styles$2.caution,
|
|
691
|
-
children: "Orphaned"
|
|
725
|
+
children: t("git.ui.orphaned", "Orphaned")
|
|
692
726
|
}) : null,
|
|
693
727
|
item.unowned ? /* @__PURE__ */ jsx(Badge, {
|
|
694
728
|
tone: "blue",
|
|
695
729
|
style: styles$2.info,
|
|
696
|
-
children: "Unowned"
|
|
730
|
+
children: t("git.ui.unowned", "Unowned")
|
|
697
731
|
}) : null,
|
|
698
732
|
!compact ? /* @__PURE__ */ jsx(Button, {
|
|
699
733
|
variant: "ghost",
|
|
700
734
|
style: styles$2.more,
|
|
701
|
-
accessibilityLabel:
|
|
735
|
+
accessibilityLabel: t("git.worktree.closeBranch", "Close {branch}", { branch: item.branch }),
|
|
702
736
|
testID: `git-worktree-close-${item.id}`,
|
|
703
737
|
onPress: onClose,
|
|
704
738
|
disabled,
|
|
@@ -724,9 +758,10 @@ function WorktreeRow({ item, error, compact = false, onClose, onOpen, disabled =
|
|
|
724
758
|
});
|
|
725
759
|
}
|
|
726
760
|
function WorktreeStarting({ branch }) {
|
|
761
|
+
const t = useT();
|
|
727
762
|
return /* @__PURE__ */ jsxs(View, {
|
|
728
763
|
style: styles$2.starting,
|
|
729
|
-
children: [/* @__PURE__ */ jsx(Spinner, { label: "Starting session..." }), /* @__PURE__ */ jsxs(View, {
|
|
764
|
+
children: [/* @__PURE__ */ jsx(Spinner, { label: t("git.ui.startingSessionPending", "Starting session...") }), /* @__PURE__ */ jsxs(View, {
|
|
730
765
|
style: styles$2.grow,
|
|
731
766
|
children: [branch ? /* @__PURE__ */ jsx(Text, {
|
|
732
767
|
numberOfLines: 1,
|
|
@@ -735,7 +770,7 @@ function WorktreeStarting({ branch }) {
|
|
|
735
770
|
children: branch
|
|
736
771
|
}) : null, /* @__PURE__ */ jsx(Text, {
|
|
737
772
|
style: styles$2.dim,
|
|
738
|
-
children: "Starting session..."
|
|
773
|
+
children: t("git.ui.startingSessionPending", "Starting session...")
|
|
739
774
|
})]
|
|
740
775
|
})]
|
|
741
776
|
});
|
|
@@ -753,44 +788,45 @@ function WorktreeGroup({ title, count }) {
|
|
|
753
788
|
});
|
|
754
789
|
}
|
|
755
790
|
function WorktreeForm({ close = false, branch = "", baseRef = "", onBranch, onBaseRef, onConfirm, onCancel, disabled = false, framed = true }) {
|
|
791
|
+
const t = useT();
|
|
756
792
|
return /* @__PURE__ */ jsxs(View, {
|
|
757
793
|
style: [styles$2.sheet, !framed && styles$2.unframed],
|
|
758
794
|
children: [
|
|
759
795
|
framed ? /* @__PURE__ */ jsx(View, { style: styles$2.handle }) : null,
|
|
760
796
|
/* @__PURE__ */ jsx(Text, {
|
|
761
797
|
style: styles$2.sheetTitle,
|
|
762
|
-
children: close ? "Close this worktree?" : "New worktree"
|
|
798
|
+
children: close ? t("git.ui.closeThisWorktreeConfirm", "Close this worktree?") : t("git.ui.newWorktree", "New worktree")
|
|
763
799
|
}),
|
|
764
800
|
close ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Text, {
|
|
765
801
|
style: styles$2.branch,
|
|
766
802
|
children: branch
|
|
767
803
|
}), /* @__PURE__ */ jsx(Text, {
|
|
768
804
|
style: styles$2.body,
|
|
769
|
-
children: "Removes the checkout and stops its session."
|
|
805
|
+
children: t("git.ui.removesTheCheckoutAndStopsItsSession", "Removes the checkout and stops its session.")
|
|
770
806
|
})] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
771
807
|
/* @__PURE__ */ jsx(Text, {
|
|
772
808
|
style: styles$2.body,
|
|
773
|
-
children: "A separate checkout on its own branch, with its own session. This session stays where it is."
|
|
809
|
+
children: t("git.ui.aSeparateCheckoutOnItsOwnBranchWithItsOwnSessionThisSessionStaysWhereItIs", "A separate checkout on its own branch, with its own session. This session stays where it is.")
|
|
774
810
|
}),
|
|
775
811
|
/* @__PURE__ */ jsx(Text, {
|
|
776
812
|
style: styles$2.label,
|
|
777
|
-
children: "Branch"
|
|
813
|
+
children: t("git.ui.branch", "Branch")
|
|
778
814
|
}),
|
|
779
815
|
/* @__PURE__ */ jsx(Input, {
|
|
780
|
-
accessibilityLabel: "Branch",
|
|
816
|
+
accessibilityLabel: t("git.ui.branch", "Branch"),
|
|
781
817
|
value: branch,
|
|
782
818
|
onChangeText: onBranch,
|
|
783
819
|
style: styles$2.monoInput
|
|
784
820
|
}),
|
|
785
821
|
/* @__PURE__ */ jsx(Text, {
|
|
786
822
|
style: styles$2.label,
|
|
787
|
-
children: "Start from"
|
|
823
|
+
children: t("git.ui.startFrom", "Start from")
|
|
788
824
|
}),
|
|
789
825
|
/* @__PURE__ */ jsx(Input, {
|
|
790
|
-
accessibilityLabel: "Start from",
|
|
826
|
+
accessibilityLabel: t("git.ui.startFrom", "Start from"),
|
|
791
827
|
value: baseRef,
|
|
792
828
|
onChangeText: onBaseRef,
|
|
793
|
-
placeholder: "Current branch"
|
|
829
|
+
placeholder: t("git.ui.currentBranch", "Current branch")
|
|
794
830
|
})
|
|
795
831
|
] }),
|
|
796
832
|
/* @__PURE__ */ jsx(Button, {
|
|
@@ -798,21 +834,22 @@ function WorktreeForm({ close = false, branch = "", baseRef = "", onBranch, onBa
|
|
|
798
834
|
disabled: disabled || !close && branch.trim() === "",
|
|
799
835
|
variant: close ? "danger" : "primary",
|
|
800
836
|
style: [styles$2.fullButton, !close && styles$2.createButton],
|
|
801
|
-
children: close ? "Close worktree" : /* @__PURE__ */ jsx(Text, {
|
|
837
|
+
children: close ? t("git.ui.closeWorktree", "Close worktree") : /* @__PURE__ */ jsx(Text, {
|
|
802
838
|
style: styles$2.createLabel,
|
|
803
|
-
children: "Create worktree"
|
|
839
|
+
children: t("git.ui.createWorktree", "Create worktree")
|
|
804
840
|
})
|
|
805
841
|
}),
|
|
806
842
|
/* @__PURE__ */ jsx(Button, {
|
|
807
843
|
variant: "outline",
|
|
808
844
|
style: styles$2.fullButton,
|
|
809
845
|
onPress: onCancel,
|
|
810
|
-
children: "Cancel"
|
|
846
|
+
children: t("git.ui.cancel", "Cancel")
|
|
811
847
|
})
|
|
812
848
|
]
|
|
813
849
|
});
|
|
814
850
|
}
|
|
815
851
|
function WorktreesView({ state, disabled = false, onNew, onClose, onOpen }) {
|
|
852
|
+
const t = useT();
|
|
816
853
|
const { working, attention, starting, closeErrorId } = worktreesPresentation(state);
|
|
817
854
|
const empty = state.worktrees.length === 0 && !starting;
|
|
818
855
|
const busy = disabled || !!state.pending;
|
|
@@ -835,22 +872,25 @@ function WorktreesView({ state, disabled = false, onNew, onClose, onOpen }) {
|
|
|
835
872
|
style: styles$2.content,
|
|
836
873
|
children: [
|
|
837
874
|
/* @__PURE__ */ jsx(WorktreeGroup, {
|
|
838
|
-
title: "Working",
|
|
839
|
-
count:
|
|
875
|
+
title: t("git.ui.working", "Working"),
|
|
876
|
+
count: t("git.worktree.openStarting", "{count} open{starting}", {
|
|
877
|
+
count: working.length,
|
|
878
|
+
starting: starting ? t("git.worktree.oneStarting", " · 1 starting") : ""
|
|
879
|
+
})
|
|
840
880
|
}),
|
|
841
881
|
working.map(row),
|
|
842
882
|
starting ? /* @__PURE__ */ jsx(WorktreeStarting, { branch: state.requestedBranch }) : null,
|
|
843
883
|
attention.length ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
844
884
|
/* @__PURE__ */ jsx(WorktreeGroup, {
|
|
845
|
-
title: "Needs a look",
|
|
846
|
-
count:
|
|
885
|
+
title: t("git.ui.needsALook", "Needs a look"),
|
|
886
|
+
count: t("git.worktree.openCount", "{count} open", { count: attention.length })
|
|
847
887
|
}),
|
|
848
888
|
/* @__PURE__ */ jsxs(Text, {
|
|
849
889
|
style: styles$2.dim,
|
|
850
890
|
children: [
|
|
851
|
-
attention.length === 2 ? "Two worktrees" : attention.length === 1 ? "One worktree" :
|
|
891
|
+
attention.length === 2 ? t("git.ui.twoWorktrees", "Two worktrees") : attention.length === 1 ? t("git.ui.oneWorktree", "One worktree") : t("git.worktree.count", "{count} worktrees", { count: attention.length }),
|
|
852
892
|
" ",
|
|
853
|
-
"would like your eye, whenever you are ready."
|
|
893
|
+
t("git.ui.wouldLikeYourEyeWheneverYouAreReady", "would like your eye, whenever you are ready.")
|
|
854
894
|
]
|
|
855
895
|
}),
|
|
856
896
|
attention.map(row)
|
|
@@ -859,10 +899,10 @@ function WorktreesView({ state, disabled = false, onNew, onClose, onOpen }) {
|
|
|
859
899
|
}) : /* @__PURE__ */ jsx(EmptyState, {
|
|
860
900
|
testID: "git-worktrees-empty",
|
|
861
901
|
icon: /* @__PURE__ */ jsx(BranchIcon, { size: 20 }),
|
|
862
|
-
title: "No worktrees yet",
|
|
863
|
-
description: "A worktree gives a branch its own checkout and a session nested under this one.",
|
|
902
|
+
title: t("git.ui.noWorktreesYet", "No worktrees yet"),
|
|
903
|
+
description: t("git.ui.aWorktreeGivesABranchItsOwnCheckoutAndASessionNestedUnderThisOne", "A worktree gives a branch its own checkout and a session nested under this one."),
|
|
864
904
|
action: onNew ? {
|
|
865
|
-
label: "New worktree",
|
|
905
|
+
label: t("git.ui.newWorktree", "New worktree"),
|
|
866
906
|
onAction: onNew,
|
|
867
907
|
disabled: busy,
|
|
868
908
|
testId: "git-worktree-create"
|
|
@@ -1278,6 +1318,7 @@ function requestGitSync(sessionId, action, force = false) {
|
|
|
1278
1318
|
//#endregion
|
|
1279
1319
|
//#region src/extensions/workspaces/sessions/(frontend)/activity-group/git.native.ts
|
|
1280
1320
|
var git_native_default = defineActivityGroup({
|
|
1321
|
+
label: "Git",
|
|
1281
1322
|
keys: "g w",
|
|
1282
1323
|
icon: () => createElement(BranchIcon),
|
|
1283
1324
|
activeSource: {
|
|
@@ -1312,14 +1353,14 @@ var git_worktrees_native_default = defineChannelFile(worktreesChannel);
|
|
|
1312
1353
|
* spells a route or reaches for `fetch`. What travels is file contents, which a
|
|
1313
1354
|
* tunnel's relay must never see in the clear.
|
|
1314
1355
|
*/
|
|
1315
|
-
const
|
|
1356
|
+
const unreachable = () => t("git.ui.theSessionIsUnreachable", "The session is unreachable.");
|
|
1316
1357
|
function isRecord(value) {
|
|
1317
1358
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1318
1359
|
}
|
|
1319
1360
|
/** The message a reader is shown: the route's own words, or why there were none. */
|
|
1320
1361
|
function messageOf(result) {
|
|
1321
|
-
if (result.status === 0) return
|
|
1322
|
-
return result.error === "" ?
|
|
1362
|
+
if (result.status === 0) return unreachable();
|
|
1363
|
+
return result.error === "" ? t("git.request.sessionStatus", "The session answered {status}.", { status: result.status }) : result.error;
|
|
1323
1364
|
}
|
|
1324
1365
|
async function fetchReviewSummary(sessionId, signal) {
|
|
1325
1366
|
const result = await api.session(sessionId).review(signal === void 0 ? {} : { signal });
|
|
@@ -1329,7 +1370,7 @@ async function fetchReviewSummary(sessionId, signal) {
|
|
|
1329
1370
|
};
|
|
1330
1371
|
if (!isRecord(result.data) || !Array.isArray(result.data.files)) return {
|
|
1331
1372
|
ok: false,
|
|
1332
|
-
error: "The session answered with no file list."
|
|
1373
|
+
error: t("git.ui.theSessionAnsweredWithNoFileList", "The session answered with no file list.")
|
|
1333
1374
|
};
|
|
1334
1375
|
return {
|
|
1335
1376
|
ok: true,
|
|
@@ -1347,7 +1388,7 @@ async function fetchReviewFile(sessionId, path, signal) {
|
|
|
1347
1388
|
};
|
|
1348
1389
|
if (!isRecord(result.data) || !Array.isArray(result.data.hunks)) return {
|
|
1349
1390
|
ok: false,
|
|
1350
|
-
error: "The session answered with no diff."
|
|
1391
|
+
error: t("git.ui.theSessionAnsweredWithNoDiff", "The session answered with no diff.")
|
|
1351
1392
|
};
|
|
1352
1393
|
return {
|
|
1353
1394
|
ok: true,
|
|
@@ -1436,16 +1477,19 @@ function suggestedSyncAction(changes) {
|
|
|
1436
1477
|
return changes.upstream.ahead > 0 ? "push" : void 0;
|
|
1437
1478
|
}
|
|
1438
1479
|
/** "2 to push, 1 new on origin/feat/git", or "Up to date with origin/feat/git". */
|
|
1439
|
-
function upstreamSummary(upstream) {
|
|
1440
|
-
if (upstream === void 0) return "No upstream yet";
|
|
1441
|
-
const parts = [...upstream.ahead > 0 ? [
|
|
1442
|
-
|
|
1480
|
+
function upstreamSummary(t, upstream) {
|
|
1481
|
+
if (upstream === void 0) return t("git.ui.noUpstreamYet", "No upstream yet");
|
|
1482
|
+
const parts = [...upstream.ahead > 0 ? [t("git.sync.toPush", "{count} to push", { count: upstream.ahead })] : [], ...upstream.behind > 0 ? [t("git.sync.newOn", "{count} new on {ref}", {
|
|
1483
|
+
count: upstream.behind,
|
|
1484
|
+
ref: upstream.ref
|
|
1485
|
+
})] : []];
|
|
1486
|
+
return parts.length === 0 ? t("git.sync.upToDate", "Up to date with {ref}", { ref: upstream.ref }) : parts.join(", ");
|
|
1443
1487
|
}
|
|
1444
1488
|
/**
|
|
1445
1489
|
* Hands one deferred follow-up to the session. Returns the reason it failed,
|
|
1446
1490
|
* or undefined once sent. The sender throws when the session is disconnected.
|
|
1447
1491
|
*/
|
|
1448
|
-
function deliverToAgent(send, sessionId, message) {
|
|
1492
|
+
function deliverToAgent(t, send, sessionId, message) {
|
|
1449
1493
|
try {
|
|
1450
1494
|
send(sessionId, {
|
|
1451
1495
|
type: "follow_up",
|
|
@@ -1453,7 +1497,7 @@ function deliverToAgent(send, sessionId, message) {
|
|
|
1453
1497
|
});
|
|
1454
1498
|
return;
|
|
1455
1499
|
} catch (error) {
|
|
1456
|
-
return error instanceof Error ? error.message : "The session did not take the message.";
|
|
1500
|
+
return error instanceof Error ? error.message : t("git.ui.theSessionDidNotTakeTheMessage", "The session did not take the message.");
|
|
1457
1501
|
}
|
|
1458
1502
|
}
|
|
1459
1503
|
//#endregion
|
|
@@ -1472,38 +1516,35 @@ function Action({ children, variant = "outline", disabled = false, onPress }) {
|
|
|
1472
1516
|
});
|
|
1473
1517
|
}
|
|
1474
1518
|
function Footer({ count, discard = false, confirmation = false, onReview, onSend, onDiscard }) {
|
|
1519
|
+
const t = useT();
|
|
1475
1520
|
return /* @__PURE__ */ jsxs(View, {
|
|
1476
1521
|
style: styles$1.footer,
|
|
1477
1522
|
children: [discard ? /* @__PURE__ */ jsx(Action, {
|
|
1478
1523
|
variant: "ghost",
|
|
1479
1524
|
onPress: onDiscard,
|
|
1480
|
-
children: "Discard"
|
|
1525
|
+
children: t("git.ui.discard", "Discard")
|
|
1481
1526
|
}) : /* @__PURE__ */ jsxs(Pressable, {
|
|
1482
1527
|
accessibilityRole: "button",
|
|
1483
|
-
accessibilityLabel: "Review queued comments",
|
|
1528
|
+
accessibilityLabel: t("git.ui.reviewQueuedComments", "Review queued comments"),
|
|
1484
1529
|
onPress: onReview,
|
|
1485
1530
|
style: [styles$1.inline, styles$1.action],
|
|
1486
1531
|
children: [/* @__PURE__ */ jsx(MessageIcon, {
|
|
1487
1532
|
size: 16,
|
|
1488
1533
|
color: "blue"
|
|
1489
|
-
}), /* @__PURE__ */
|
|
1534
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
1490
1535
|
style: styles$1.dim,
|
|
1491
|
-
children:
|
|
1492
|
-
count,
|
|
1493
|
-
" ",
|
|
1494
|
-
count === 1 ? "comment" : "comments",
|
|
1495
|
-
" queued"
|
|
1496
|
-
]
|
|
1536
|
+
children: count === 1 ? t("git.ui.queuedCommentCount", "{count} comment queued", { count }) : t("git.ui.queuedCommentsCount", "{count} comments queued", { count })
|
|
1497
1537
|
})]
|
|
1498
1538
|
}), /* @__PURE__ */ jsx(Action, {
|
|
1499
1539
|
variant: confirmation ? "outline" : "primary",
|
|
1500
1540
|
disabled: count === 0,
|
|
1501
1541
|
onPress: onSend,
|
|
1502
|
-
children: "Send review"
|
|
1542
|
+
children: t("git.ui.sendReview", "Send review")
|
|
1503
1543
|
})]
|
|
1504
1544
|
});
|
|
1505
1545
|
}
|
|
1506
1546
|
function SyncCard({ changes, busy = false, onSync }) {
|
|
1547
|
+
const t = useT();
|
|
1507
1548
|
const suggested = suggestedSyncAction(changes);
|
|
1508
1549
|
return /* @__PURE__ */ jsxs(View, {
|
|
1509
1550
|
style: styles$1.card,
|
|
@@ -1517,7 +1558,7 @@ function SyncCard({ changes, busy = false, onSync }) {
|
|
|
1517
1558
|
}),
|
|
1518
1559
|
/* @__PURE__ */ jsx(Text, {
|
|
1519
1560
|
style: styles$1.branch,
|
|
1520
|
-
children: changes?.branch ?? "Detached HEAD"
|
|
1561
|
+
children: changes?.branch ?? t("git.ui.detachedHEAD", "Detached HEAD")
|
|
1521
1562
|
}),
|
|
1522
1563
|
/* @__PURE__ */ jsx(View, { style: styles$1.grow }),
|
|
1523
1564
|
/* @__PURE__ */ jsxs(Text, {
|
|
@@ -1532,11 +1573,11 @@ function SyncCard({ changes, busy = false, onSync }) {
|
|
|
1532
1573
|
}),
|
|
1533
1574
|
/* @__PURE__ */ jsx(Text, {
|
|
1534
1575
|
style: [styles$1.dim, styles$1.mono],
|
|
1535
|
-
children: changes?.base ?
|
|
1576
|
+
children: changes?.base ? t("git.review.versus", "vs {base}", { base: changes.base }) : t("git.ui.uncommittedChanges", "Uncommitted changes")
|
|
1536
1577
|
}),
|
|
1537
1578
|
/* @__PURE__ */ jsx(Text, {
|
|
1538
1579
|
style: styles$1.dim,
|
|
1539
|
-
children: upstreamSummary(changes?.upstream)
|
|
1580
|
+
children: upstreamSummary(t, changes?.upstream)
|
|
1540
1581
|
}),
|
|
1541
1582
|
/* @__PURE__ */ jsx(View, {
|
|
1542
1583
|
style: styles$1.inline,
|
|
@@ -1549,18 +1590,23 @@ function SyncCard({ changes, busy = false, onSync }) {
|
|
|
1549
1590
|
style: suggested === action ? [styles$1.action, styles$1.suggested] : styles$1.action,
|
|
1550
1591
|
disabled: busy || changes?.rebase !== void 0 || (action === "pull" ? changes?.upstream === void 0 : action === "push" ? changes?.branch === void 0 : changes?.base === void 0),
|
|
1551
1592
|
onPress: () => onSync?.(action),
|
|
1552
|
-
children: action === "pull" ? "Pull" : action === "push" ? "Push" : "Rebase"
|
|
1593
|
+
children: action === "pull" ? t("git.ui.pull", "Pull") : action === "push" ? t("git.ui.push", "Push") : t("git.ui.rebase", "Rebase")
|
|
1553
1594
|
}, action))
|
|
1554
1595
|
})
|
|
1555
1596
|
]
|
|
1556
1597
|
});
|
|
1557
1598
|
}
|
|
1558
1599
|
function FileList({ files, comments = [], onFile }) {
|
|
1600
|
+
const t = useT();
|
|
1559
1601
|
return /* @__PURE__ */ jsxs(View, {
|
|
1560
1602
|
style: styles$1.list,
|
|
1561
1603
|
children: [/* @__PURE__ */ jsxs(Text, {
|
|
1562
1604
|
style: styles$1.section,
|
|
1563
|
-
children: [
|
|
1605
|
+
children: [
|
|
1606
|
+
files.length,
|
|
1607
|
+
" ",
|
|
1608
|
+
t("git.ui.files", "files")
|
|
1609
|
+
]
|
|
1564
1610
|
}), files.map((file) => /* @__PURE__ */ jsxs(Pressable, {
|
|
1565
1611
|
accessibilityRole: "button",
|
|
1566
1612
|
testID: `git-review-file-${file.path}`,
|
|
@@ -1612,6 +1658,7 @@ function FileList({ files, comments = [], onFile }) {
|
|
|
1612
1658
|
});
|
|
1613
1659
|
}
|
|
1614
1660
|
function RebaseCard({ confirmation = false, conflicts, busy = false, onResolve, onAbort }) {
|
|
1661
|
+
const t = useT();
|
|
1615
1662
|
return /* @__PURE__ */ jsxs(View, {
|
|
1616
1663
|
style: [styles$1.card, styles$1.caution],
|
|
1617
1664
|
children: [
|
|
@@ -1622,12 +1669,12 @@ function RebaseCard({ confirmation = false, conflicts, busy = false, onResolve,
|
|
|
1622
1669
|
color: "yellow"
|
|
1623
1670
|
}), /* @__PURE__ */ jsx(Text, {
|
|
1624
1671
|
style: styles$1.section,
|
|
1625
|
-
children: "Rebase paused"
|
|
1672
|
+
children: t("git.ui.rebasePaused", "Rebase paused")
|
|
1626
1673
|
})]
|
|
1627
1674
|
}),
|
|
1628
1675
|
/* @__PURE__ */ jsx(Text, {
|
|
1629
1676
|
style: styles$1.body,
|
|
1630
|
-
children: "Resolve conflicts or ask Po to do it for you."
|
|
1677
|
+
children: t("git.ui.resolveConflictsOrAskPoToDoItForYou", "Resolve conflicts or ask Po to do it for you.")
|
|
1631
1678
|
}),
|
|
1632
1679
|
/* @__PURE__ */ jsx(Text, {
|
|
1633
1680
|
style: [styles$1.dim, styles$1.mono],
|
|
@@ -1637,18 +1684,19 @@ function RebaseCard({ confirmation = false, conflicts, busy = false, onResolve,
|
|
|
1637
1684
|
disabled: busy,
|
|
1638
1685
|
onPress: onResolve,
|
|
1639
1686
|
variant: confirmation ? "outline" : "primary",
|
|
1640
|
-
children: "Ask Po to resolve"
|
|
1687
|
+
children: t("git.ui.askPoToResolve", "Ask Po to resolve")
|
|
1641
1688
|
}),
|
|
1642
1689
|
/* @__PURE__ */ jsx(Action, {
|
|
1643
1690
|
disabled: busy,
|
|
1644
1691
|
onPress: onAbort,
|
|
1645
1692
|
variant: "danger-outline",
|
|
1646
|
-
children: "Abort rebase"
|
|
1693
|
+
children: t("git.ui.abortRebase", "Abort rebase")
|
|
1647
1694
|
})
|
|
1648
1695
|
]
|
|
1649
1696
|
});
|
|
1650
1697
|
}
|
|
1651
1698
|
function FileHeader({ entry, index, total, onPrevious, onNext, onChanges }) {
|
|
1699
|
+
const t = useT();
|
|
1652
1700
|
return /* @__PURE__ */ jsxs(View, {
|
|
1653
1701
|
style: styles$1.content,
|
|
1654
1702
|
children: [
|
|
@@ -1684,19 +1732,21 @@ function FileHeader({ entry, index, total, onPrevious, onNext, onChanges }) {
|
|
|
1684
1732
|
variant: "ghost",
|
|
1685
1733
|
disabled: index === 0,
|
|
1686
1734
|
onPress: onPrevious,
|
|
1687
|
-
children: "Previous"
|
|
1735
|
+
children: t("git.ui.previous", "Previous")
|
|
1688
1736
|
}),
|
|
1689
1737
|
/* @__PURE__ */ jsx(Pressable, {
|
|
1690
1738
|
accessibilityRole: "button",
|
|
1691
|
-
accessibilityLabel: "Return to changes",
|
|
1739
|
+
accessibilityLabel: t("git.ui.returnToChanges", "Return to changes"),
|
|
1692
1740
|
onPress: onChanges,
|
|
1693
1741
|
style: [styles$1.inline, styles$1.action],
|
|
1694
1742
|
children: /* @__PURE__ */ jsxs(Text, {
|
|
1695
1743
|
style: styles$1.dim,
|
|
1696
1744
|
children: [
|
|
1697
|
-
onChanges ? "Changes · " : "",
|
|
1745
|
+
onChanges ? t("git.ui.changes", "Changes · ") : "",
|
|
1698
1746
|
index + 1,
|
|
1699
|
-
"
|
|
1747
|
+
" ",
|
|
1748
|
+
t("git.ui.of", "of"),
|
|
1749
|
+
" ",
|
|
1700
1750
|
total
|
|
1701
1751
|
]
|
|
1702
1752
|
})
|
|
@@ -1705,7 +1755,7 @@ function FileHeader({ entry, index, total, onPrevious, onNext, onChanges }) {
|
|
|
1705
1755
|
variant: "ghost",
|
|
1706
1756
|
disabled: index === total - 1,
|
|
1707
1757
|
onPress: onNext,
|
|
1708
|
-
children: "Next"
|
|
1758
|
+
children: t("git.ui.next", "Next")
|
|
1709
1759
|
})
|
|
1710
1760
|
]
|
|
1711
1761
|
})
|
|
@@ -1729,7 +1779,10 @@ const DiffRows = memo(function DiffRows({ rows, comments = [], selection, onLine
|
|
|
1729
1779
|
const anchored = anchoredComments.get(`${side}:${row.line}`) ?? [];
|
|
1730
1780
|
return /* @__PURE__ */ jsxs(View, { children: [/* @__PURE__ */ jsxs(Pressable, {
|
|
1731
1781
|
accessibilityRole: "button",
|
|
1732
|
-
accessibilityLabel:
|
|
1782
|
+
accessibilityLabel: t("git.review.selectLine", "Select {side} line {line}", {
|
|
1783
|
+
side: side === "old" ? t("git.review.oldSide", "old") : t("git.review.newSide", "new"),
|
|
1784
|
+
line: row.line
|
|
1785
|
+
}),
|
|
1733
1786
|
onPress: () => onLine?.(row),
|
|
1734
1787
|
style: [
|
|
1735
1788
|
styles$1.diffRow,
|
|
@@ -1760,7 +1813,11 @@ const DiffRows = memo(function DiffRows({ rows, comments = [], selection, onLine
|
|
|
1760
1813
|
style: styles$1.inlineComment,
|
|
1761
1814
|
children: [/* @__PURE__ */ jsxs(Text, {
|
|
1762
1815
|
style: styles$1.blue,
|
|
1763
|
-
children: [
|
|
1816
|
+
children: [
|
|
1817
|
+
t("git.ui.queuedComment", "Queued comment ·"),
|
|
1818
|
+
" ",
|
|
1819
|
+
lineLabel(comment)
|
|
1820
|
+
]
|
|
1764
1821
|
}), /* @__PURE__ */ jsx(Text, {
|
|
1765
1822
|
style: styles$1.body,
|
|
1766
1823
|
children: comment.body
|
|
@@ -1769,16 +1826,20 @@ const DiffRows = memo(function DiffRows({ rows, comments = [], selection, onLine
|
|
|
1769
1826
|
}) });
|
|
1770
1827
|
});
|
|
1771
1828
|
function lineLabel(comment) {
|
|
1772
|
-
return comment.startLine === void 0 ? "File comment" : comment.endLine === comment.startLine || comment.endLine === void 0 ?
|
|
1829
|
+
return comment.startLine === void 0 ? t("git.ui.fileComment", "File comment") : comment.endLine === comment.startLine || comment.endLine === void 0 ? t("git.review.line", "Line {line}", { line: comment.startLine }) : t("git.review.lines", "Lines {start} to {end}", {
|
|
1830
|
+
start: comment.startLine,
|
|
1831
|
+
end: comment.endLine
|
|
1832
|
+
});
|
|
1773
1833
|
}
|
|
1774
1834
|
function CommentSheet({ range, snippet, value, onChange, onAdd, onCancel }) {
|
|
1835
|
+
const t = useT();
|
|
1775
1836
|
return /* @__PURE__ */ jsxs(View, {
|
|
1776
1837
|
style: styles$1.sheet,
|
|
1777
1838
|
children: [
|
|
1778
1839
|
/* @__PURE__ */ jsx(View, { style: styles$1.handle }),
|
|
1779
1840
|
/* @__PURE__ */ jsx(Text, {
|
|
1780
1841
|
style: styles$1.sheetTitle,
|
|
1781
|
-
children: range ? lineLabel(range) : "Comment on file"
|
|
1842
|
+
children: range ? lineLabel(range) : t("git.ui.commentOnFile", "Comment on file")
|
|
1782
1843
|
}),
|
|
1783
1844
|
snippet ? /* @__PURE__ */ jsx(View, {
|
|
1784
1845
|
style: styles$1.quote,
|
|
@@ -1788,8 +1849,8 @@ function CommentSheet({ range, snippet, value, onChange, onAdd, onCancel }) {
|
|
|
1788
1849
|
})
|
|
1789
1850
|
}) : null,
|
|
1790
1851
|
/* @__PURE__ */ jsx(Textarea, {
|
|
1791
|
-
accessibilityLabel: "What should change here?",
|
|
1792
|
-
placeholder: "What should change here?",
|
|
1852
|
+
accessibilityLabel: t("git.ui.whatShouldChangeHereConfirm", "What should change here?"),
|
|
1853
|
+
placeholder: t("git.ui.whatShouldChangeHereConfirm", "What should change here?"),
|
|
1793
1854
|
rows: 4,
|
|
1794
1855
|
value,
|
|
1795
1856
|
onChangeText: onChange
|
|
@@ -1798,27 +1859,23 @@ function CommentSheet({ range, snippet, value, onChange, onAdd, onCancel }) {
|
|
|
1798
1859
|
variant: "primary",
|
|
1799
1860
|
disabled: value !== void 0 && value.trim() === "",
|
|
1800
1861
|
onPress: onAdd,
|
|
1801
|
-
children: "Add comment"
|
|
1862
|
+
children: t("git.ui.addComment", "Add comment")
|
|
1802
1863
|
}),
|
|
1803
1864
|
/* @__PURE__ */ jsx(Action, {
|
|
1804
1865
|
variant: "ghost",
|
|
1805
1866
|
onPress: onCancel,
|
|
1806
|
-
children: "Cancel"
|
|
1867
|
+
children: t("git.ui.cancel", "Cancel")
|
|
1807
1868
|
})
|
|
1808
1869
|
]
|
|
1809
1870
|
});
|
|
1810
1871
|
}
|
|
1811
1872
|
function CommentCards({ comments, onRemove }) {
|
|
1873
|
+
const t = useT();
|
|
1812
1874
|
return /* @__PURE__ */ jsxs(View, {
|
|
1813
1875
|
style: styles$1.content,
|
|
1814
|
-
children: [/* @__PURE__ */
|
|
1876
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
1815
1877
|
style: styles$1.body,
|
|
1816
|
-
children:
|
|
1817
|
-
comments.length === 2 ? "Two" : comments.length,
|
|
1818
|
-
" ",
|
|
1819
|
-
comments.length === 1 ? "comment" : "comments",
|
|
1820
|
-
" queued for Po, whenever you are ready."
|
|
1821
|
-
]
|
|
1878
|
+
children: comments.length === 1 ? t("git.review.readyCommentsOne", "{count} comment queued for Po, whenever you are ready.", { count: comments.length }) : t("git.review.readyComments", "{count} comments queued for Po, whenever you are ready.", { count: comments.length })
|
|
1822
1879
|
}), comments.map((comment) => /* @__PURE__ */ jsxs(View, {
|
|
1823
1880
|
style: styles$1.card,
|
|
1824
1881
|
children: [
|
|
@@ -1846,7 +1903,7 @@ function CommentCards({ comments, onRemove }) {
|
|
|
1846
1903
|
children: /* @__PURE__ */ jsx(Action, {
|
|
1847
1904
|
variant: "ghost",
|
|
1848
1905
|
onPress: () => onRemove?.(comment.id),
|
|
1849
|
-
children: "Remove"
|
|
1906
|
+
children: t("git.ui.remove", "Remove")
|
|
1850
1907
|
})
|
|
1851
1908
|
})
|
|
1852
1909
|
]
|
|
@@ -2086,6 +2143,7 @@ const styles$1 = StyleSheet.create((theme) => ({
|
|
|
2086
2143
|
}));
|
|
2087
2144
|
const DIFF_ROW_STEP = 200;
|
|
2088
2145
|
function GitReviewView(props) {
|
|
2146
|
+
const t = useT();
|
|
2089
2147
|
const { screen, activity, summary, file, path, comments } = props;
|
|
2090
2148
|
const rows = useMemo(() => file?.hunks.flatMap((hunk) => hunk.rows) ?? [], [file?.hunks]);
|
|
2091
2149
|
const gutterDigits = useMemo(() => rows.reduce((max, row) => Math.max(max, String(row.line).length), 1), [rows]);
|
|
@@ -2113,11 +2171,11 @@ function GitReviewView(props) {
|
|
|
2113
2171
|
children: [/* @__PURE__ */ jsx(Action, {
|
|
2114
2172
|
variant: "ghost",
|
|
2115
2173
|
onPress: () => props.onScreen("changes"),
|
|
2116
|
-
children: "Changes"
|
|
2174
|
+
children: t("git.ui.changesLabel", "Changes")
|
|
2117
2175
|
}), screen === "review" && path ? /* @__PURE__ */ jsx(Action, {
|
|
2118
2176
|
variant: "ghost",
|
|
2119
2177
|
onPress: () => props.onScreen("file"),
|
|
2120
|
-
children: "File diff"
|
|
2178
|
+
children: t("git.ui.fileDiff", "File diff")
|
|
2121
2179
|
}) : null]
|
|
2122
2180
|
}) : null,
|
|
2123
2181
|
/* @__PURE__ */ jsxs(ScrollView, {
|
|
@@ -2144,12 +2202,12 @@ function GitReviewView(props) {
|
|
|
2144
2202
|
props.forceRequired ? /* @__PURE__ */ jsx(Action, {
|
|
2145
2203
|
variant: "danger-outline",
|
|
2146
2204
|
onPress: props.onForce,
|
|
2147
|
-
children: "Force push with lease"
|
|
2205
|
+
children: t("git.ui.forcePushWithLease", "Force push with lease")
|
|
2148
2206
|
}) : null,
|
|
2149
2207
|
/* @__PURE__ */ jsx(Action, {
|
|
2150
2208
|
variant: "ghost",
|
|
2151
2209
|
onPress: props.onDismiss,
|
|
2152
|
-
children: "Dismiss"
|
|
2210
|
+
children: t("git.ui.dismiss", "Dismiss")
|
|
2153
2211
|
})
|
|
2154
2212
|
]
|
|
2155
2213
|
}) : null,
|
|
@@ -2161,7 +2219,7 @@ function GitReviewView(props) {
|
|
|
2161
2219
|
}) : null,
|
|
2162
2220
|
!summary ? /* @__PURE__ */ jsx(Text, {
|
|
2163
2221
|
style: styles$1.dim,
|
|
2164
|
-
children: "Loading changes…"
|
|
2222
|
+
children: t("git.ui.loadingChangesProgress", "Loading changes…")
|
|
2165
2223
|
}) : summary.files.length ? /* @__PURE__ */ jsx(FileList, {
|
|
2166
2224
|
files: summary.files,
|
|
2167
2225
|
comments,
|
|
@@ -2169,17 +2227,17 @@ function GitReviewView(props) {
|
|
|
2169
2227
|
}) : summary.repository ? /* @__PURE__ */ jsx(EmptyState, {
|
|
2170
2228
|
testID: "git-review-empty",
|
|
2171
2229
|
icon: /* @__PURE__ */ jsx(BranchIcon, { size: 20 }),
|
|
2172
|
-
title: "No changes yet",
|
|
2173
|
-
description: summary.base === void 0 ? "Nothing uncommitted in this checkout." :
|
|
2230
|
+
title: t("git.ui.noChangesYet", "No changes yet"),
|
|
2231
|
+
description: summary.base === void 0 ? t("git.ui.nothingUncommittedInThisCheckout", "Nothing uncommitted in this checkout.") : t("git.review.nothingDiffers", "Nothing differs from {base}, committed or not.", { base: summary.base })
|
|
2174
2232
|
}) : /* @__PURE__ */ jsx(EmptyState, {
|
|
2175
2233
|
testID: "git-review-no-repository",
|
|
2176
2234
|
icon: /* @__PURE__ */ jsx(BranchIcon, { size: 20 }),
|
|
2177
|
-
title: "Not a Git checkout",
|
|
2178
|
-
description: "This session's folder is not inside a Git repository."
|
|
2235
|
+
title: t("git.ui.notAGitCheckout", "Not a Git checkout"),
|
|
2236
|
+
description: t("git.ui.thisSessionSFolderIsNotInsideAGitRepository", "This session's folder is not inside a Git repository.")
|
|
2179
2237
|
}),
|
|
2180
2238
|
summary?.truncated ? /* @__PURE__ */ jsx(Text, {
|
|
2181
2239
|
style: styles$1.dim,
|
|
2182
|
-
children: "The file list was truncated."
|
|
2240
|
+
children: t("git.ui.theFileListWasTruncated", "The file list was truncated.")
|
|
2183
2241
|
}) : null
|
|
2184
2242
|
]
|
|
2185
2243
|
}) : screen === "file" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -2204,16 +2262,16 @@ function GitReviewView(props) {
|
|
|
2204
2262
|
style: styles$1.content,
|
|
2205
2263
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
2206
2264
|
style: styles$1.dim,
|
|
2207
|
-
children: props.error ? "The diff could not be loaded. Please try again." : "Loading diff…"
|
|
2265
|
+
children: props.error ? t("git.ui.theDiffCouldNotBeLoadedPleaseTryAgain", "The diff could not be loaded. Please try again.") : t("git.ui.loadingDiffProgress", "Loading diff…")
|
|
2208
2266
|
}), props.error && path ? /* @__PURE__ */ jsx(Action, {
|
|
2209
2267
|
onPress: () => props.onFile(path),
|
|
2210
|
-
children: "Retry"
|
|
2268
|
+
children: t("git.ui.retry", "Retry")
|
|
2211
2269
|
}) : null]
|
|
2212
2270
|
}) : file.binary || file.tooLarge ? /* @__PURE__ */ jsx(View, {
|
|
2213
2271
|
style: styles$1.content,
|
|
2214
2272
|
children: /* @__PURE__ */ jsx(Text, {
|
|
2215
2273
|
style: styles$1.section,
|
|
2216
|
-
children: file.binary ? "Binary file" : "Diff too large to display"
|
|
2274
|
+
children: file.binary ? t("git.ui.binaryFile", "Binary file") : t("git.ui.diffTooLargeToDisplay", "Diff too large to display")
|
|
2217
2275
|
})
|
|
2218
2276
|
}) : /* @__PURE__ */ jsx(DiffRows, {
|
|
2219
2277
|
rows: visibleRows,
|
|
@@ -2226,7 +2284,7 @@ function GitReviewView(props) {
|
|
|
2226
2284
|
style: styles$1.inlineComment,
|
|
2227
2285
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
2228
2286
|
style: styles$1.blue,
|
|
2229
|
-
children: "Queued file comment"
|
|
2287
|
+
children: t("git.ui.queuedFileComment", "Queued file comment")
|
|
2230
2288
|
}), /* @__PURE__ */ jsx(Text, {
|
|
2231
2289
|
style: styles$1.body,
|
|
2232
2290
|
children: comment.body
|
|
@@ -2236,7 +2294,7 @@ function GitReviewView(props) {
|
|
|
2236
2294
|
style: styles$1.content,
|
|
2237
2295
|
children: /* @__PURE__ */ jsx(Action, {
|
|
2238
2296
|
onPress: props.onComment,
|
|
2239
|
-
children: "Comment on file"
|
|
2297
|
+
children: t("git.ui.commentOnFile", "Comment on file")
|
|
2240
2298
|
})
|
|
2241
2299
|
})
|
|
2242
2300
|
] }) : /* @__PURE__ */ jsx(CommentCards, {
|
|
@@ -2260,27 +2318,23 @@ function GitReviewView(props) {
|
|
|
2260
2318
|
children: [/* @__PURE__ */ jsxs(Text, {
|
|
2261
2319
|
style: styles$1.dim,
|
|
2262
2320
|
accessibilityLiveRegion: "polite",
|
|
2263
|
-
children: [
|
|
2264
|
-
Math.min(current.limit, rows.length),
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
"
|
|
2268
|
-
|
|
2269
|
-
]
|
|
2270
|
-
}), current.limit < rows.length ? /* @__PURE__ */
|
|
2321
|
+
children: [t("git.review.rowsShown", "{shown} of {total} diff rows shown", {
|
|
2322
|
+
shown: Math.min(current.limit, rows.length),
|
|
2323
|
+
total: rows.length
|
|
2324
|
+
}), props.selection ? t("git.review.selectedLine", " · {side} line {line} selected", {
|
|
2325
|
+
side: props.selection.side === "old" ? t("git.review.oldSide", "old") : t("git.review.newSide", "new"),
|
|
2326
|
+
line: props.selection.startLine
|
|
2327
|
+
}) : ""]
|
|
2328
|
+
}), current.limit < rows.length ? /* @__PURE__ */ jsx(Button, {
|
|
2271
2329
|
variant: "outline",
|
|
2272
2330
|
onPress: () => setDisclosure({
|
|
2273
2331
|
...current,
|
|
2274
2332
|
limit: Math.min(rows.length, current.limit + DIFF_ROW_STEP)
|
|
2275
2333
|
}),
|
|
2276
|
-
children:
|
|
2277
|
-
"Show ",
|
|
2278
|
-
Math.min(DIFF_ROW_STEP, rows.length - current.limit),
|
|
2279
|
-
" more rows"
|
|
2280
|
-
]
|
|
2334
|
+
children: t("git.review.showMoreRows", "Show {count} more rows", { count: Math.min(DIFF_ROW_STEP, rows.length - current.limit) })
|
|
2281
2335
|
}) : /* @__PURE__ */ jsx(Text, {
|
|
2282
2336
|
style: styles$1.dim,
|
|
2283
|
-
children: "All diff rows shown"
|
|
2337
|
+
children: t("git.ui.allDiffRowsShown", "All diff rows shown")
|
|
2284
2338
|
})]
|
|
2285
2339
|
}) : null
|
|
2286
2340
|
]
|
|
@@ -2298,7 +2352,7 @@ function useGitChanges(sessionId) {
|
|
|
2298
2352
|
function reviewTab() {
|
|
2299
2353
|
return {
|
|
2300
2354
|
id: "git-review",
|
|
2301
|
-
label: "review",
|
|
2355
|
+
label: t("git.tab.review", "review"),
|
|
2302
2356
|
panel: GitReviewPanel
|
|
2303
2357
|
};
|
|
2304
2358
|
}
|
|
@@ -2306,6 +2360,7 @@ function GitReviewPanel(props) {
|
|
|
2306
2360
|
return /* @__PURE__ */ jsx(GitReviewPanelSession, { ...props }, props.sessionId);
|
|
2307
2361
|
}
|
|
2308
2362
|
function GitReviewPanelSession({ sessionId, sendSessionFrame }) {
|
|
2363
|
+
const t = useT();
|
|
2309
2364
|
const activity = useGitChanges(sessionId);
|
|
2310
2365
|
const subscribe = useCallback((listener) => {
|
|
2311
2366
|
const sub = gitReview.store.subscribe(listener);
|
|
@@ -2363,7 +2418,7 @@ function GitReviewPanelSession({ sessionId, sendSessionFrame }) {
|
|
|
2363
2418
|
if (sessionId === null) return null;
|
|
2364
2419
|
const changes = activity.changes;
|
|
2365
2420
|
const send = (message, onSent) => {
|
|
2366
|
-
const failure = deliverToAgent(sendSessionFrame, sessionId, message);
|
|
2421
|
+
const failure = deliverToAgent(t, sendSessionFrame, sessionId, message);
|
|
2367
2422
|
setError(failure);
|
|
2368
2423
|
if (failure === void 0) onSent?.();
|
|
2369
2424
|
};
|
|
@@ -2458,10 +2513,10 @@ function GitReviewPanelSession({ sessionId, sendSessionFrame }) {
|
|
|
2458
2513
|
onOpenChange: (open) => {
|
|
2459
2514
|
if (!open) setConfirm(void 0);
|
|
2460
2515
|
},
|
|
2461
|
-
children: /* @__PURE__ */ jsxs(SheetContent, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: confirm === "force" ? "Force push with lease?" : confirm === "abort" ? "Abort rebase?" : "Discard review?" }) }), /* @__PURE__ */ jsxs(SheetBody, { children: [
|
|
2516
|
+
children: /* @__PURE__ */ jsxs(SheetContent, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: confirm === "force" ? t("git.ui.forcePushWithLeaseConfirm", "Force push with lease?") : confirm === "abort" ? t("git.ui.abortRebaseConfirm", "Abort rebase?") : t("git.ui.discardReviewConfirm", "Discard review?") }) }), /* @__PURE__ */ jsxs(SheetBody, { children: [
|
|
2462
2517
|
/* @__PURE__ */ jsx(Text, {
|
|
2463
2518
|
style: styles$1.dim,
|
|
2464
|
-
children: confirm === "force" ? "Git refuses this if the remote holds commits you never fetched and integrated." : confirm === "abort" ? "Abort discards any conflict resolution in progress." : "Your queued comments will be removed."
|
|
2519
|
+
children: confirm === "force" ? t("git.ui.gitRefusesThisIfTheRemoteHoldsCommitsYouNeverFetchedAndIntegrated", "Git refuses this if the remote holds commits you never fetched and integrated.") : confirm === "abort" ? t("git.ui.abortDiscardsAnyConflictResolutionInProgress", "Abort discards any conflict resolution in progress.") : t("git.ui.yourQueuedCommentsWillBeRemoved", "Your queued comments will be removed.")
|
|
2465
2520
|
}),
|
|
2466
2521
|
/* @__PURE__ */ jsx(Button, {
|
|
2467
2522
|
variant: "danger",
|
|
@@ -2472,12 +2527,12 @@ function GitReviewPanelSession({ sessionId, sendSessionFrame }) {
|
|
|
2472
2527
|
else clearReviewComments(sessionId);
|
|
2473
2528
|
setConfirm(void 0);
|
|
2474
2529
|
},
|
|
2475
|
-
children: confirm === "force" ? "Force push with lease" : confirm === "abort" ? "Abort rebase" : "Discard"
|
|
2530
|
+
children: confirm === "force" ? t("git.ui.forcePushWithLease", "Force push with lease") : confirm === "abort" ? t("git.ui.abortRebase", "Abort rebase") : t("git.ui.discard", "Discard")
|
|
2476
2531
|
}),
|
|
2477
2532
|
/* @__PURE__ */ jsx(Button, {
|
|
2478
2533
|
variant: "ghost",
|
|
2479
2534
|
onPress: () => setConfirm(void 0),
|
|
2480
|
-
children: "Cancel"
|
|
2535
|
+
children: t("git.ui.cancel", "Cancel")
|
|
2481
2536
|
})
|
|
2482
2537
|
] })] })
|
|
2483
2538
|
})
|
|
@@ -2494,11 +2549,12 @@ function CommentEditor({ onAdd, ...props }) {
|
|
|
2494
2549
|
}
|
|
2495
2550
|
//#endregion
|
|
2496
2551
|
//#region src/extensions/workspaces/sessions/(frontend)/fill/_components/WorktreesActivitySection.native.tsx
|
|
2497
|
-
function GitChangesRow({ state = "changes", branch = "Detached HEAD", added = 0, removed = 0, onReview }) {
|
|
2552
|
+
function GitChangesRow({ state = "changes", branch = t("git.ui.detachedHEAD", "Detached HEAD"), added = 0, removed = 0, onReview }) {
|
|
2553
|
+
const t$1 = useT();
|
|
2498
2554
|
return /* @__PURE__ */ jsxs(Pressable, {
|
|
2499
2555
|
testID: "activity-diff-changes",
|
|
2500
2556
|
accessibilityRole: "button",
|
|
2501
|
-
accessibilityLabel: "Open changes review",
|
|
2557
|
+
accessibilityLabel: t$1("git.ui.openChangesReview", "Open changes review"),
|
|
2502
2558
|
onPress: onReview,
|
|
2503
2559
|
style: styles.changeRow,
|
|
2504
2560
|
children: [/* @__PURE__ */ jsxs(View, {
|
|
@@ -2510,7 +2566,7 @@ function GitChangesRow({ state = "changes", branch = "Detached HEAD", added = 0,
|
|
|
2510
2566
|
}),
|
|
2511
2567
|
/* @__PURE__ */ jsx(Text, {
|
|
2512
2568
|
style: [styles.heading, styles.grow],
|
|
2513
|
-
children: "Changes"
|
|
2569
|
+
children: t$1("git.ui.changesLabel", "Changes")
|
|
2514
2570
|
}),
|
|
2515
2571
|
/* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
2516
2572
|
size: 16,
|
|
@@ -2528,31 +2584,35 @@ function GitChangesRow({ state = "changes", branch = "Detached HEAD", added = 0,
|
|
|
2528
2584
|
}), /* @__PURE__ */ jsxs(Text, {
|
|
2529
2585
|
style: styles.error,
|
|
2530
2586
|
children: ["-", removed]
|
|
2531
|
-
})] }) : state === "pushing" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Spinner, { label: "Pushing..." }), /* @__PURE__ */ jsx(Text, {
|
|
2587
|
+
})] }) : state === "pushing" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Spinner, { label: t$1("git.ui.pushingPending", "Pushing...") }), /* @__PURE__ */ jsx(Text, {
|
|
2532
2588
|
style: styles.dim,
|
|
2533
|
-
children: "Pushing..."
|
|
2589
|
+
children: t$1("git.ui.pushingPending", "Pushing...")
|
|
2534
2590
|
})] }) : /* @__PURE__ */ jsx(Text, {
|
|
2535
2591
|
style: styles.dim,
|
|
2536
|
-
children: "No changes yet"
|
|
2592
|
+
children: t$1("git.ui.noChangesYet", "No changes yet")
|
|
2537
2593
|
})]
|
|
2538
2594
|
})]
|
|
2539
2595
|
});
|
|
2540
2596
|
}
|
|
2541
2597
|
function WorktreesActivityView({ git, state, disabled = false, onReview, onWorktrees }) {
|
|
2598
|
+
const t = useT();
|
|
2542
2599
|
const { starting } = worktreesPresentation(state);
|
|
2543
2600
|
return /* @__PURE__ */ jsxs(View, {
|
|
2544
2601
|
style: styles.section,
|
|
2545
2602
|
children: [
|
|
2546
2603
|
git.changes ? /* @__PURE__ */ jsx(GitChangesRow, {
|
|
2547
|
-
branch: git.changes.branch ?? "Detached HEAD",
|
|
2604
|
+
branch: git.changes.branch ?? t("git.ui.detachedHEAD", "Detached HEAD"),
|
|
2548
2605
|
added: git.changes.added,
|
|
2549
2606
|
removed: git.changes.removed,
|
|
2550
2607
|
state: git.pending?.startsWith("pushing") ? "pushing" : git.changes.added === 0 && git.changes.removed === 0 && git.changes.files === 0 ? "clean" : "changes",
|
|
2551
2608
|
onReview
|
|
2552
2609
|
}) : null,
|
|
2553
2610
|
/* @__PURE__ */ jsx(WorktreeGroup, {
|
|
2554
|
-
title: "Worktrees",
|
|
2555
|
-
count:
|
|
2611
|
+
title: t("git.ui.worktrees", "Worktrees"),
|
|
2612
|
+
count: t("git.worktree.openStarting", "{count} open{starting}", {
|
|
2613
|
+
count: state.worktrees.length,
|
|
2614
|
+
starting: starting ? t("git.worktree.oneStarting", " · 1 starting") : ""
|
|
2615
|
+
})
|
|
2556
2616
|
}),
|
|
2557
2617
|
state.worktrees.map((item) => /* @__PURE__ */ jsx(WorktreeRow, {
|
|
2558
2618
|
item,
|
|
@@ -2567,7 +2627,7 @@ function WorktreesActivityView({ git, state, disabled = false, onReview, onWorkt
|
|
|
2567
2627
|
style: styles.idle,
|
|
2568
2628
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
2569
2629
|
style: styles.dim,
|
|
2570
|
-
children: "Idle"
|
|
2630
|
+
children: t("git.ui.idle", "Idle")
|
|
2571
2631
|
}), /* @__PURE__ */ jsx(Button, {
|
|
2572
2632
|
testID: "activity-git-create",
|
|
2573
2633
|
variant: "ghost",
|
|
@@ -2576,7 +2636,7 @@ function WorktreesActivityView({ git, state, disabled = false, onReview, onWorkt
|
|
|
2576
2636
|
onPress: onWorktrees,
|
|
2577
2637
|
children: /* @__PURE__ */ jsx(Text, {
|
|
2578
2638
|
style: styles.jade,
|
|
2579
|
-
children: "Create a worktree →"
|
|
2639
|
+
children: t("git.ui.createAWorktree", "Create a worktree →")
|
|
2580
2640
|
})
|
|
2581
2641
|
})]
|
|
2582
2642
|
}) : null
|