gh-manager-cli 1.19.1 → 1.20.0
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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/dist/{chunk-FPJS7YJW.js → chunk-RI2B33OX.js} +50 -0
- package/dist/{github-7RR5WPCN.js → github-ERXQNAVD.js} +5 -1
- package/dist/index.js +498 -362
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,21 +14,23 @@ import {
|
|
|
14
14
|
logger,
|
|
15
15
|
makeClient,
|
|
16
16
|
purgeApolloCacheFiles,
|
|
17
|
+
renameRepositoryById,
|
|
17
18
|
searchRepositoriesUnified,
|
|
18
19
|
syncForkWithUpstream,
|
|
19
20
|
unarchiveRepositoryById,
|
|
20
21
|
updateCacheAfterArchive,
|
|
21
22
|
updateCacheAfterDelete,
|
|
23
|
+
updateCacheAfterRename,
|
|
22
24
|
updateCacheAfterVisibilityChange,
|
|
23
25
|
updateCacheWithRepository
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RI2B33OX.js";
|
|
25
27
|
|
|
26
28
|
// package.json
|
|
27
29
|
var require_package = __commonJS({
|
|
28
30
|
"package.json"(exports, module) {
|
|
29
31
|
module.exports = {
|
|
30
32
|
name: "gh-manager-cli",
|
|
31
|
-
version: "1.
|
|
33
|
+
version: "1.20.0",
|
|
32
34
|
private: false,
|
|
33
35
|
description: "Interactive CLI to manage your GitHub repos (personal) with Ink",
|
|
34
36
|
license: "MIT",
|
|
@@ -153,13 +155,13 @@ var require_package = __commonJS({
|
|
|
153
155
|
|
|
154
156
|
// src/index.tsx
|
|
155
157
|
var import_package = __toESM(require_package(), 1);
|
|
156
|
-
import { render, Box as
|
|
158
|
+
import { render, Box as Box18, Text as Text19 } from "ink";
|
|
157
159
|
import "dotenv/config";
|
|
158
160
|
|
|
159
161
|
// src/ui/App.tsx
|
|
160
|
-
import { useEffect as
|
|
161
|
-
import { Box as
|
|
162
|
-
import
|
|
162
|
+
import { useEffect as useEffect9, useMemo as useMemo2, useState as useState13 } from "react";
|
|
163
|
+
import { Box as Box17, Text as Text18, useApp as useApp2, useStdout as useStdout2, useInput as useInput13 } from "ink";
|
|
164
|
+
import TextInput6 from "ink-text-input";
|
|
163
165
|
|
|
164
166
|
// src/config.ts
|
|
165
167
|
import fs from "fs";
|
|
@@ -404,9 +406,9 @@ async function openGitHubAuthorizationPage() {
|
|
|
404
406
|
}
|
|
405
407
|
|
|
406
408
|
// src/ui/RepoList.tsx
|
|
407
|
-
import
|
|
408
|
-
import { Box as
|
|
409
|
-
import
|
|
409
|
+
import React11, { useEffect as useEffect8, useMemo, useState as useState11, useRef, useCallback } from "react";
|
|
410
|
+
import { Box as Box14, Text as Text15, useApp, useInput as useInput11, useStdout } from "ink";
|
|
411
|
+
import TextInput5 from "ink-text-input";
|
|
410
412
|
import chalk11 from "chalk";
|
|
411
413
|
|
|
412
414
|
// src/apolloMeta.ts
|
|
@@ -485,7 +487,7 @@ function OrgSwitcher({ token, currentContext, onSelect, onClose }) {
|
|
|
485
487
|
try {
|
|
486
488
|
setLoading(true);
|
|
487
489
|
setError(null);
|
|
488
|
-
const client = await import("./github-
|
|
490
|
+
const client = await import("./github-ERXQNAVD.js").then((m) => m.makeClient(token));
|
|
489
491
|
const orgs = await fetchViewerOrganizations(client);
|
|
490
492
|
setOrganizations(orgs);
|
|
491
493
|
const entOrgs = /* @__PURE__ */ new Set();
|
|
@@ -1099,10 +1101,102 @@ var ChangeVisibilityModal = ({
|
|
|
1099
1101
|
);
|
|
1100
1102
|
};
|
|
1101
1103
|
|
|
1104
|
+
// src/ui/components/modals/RenameModal.tsx
|
|
1105
|
+
import { useState as useState10, useEffect as useEffect7 } from "react";
|
|
1106
|
+
import { Box as Box10, Text as Text11, useInput as useInput10 } from "ink";
|
|
1107
|
+
import TextInput3 from "ink-text-input";
|
|
1108
|
+
import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1109
|
+
function RenameModal({ repo, onRename, onCancel }) {
|
|
1110
|
+
const [newName, setNewName] = useState10("");
|
|
1111
|
+
const [renaming, setRenaming] = useState10(false);
|
|
1112
|
+
const [renameError, setRenameError] = useState10(null);
|
|
1113
|
+
useEffect7(() => {
|
|
1114
|
+
if (repo) {
|
|
1115
|
+
setNewName(repo.name);
|
|
1116
|
+
setRenameError(null);
|
|
1117
|
+
}
|
|
1118
|
+
}, [repo]);
|
|
1119
|
+
useInput10((input, key) => {
|
|
1120
|
+
if (renaming) return;
|
|
1121
|
+
if (key.escape) {
|
|
1122
|
+
onCancel();
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1125
|
+
if (key.return) {
|
|
1126
|
+
if (newName.trim() && newName !== repo?.name) {
|
|
1127
|
+
handleRenameConfirm();
|
|
1128
|
+
}
|
|
1129
|
+
return;
|
|
1130
|
+
}
|
|
1131
|
+
});
|
|
1132
|
+
const handleRenameConfirm = async () => {
|
|
1133
|
+
if (!repo || renaming || !newName.trim() || newName === repo.name) return;
|
|
1134
|
+
try {
|
|
1135
|
+
setRenaming(true);
|
|
1136
|
+
setRenameError(null);
|
|
1137
|
+
await onRename(repo, newName.trim());
|
|
1138
|
+
} catch (e) {
|
|
1139
|
+
setRenameError(e.message || "Failed to rename repository");
|
|
1140
|
+
setRenaming(false);
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
const handleNameChange = (value) => {
|
|
1144
|
+
const filtered = value.replace(/[^a-zA-Z0-9\-_.]/g, "");
|
|
1145
|
+
setNewName(filtered);
|
|
1146
|
+
};
|
|
1147
|
+
if (!repo) return null;
|
|
1148
|
+
const owner = repo.nameWithOwner.split("/")[0];
|
|
1149
|
+
const isDisabled = !newName.trim() || newName === repo.name;
|
|
1150
|
+
return /* @__PURE__ */ jsxs10(
|
|
1151
|
+
Box10,
|
|
1152
|
+
{
|
|
1153
|
+
flexDirection: "column",
|
|
1154
|
+
borderStyle: "round",
|
|
1155
|
+
borderColor: "cyan",
|
|
1156
|
+
paddingX: 3,
|
|
1157
|
+
paddingY: 2,
|
|
1158
|
+
width: 80,
|
|
1159
|
+
children: [
|
|
1160
|
+
/* @__PURE__ */ jsx11(Text11, { bold: true, color: "cyan", children: "Rename Repository" }),
|
|
1161
|
+
/* @__PURE__ */ jsx11(Box10, { height: 1, children: /* @__PURE__ */ jsx11(Text11, { children: " " }) }),
|
|
1162
|
+
/* @__PURE__ */ jsxs10(Text11, { color: "gray", children: [
|
|
1163
|
+
"Current: ",
|
|
1164
|
+
repo.nameWithOwner
|
|
1165
|
+
] }),
|
|
1166
|
+
/* @__PURE__ */ jsx11(Box10, { height: 1, children: /* @__PURE__ */ jsx11(Text11, { children: " " }) }),
|
|
1167
|
+
/* @__PURE__ */ jsx11(Text11, { children: "New name:" }),
|
|
1168
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "row", alignItems: "center", children: [
|
|
1169
|
+
/* @__PURE__ */ jsxs10(Text11, { children: [
|
|
1170
|
+
owner,
|
|
1171
|
+
"/"
|
|
1172
|
+
] }),
|
|
1173
|
+
/* @__PURE__ */ jsx11(
|
|
1174
|
+
TextInput3,
|
|
1175
|
+
{
|
|
1176
|
+
value: newName,
|
|
1177
|
+
onChange: handleNameChange,
|
|
1178
|
+
placeholder: repo.name,
|
|
1179
|
+
focus: !renaming
|
|
1180
|
+
}
|
|
1181
|
+
)
|
|
1182
|
+
] }),
|
|
1183
|
+
renaming ? /* @__PURE__ */ jsx11(Box10, { marginTop: 2, justifyContent: "center", children: /* @__PURE__ */ jsxs10(Box10, { flexDirection: "row", children: [
|
|
1184
|
+
/* @__PURE__ */ jsx11(Box10, { marginRight: 1, children: /* @__PURE__ */ jsx11(SlowSpinner, {}) }),
|
|
1185
|
+
/* @__PURE__ */ jsx11(Text11, { color: "cyan", children: "Renaming repository..." })
|
|
1186
|
+
] }) }) : /* @__PURE__ */ jsxs10(Fragment5, { children: [
|
|
1187
|
+
/* @__PURE__ */ jsx11(Box10, { marginTop: 2, children: /* @__PURE__ */ jsx11(Text11, { color: "gray", children: isDisabled ? "Enter a different name to rename" : `Press Enter to rename to "${newName}"` }) }),
|
|
1188
|
+
/* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx11(Text11, { color: "gray", children: "Press Esc to cancel" }) })
|
|
1189
|
+
] }),
|
|
1190
|
+
renameError && /* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx11(Text11, { color: "red", children: renameError }) })
|
|
1191
|
+
]
|
|
1192
|
+
}
|
|
1193
|
+
);
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1102
1196
|
// src/ui/components/repo/RepoRow.tsx
|
|
1103
|
-
import { Box as
|
|
1197
|
+
import { Box as Box11, Text as Text12 } from "ink";
|
|
1104
1198
|
import chalk10 from "chalk";
|
|
1105
|
-
import { jsx as
|
|
1199
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1106
1200
|
function RepoRow({
|
|
1107
1201
|
repo,
|
|
1108
1202
|
selected,
|
|
@@ -1147,21 +1241,21 @@ function RepoRow({
|
|
|
1147
1241
|
if (line3) fullText += "\n" + metaColor(line3);
|
|
1148
1242
|
const spacingAbove = Math.floor(spacingLines / 2);
|
|
1149
1243
|
const spacingBelow = spacingLines - spacingAbove;
|
|
1150
|
-
return /* @__PURE__ */
|
|
1151
|
-
spacingAbove > 0 && /* @__PURE__ */
|
|
1152
|
-
/* @__PURE__ */
|
|
1153
|
-
spacingBelow > 0 && /* @__PURE__ */
|
|
1244
|
+
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", backgroundColor: selected ? "gray" : void 0, children: [
|
|
1245
|
+
spacingAbove > 0 && /* @__PURE__ */ jsx12(Box11, { height: spacingAbove, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) }),
|
|
1246
|
+
/* @__PURE__ */ jsx12(Text12, { children: dim ? chalk10.dim(fullText) : fullText }),
|
|
1247
|
+
spacingBelow > 0 && /* @__PURE__ */ jsx12(Box11, { height: spacingBelow, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) })
|
|
1154
1248
|
] });
|
|
1155
1249
|
}
|
|
1156
1250
|
|
|
1157
1251
|
// src/ui/components/repo/FilterInput.tsx
|
|
1158
|
-
import { Box as
|
|
1159
|
-
import
|
|
1160
|
-
import { jsx as
|
|
1252
|
+
import { Box as Box12, Text as Text13 } from "ink";
|
|
1253
|
+
import TextInput4 from "ink-text-input";
|
|
1254
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1161
1255
|
|
|
1162
1256
|
// src/ui/components/repo/RepoListHeader.tsx
|
|
1163
|
-
import { Box as
|
|
1164
|
-
import { Fragment as
|
|
1257
|
+
import { Box as Box13, Text as Text14 } from "ink";
|
|
1258
|
+
import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1165
1259
|
function RepoListHeader({
|
|
1166
1260
|
ownerContext,
|
|
1167
1261
|
sortKey,
|
|
@@ -1175,35 +1269,35 @@ function RepoListHeader({
|
|
|
1175
1269
|
}) {
|
|
1176
1270
|
const contextLabel = ownerContext === "personal" ? "Personal Account" : ownerContext?.type === "organization" ? `Organization: ${ownerContext.name ?? ownerContext.login}` : "";
|
|
1177
1271
|
const visibilityLabel = visibilityFilter === "public" ? "Public" : visibilityFilter === "private" ? isEnterprise ? "Private/Internal" : "Private" : visibilityFilter === "internal" ? "Internal" : "";
|
|
1178
|
-
return /* @__PURE__ */
|
|
1179
|
-
contextLabel && /* @__PURE__ */
|
|
1180
|
-
/* @__PURE__ */
|
|
1272
|
+
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "row", gap: 2, marginBottom: 1, children: [
|
|
1273
|
+
contextLabel && /* @__PURE__ */ jsx14(Text14, { children: contextLabel }),
|
|
1274
|
+
/* @__PURE__ */ jsxs13(Text14, { color: "gray", dimColor: true, children: [
|
|
1181
1275
|
"Sort: ",
|
|
1182
1276
|
sortKey,
|
|
1183
1277
|
" ",
|
|
1184
1278
|
sortDir === "asc" ? "\u2191" : "\u2193"
|
|
1185
1279
|
] }),
|
|
1186
|
-
/* @__PURE__ */
|
|
1280
|
+
/* @__PURE__ */ jsxs13(Text14, { color: "gray", dimColor: true, children: [
|
|
1187
1281
|
"Fork Status - Commits Behind: ",
|
|
1188
1282
|
forkTracking ? "ON" : "OFF"
|
|
1189
1283
|
] }),
|
|
1190
|
-
!!visibilityLabel && /* @__PURE__ */
|
|
1284
|
+
!!visibilityLabel && /* @__PURE__ */ jsxs13(Text14, { color: "yellow", children: [
|
|
1191
1285
|
"Visibility: ",
|
|
1192
1286
|
visibilityLabel
|
|
1193
1287
|
] }),
|
|
1194
|
-
filter && !searchActive && /* @__PURE__ */
|
|
1288
|
+
filter && !searchActive && /* @__PURE__ */ jsxs13(Text14, { color: "cyan", children: [
|
|
1195
1289
|
'Filter: "',
|
|
1196
1290
|
filter,
|
|
1197
1291
|
'"'
|
|
1198
1292
|
] }),
|
|
1199
|
-
searchActive && /* @__PURE__ */
|
|
1200
|
-
/* @__PURE__ */
|
|
1293
|
+
searchActive && /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
1294
|
+
/* @__PURE__ */ jsxs13(Text14, { color: "cyan", children: [
|
|
1201
1295
|
'Search: "',
|
|
1202
1296
|
filter.trim(),
|
|
1203
1297
|
'"'
|
|
1204
1298
|
] }),
|
|
1205
|
-
searchLoading && /* @__PURE__ */
|
|
1206
|
-
/* @__PURE__ */
|
|
1299
|
+
searchLoading && /* @__PURE__ */ jsx14(Box13, { marginLeft: 1, children: /* @__PURE__ */ jsxs13(Text14, { color: "cyan", children: [
|
|
1300
|
+
/* @__PURE__ */ jsx14(SlowSpinner, {}),
|
|
1207
1301
|
" Searching\u2026"
|
|
1208
1302
|
] }) })
|
|
1209
1303
|
] })
|
|
@@ -1211,7 +1305,7 @@ function RepoListHeader({
|
|
|
1211
1305
|
}
|
|
1212
1306
|
|
|
1213
1307
|
// src/ui/RepoList.tsx
|
|
1214
|
-
import { Fragment as
|
|
1308
|
+
import { Fragment as Fragment7, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1215
1309
|
var getPageSize = () => {
|
|
1216
1310
|
const envValue = process.env.REPOS_PER_FETCH;
|
|
1217
1311
|
if (envValue) {
|
|
@@ -1227,17 +1321,17 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1227
1321
|
const { exit } = useApp();
|
|
1228
1322
|
const { stdout } = useStdout();
|
|
1229
1323
|
const client = useMemo(() => makeClient(token), [token]);
|
|
1230
|
-
const [debugMessages, setDebugMessages] =
|
|
1324
|
+
const [debugMessages, setDebugMessages] = useState11([]);
|
|
1231
1325
|
const addDebugMessage = useCallback((msg) => {
|
|
1232
1326
|
if (process.env.GH_MANAGER_DEBUG === "1") {
|
|
1233
1327
|
setDebugMessages((prev) => [...prev.slice(-9), msg]);
|
|
1234
1328
|
}
|
|
1235
1329
|
}, []);
|
|
1236
1330
|
const handleOrgContextChangeRef = useRef(onOrgContextChange);
|
|
1237
|
-
|
|
1331
|
+
useEffect8(() => {
|
|
1238
1332
|
handleOrgContextChangeRef.current = onOrgContextChange;
|
|
1239
1333
|
}, [onOrgContextChange]);
|
|
1240
|
-
|
|
1334
|
+
React11.useEffect(() => {
|
|
1241
1335
|
addDebugMessage(`[RepoList] Component mounted`);
|
|
1242
1336
|
logger.info("RepoList component mounted", {
|
|
1243
1337
|
token: token ? "present" : "missing",
|
|
@@ -1249,62 +1343,64 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1249
1343
|
}, []);
|
|
1250
1344
|
const terminalWidth = stdout?.columns ?? 80;
|
|
1251
1345
|
const availableHeight = maxVisibleRows ?? 20;
|
|
1252
|
-
const [items, setItems] =
|
|
1253
|
-
const [cursor, setCursor] =
|
|
1254
|
-
const [endCursor, setEndCursor] =
|
|
1255
|
-
const [hasNextPage, setHasNextPage] =
|
|
1256
|
-
const [totalCount, setTotalCount] =
|
|
1257
|
-
const [loading, setLoading] =
|
|
1258
|
-
const [sortingLoading, setSortingLoading] =
|
|
1259
|
-
const [refreshing, setRefreshing] =
|
|
1260
|
-
const [loadingMore, setLoadingMore] =
|
|
1261
|
-
const [error, setError] =
|
|
1262
|
-
const [rateLimit, setRateLimit] =
|
|
1263
|
-
const [prevRateLimit, setPrevRateLimit] =
|
|
1264
|
-
const [density, setDensity] =
|
|
1265
|
-
const [prefsLoaded, setPrefsLoaded] =
|
|
1266
|
-
const [ownerContext, setOwnerContext] =
|
|
1267
|
-
const [ownerAffiliations, setOwnerAffiliations] =
|
|
1268
|
-
const [orgSwitcherOpen, setOrgSwitcherOpen] =
|
|
1269
|
-
const [searchItems, setSearchItems] =
|
|
1270
|
-
const [searchEndCursor, setSearchEndCursor] =
|
|
1271
|
-
const [searchHasNextPage, setSearchHasNextPage] =
|
|
1272
|
-
const [searchTotalCount, setSearchTotalCount] =
|
|
1273
|
-
const [searchLoading, setSearchLoading] =
|
|
1274
|
-
const [deleteMode, setDeleteMode] =
|
|
1275
|
-
const [deleteTarget, setDeleteTarget] =
|
|
1276
|
-
const [deleteCode, setDeleteCode] =
|
|
1277
|
-
const [typedCode, setTypedCode] =
|
|
1278
|
-
const [deleting, setDeleting] =
|
|
1279
|
-
const [deleteError, setDeleteError] =
|
|
1280
|
-
const [deleteConfirmStage, setDeleteConfirmStage] =
|
|
1281
|
-
const [confirmFocus, setConfirmFocus] =
|
|
1282
|
-
const [archiveMode, setArchiveMode] =
|
|
1283
|
-
const [archiveTarget, setArchiveTarget] =
|
|
1284
|
-
const [archiving, setArchiving] =
|
|
1285
|
-
const [archiveError, setArchiveError] =
|
|
1286
|
-
const [archiveFocus, setArchiveFocus] =
|
|
1287
|
-
const [
|
|
1288
|
-
const [
|
|
1289
|
-
const [
|
|
1290
|
-
const [
|
|
1291
|
-
const [
|
|
1292
|
-
const [
|
|
1293
|
-
const [
|
|
1294
|
-
const [
|
|
1295
|
-
const [
|
|
1296
|
-
const [
|
|
1297
|
-
const [
|
|
1298
|
-
const [
|
|
1299
|
-
const [
|
|
1300
|
-
const [
|
|
1301
|
-
const [
|
|
1302
|
-
const [
|
|
1303
|
-
const [
|
|
1304
|
-
const [
|
|
1305
|
-
const [
|
|
1346
|
+
const [items, setItems] = useState11([]);
|
|
1347
|
+
const [cursor, setCursor] = useState11(0);
|
|
1348
|
+
const [endCursor, setEndCursor] = useState11(null);
|
|
1349
|
+
const [hasNextPage, setHasNextPage] = useState11(false);
|
|
1350
|
+
const [totalCount, setTotalCount] = useState11(0);
|
|
1351
|
+
const [loading, setLoading] = useState11(true);
|
|
1352
|
+
const [sortingLoading, setSortingLoading] = useState11(false);
|
|
1353
|
+
const [refreshing, setRefreshing] = useState11(false);
|
|
1354
|
+
const [loadingMore, setLoadingMore] = useState11(false);
|
|
1355
|
+
const [error, setError] = useState11(null);
|
|
1356
|
+
const [rateLimit, setRateLimit] = useState11(void 0);
|
|
1357
|
+
const [prevRateLimit, setPrevRateLimit] = useState11(void 0);
|
|
1358
|
+
const [density, setDensity] = useState11(2);
|
|
1359
|
+
const [prefsLoaded, setPrefsLoaded] = useState11(false);
|
|
1360
|
+
const [ownerContext, setOwnerContext] = useState11("personal");
|
|
1361
|
+
const [ownerAffiliations, setOwnerAffiliations] = useState11(["OWNER"]);
|
|
1362
|
+
const [orgSwitcherOpen, setOrgSwitcherOpen] = useState11(false);
|
|
1363
|
+
const [searchItems, setSearchItems] = useState11([]);
|
|
1364
|
+
const [searchEndCursor, setSearchEndCursor] = useState11(null);
|
|
1365
|
+
const [searchHasNextPage, setSearchHasNextPage] = useState11(false);
|
|
1366
|
+
const [searchTotalCount, setSearchTotalCount] = useState11(0);
|
|
1367
|
+
const [searchLoading, setSearchLoading] = useState11(false);
|
|
1368
|
+
const [deleteMode, setDeleteMode] = useState11(false);
|
|
1369
|
+
const [deleteTarget, setDeleteTarget] = useState11(null);
|
|
1370
|
+
const [deleteCode, setDeleteCode] = useState11("");
|
|
1371
|
+
const [typedCode, setTypedCode] = useState11("");
|
|
1372
|
+
const [deleting, setDeleting] = useState11(false);
|
|
1373
|
+
const [deleteError, setDeleteError] = useState11(null);
|
|
1374
|
+
const [deleteConfirmStage, setDeleteConfirmStage] = useState11(false);
|
|
1375
|
+
const [confirmFocus, setConfirmFocus] = useState11("delete");
|
|
1376
|
+
const [archiveMode, setArchiveMode] = useState11(false);
|
|
1377
|
+
const [archiveTarget, setArchiveTarget] = useState11(null);
|
|
1378
|
+
const [archiving, setArchiving] = useState11(false);
|
|
1379
|
+
const [archiveError, setArchiveError] = useState11(null);
|
|
1380
|
+
const [archiveFocus, setArchiveFocus] = useState11("confirm");
|
|
1381
|
+
const [renameMode, setRenameMode] = useState11(false);
|
|
1382
|
+
const [renameTarget, setRenameTarget] = useState11(null);
|
|
1383
|
+
const [syncMode, setSyncMode] = useState11(false);
|
|
1384
|
+
const [syncTarget, setSyncTarget] = useState11(null);
|
|
1385
|
+
const [syncing, setSyncing] = useState11(false);
|
|
1386
|
+
const [syncError, setSyncError] = useState11(null);
|
|
1387
|
+
const [syncFocus, setSyncFocus] = useState11("confirm");
|
|
1388
|
+
const [syncTrigger, setSyncTrigger] = useState11(false);
|
|
1389
|
+
const [infoMode, setInfoMode] = useState11(false);
|
|
1390
|
+
const [infoRepo, setInfoRepo] = useState11(null);
|
|
1391
|
+
const [logoutMode, setLogoutMode] = useState11(false);
|
|
1392
|
+
const [logoutFocus, setLogoutFocus] = useState11("confirm");
|
|
1393
|
+
const [logoutError, setLogoutError] = useState11(null);
|
|
1394
|
+
const [visibilityMode, setVisibilityMode] = useState11(false);
|
|
1395
|
+
const [isEnterpriseOrg, setIsEnterpriseOrg] = useState11(false);
|
|
1396
|
+
const [hasInternalRepos, setHasInternalRepos] = useState11(false);
|
|
1397
|
+
const [changeVisibilityMode, setChangeVisibilityMode] = useState11(false);
|
|
1398
|
+
const [changeVisibilityTarget, setChangeVisibilityTarget] = useState11(null);
|
|
1399
|
+
const [changingVisibility, setChangingVisibility] = useState11(false);
|
|
1400
|
+
const [changeVisibilityError, setChangeVisibilityError] = useState11(null);
|
|
1401
|
+
const [sortMode, setSortMode] = useState11(false);
|
|
1306
1402
|
const appliedInitialOrg = useRef(false);
|
|
1307
|
-
|
|
1403
|
+
useEffect8(() => {
|
|
1308
1404
|
(async () => {
|
|
1309
1405
|
if (appliedInitialOrg.current) return;
|
|
1310
1406
|
if (!initialOrgSlug2) return;
|
|
@@ -1339,6 +1435,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1339
1435
|
setArchiveError(null);
|
|
1340
1436
|
setArchiveFocus("confirm");
|
|
1341
1437
|
}
|
|
1438
|
+
function closeRenameModal() {
|
|
1439
|
+
setRenameMode(false);
|
|
1440
|
+
setRenameTarget(null);
|
|
1441
|
+
}
|
|
1342
1442
|
function closeChangeVisibilityModal() {
|
|
1343
1443
|
setChangeVisibilityMode(false);
|
|
1344
1444
|
setChangeVisibilityTarget(null);
|
|
@@ -1413,6 +1513,22 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1413
1513
|
setArchiveError("Failed to update archive state. Check permissions.");
|
|
1414
1514
|
}
|
|
1415
1515
|
}
|
|
1516
|
+
async function executeRename(repo, newName) {
|
|
1517
|
+
if (!repo || !newName.trim()) return;
|
|
1518
|
+
try {
|
|
1519
|
+
const id = repo.id;
|
|
1520
|
+
const owner = repo.nameWithOwner.split("/")[0];
|
|
1521
|
+
const newNameWithOwner = `${owner}/${newName}`;
|
|
1522
|
+
await renameRepositoryById(client, id, newName);
|
|
1523
|
+
await updateCacheAfterRename(token, id, newName, newNameWithOwner);
|
|
1524
|
+
const updateRepo = (r) => r.id === id ? { ...r, name: newName, nameWithOwner: newNameWithOwner } : r;
|
|
1525
|
+
setItems((prev) => prev.map(updateRepo));
|
|
1526
|
+
setSearchItems((prev) => prev.map(updateRepo));
|
|
1527
|
+
closeRenameModal();
|
|
1528
|
+
} catch (error2) {
|
|
1529
|
+
throw error2;
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1416
1532
|
async function handleVisibilityChange(newVisibility) {
|
|
1417
1533
|
if (!changeVisibilityTarget || changingVisibility) return;
|
|
1418
1534
|
try {
|
|
@@ -1450,6 +1566,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1450
1566
|
setSearchItems([]);
|
|
1451
1567
|
setTotalCount(0);
|
|
1452
1568
|
setSearchTotalCount(0);
|
|
1569
|
+
setFilter("");
|
|
1570
|
+
setFilterMode(false);
|
|
1453
1571
|
setVisibilityFilter("all");
|
|
1454
1572
|
const newAffiliations = newContext === "personal" ? ["OWNER"] : ["ORGANIZATION_MEMBER"];
|
|
1455
1573
|
setOwnerAffiliations(newAffiliations);
|
|
@@ -1504,12 +1622,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1504
1622
|
setDeleteError("Failed to delete repository. Ensure delete_repo scope and admin permissions.");
|
|
1505
1623
|
}
|
|
1506
1624
|
}
|
|
1507
|
-
const [filter, setFilter] =
|
|
1508
|
-
const [filterMode, setFilterMode] =
|
|
1509
|
-
const [sortKey, setSortKey] =
|
|
1510
|
-
const [sortDir, setSortDir] =
|
|
1511
|
-
const [forkTracking, setForkTracking] =
|
|
1512
|
-
const [visibilityFilter, setVisibilityFilter] =
|
|
1625
|
+
const [filter, setFilter] = useState11("");
|
|
1626
|
+
const [filterMode, setFilterMode] = useState11(false);
|
|
1627
|
+
const [sortKey, setSortKey] = useState11("updated");
|
|
1628
|
+
const [sortDir, setSortDir] = useState11("desc");
|
|
1629
|
+
const [forkTracking, setForkTracking] = useState11(true);
|
|
1630
|
+
const [visibilityFilter, setVisibilityFilter] = useState11("all");
|
|
1513
1631
|
const previousVisibilityFilter = useRef("all");
|
|
1514
1632
|
const sortFieldMap = {
|
|
1515
1633
|
"updated": "UPDATED_AT",
|
|
@@ -1662,7 +1780,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1662
1780
|
setSearchLoading(false);
|
|
1663
1781
|
}
|
|
1664
1782
|
};
|
|
1665
|
-
|
|
1783
|
+
useEffect8(() => {
|
|
1666
1784
|
const ui = getUIPrefs();
|
|
1667
1785
|
if (ui.density !== void 0) setDensity(ui.density);
|
|
1668
1786
|
if (ui.sortKey && ["updated", "pushed", "name", "stars"].includes(ui.sortKey)) {
|
|
@@ -1693,7 +1811,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1693
1811
|
}
|
|
1694
1812
|
setPrefsLoaded(true);
|
|
1695
1813
|
}, [onOrgContextChange]);
|
|
1696
|
-
|
|
1814
|
+
useEffect8(() => {
|
|
1697
1815
|
if (!prefsLoaded) return;
|
|
1698
1816
|
let policy = "cache-first";
|
|
1699
1817
|
const orgLogin = ownerContext !== "personal" ? ownerContext.login : void 0;
|
|
@@ -1713,7 +1831,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1713
1831
|
setCursor(0);
|
|
1714
1832
|
fetchPage(null, true, false, void 0, policy);
|
|
1715
1833
|
}, [client, prefsLoaded, ownerContext, ownerAffiliations]);
|
|
1716
|
-
|
|
1834
|
+
useEffect8(() => {
|
|
1717
1835
|
if (!searchActive) {
|
|
1718
1836
|
if (items.length > 0) {
|
|
1719
1837
|
let policy = "cache-first";
|
|
@@ -1752,7 +1870,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1752
1870
|
}
|
|
1753
1871
|
}
|
|
1754
1872
|
}, [sortKey, sortDir]);
|
|
1755
|
-
|
|
1873
|
+
useEffect8(() => {
|
|
1756
1874
|
if (visibilityFilter !== "all" || previousVisibilityFilter.current && previousVisibilityFilter.current !== visibilityFilter) {
|
|
1757
1875
|
if (!searchActive) {
|
|
1758
1876
|
if (items.length > 0) {
|
|
@@ -1769,7 +1887,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1769
1887
|
}
|
|
1770
1888
|
previousVisibilityFilter.current = visibilityFilter;
|
|
1771
1889
|
}, [visibilityFilter]);
|
|
1772
|
-
|
|
1890
|
+
useEffect8(() => {
|
|
1773
1891
|
if (viewerLogin && searchActive && !searchLoading && searchItems.length === 0) {
|
|
1774
1892
|
let policy = "cache-first";
|
|
1775
1893
|
try {
|
|
@@ -1790,7 +1908,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1790
1908
|
fetchSearchPage(null, true, policy);
|
|
1791
1909
|
}
|
|
1792
1910
|
}, [viewerLogin]);
|
|
1793
|
-
|
|
1911
|
+
useInput11((input, key) => {
|
|
1794
1912
|
if (error) {
|
|
1795
1913
|
if (input && input.toUpperCase() === "Q") {
|
|
1796
1914
|
try {
|
|
@@ -1802,7 +1920,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1802
1920
|
exit();
|
|
1803
1921
|
return;
|
|
1804
1922
|
}
|
|
1805
|
-
if (input && input.toUpperCase() === "R") {
|
|
1923
|
+
if (input && input.toUpperCase() === "R" && !key.ctrl) {
|
|
1806
1924
|
setCursor(0);
|
|
1807
1925
|
setRefreshing(true);
|
|
1808
1926
|
setSortingLoading(true);
|
|
@@ -1852,6 +1970,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1852
1970
|
}
|
|
1853
1971
|
return;
|
|
1854
1972
|
}
|
|
1973
|
+
if (renameMode) {
|
|
1974
|
+
return;
|
|
1975
|
+
}
|
|
1855
1976
|
if (archiveMode) {
|
|
1856
1977
|
if (key.escape || input && input.toUpperCase() === "C") {
|
|
1857
1978
|
closeArchiveModal();
|
|
@@ -2015,7 +2136,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2015
2136
|
setCursor(visibleItems.length - 1);
|
|
2016
2137
|
return;
|
|
2017
2138
|
}
|
|
2018
|
-
if (input && input.toUpperCase() === "R") {
|
|
2139
|
+
if (input && input.toUpperCase() === "R" && !key.ctrl) {
|
|
2019
2140
|
setCursor(0);
|
|
2020
2141
|
setRefreshing(true);
|
|
2021
2142
|
setSortingLoading(true);
|
|
@@ -2043,6 +2164,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2043
2164
|
}
|
|
2044
2165
|
return;
|
|
2045
2166
|
}
|
|
2167
|
+
if (key.ctrl && (input === "r" || input === "R")) {
|
|
2168
|
+
const repo = visibleItems[cursor];
|
|
2169
|
+
if (repo) {
|
|
2170
|
+
setRenameTarget(repo);
|
|
2171
|
+
setRenameMode(true);
|
|
2172
|
+
}
|
|
2173
|
+
return;
|
|
2174
|
+
}
|
|
2046
2175
|
if (key.ctrl && (input === "v" || input === "V")) {
|
|
2047
2176
|
const repo = visibleItems[cursor];
|
|
2048
2177
|
if (repo) {
|
|
@@ -2194,12 +2323,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2194
2323
|
return result;
|
|
2195
2324
|
}, [searchItems, visibilityFilter]);
|
|
2196
2325
|
const visibleItems = searchActive ? filteredSearchItems : filteredAndSorted;
|
|
2197
|
-
|
|
2326
|
+
useEffect8(() => {
|
|
2198
2327
|
if (searchActive) {
|
|
2199
2328
|
addDebugMessage(`[State] searchActive=${searchActive}, searchItems=${searchItems.length}, visibleItems=${visibleItems.length}, filter="${filter}"`);
|
|
2200
2329
|
}
|
|
2201
2330
|
}, [searchActive, searchItems.length, visibleItems.length, filter]);
|
|
2202
|
-
|
|
2331
|
+
useEffect8(() => {
|
|
2203
2332
|
setCursor((c) => Math.min(c, Math.max(0, (searchActive ? searchItems.length : items.length) - 1)));
|
|
2204
2333
|
}, [searchActive, searchItems.length, items.length]);
|
|
2205
2334
|
const headerHeight = 2;
|
|
@@ -2220,7 +2349,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2220
2349
|
const end = Math.min(total, start + visibleRepos + buffer);
|
|
2221
2350
|
return { start, end };
|
|
2222
2351
|
}, [visibleItems.length, cursor, listHeight, spacingLines]);
|
|
2223
|
-
|
|
2352
|
+
useEffect8(() => {
|
|
2224
2353
|
const prefetchThreshold = Math.floor(visibleItems.length * 0.8);
|
|
2225
2354
|
const nearEnd = visibleItems.length > 0 && cursor >= prefetchThreshold;
|
|
2226
2355
|
if (searchActive) {
|
|
@@ -2241,70 +2370,70 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2241
2370
|
exec(cmd);
|
|
2242
2371
|
}
|
|
2243
2372
|
const lowRate = rateLimit && rateLimit.remaining <= Math.ceil(rateLimit.limit * 0.1);
|
|
2244
|
-
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode;
|
|
2245
|
-
const headerBar = useMemo(() => /* @__PURE__ */
|
|
2246
|
-
/* @__PURE__ */
|
|
2247
|
-
/* @__PURE__ */
|
|
2373
|
+
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || renameMode;
|
|
2374
|
+
const headerBar = useMemo(() => /* @__PURE__ */ jsxs14(Box14, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: [
|
|
2375
|
+
/* @__PURE__ */ jsxs14(Box14, { flexDirection: "row", gap: 1, children: [
|
|
2376
|
+
/* @__PURE__ */ jsxs14(Text15, { color: "cyan", bold: !modalOpen, dimColor: modalOpen, children: [
|
|
2248
2377
|
" ",
|
|
2249
2378
|
ownerContext === "personal" ? "Personal" : ownerContext.name || ownerContext.login,
|
|
2250
2379
|
ownerContext !== "personal" && isEnterpriseOrg && " (ENT)"
|
|
2251
2380
|
] }),
|
|
2252
|
-
/* @__PURE__ */
|
|
2253
|
-
/* @__PURE__ */
|
|
2381
|
+
/* @__PURE__ */ jsx15(Text15, { bold: true, color: modalOpen ? "gray" : void 0, dimColor: modalOpen ? true : void 0, children: "Repositories" }),
|
|
2382
|
+
/* @__PURE__ */ jsxs14(Text15, { color: "gray", children: [
|
|
2254
2383
|
"(",
|
|
2255
2384
|
visibleItems.length,
|
|
2256
2385
|
"/",
|
|
2257
2386
|
searchActive ? searchTotalCount : totalCount,
|
|
2258
2387
|
")"
|
|
2259
2388
|
] }),
|
|
2260
|
-
(loading || searchLoading) && /* @__PURE__ */
|
|
2389
|
+
(loading || searchLoading) && /* @__PURE__ */ jsx15(Box14, { width: 2, flexShrink: 0, flexGrow: 0, marginLeft: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "yellow", children: /* @__PURE__ */ jsx15(SlowSpinner, {}) }) })
|
|
2261
2390
|
] }),
|
|
2262
|
-
rateLimit && /* @__PURE__ */
|
|
2391
|
+
rateLimit && /* @__PURE__ */ jsxs14(Text15, { color: lowRate ? "yellow" : "gray", children: [
|
|
2263
2392
|
"API: ",
|
|
2264
2393
|
rateLimit.remaining,
|
|
2265
2394
|
"/",
|
|
2266
2395
|
rateLimit.limit,
|
|
2267
|
-
prevRateLimit !== void 0 && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */
|
|
2396
|
+
prevRateLimit !== void 0 && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */ jsx15(Text15, { color: rateLimit.remaining < prevRateLimit ? "red" : "green", children: ` (${rateLimit.remaining - prevRateLimit > 0 ? "+" : ""}${rateLimit.remaining - prevRateLimit})` }),
|
|
2268
2397
|
" "
|
|
2269
2398
|
] })
|
|
2270
2399
|
] }), [visibleItems.length, searchActive, searchTotalCount, totalCount, loading, searchLoading, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg]);
|
|
2271
2400
|
if (error) {
|
|
2272
|
-
return /* @__PURE__ */
|
|
2273
|
-
/* @__PURE__ */
|
|
2274
|
-
/* @__PURE__ */
|
|
2275
|
-
/* @__PURE__ */
|
|
2401
|
+
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", height: availableHeight, children: [
|
|
2402
|
+
/* @__PURE__ */ jsx15(Box14, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs14(Box14, { flexDirection: "row", gap: 1, children: [
|
|
2403
|
+
/* @__PURE__ */ jsx15(Text15, { bold: true, children: " Repositories" }),
|
|
2404
|
+
/* @__PURE__ */ jsx15(Text15, { color: "red", children: "(Error)" })
|
|
2276
2405
|
] }) }),
|
|
2277
|
-
/* @__PURE__ */
|
|
2278
|
-
/* @__PURE__ */
|
|
2279
|
-
/* @__PURE__ */
|
|
2406
|
+
/* @__PURE__ */ jsx15(Box14, { borderStyle: "single", borderColor: "red", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx15(Box14, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", alignItems: "center", children: [
|
|
2407
|
+
/* @__PURE__ */ jsx15(Text15, { color: "red", children: error }),
|
|
2408
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "gray", dimColor: true, children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
2280
2409
|
] }) }) }),
|
|
2281
|
-
/* @__PURE__ */
|
|
2410
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "gray", children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
2282
2411
|
] });
|
|
2283
2412
|
}
|
|
2284
2413
|
if (loading && items.length === 0 || sortingLoading) {
|
|
2285
|
-
return /* @__PURE__ */
|
|
2286
|
-
/* @__PURE__ */
|
|
2287
|
-
/* @__PURE__ */
|
|
2288
|
-
/* @__PURE__ */
|
|
2414
|
+
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", height: availableHeight, children: [
|
|
2415
|
+
/* @__PURE__ */ jsx15(Box14, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs14(Box14, { flexDirection: "row", gap: 1, children: [
|
|
2416
|
+
/* @__PURE__ */ jsx15(Text15, { bold: true, children: " Repositories" }),
|
|
2417
|
+
/* @__PURE__ */ jsx15(Text15, { color: "gray", children: "(Loading...)" })
|
|
2289
2418
|
] }) }),
|
|
2290
|
-
/* @__PURE__ */
|
|
2291
|
-
/* @__PURE__ */
|
|
2292
|
-
/* @__PURE__ */
|
|
2293
|
-
/* @__PURE__ */
|
|
2419
|
+
/* @__PURE__ */ jsx15(Box14, { borderStyle: "single", borderColor: "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx15(Box14, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx15(Box14, { flexDirection: "column", alignItems: "center", children: /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", alignItems: "center", children: [
|
|
2420
|
+
/* @__PURE__ */ jsxs14(Box14, { height: 1, flexDirection: "row", children: [
|
|
2421
|
+
/* @__PURE__ */ jsx15(Box14, { width: 2, flexShrink: 0, flexGrow: 0, children: /* @__PURE__ */ jsx15(Text15, { color: "cyan", children: /* @__PURE__ */ jsx15(SlowSpinner, {}) }) }),
|
|
2422
|
+
/* @__PURE__ */ jsx15(Text15, { color: "cyan", children: refreshing ? "Refreshing..." : sortingLoading ? "Applying sort..." : "Loading repositories..." })
|
|
2294
2423
|
] }),
|
|
2295
|
-
/* @__PURE__ */
|
|
2424
|
+
/* @__PURE__ */ jsx15(Box14, { height: 1, marginTop: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "gray", children: refreshing ? "Fetching latest repository data" : sortingLoading ? `Sorting by ${sortKey} (${sortDir === "asc" ? "ascending" : "descending"})` : "Fetching your GitHub repositories" }) })
|
|
2296
2425
|
] }) }) }) }),
|
|
2297
|
-
/* @__PURE__ */
|
|
2426
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "gray", children: "Please wait..." }) })
|
|
2298
2427
|
] });
|
|
2299
2428
|
}
|
|
2300
|
-
return /* @__PURE__ */
|
|
2429
|
+
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", height: availableHeight, children: [
|
|
2301
2430
|
headerBar,
|
|
2302
|
-
/* @__PURE__ */
|
|
2431
|
+
/* @__PURE__ */ jsx15(Box14, { borderStyle: "single", borderColor: modalOpen ? "gray" : "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: deleteMode && deleteTarget ? (
|
|
2303
2432
|
// Centered modal; hide list content while modal is open
|
|
2304
|
-
/* @__PURE__ */
|
|
2305
|
-
/* @__PURE__ */
|
|
2306
|
-
/* @__PURE__ */
|
|
2307
|
-
/* @__PURE__ */
|
|
2433
|
+
/* @__PURE__ */ jsx15(Box14, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
2434
|
+
/* @__PURE__ */ jsx15(Text15, { bold: true, children: "Delete Confirmation" }),
|
|
2435
|
+
/* @__PURE__ */ jsx15(Text15, { color: "red", children: "\u26A0\uFE0F Delete repository?" }),
|
|
2436
|
+
/* @__PURE__ */ jsx15(Box14, { height: 2, children: /* @__PURE__ */ jsx15(Text15, { children: " " }) }),
|
|
2308
2437
|
(() => {
|
|
2309
2438
|
const langName = deleteTarget.primaryLanguage?.name || "";
|
|
2310
2439
|
const langColor = deleteTarget.primaryLanguage?.color || "#666666";
|
|
@@ -2316,20 +2445,20 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2316
2445
|
let line2 = "";
|
|
2317
2446
|
if (langName) line2 += chalk11.hex(langColor)("\u25CF ") + chalk11.gray(`${langName} `);
|
|
2318
2447
|
line2 += chalk11.gray(`\u2605 ${deleteTarget.stargazerCount} \u2442 ${deleteTarget.forkCount} Updated ${formatDate(deleteTarget.updatedAt)}`);
|
|
2319
|
-
return /* @__PURE__ */
|
|
2320
|
-
/* @__PURE__ */
|
|
2321
|
-
/* @__PURE__ */
|
|
2448
|
+
return /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
2449
|
+
/* @__PURE__ */ jsx15(Text15, { children: line1 }),
|
|
2450
|
+
/* @__PURE__ */ jsx15(Text15, { children: line2 })
|
|
2322
2451
|
] });
|
|
2323
2452
|
})(),
|
|
2324
|
-
/* @__PURE__ */
|
|
2453
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsxs14(Text15, { children: [
|
|
2325
2454
|
"Type ",
|
|
2326
|
-
/* @__PURE__ */
|
|
2455
|
+
/* @__PURE__ */ jsx15(Text15, { color: "yellow", bold: true, children: deleteCode }),
|
|
2327
2456
|
" to confirm."
|
|
2328
2457
|
] }) }),
|
|
2329
|
-
!deleteConfirmStage && /* @__PURE__ */
|
|
2330
|
-
/* @__PURE__ */
|
|
2331
|
-
/* @__PURE__ */
|
|
2332
|
-
|
|
2458
|
+
!deleteConfirmStage && /* @__PURE__ */ jsxs14(Box14, { marginTop: 1, children: [
|
|
2459
|
+
/* @__PURE__ */ jsx15(Text15, { children: "Confirm code: " }),
|
|
2460
|
+
/* @__PURE__ */ jsx15(
|
|
2461
|
+
TextInput5,
|
|
2333
2462
|
{
|
|
2334
2463
|
value: typedCode,
|
|
2335
2464
|
onChange: (v) => {
|
|
@@ -2355,11 +2484,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2355
2484
|
}
|
|
2356
2485
|
)
|
|
2357
2486
|
] }),
|
|
2358
|
-
deleteConfirmStage && /* @__PURE__ */
|
|
2359
|
-
/* @__PURE__ */
|
|
2360
|
-
/* @__PURE__ */
|
|
2361
|
-
/* @__PURE__ */
|
|
2362
|
-
|
|
2487
|
+
deleteConfirmStage && /* @__PURE__ */ jsxs14(Box14, { marginTop: 1, flexDirection: "column", children: [
|
|
2488
|
+
/* @__PURE__ */ jsx15(Text15, { color: "red", children: "This action will permanently delete the repository. This cannot be undone." }),
|
|
2489
|
+
/* @__PURE__ */ jsxs14(Box14, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
2490
|
+
/* @__PURE__ */ jsx15(
|
|
2491
|
+
Box14,
|
|
2363
2492
|
{
|
|
2364
2493
|
borderStyle: "round",
|
|
2365
2494
|
borderColor: "red",
|
|
@@ -2368,11 +2497,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2368
2497
|
alignItems: "center",
|
|
2369
2498
|
justifyContent: "center",
|
|
2370
2499
|
flexDirection: "column",
|
|
2371
|
-
children: /* @__PURE__ */
|
|
2500
|
+
children: /* @__PURE__ */ jsx15(Text15, { children: confirmFocus === "delete" ? chalk11.bgRed.white.bold(" Delete ") : chalk11.red.bold("Delete") })
|
|
2372
2501
|
}
|
|
2373
2502
|
),
|
|
2374
|
-
/* @__PURE__ */
|
|
2375
|
-
|
|
2503
|
+
/* @__PURE__ */ jsx15(
|
|
2504
|
+
Box14,
|
|
2376
2505
|
{
|
|
2377
2506
|
borderStyle: "round",
|
|
2378
2507
|
borderColor: confirmFocus === "cancel" ? "white" : "gray",
|
|
@@ -2381,17 +2510,17 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2381
2510
|
alignItems: "center",
|
|
2382
2511
|
justifyContent: "center",
|
|
2383
2512
|
flexDirection: "column",
|
|
2384
|
-
children: /* @__PURE__ */
|
|
2513
|
+
children: /* @__PURE__ */ jsx15(Text15, { children: confirmFocus === "cancel" ? chalk11.bgGray.white.bold(" Cancel ") : chalk11.gray.bold("Cancel") })
|
|
2385
2514
|
}
|
|
2386
2515
|
)
|
|
2387
2516
|
] }),
|
|
2388
|
-
/* @__PURE__ */
|
|
2517
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs14(Text15, { color: "gray", children: [
|
|
2389
2518
|
"Press Enter to ",
|
|
2390
2519
|
confirmFocus === "delete" ? "Delete" : "Cancel",
|
|
2391
2520
|
" | Y to Delete | C to Cancel"
|
|
2392
2521
|
] }) }),
|
|
2393
|
-
/* @__PURE__ */
|
|
2394
|
-
|
|
2522
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(
|
|
2523
|
+
TextInput5,
|
|
2395
2524
|
{
|
|
2396
2525
|
value: "",
|
|
2397
2526
|
onChange: () => {
|
|
@@ -2404,18 +2533,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2404
2533
|
}
|
|
2405
2534
|
) })
|
|
2406
2535
|
] }),
|
|
2407
|
-
deleteError && /* @__PURE__ */
|
|
2408
|
-
deleting && /* @__PURE__ */
|
|
2536
|
+
deleteError && /* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "magenta", children: deleteError }) }),
|
|
2537
|
+
deleting && /* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "yellow", children: "Deleting..." }) })
|
|
2409
2538
|
] }) })
|
|
2410
|
-
) : archiveMode && archiveTarget ? /* @__PURE__ */
|
|
2411
|
-
/* @__PURE__ */
|
|
2412
|
-
/* @__PURE__ */
|
|
2413
|
-
/* @__PURE__ */
|
|
2414
|
-
/* @__PURE__ */
|
|
2415
|
-
/* @__PURE__ */
|
|
2416
|
-
/* @__PURE__ */
|
|
2417
|
-
/* @__PURE__ */
|
|
2418
|
-
|
|
2539
|
+
) : archiveMode && archiveTarget ? /* @__PURE__ */ jsx15(Box14, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", borderStyle: "round", borderColor: archiveTarget.isArchived ? "green" : "yellow", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
2540
|
+
/* @__PURE__ */ jsx15(Text15, { bold: true, children: archiveTarget.isArchived ? "Unarchive Confirmation" : "Archive Confirmation" }),
|
|
2541
|
+
/* @__PURE__ */ jsx15(Text15, { color: archiveTarget.isArchived ? "green" : "yellow", children: archiveTarget.isArchived ? "\u21BA Unarchive repository?" : "\u26A0\uFE0F Archive repository?" }),
|
|
2542
|
+
/* @__PURE__ */ jsx15(Box14, { height: 1, children: /* @__PURE__ */ jsx15(Text15, { children: " " }) }),
|
|
2543
|
+
/* @__PURE__ */ jsx15(Text15, { children: archiveTarget.nameWithOwner }),
|
|
2544
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(Text15, { children: archiveTarget.isArchived ? "This will make the repository active again." : "This will make the repository read-only." }) }),
|
|
2545
|
+
/* @__PURE__ */ jsxs14(Box14, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
2546
|
+
/* @__PURE__ */ jsx15(
|
|
2547
|
+
Box14,
|
|
2419
2548
|
{
|
|
2420
2549
|
borderStyle: "round",
|
|
2421
2550
|
borderColor: archiveTarget.isArchived ? "green" : "yellow",
|
|
@@ -2424,11 +2553,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2424
2553
|
alignItems: "center",
|
|
2425
2554
|
justifyContent: "center",
|
|
2426
2555
|
flexDirection: "column",
|
|
2427
|
-
children: /* @__PURE__ */
|
|
2556
|
+
children: /* @__PURE__ */ jsx15(Text15, { children: archiveFocus === "confirm" ? chalk11.bgGreen.white.bold(` ${archiveTarget.isArchived ? "Unarchive" : "Archive"} `) : chalk11.bold[archiveTarget.isArchived ? "green" : "yellow"](archiveTarget.isArchived ? "Unarchive" : "Archive") })
|
|
2428
2557
|
}
|
|
2429
2558
|
),
|
|
2430
|
-
/* @__PURE__ */
|
|
2431
|
-
|
|
2559
|
+
/* @__PURE__ */ jsx15(
|
|
2560
|
+
Box14,
|
|
2432
2561
|
{
|
|
2433
2562
|
borderStyle: "round",
|
|
2434
2563
|
borderColor: archiveFocus === "cancel" ? "white" : "gray",
|
|
@@ -2437,19 +2566,19 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2437
2566
|
alignItems: "center",
|
|
2438
2567
|
justifyContent: "center",
|
|
2439
2568
|
flexDirection: "column",
|
|
2440
|
-
children: /* @__PURE__ */
|
|
2569
|
+
children: /* @__PURE__ */ jsx15(Text15, { children: archiveFocus === "cancel" ? chalk11.bgGray.white.bold(" Cancel ") : chalk11.gray.bold("Cancel") })
|
|
2441
2570
|
}
|
|
2442
2571
|
)
|
|
2443
2572
|
] }),
|
|
2444
|
-
/* @__PURE__ */
|
|
2573
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs14(Text15, { color: "gray", children: [
|
|
2445
2574
|
"Press Enter to ",
|
|
2446
2575
|
archiveFocus === "confirm" ? archiveTarget.isArchived ? "Unarchive" : "Archive" : "Cancel",
|
|
2447
2576
|
" | Y to ",
|
|
2448
2577
|
archiveTarget.isArchived ? "Unarchive" : "Archive",
|
|
2449
2578
|
" | C to Cancel"
|
|
2450
2579
|
] }) }),
|
|
2451
|
-
/* @__PURE__ */
|
|
2452
|
-
|
|
2580
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(
|
|
2581
|
+
TextInput5,
|
|
2453
2582
|
{
|
|
2454
2583
|
value: "",
|
|
2455
2584
|
onChange: () => {
|
|
@@ -2463,21 +2592,28 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2463
2592
|
}
|
|
2464
2593
|
}
|
|
2465
2594
|
) }),
|
|
2466
|
-
archiveError && /* @__PURE__ */
|
|
2467
|
-
archiving && /* @__PURE__ */
|
|
2468
|
-
] }) }) :
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2595
|
+
archiveError && /* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "magenta", children: archiveError }) }),
|
|
2596
|
+
archiving && /* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "yellow", children: archiveTarget.isArchived ? "Unarchiving..." : "Archiving..." }) })
|
|
2597
|
+
] }) }) : renameMode && renameTarget ? /* @__PURE__ */ jsx15(Box14, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx15(
|
|
2598
|
+
RenameModal,
|
|
2599
|
+
{
|
|
2600
|
+
repo: renameTarget,
|
|
2601
|
+
onRename: executeRename,
|
|
2602
|
+
onCancel: closeRenameModal
|
|
2603
|
+
}
|
|
2604
|
+
) }) : syncMode && syncTarget ? /* @__PURE__ */ jsx15(Box14, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
2605
|
+
/* @__PURE__ */ jsx15(Text15, { bold: true, children: "Sync Fork Confirmation" }),
|
|
2606
|
+
/* @__PURE__ */ jsx15(Text15, { color: "blue", children: "\u27F2 Sync fork with upstream?" }),
|
|
2607
|
+
/* @__PURE__ */ jsx15(Box14, { height: 1, children: /* @__PURE__ */ jsx15(Text15, { children: " " }) }),
|
|
2608
|
+
/* @__PURE__ */ jsx15(Text15, { children: syncTarget.nameWithOwner }),
|
|
2609
|
+
syncTarget.parent && /* @__PURE__ */ jsxs14(Text15, { color: "gray", children: [
|
|
2474
2610
|
"Upstream: ",
|
|
2475
2611
|
syncTarget.parent.nameWithOwner
|
|
2476
2612
|
] }),
|
|
2477
|
-
/* @__PURE__ */
|
|
2478
|
-
/* @__PURE__ */
|
|
2479
|
-
/* @__PURE__ */
|
|
2480
|
-
|
|
2613
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(Text15, { children: "This will merge upstream changes into your fork." }) }),
|
|
2614
|
+
/* @__PURE__ */ jsxs14(Box14, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
2615
|
+
/* @__PURE__ */ jsx15(
|
|
2616
|
+
Box14,
|
|
2481
2617
|
{
|
|
2482
2618
|
borderStyle: "round",
|
|
2483
2619
|
borderColor: "blue",
|
|
@@ -2486,11 +2622,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2486
2622
|
alignItems: "center",
|
|
2487
2623
|
justifyContent: "center",
|
|
2488
2624
|
flexDirection: "column",
|
|
2489
|
-
children: /* @__PURE__ */
|
|
2625
|
+
children: /* @__PURE__ */ jsx15(Text15, { children: syncFocus === "confirm" ? chalk11.bgBlue.white.bold(" Sync ") : chalk11.blue.bold("Sync") })
|
|
2490
2626
|
}
|
|
2491
2627
|
),
|
|
2492
|
-
/* @__PURE__ */
|
|
2493
|
-
|
|
2628
|
+
/* @__PURE__ */ jsx15(
|
|
2629
|
+
Box14,
|
|
2494
2630
|
{
|
|
2495
2631
|
borderStyle: "round",
|
|
2496
2632
|
borderColor: syncFocus === "cancel" ? "white" : "gray",
|
|
@@ -2499,17 +2635,17 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2499
2635
|
alignItems: "center",
|
|
2500
2636
|
justifyContent: "center",
|
|
2501
2637
|
flexDirection: "column",
|
|
2502
|
-
children: /* @__PURE__ */
|
|
2638
|
+
children: /* @__PURE__ */ jsx15(Text15, { children: syncFocus === "cancel" ? chalk11.bgGray.white.bold(" Cancel ") : chalk11.gray.bold("Cancel") })
|
|
2503
2639
|
}
|
|
2504
2640
|
)
|
|
2505
2641
|
] }),
|
|
2506
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs14(Text15, { color: "gray", children: [
|
|
2507
2643
|
"Press Enter to ",
|
|
2508
2644
|
syncFocus === "confirm" ? "Sync" : "Cancel",
|
|
2509
2645
|
" | Y to Sync | C to Cancel"
|
|
2510
2646
|
] }) }),
|
|
2511
|
-
/* @__PURE__ */
|
|
2512
|
-
|
|
2647
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(
|
|
2648
|
+
TextInput5,
|
|
2513
2649
|
{
|
|
2514
2650
|
value: "",
|
|
2515
2651
|
onChange: () => {
|
|
@@ -2523,14 +2659,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2523
2659
|
}
|
|
2524
2660
|
}
|
|
2525
2661
|
) }),
|
|
2526
|
-
syncError && /* @__PURE__ */
|
|
2527
|
-
syncing && /* @__PURE__ */
|
|
2528
|
-
] }) }) : logoutMode ? /* @__PURE__ */
|
|
2529
|
-
/* @__PURE__ */
|
|
2530
|
-
/* @__PURE__ */
|
|
2531
|
-
/* @__PURE__ */
|
|
2532
|
-
/* @__PURE__ */
|
|
2533
|
-
|
|
2662
|
+
syncError && /* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "magenta", children: syncError }) }),
|
|
2663
|
+
syncing && /* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "yellow", children: "Syncing..." }) })
|
|
2664
|
+
] }) }) : logoutMode ? /* @__PURE__ */ jsx15(Box14, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
2665
|
+
/* @__PURE__ */ jsx15(Text15, { bold: true, children: "Logout Confirmation" }),
|
|
2666
|
+
/* @__PURE__ */ jsx15(Text15, { color: "cyan", children: "Are you sure you want to log out?" }),
|
|
2667
|
+
/* @__PURE__ */ jsxs14(Box14, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
2668
|
+
/* @__PURE__ */ jsx15(
|
|
2669
|
+
Box14,
|
|
2534
2670
|
{
|
|
2535
2671
|
borderStyle: "round",
|
|
2536
2672
|
borderColor: "cyan",
|
|
@@ -2539,11 +2675,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2539
2675
|
alignItems: "center",
|
|
2540
2676
|
justifyContent: "center",
|
|
2541
2677
|
flexDirection: "column",
|
|
2542
|
-
children: /* @__PURE__ */
|
|
2678
|
+
children: /* @__PURE__ */ jsx15(Text15, { children: logoutFocus === "confirm" ? chalk11.bgCyan.white.bold(" Logout ") : chalk11.cyan.bold("Logout") })
|
|
2543
2679
|
}
|
|
2544
2680
|
),
|
|
2545
|
-
/* @__PURE__ */
|
|
2546
|
-
|
|
2681
|
+
/* @__PURE__ */ jsx15(
|
|
2682
|
+
Box14,
|
|
2547
2683
|
{
|
|
2548
2684
|
borderStyle: "round",
|
|
2549
2685
|
borderColor: logoutFocus === "cancel" ? "white" : "gray",
|
|
@@ -2552,16 +2688,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2552
2688
|
alignItems: "center",
|
|
2553
2689
|
justifyContent: "center",
|
|
2554
2690
|
flexDirection: "column",
|
|
2555
|
-
children: /* @__PURE__ */
|
|
2691
|
+
children: /* @__PURE__ */ jsx15(Text15, { children: logoutFocus === "cancel" ? chalk11.bgGray.white.bold(" Cancel ") : chalk11.gray.bold("Cancel") })
|
|
2556
2692
|
}
|
|
2557
2693
|
)
|
|
2558
2694
|
] }),
|
|
2559
|
-
/* @__PURE__ */
|
|
2695
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs14(Text15, { color: "gray", children: [
|
|
2560
2696
|
"Press Enter to ",
|
|
2561
2697
|
logoutFocus === "confirm" ? "Logout" : "Cancel",
|
|
2562
2698
|
" | Y to Logout | C to Cancel"
|
|
2563
2699
|
] }) })
|
|
2564
|
-
] }) }) : orgSwitcherOpen ? /* @__PURE__ */
|
|
2700
|
+
] }) }) : orgSwitcherOpen ? /* @__PURE__ */ jsx15(Box14, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx15(
|
|
2565
2701
|
OrgSwitcher,
|
|
2566
2702
|
{
|
|
2567
2703
|
token,
|
|
@@ -2569,45 +2705,45 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2569
2705
|
onSelect: handleOrgContextChange,
|
|
2570
2706
|
onClose: () => setOrgSwitcherOpen(false)
|
|
2571
2707
|
}
|
|
2572
|
-
) }) : infoMode ? /* @__PURE__ */
|
|
2708
|
+
) }) : infoMode ? /* @__PURE__ */ jsx15(Box14, { height: contentHeight, alignItems: "center", justifyContent: "center", children: (() => {
|
|
2573
2709
|
const repo = infoRepo || visibleItems[cursor];
|
|
2574
|
-
if (!repo) return /* @__PURE__ */
|
|
2710
|
+
if (!repo) return /* @__PURE__ */ jsx15(Text15, { color: "red", children: "No repository selected." });
|
|
2575
2711
|
const langName = repo.primaryLanguage?.name || "N/A";
|
|
2576
2712
|
const langColor = repo.primaryLanguage?.color || "#666666";
|
|
2577
|
-
return /* @__PURE__ */
|
|
2578
|
-
/* @__PURE__ */
|
|
2713
|
+
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 90), children: [
|
|
2714
|
+
/* @__PURE__ */ jsxs14(Text15, { bold: true, children: [
|
|
2579
2715
|
"Repository Info ",
|
|
2580
2716
|
infoRepo ? chalk11.dim("(cached)") : ""
|
|
2581
2717
|
] }),
|
|
2582
|
-
/* @__PURE__ */
|
|
2583
|
-
/* @__PURE__ */
|
|
2584
|
-
repo.description && /* @__PURE__ */
|
|
2585
|
-
/* @__PURE__ */
|
|
2586
|
-
/* @__PURE__ */
|
|
2718
|
+
/* @__PURE__ */ jsx15(Box14, { height: 1, children: /* @__PURE__ */ jsx15(Text15, { children: " " }) }),
|
|
2719
|
+
/* @__PURE__ */ jsx15(Text15, { children: chalk11.bold(repo.nameWithOwner) }),
|
|
2720
|
+
repo.description && /* @__PURE__ */ jsx15(Text15, { color: "gray", children: repo.description }),
|
|
2721
|
+
/* @__PURE__ */ jsx15(Box14, { height: 1, children: /* @__PURE__ */ jsx15(Text15, { children: " " }) }),
|
|
2722
|
+
/* @__PURE__ */ jsxs14(Text15, { children: [
|
|
2587
2723
|
repo.visibility === "PRIVATE" ? chalk11.yellow("Private") : repo.visibility === "INTERNAL" ? chalk11.magenta("Internal") : chalk11.green("Public"),
|
|
2588
2724
|
repo.isArchived ? chalk11.gray(" Archived") : "",
|
|
2589
2725
|
repo.isFork ? chalk11.blue(" Fork") : ""
|
|
2590
2726
|
] }),
|
|
2591
|
-
/* @__PURE__ */
|
|
2592
|
-
/* @__PURE__ */
|
|
2727
|
+
/* @__PURE__ */ jsx15(Text15, { children: chalk11.gray(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount}`) }),
|
|
2728
|
+
/* @__PURE__ */ jsxs14(Text15, { children: [
|
|
2593
2729
|
chalk11.hex(langColor)(`\u25CF `),
|
|
2594
2730
|
chalk11.gray(`${langName}`)
|
|
2595
2731
|
] }),
|
|
2596
|
-
/* @__PURE__ */
|
|
2732
|
+
/* @__PURE__ */ jsxs14(Text15, { color: "gray", children: [
|
|
2597
2733
|
"Updated: ",
|
|
2598
2734
|
formatDate(repo.updatedAt),
|
|
2599
2735
|
" \u2022 Pushed: ",
|
|
2600
2736
|
formatDate(repo.pushedAt)
|
|
2601
2737
|
] }),
|
|
2602
|
-
/* @__PURE__ */
|
|
2738
|
+
/* @__PURE__ */ jsxs14(Text15, { color: "gray", children: [
|
|
2603
2739
|
"Size: ",
|
|
2604
2740
|
repo.diskUsage,
|
|
2605
2741
|
" KB"
|
|
2606
2742
|
] }),
|
|
2607
|
-
/* @__PURE__ */
|
|
2608
|
-
/* @__PURE__ */
|
|
2743
|
+
/* @__PURE__ */ jsx15(Box14, { height: 1, children: /* @__PURE__ */ jsx15(Text15, { children: " " }) }),
|
|
2744
|
+
/* @__PURE__ */ jsx15(Text15, { color: "gray", children: "Press Esc or I to close" })
|
|
2609
2745
|
] });
|
|
2610
|
-
})() }) : visibilityMode ? /* @__PURE__ */
|
|
2746
|
+
})() }) : visibilityMode ? /* @__PURE__ */ jsx15(Box14, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx15(
|
|
2611
2747
|
VisibilityModal,
|
|
2612
2748
|
{
|
|
2613
2749
|
currentFilter: visibilityFilter,
|
|
@@ -2620,7 +2756,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2620
2756
|
},
|
|
2621
2757
|
onCancel: () => setVisibilityMode(false)
|
|
2622
2758
|
}
|
|
2623
|
-
) }) : sortMode ? /* @__PURE__ */
|
|
2759
|
+
) }) : sortMode ? /* @__PURE__ */ jsx15(Box14, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx15(
|
|
2624
2760
|
SortModal,
|
|
2625
2761
|
{
|
|
2626
2762
|
currentSort: sortKey,
|
|
@@ -2632,7 +2768,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2632
2768
|
},
|
|
2633
2769
|
onCancel: () => setSortMode(false)
|
|
2634
2770
|
}
|
|
2635
|
-
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */
|
|
2771
|
+
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */ jsx15(Box14, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx15(
|
|
2636
2772
|
ChangeVisibilityModal,
|
|
2637
2773
|
{
|
|
2638
2774
|
isOpen: changeVisibilityMode,
|
|
@@ -2645,8 +2781,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2645
2781
|
changing: changingVisibility,
|
|
2646
2782
|
error: changeVisibilityError
|
|
2647
2783
|
}
|
|
2648
|
-
) }) : /* @__PURE__ */
|
|
2649
|
-
/* @__PURE__ */
|
|
2784
|
+
) }) : /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
2785
|
+
/* @__PURE__ */ jsx15(
|
|
2650
2786
|
RepoListHeader,
|
|
2651
2787
|
{
|
|
2652
2788
|
ownerContext,
|
|
@@ -2660,10 +2796,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2660
2796
|
isEnterprise: isEnterpriseOrg
|
|
2661
2797
|
}
|
|
2662
2798
|
),
|
|
2663
|
-
filterMode && /* @__PURE__ */
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2666
|
-
|
|
2799
|
+
filterMode && /* @__PURE__ */ jsxs14(Box14, { marginBottom: 1, children: [
|
|
2800
|
+
/* @__PURE__ */ jsx15(Text15, { children: "Search: " }),
|
|
2801
|
+
/* @__PURE__ */ jsx15(
|
|
2802
|
+
TextInput5,
|
|
2667
2803
|
{
|
|
2668
2804
|
value: filter,
|
|
2669
2805
|
onChange: (val) => {
|
|
@@ -2702,10 +2838,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2702
2838
|
}
|
|
2703
2839
|
)
|
|
2704
2840
|
] }),
|
|
2705
|
-
/* @__PURE__ */
|
|
2706
|
-
filterMode && filter.trim().length > 0 && filter.trim().length < 3 ? /* @__PURE__ */
|
|
2841
|
+
/* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", height: listHeight, children: [
|
|
2842
|
+
filterMode && filter.trim().length > 0 && filter.trim().length < 3 ? /* @__PURE__ */ jsx15(Box14, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "gray", dimColor: true, children: "Type at least 3 characters to search" }) }) : visibleItems.slice(windowed.start, windowed.end).map((repo, i) => {
|
|
2707
2843
|
const idx = windowed.start + i;
|
|
2708
|
-
return /* @__PURE__ */
|
|
2844
|
+
return /* @__PURE__ */ jsx15(
|
|
2709
2845
|
RepoRow,
|
|
2710
2846
|
{
|
|
2711
2847
|
repo,
|
|
@@ -2718,32 +2854,32 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2718
2854
|
repo.nameWithOwner
|
|
2719
2855
|
);
|
|
2720
2856
|
}),
|
|
2721
|
-
loadingMore && hasNextPage && /* @__PURE__ */
|
|
2722
|
-
/* @__PURE__ */
|
|
2723
|
-
/* @__PURE__ */
|
|
2857
|
+
loadingMore && hasNextPage && /* @__PURE__ */ jsx15(Box14, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs14(Box14, { flexDirection: "row", children: [
|
|
2858
|
+
/* @__PURE__ */ jsx15(Box14, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "cyan", children: /* @__PURE__ */ jsx15(SlowSpinner, {}) }) }),
|
|
2859
|
+
/* @__PURE__ */ jsx15(Text15, { color: "cyan", children: "Loading more repositories..." })
|
|
2724
2860
|
] }) }),
|
|
2725
|
-
!loading && !searchLoading && visibleItems.length === 0 && /* @__PURE__ */
|
|
2861
|
+
!loading && !searchLoading && visibleItems.length === 0 && /* @__PURE__ */ jsx15(Box14, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx15(Text15, { color: "gray", dimColor: true, children: searchActive ? "No repositories match your search" : filter ? "No repositories match your filter" : "No repositories found" }) })
|
|
2726
2862
|
] })
|
|
2727
2863
|
] }) }),
|
|
2728
|
-
/* @__PURE__ */
|
|
2729
|
-
/* @__PURE__ */
|
|
2730
|
-
/* @__PURE__ */
|
|
2731
|
-
/* @__PURE__ */
|
|
2864
|
+
/* @__PURE__ */ jsxs14(Box14, { marginTop: 1, paddingX: 1, flexDirection: "column", children: [
|
|
2865
|
+
/* @__PURE__ */ jsx15(Box14, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx15(Text15, { color: "gray", dimColor: modalOpen ? true : void 0, children: "\u2191\u2193 Navigate \u2022 \u23CE/O Open \u2022 R Refresh \u2022 W Org Switch \u2022 Ctrl+L Logout \u2022 Q Quit" }) }),
|
|
2866
|
+
/* @__PURE__ */ jsx15(Box14, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx15(Text15, { color: "gray", dimColor: modalOpen ? true : void 0, children: "Ctrl+G Top \u2022 G Bottom \u2022 / Search \u2022 S Sort \u2022 D Direction \u2022 T Density \u2022 F Fork Status \u2022 V Visibility" }) }),
|
|
2867
|
+
/* @__PURE__ */ jsx15(Box14, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx15(Text15, { color: "gray", dimColor: modalOpen ? true : void 0, children: "I Info \u2022 K Cache Info \u2022 Ctrl+R Rename \u2022 Ctrl+A Un/Archive \u2022 Ctrl+V Change Visibility \u2022 Del/Backspace Delete \u2022 Ctrl+S Sync Fork" }) })
|
|
2732
2868
|
] }),
|
|
2733
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
2734
|
-
/* @__PURE__ */
|
|
2735
|
-
debugMessages.length === 0 ? /* @__PURE__ */
|
|
2869
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsxs14(Box14, { marginTop: 1, borderStyle: "single", borderColor: "yellow", paddingX: 1, flexDirection: "column", children: [
|
|
2870
|
+
/* @__PURE__ */ jsx15(Text15, { bold: true, color: "yellow", children: "Debug Messages:" }),
|
|
2871
|
+
debugMessages.length === 0 ? /* @__PURE__ */ jsx15(Text15, { color: "gray", children: "No debug messages yet..." }) : debugMessages.map((msg, i) => /* @__PURE__ */ jsx15(Text15, { color: "gray", children: msg }, i))
|
|
2736
2872
|
] })
|
|
2737
2873
|
] });
|
|
2738
2874
|
}
|
|
2739
2875
|
|
|
2740
2876
|
// src/ui/components/auth/AuthMethodSelector.tsx
|
|
2741
|
-
import { useState as
|
|
2742
|
-
import { Box as
|
|
2877
|
+
import { useState as useState12 } from "react";
|
|
2878
|
+
import { Box as Box15, Text as Text16, useInput as useInput12 } from "ink";
|
|
2743
2879
|
import chalk12 from "chalk";
|
|
2744
|
-
import { jsx as
|
|
2880
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2745
2881
|
function AuthMethodSelector({ onSelect, onQuit }) {
|
|
2746
|
-
const [selectedIndex, setSelectedIndex] =
|
|
2882
|
+
const [selectedIndex, setSelectedIndex] = useState12(0);
|
|
2747
2883
|
const methods = [
|
|
2748
2884
|
{
|
|
2749
2885
|
key: "oauth",
|
|
@@ -2756,7 +2892,7 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
2756
2892
|
description: "Manually enter a GitHub Personal Access Token"
|
|
2757
2893
|
}
|
|
2758
2894
|
];
|
|
2759
|
-
|
|
2895
|
+
useInput12((input, key) => {
|
|
2760
2896
|
if (key.escape || input?.toLowerCase() === "q") {
|
|
2761
2897
|
if (onQuit) {
|
|
2762
2898
|
onQuit();
|
|
@@ -2775,34 +2911,34 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
2775
2911
|
onSelect("pat");
|
|
2776
2912
|
}
|
|
2777
2913
|
});
|
|
2778
|
-
return /* @__PURE__ */
|
|
2779
|
-
/* @__PURE__ */
|
|
2780
|
-
/* @__PURE__ */
|
|
2914
|
+
return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, children: [
|
|
2915
|
+
/* @__PURE__ */ jsx16(Text16, { bold: true, marginBottom: 1, children: "Choose Authentication Method" }),
|
|
2916
|
+
/* @__PURE__ */ jsx16(Box15, { flexDirection: "column", marginY: 1, children: methods.map((method, index) => {
|
|
2781
2917
|
const isSelected = index === selectedIndex;
|
|
2782
2918
|
const prefix = isSelected ? chalk12.cyan("\u203A") : " ";
|
|
2783
2919
|
const numberPrefix = `${index + 1}.`;
|
|
2784
|
-
return /* @__PURE__ */
|
|
2785
|
-
/* @__PURE__ */
|
|
2920
|
+
return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", marginBottom: 1, children: [
|
|
2921
|
+
/* @__PURE__ */ jsx16(Text16, { children: /* @__PURE__ */ jsxs15(Text16, { color: isSelected ? "cyan" : void 0, bold: isSelected, children: [
|
|
2786
2922
|
prefix,
|
|
2787
2923
|
" ",
|
|
2788
2924
|
numberPrefix,
|
|
2789
2925
|
" ",
|
|
2790
2926
|
method.label
|
|
2791
2927
|
] }) }),
|
|
2792
|
-
/* @__PURE__ */
|
|
2928
|
+
/* @__PURE__ */ jsxs15(Text16, { color: "gray", dimColor: true, children: [
|
|
2793
2929
|
" ",
|
|
2794
2930
|
method.description
|
|
2795
2931
|
] })
|
|
2796
2932
|
] }, method.key);
|
|
2797
2933
|
}) }),
|
|
2798
|
-
/* @__PURE__ */
|
|
2934
|
+
/* @__PURE__ */ jsx16(Text16, { color: "gray", dimColor: true, marginTop: 1, children: "Use arrow keys to navigate, Enter to select, or press 1/2 \u2022 Q/Esc to quit" })
|
|
2799
2935
|
] });
|
|
2800
2936
|
}
|
|
2801
2937
|
|
|
2802
2938
|
// src/ui/components/auth/OAuthProgress.tsx
|
|
2803
|
-
import { Box as
|
|
2939
|
+
import { Box as Box16, Text as Text17 } from "ink";
|
|
2804
2940
|
import Spinner from "ink-spinner";
|
|
2805
|
-
import { jsx as
|
|
2941
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2806
2942
|
function OAuthProgress({ status, error, deviceCode }) {
|
|
2807
2943
|
const statusMessages = {
|
|
2808
2944
|
initializing: {
|
|
@@ -2839,69 +2975,69 @@ function OAuthProgress({ status, error, deviceCode }) {
|
|
|
2839
2975
|
}
|
|
2840
2976
|
};
|
|
2841
2977
|
const { message, showSpinner } = statusMessages[status];
|
|
2842
|
-
return /* @__PURE__ */
|
|
2843
|
-
/* @__PURE__ */
|
|
2844
|
-
/* @__PURE__ */
|
|
2845
|
-
/* @__PURE__ */
|
|
2846
|
-
/* @__PURE__ */
|
|
2978
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", borderStyle: "single", borderColor: status === "error" ? "red" : "cyan", paddingX: 2, paddingY: 1, children: [
|
|
2979
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, marginBottom: 1, children: "GitHub OAuth Authentication" }),
|
|
2980
|
+
/* @__PURE__ */ jsx17(Box16, { marginY: 1, children: showSpinner ? /* @__PURE__ */ jsxs16(Box16, { children: [
|
|
2981
|
+
/* @__PURE__ */ jsx17(Text17, { color: "green", children: /* @__PURE__ */ jsx17(Spinner, { type: "dots" }) }),
|
|
2982
|
+
/* @__PURE__ */ jsxs16(Text17, { children: [
|
|
2847
2983
|
" ",
|
|
2848
2984
|
message
|
|
2849
2985
|
] })
|
|
2850
|
-
] }) : /* @__PURE__ */
|
|
2986
|
+
] }) : /* @__PURE__ */ jsxs16(Text17, { color: status === "error" ? "red" : "green", children: [
|
|
2851
2987
|
status === "error" ? "\u2717" : "\u2713",
|
|
2852
2988
|
" ",
|
|
2853
2989
|
message
|
|
2854
2990
|
] }) }),
|
|
2855
|
-
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */
|
|
2856
|
-
/* @__PURE__ */
|
|
2857
|
-
/* @__PURE__ */
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
/* @__PURE__ */
|
|
2991
|
+
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */ jsxs16(Box16, { marginY: 1, flexDirection: "column", children: [
|
|
2992
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, color: "cyan", marginBottom: 1, children: "\u{1F4CB} Please complete these steps:" }),
|
|
2993
|
+
/* @__PURE__ */ jsxs16(Box16, { marginBottom: 1, children: [
|
|
2994
|
+
/* @__PURE__ */ jsx17(Text17, { children: "1. Visit: " }),
|
|
2995
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, color: "blue", children: deviceCode.verification_uri })
|
|
2860
2996
|
] }),
|
|
2861
|
-
/* @__PURE__ */
|
|
2862
|
-
/* @__PURE__ */
|
|
2863
|
-
/* @__PURE__ */
|
|
2997
|
+
/* @__PURE__ */ jsxs16(Box16, { marginBottom: 1, flexDirection: "column", children: [
|
|
2998
|
+
/* @__PURE__ */ jsx17(Text17, { children: "2. Enter this code:" }),
|
|
2999
|
+
/* @__PURE__ */ jsx17(Box16, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { bold: true, color: "yellow", children: deviceCode.user_code }) })
|
|
2864
3000
|
] }),
|
|
2865
|
-
status === "waiting_for_authorization" && /* @__PURE__ */
|
|
2866
|
-
status === "polling_for_token" && /* @__PURE__ */
|
|
2867
|
-
/* @__PURE__ */
|
|
2868
|
-
/* @__PURE__ */
|
|
3001
|
+
status === "waiting_for_authorization" && /* @__PURE__ */ jsx17(Text17, { color: "gray", marginTop: 1, children: "Your browser should open automatically." }),
|
|
3002
|
+
status === "polling_for_token" && /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", marginTop: 1, children: [
|
|
3003
|
+
/* @__PURE__ */ jsx17(Text17, { color: "gray", children: "Waiting for you to complete authorization in your browser..." }),
|
|
3004
|
+
/* @__PURE__ */ jsx17(Text17, { color: "gray", dimColor: true, marginTop: 1, children: "This will timeout in 15 minutes. Press Esc to cancel." })
|
|
2869
3005
|
] })
|
|
2870
3006
|
] }),
|
|
2871
|
-
status === "error" && error && /* @__PURE__ */
|
|
2872
|
-
/* @__PURE__ */
|
|
2873
|
-
/* @__PURE__ */
|
|
3007
|
+
status === "error" && error && /* @__PURE__ */ jsxs16(Box16, { marginY: 1, flexDirection: "column", children: [
|
|
3008
|
+
/* @__PURE__ */ jsx17(Text17, { color: "red", children: error }),
|
|
3009
|
+
/* @__PURE__ */ jsx17(Text17, { color: "gray", marginTop: 1, children: "Press Esc to go back and try again." })
|
|
2874
3010
|
] }),
|
|
2875
|
-
status === "success" && /* @__PURE__ */
|
|
3011
|
+
status === "success" && /* @__PURE__ */ jsx17(Text17, { color: "gray", marginTop: 1, children: "Returning to application..." })
|
|
2876
3012
|
] });
|
|
2877
3013
|
}
|
|
2878
3014
|
|
|
2879
3015
|
// src/ui/App.tsx
|
|
2880
|
-
import { jsx as
|
|
3016
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2881
3017
|
var packageJson = require_package();
|
|
2882
3018
|
function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlineTokenEphemeral }) {
|
|
2883
3019
|
const { exit } = useApp2();
|
|
2884
3020
|
const { stdout } = useStdout2();
|
|
2885
|
-
const [mode, setMode] =
|
|
2886
|
-
const [token, setToken] =
|
|
2887
|
-
const [input, setInput] =
|
|
2888
|
-
const [error, setError] =
|
|
2889
|
-
const [viewer, setViewer] =
|
|
2890
|
-
const [rateLimitReset, setRateLimitReset] =
|
|
2891
|
-
const [wasRateLimited, setWasRateLimited] =
|
|
2892
|
-
const [orgContext, setOrgContext] =
|
|
2893
|
-
const [authMethod, setAuthMethod] =
|
|
2894
|
-
const [oauthStatus, setOAuthStatus] =
|
|
2895
|
-
const [tokenSource, setTokenSource] =
|
|
2896
|
-
const [sessionTokenOrigin, setSessionTokenOrigin] =
|
|
2897
|
-
const [deviceCodeResponse, setDeviceCodeResponse] =
|
|
2898
|
-
const [oauthDeviceCode, setOauthDeviceCode] =
|
|
2899
|
-
const [dims, setDims] =
|
|
3021
|
+
const [mode, setMode] = useState13("checking");
|
|
3022
|
+
const [token, setToken] = useState13(null);
|
|
3023
|
+
const [input, setInput] = useState13("");
|
|
3024
|
+
const [error, setError] = useState13(null);
|
|
3025
|
+
const [viewer, setViewer] = useState13(null);
|
|
3026
|
+
const [rateLimitReset, setRateLimitReset] = useState13(null);
|
|
3027
|
+
const [wasRateLimited, setWasRateLimited] = useState13(false);
|
|
3028
|
+
const [orgContext, setOrgContext] = useState13("personal");
|
|
3029
|
+
const [authMethod, setAuthMethod] = useState13("pat");
|
|
3030
|
+
const [oauthStatus, setOAuthStatus] = useState13("initializing");
|
|
3031
|
+
const [tokenSource, setTokenSource] = useState13("pat");
|
|
3032
|
+
const [sessionTokenOrigin, setSessionTokenOrigin] = useState13("stored");
|
|
3033
|
+
const [deviceCodeResponse, setDeviceCodeResponse] = useState13(null);
|
|
3034
|
+
const [oauthDeviceCode, setOauthDeviceCode] = useState13(null);
|
|
3035
|
+
const [dims, setDims] = useState13(() => {
|
|
2900
3036
|
const cols = stdout?.columns ?? 100;
|
|
2901
3037
|
const rows = stdout?.rows ?? 30;
|
|
2902
3038
|
return { cols, rows };
|
|
2903
3039
|
});
|
|
2904
|
-
|
|
3040
|
+
useEffect9(() => {
|
|
2905
3041
|
if (!stdout) return;
|
|
2906
3042
|
const onResize = () => {
|
|
2907
3043
|
const cols = stdout.columns ?? 100;
|
|
@@ -2913,7 +3049,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
2913
3049
|
stdout.off?.("resize", onResize);
|
|
2914
3050
|
};
|
|
2915
3051
|
}, [stdout]);
|
|
2916
|
-
|
|
3052
|
+
useEffect9(() => {
|
|
2917
3053
|
const env = getTokenFromEnv();
|
|
2918
3054
|
const stored = getStoredToken();
|
|
2919
3055
|
const source = getTokenSource();
|
|
@@ -2937,7 +3073,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
2937
3073
|
setMode("auth_method_selection");
|
|
2938
3074
|
}
|
|
2939
3075
|
}, [inlineToken2]);
|
|
2940
|
-
|
|
3076
|
+
useEffect9(() => {
|
|
2941
3077
|
if (mode !== "oauth_flow") return;
|
|
2942
3078
|
(async () => {
|
|
2943
3079
|
try {
|
|
@@ -2989,7 +3125,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
2989
3125
|
setMode("oauth_flow");
|
|
2990
3126
|
}
|
|
2991
3127
|
};
|
|
2992
|
-
|
|
3128
|
+
useEffect9(() => {
|
|
2993
3129
|
(async () => {
|
|
2994
3130
|
if (mode !== "validating" || !token) return;
|
|
2995
3131
|
const timeoutId = setTimeout(() => {
|
|
@@ -3101,7 +3237,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3101
3237
|
setTokenSource("pat");
|
|
3102
3238
|
setMode("auth_method_selection");
|
|
3103
3239
|
};
|
|
3104
|
-
|
|
3240
|
+
useInput13((input2, key) => {
|
|
3105
3241
|
if ((mode === "prompt" || mode === "auth_method_selection") && key.escape) {
|
|
3106
3242
|
exit();
|
|
3107
3243
|
}
|
|
@@ -3133,19 +3269,19 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3133
3269
|
}
|
|
3134
3270
|
});
|
|
3135
3271
|
const verticalPadding = Math.floor(dims.rows * 0.15);
|
|
3136
|
-
const header = useMemo2(() => /* @__PURE__ */
|
|
3137
|
-
/* @__PURE__ */
|
|
3138
|
-
/* @__PURE__ */
|
|
3272
|
+
const header = useMemo2(() => /* @__PURE__ */ jsxs17(Box17, { flexDirection: "row", justifyContent: "space-between", marginBottom: 1, children: [
|
|
3273
|
+
/* @__PURE__ */ jsxs17(Box17, { flexDirection: "row", gap: 1, children: [
|
|
3274
|
+
/* @__PURE__ */ jsxs17(Text18, { bold: true, color: "cyan", children: [
|
|
3139
3275
|
" ",
|
|
3140
3276
|
"GitHub Repository Manager"
|
|
3141
3277
|
] }),
|
|
3142
|
-
/* @__PURE__ */
|
|
3278
|
+
/* @__PURE__ */ jsxs17(Text18, { color: "gray", dimColor: true, children: [
|
|
3143
3279
|
"v",
|
|
3144
3280
|
packageJson.version
|
|
3145
3281
|
] }),
|
|
3146
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
3282
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsx18(Text18, { backgroundColor: "blue", color: "white", children: " debug mode " })
|
|
3147
3283
|
] }),
|
|
3148
|
-
viewer && /* @__PURE__ */
|
|
3284
|
+
viewer && /* @__PURE__ */ jsx18(Text18, { color: "gray", children: orgContext !== "personal" && orgContext.login ? `${orgContext.login}/@${viewer} ` : `@${viewer} ` })
|
|
3149
3285
|
] }), [viewer, orgContext]);
|
|
3150
3286
|
if (mode === "rate_limited") {
|
|
3151
3287
|
const formatResetTime = (resetTime) => {
|
|
@@ -3168,71 +3304,71 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3168
3304
|
return "Unknown";
|
|
3169
3305
|
}
|
|
3170
3306
|
};
|
|
3171
|
-
return /* @__PURE__ */
|
|
3307
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3172
3308
|
header,
|
|
3173
|
-
/* @__PURE__ */
|
|
3174
|
-
/* @__PURE__ */
|
|
3175
|
-
/* @__PURE__ */
|
|
3176
|
-
/* @__PURE__ */
|
|
3177
|
-
rateLimitReset && /* @__PURE__ */
|
|
3178
|
-
/* @__PURE__ */
|
|
3179
|
-
/* @__PURE__ */
|
|
3309
|
+
/* @__PURE__ */ jsx18(Box17, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs17(Box17, { borderStyle: "single", borderColor: "yellow", paddingX: 3, paddingY: 2, flexDirection: "column", width: Math.min(dims.cols - 8, 80), children: [
|
|
3310
|
+
/* @__PURE__ */ jsx18(Text18, { bold: true, color: "yellow", marginBottom: 1, children: "\u26A0\uFE0F Rate Limit Exceeded" }),
|
|
3311
|
+
/* @__PURE__ */ jsx18(Text18, { color: "gray", marginBottom: 1, children: "You've hit GitHub's API rate limit for your token." }),
|
|
3312
|
+
/* @__PURE__ */ jsx18(Text18, { color: "gray", marginBottom: 1, children: "This happens when you make too many requests in a short time." }),
|
|
3313
|
+
rateLimitReset && /* @__PURE__ */ jsxs17(Box17, { marginTop: 1, marginBottom: 1, children: [
|
|
3314
|
+
/* @__PURE__ */ jsxs17(Text18, { children: [
|
|
3315
|
+
/* @__PURE__ */ jsx18(Text18, { color: "cyan", children: "Reset in:" }),
|
|
3180
3316
|
" ",
|
|
3181
|
-
/* @__PURE__ */
|
|
3317
|
+
/* @__PURE__ */ jsx18(Text18, { bold: true, children: formatResetTime(rateLimitReset) })
|
|
3182
3318
|
] }),
|
|
3183
|
-
/* @__PURE__ */
|
|
3319
|
+
/* @__PURE__ */ jsxs17(Text18, { color: "gray", dimColor: true, children: [
|
|
3184
3320
|
"(",
|
|
3185
3321
|
new Date(rateLimitReset).toLocaleTimeString(),
|
|
3186
3322
|
")"
|
|
3187
3323
|
] })
|
|
3188
3324
|
] }),
|
|
3189
|
-
/* @__PURE__ */
|
|
3190
|
-
/* @__PURE__ */
|
|
3191
|
-
/* @__PURE__ */
|
|
3192
|
-
/* @__PURE__ */
|
|
3193
|
-
/* @__PURE__ */
|
|
3325
|
+
/* @__PURE__ */ jsxs17(Box17, { marginTop: 2, flexDirection: "column", gap: 1, children: [
|
|
3326
|
+
/* @__PURE__ */ jsx18(Text18, { bold: true, children: "What would you like to do?" }),
|
|
3327
|
+
/* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", paddingLeft: 2, children: [
|
|
3328
|
+
/* @__PURE__ */ jsxs17(Text18, { children: [
|
|
3329
|
+
/* @__PURE__ */ jsx18(Text18, { color: "cyan", bold: true, children: "R" }),
|
|
3194
3330
|
" - Retry now ",
|
|
3195
3331
|
rateLimitReset && formatResetTime(rateLimitReset) !== "Now (should be reset)" ? "(likely to fail until reset)" : "(should work now)"
|
|
3196
3332
|
] }),
|
|
3197
|
-
/* @__PURE__ */
|
|
3198
|
-
/* @__PURE__ */
|
|
3333
|
+
/* @__PURE__ */ jsxs17(Text18, { children: [
|
|
3334
|
+
/* @__PURE__ */ jsx18(Text18, { color: "cyan", bold: true, children: "L" }),
|
|
3199
3335
|
" - Logout and choose authentication method"
|
|
3200
3336
|
] }),
|
|
3201
|
-
/* @__PURE__ */
|
|
3202
|
-
/* @__PURE__ */
|
|
3337
|
+
/* @__PURE__ */ jsxs17(Text18, { children: [
|
|
3338
|
+
/* @__PURE__ */ jsx18(Text18, { color: "gray", bold: true, children: "Q/Esc" }),
|
|
3203
3339
|
" - Quit application"
|
|
3204
3340
|
] })
|
|
3205
3341
|
] })
|
|
3206
3342
|
] }),
|
|
3207
|
-
/* @__PURE__ */
|
|
3343
|
+
/* @__PURE__ */ jsx18(Text18, { color: "gray", dimColor: true, marginTop: 2, children: "Tip: Using multiple tokens or waiting between requests can help avoid rate limits." })
|
|
3208
3344
|
] }) })
|
|
3209
3345
|
] });
|
|
3210
3346
|
}
|
|
3211
3347
|
if (mode === "auth_method_selection") {
|
|
3212
|
-
return /* @__PURE__ */
|
|
3348
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3213
3349
|
header,
|
|
3214
|
-
/* @__PURE__ */
|
|
3215
|
-
/* @__PURE__ */
|
|
3216
|
-
error && /* @__PURE__ */
|
|
3350
|
+
/* @__PURE__ */ jsx18(Box17, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", alignItems: "center", children: [
|
|
3351
|
+
/* @__PURE__ */ jsx18(AuthMethodSelector, { onSelect: handleAuthMethodSelect }),
|
|
3352
|
+
error && /* @__PURE__ */ jsx18(Text18, { color: "red", marginTop: 1, children: error })
|
|
3217
3353
|
] }) })
|
|
3218
3354
|
] });
|
|
3219
3355
|
}
|
|
3220
3356
|
if (mode === "oauth_flow") {
|
|
3221
|
-
return /* @__PURE__ */
|
|
3357
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3222
3358
|
header,
|
|
3223
|
-
/* @__PURE__ */
|
|
3359
|
+
/* @__PURE__ */ jsx18(Box17, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx18(OAuthProgress, { status: oauthStatus, error: error || void 0, deviceCode: oauthDeviceCode || void 0 }) })
|
|
3224
3360
|
] });
|
|
3225
3361
|
}
|
|
3226
3362
|
if (mode === "prompt") {
|
|
3227
|
-
return /* @__PURE__ */
|
|
3363
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3228
3364
|
header,
|
|
3229
|
-
/* @__PURE__ */
|
|
3230
|
-
/* @__PURE__ */
|
|
3231
|
-
/* @__PURE__ */
|
|
3232
|
-
/* @__PURE__ */
|
|
3233
|
-
/* @__PURE__ */
|
|
3234
|
-
/* @__PURE__ */
|
|
3235
|
-
|
|
3365
|
+
/* @__PURE__ */ jsx18(Box17, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs17(Box17, { borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, flexDirection: "column", children: [
|
|
3366
|
+
/* @__PURE__ */ jsx18(Text18, { bold: true, marginBottom: 1, children: "Authentication Required" }),
|
|
3367
|
+
/* @__PURE__ */ jsx18(Text18, { color: "gray", marginBottom: 1, children: "Enter your GitHub Personal Access Token" }),
|
|
3368
|
+
/* @__PURE__ */ jsxs17(Box17, { children: [
|
|
3369
|
+
/* @__PURE__ */ jsx18(Text18, { children: "Token: " }),
|
|
3370
|
+
/* @__PURE__ */ jsx18(
|
|
3371
|
+
TextInput6,
|
|
3236
3372
|
{
|
|
3237
3373
|
value: input,
|
|
3238
3374
|
onChange: setInput,
|
|
@@ -3241,30 +3377,30 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3241
3377
|
}
|
|
3242
3378
|
)
|
|
3243
3379
|
] }),
|
|
3244
|
-
error && /* @__PURE__ */
|
|
3245
|
-
/* @__PURE__ */
|
|
3246
|
-
/* @__PURE__ */
|
|
3380
|
+
error && /* @__PURE__ */ jsx18(Text18, { color: "red", marginTop: 1, children: error }),
|
|
3381
|
+
/* @__PURE__ */ jsx18(Text18, { color: "gray", dimColor: true, marginTop: 1, children: "The token will be stored securely in your local config" }),
|
|
3382
|
+
/* @__PURE__ */ jsx18(Text18, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to go back" })
|
|
3247
3383
|
] }) })
|
|
3248
3384
|
] });
|
|
3249
3385
|
}
|
|
3250
3386
|
if (mode === "validating" || mode === "checking") {
|
|
3251
|
-
return /* @__PURE__ */
|
|
3387
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3252
3388
|
header,
|
|
3253
|
-
/* @__PURE__ */
|
|
3254
|
-
/* @__PURE__ */
|
|
3255
|
-
mode === "validating" && /* @__PURE__ */
|
|
3389
|
+
/* @__PURE__ */ jsx18(Box17, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", alignItems: "center", children: [
|
|
3390
|
+
/* @__PURE__ */ jsx18(Text18, { color: "yellow", children: "Validating token..." }),
|
|
3391
|
+
mode === "validating" && /* @__PURE__ */ jsx18(Text18, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to cancel" })
|
|
3256
3392
|
] }) })
|
|
3257
3393
|
] });
|
|
3258
3394
|
}
|
|
3259
3395
|
if (mode === "error") {
|
|
3260
|
-
return /* @__PURE__ */
|
|
3396
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3261
3397
|
header,
|
|
3262
|
-
/* @__PURE__ */
|
|
3398
|
+
/* @__PURE__ */ jsx18(Box17, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx18(Text18, { color: "red", children: error ?? "Unexpected error" }) })
|
|
3263
3399
|
] });
|
|
3264
3400
|
}
|
|
3265
|
-
return /* @__PURE__ */
|
|
3401
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3266
3402
|
header,
|
|
3267
|
-
/* @__PURE__ */
|
|
3403
|
+
/* @__PURE__ */ jsx18(
|
|
3268
3404
|
RepoList,
|
|
3269
3405
|
{
|
|
3270
3406
|
token,
|
|
@@ -3279,7 +3415,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3279
3415
|
}
|
|
3280
3416
|
|
|
3281
3417
|
// src/index.tsx
|
|
3282
|
-
import { jsx as
|
|
3418
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3283
3419
|
var argv = process.argv.slice(2);
|
|
3284
3420
|
var getFlagValue = (name) => {
|
|
3285
3421
|
const idx = argv.findIndex((a) => a === `--${name}` || a.startsWith(`--${name}=`));
|
|
@@ -3374,8 +3510,8 @@ var inlineToken = (() => {
|
|
|
3374
3510
|
})();
|
|
3375
3511
|
logger.debug("Rendering UI");
|
|
3376
3512
|
var { unmount } = render(
|
|
3377
|
-
/* @__PURE__ */
|
|
3378
|
-
/* @__PURE__ */
|
|
3379
|
-
/* @__PURE__ */
|
|
3513
|
+
/* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", children: [
|
|
3514
|
+
/* @__PURE__ */ jsx19(App, { initialOrgSlug, inlineToken, inlineTokenEphemeral: Boolean(inlineToken) }),
|
|
3515
|
+
/* @__PURE__ */ jsx19(Text19, { color: "gray" })
|
|
3380
3516
|
] })
|
|
3381
3517
|
);
|