gh-manager-cli 1.31.1 → 1.32.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 +19 -0
- package/README.md +2 -14
- package/dist/index.js +642 -485
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var require_package = __commonJS({
|
|
|
31
31
|
"package.json"(exports, module) {
|
|
32
32
|
module.exports = {
|
|
33
33
|
name: "gh-manager-cli",
|
|
34
|
-
version: "1.
|
|
34
|
+
version: "1.32.0",
|
|
35
35
|
private: false,
|
|
36
36
|
description: "TUI terminal app to manage GitHub repos. Clean up your account in 5 minutes. Archive, delete, rename repos with keyboard shortcuts. Alternative to clicking through github.com",
|
|
37
37
|
license: "MIT",
|
|
@@ -171,12 +171,12 @@ var require_package = __commonJS({
|
|
|
171
171
|
|
|
172
172
|
// src/index.tsx
|
|
173
173
|
var import_package = __toESM(require_package(), 1);
|
|
174
|
-
import { render, Box as
|
|
174
|
+
import { render, Box as Box20, Text as Text21 } from "ink";
|
|
175
175
|
import "dotenv/config";
|
|
176
176
|
|
|
177
177
|
// src/ui/App.tsx
|
|
178
|
-
import { useEffect as
|
|
179
|
-
import { Box as
|
|
178
|
+
import { useEffect as useEffect10, useMemo as useMemo2, useState as useState15 } from "react";
|
|
179
|
+
import { Box as Box19, Text as Text20, useApp as useApp2, useStdout as useStdout2, useInput as useInput15 } from "ink";
|
|
180
180
|
import TextInput6 from "ink-text-input";
|
|
181
181
|
|
|
182
182
|
// src/config/config.ts
|
|
@@ -425,10 +425,10 @@ async function openGitHubAuthorizationPage() {
|
|
|
425
425
|
}
|
|
426
426
|
|
|
427
427
|
// src/ui/views/RepoList.tsx
|
|
428
|
-
import
|
|
429
|
-
import { Box as
|
|
428
|
+
import React13, { useEffect as useEffect9, useMemo, useState as useState13, useRef, useCallback } from "react";
|
|
429
|
+
import { Box as Box16, Text as Text17, useApp, useInput as useInput13, useStdout } from "ink";
|
|
430
430
|
import TextInput5 from "ink-text-input";
|
|
431
|
-
import
|
|
431
|
+
import chalk13 from "chalk";
|
|
432
432
|
|
|
433
433
|
// src/services/apolloMeta.ts
|
|
434
434
|
import fs2 from "fs";
|
|
@@ -957,12 +957,157 @@ function SortModal({
|
|
|
957
957
|
] });
|
|
958
958
|
}
|
|
959
959
|
|
|
960
|
-
// src/ui/components/modals/
|
|
960
|
+
// src/ui/components/modals/SortDirectionModal.tsx
|
|
961
961
|
import { useState as useState9, useEffect as useEffect6 } from "react";
|
|
962
962
|
import { Box as Box9, Text as Text10, useInput as useInput9 } from "ink";
|
|
963
|
-
import TextInput2 from "ink-text-input";
|
|
964
963
|
import chalk9 from "chalk";
|
|
965
|
-
import {
|
|
964
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
965
|
+
function SortDirectionModal({
|
|
966
|
+
currentDirection,
|
|
967
|
+
currentSortKey,
|
|
968
|
+
onSelect,
|
|
969
|
+
onCancel
|
|
970
|
+
}) {
|
|
971
|
+
const options = ["desc", "asc"];
|
|
972
|
+
const [focusedOption, setFocusedOption] = useState9(currentDirection);
|
|
973
|
+
useEffect6(() => {
|
|
974
|
+
setFocusedOption(currentDirection);
|
|
975
|
+
}, [currentDirection]);
|
|
976
|
+
useInput9((input, key) => {
|
|
977
|
+
if (key.escape || input && input.toUpperCase() === "C") {
|
|
978
|
+
onCancel();
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
if (key.leftArrow || key.upArrow) {
|
|
982
|
+
if (focusedOption === "cancel") {
|
|
983
|
+
setFocusedOption(options[options.length - 1]);
|
|
984
|
+
} else if (focusedOption === "asc") {
|
|
985
|
+
setFocusedOption("desc");
|
|
986
|
+
} else if (focusedOption === "desc") {
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
if (key.rightArrow || key.downArrow) {
|
|
990
|
+
if (focusedOption === "desc") {
|
|
991
|
+
setFocusedOption("asc");
|
|
992
|
+
} else if (focusedOption === "asc") {
|
|
993
|
+
setFocusedOption("cancel");
|
|
994
|
+
} else if (focusedOption === "cancel") {
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
if (key.tab) {
|
|
998
|
+
if (focusedOption === "desc") {
|
|
999
|
+
setFocusedOption("asc");
|
|
1000
|
+
} else if (focusedOption === "asc") {
|
|
1001
|
+
setFocusedOption("cancel");
|
|
1002
|
+
} else if (focusedOption === "cancel") {
|
|
1003
|
+
setFocusedOption("desc");
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
if (key.return) {
|
|
1007
|
+
if (focusedOption === "cancel") {
|
|
1008
|
+
onCancel();
|
|
1009
|
+
} else {
|
|
1010
|
+
onSelect(focusedOption);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
if (input) {
|
|
1014
|
+
const upperInput = input.toUpperCase();
|
|
1015
|
+
if (upperInput === "A") {
|
|
1016
|
+
onSelect("asc");
|
|
1017
|
+
} else if (upperInput === "D") {
|
|
1018
|
+
onSelect("desc");
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
const getButtonLabel = (direction) => {
|
|
1023
|
+
switch (direction) {
|
|
1024
|
+
case "desc":
|
|
1025
|
+
return "Descending \u2193";
|
|
1026
|
+
case "asc":
|
|
1027
|
+
return "Ascending \u2191";
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
const getButtonDescription = (direction) => {
|
|
1031
|
+
switch (direction) {
|
|
1032
|
+
case "desc":
|
|
1033
|
+
switch (currentSortKey) {
|
|
1034
|
+
case "updated":
|
|
1035
|
+
return "Most recently updated first";
|
|
1036
|
+
case "pushed":
|
|
1037
|
+
return "Most recently pushed first";
|
|
1038
|
+
case "name":
|
|
1039
|
+
return "Z to A";
|
|
1040
|
+
case "stars":
|
|
1041
|
+
return "Most stars first";
|
|
1042
|
+
default:
|
|
1043
|
+
return "Highest to lowest";
|
|
1044
|
+
}
|
|
1045
|
+
case "asc":
|
|
1046
|
+
switch (currentSortKey) {
|
|
1047
|
+
case "updated":
|
|
1048
|
+
return "Oldest updated first";
|
|
1049
|
+
case "pushed":
|
|
1050
|
+
return "Oldest pushed first";
|
|
1051
|
+
case "name":
|
|
1052
|
+
return "A to Z";
|
|
1053
|
+
case "stars":
|
|
1054
|
+
return "Fewest stars first";
|
|
1055
|
+
default:
|
|
1056
|
+
return "Lowest to highest";
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
};
|
|
1060
|
+
const getButtonColor = (direction) => {
|
|
1061
|
+
if (direction === currentDirection) {
|
|
1062
|
+
return "green";
|
|
1063
|
+
}
|
|
1064
|
+
return focusedOption === direction ? "cyan" : "gray";
|
|
1065
|
+
};
|
|
1066
|
+
const formatSortKey = () => {
|
|
1067
|
+
switch (currentSortKey) {
|
|
1068
|
+
case "updated":
|
|
1069
|
+
return "Last Updated";
|
|
1070
|
+
case "pushed":
|
|
1071
|
+
return "Last Pushed";
|
|
1072
|
+
case "name":
|
|
1073
|
+
return "Name";
|
|
1074
|
+
case "stars":
|
|
1075
|
+
return "Stars";
|
|
1076
|
+
}
|
|
1077
|
+
};
|
|
1078
|
+
return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, width: 45, children: [
|
|
1079
|
+
/* @__PURE__ */ jsx10(Text10, { bold: true, children: "Sort Direction" }),
|
|
1080
|
+
/* @__PURE__ */ jsxs9(Text10, { color: "gray", dimColor: true, children: [
|
|
1081
|
+
"Sorting by: ",
|
|
1082
|
+
formatSortKey()
|
|
1083
|
+
] }),
|
|
1084
|
+
/* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", marginTop: 1, children: [
|
|
1085
|
+
options.map((option) => /* @__PURE__ */ jsx10(Box9, { paddingX: 1, marginBottom: 0, children: /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
|
|
1086
|
+
/* @__PURE__ */ jsxs9(Text10, { children: [
|
|
1087
|
+
focusedOption === option ? chalk9.bgCyan.black(" \u2192 ") : " ",
|
|
1088
|
+
focusedOption === option ? chalk9[getButtonColor(option)].bold(getButtonLabel(option)) : chalk9[getButtonColor(option)](getButtonLabel(option)),
|
|
1089
|
+
option === currentDirection && chalk9.green(" \u2713")
|
|
1090
|
+
] }),
|
|
1091
|
+
/* @__PURE__ */ jsxs9(Text10, { color: "gray", dimColor: true, children: [
|
|
1092
|
+
" ",
|
|
1093
|
+
getButtonDescription(option)
|
|
1094
|
+
] })
|
|
1095
|
+
] }) }, option)),
|
|
1096
|
+
/* @__PURE__ */ jsx10(Box9, { paddingX: 1, marginTop: 1, children: /* @__PURE__ */ jsxs9(Text10, { children: [
|
|
1097
|
+
focusedOption === "cancel" ? chalk9.bgWhite.black(" \u2192 ") : " ",
|
|
1098
|
+
focusedOption === "cancel" ? chalk9.white.bold("Cancel") : chalk9.gray("Cancel")
|
|
1099
|
+
] }) })
|
|
1100
|
+
] }),
|
|
1101
|
+
/* @__PURE__ */ jsx10(Box9, { marginTop: 1, children: /* @__PURE__ */ jsx10(Text10, { color: "gray", dimColor: true, children: "\u2191\u2193/Enter \u2022 A/D \u2022 Esc" }) })
|
|
1102
|
+
] });
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
// src/ui/components/modals/ChangeVisibilityModal.tsx
|
|
1106
|
+
import { useState as useState10, useEffect as useEffect7 } from "react";
|
|
1107
|
+
import { Box as Box10, Text as Text11, useInput as useInput10 } from "ink";
|
|
1108
|
+
import TextInput2 from "ink-text-input";
|
|
1109
|
+
import chalk10 from "chalk";
|
|
1110
|
+
import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
966
1111
|
var ChangeVisibilityModal = ({
|
|
967
1112
|
isOpen,
|
|
968
1113
|
repoName,
|
|
@@ -985,17 +1130,17 @@ var ChangeVisibilityModal = ({
|
|
|
985
1130
|
return ["PUBLIC"];
|
|
986
1131
|
};
|
|
987
1132
|
const availableOptions = getAvailableOptions();
|
|
988
|
-
const [selectedOptionIndex, setSelectedOptionIndex] =
|
|
989
|
-
const [focusedButton, setFocusedButton] =
|
|
1133
|
+
const [selectedOptionIndex, setSelectedOptionIndex] = useState10(0);
|
|
1134
|
+
const [focusedButton, setFocusedButton] = useState10(isFork ? "cancel" : "option");
|
|
990
1135
|
const changing = externalChanging ?? false;
|
|
991
1136
|
const error = externalError ?? null;
|
|
992
|
-
|
|
1137
|
+
useEffect7(() => {
|
|
993
1138
|
if (isOpen) {
|
|
994
1139
|
setSelectedOptionIndex(0);
|
|
995
1140
|
setFocusedButton(isFork ? "cancel" : "option");
|
|
996
1141
|
}
|
|
997
1142
|
}, [isOpen, isFork]);
|
|
998
|
-
|
|
1143
|
+
useInput10((input, key) => {
|
|
999
1144
|
if (!isOpen) return;
|
|
1000
1145
|
if (key.escape || input?.toLowerCase() === "c") {
|
|
1001
1146
|
onClose();
|
|
@@ -1067,8 +1212,8 @@ var ChangeVisibilityModal = ({
|
|
|
1067
1212
|
}
|
|
1068
1213
|
};
|
|
1069
1214
|
const borderColor = isFork ? "red" : getVisibilityColor(currentVisibility);
|
|
1070
|
-
return /* @__PURE__ */
|
|
1071
|
-
|
|
1215
|
+
return /* @__PURE__ */ jsxs10(
|
|
1216
|
+
Box10,
|
|
1072
1217
|
{
|
|
1073
1218
|
flexDirection: "column",
|
|
1074
1219
|
borderStyle: "round",
|
|
@@ -1077,14 +1222,14 @@ var ChangeVisibilityModal = ({
|
|
|
1077
1222
|
paddingY: 2,
|
|
1078
1223
|
width: 80,
|
|
1079
1224
|
children: [
|
|
1080
|
-
/* @__PURE__ */
|
|
1081
|
-
isFork ? /* @__PURE__ */
|
|
1082
|
-
/* @__PURE__ */
|
|
1083
|
-
/* @__PURE__ */
|
|
1084
|
-
/* @__PURE__ */
|
|
1085
|
-
/* @__PURE__ */
|
|
1086
|
-
/* @__PURE__ */
|
|
1087
|
-
|
|
1225
|
+
/* @__PURE__ */ jsx11(Text11, { bold: true, children: isFork ? "Visibility Change Not Available" : "Change Repository Visibility" }),
|
|
1226
|
+
isFork ? /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
1227
|
+
/* @__PURE__ */ jsx11(Text11, { color: "red", children: "\u26A0\uFE0F Cannot change visibility of forked repositories" }),
|
|
1228
|
+
/* @__PURE__ */ jsx11(Box10, { height: 1, children: /* @__PURE__ */ jsx11(Text11, { children: " " }) }),
|
|
1229
|
+
/* @__PURE__ */ jsx11(Text11, { children: repoName }),
|
|
1230
|
+
/* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx11(Text11, { children: "GitHub does not allow changing the visibility of forked repositories. The fork must have the same visibility as its parent repository." }) }),
|
|
1231
|
+
/* @__PURE__ */ jsx11(Box10, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsx11(
|
|
1232
|
+
Box10,
|
|
1088
1233
|
{
|
|
1089
1234
|
borderStyle: "round",
|
|
1090
1235
|
borderColor: "white",
|
|
@@ -1093,23 +1238,23 @@ var ChangeVisibilityModal = ({
|
|
|
1093
1238
|
alignItems: "center",
|
|
1094
1239
|
justifyContent: "center",
|
|
1095
1240
|
flexDirection: "column",
|
|
1096
|
-
children: /* @__PURE__ */
|
|
1241
|
+
children: /* @__PURE__ */ jsx11(Text11, { children: chalk10.bgGray.white.bold(" Cancel ") })
|
|
1097
1242
|
}
|
|
1098
1243
|
) }),
|
|
1099
|
-
/* @__PURE__ */
|
|
1100
|
-
] }) : /* @__PURE__ */
|
|
1101
|
-
/* @__PURE__ */
|
|
1102
|
-
/* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
1244
|
+
/* @__PURE__ */ jsx11(Box10, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsx11(Text11, { color: "gray", children: "Press Enter to Cancel \u2022 C to cancel" }) })
|
|
1245
|
+
] }) : /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
1246
|
+
/* @__PURE__ */ jsx11(Text11, { color: borderColor, children: "\u26A0\uFE0F Change repository visibility?" }),
|
|
1247
|
+
/* @__PURE__ */ jsx11(Box10, { height: 1, children: /* @__PURE__ */ jsx11(Text11, { children: " " }) }),
|
|
1248
|
+
/* @__PURE__ */ jsx11(Text11, { children: repoName }),
|
|
1249
|
+
/* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsxs10(Text11, { children: [
|
|
1105
1250
|
"Current visibility:",
|
|
1106
1251
|
" ",
|
|
1107
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ jsx11(Text11, { color: getVisibilityColor(currentVisibility), children: getVisibilityLabel(currentVisibility) })
|
|
1108
1253
|
] }) }),
|
|
1109
|
-
/* @__PURE__ */
|
|
1110
|
-
/* @__PURE__ */
|
|
1111
|
-
availableOptions.map((option, index) => /* @__PURE__ */
|
|
1112
|
-
|
|
1254
|
+
/* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx11(Text11, { children: "Change to:" }) }),
|
|
1255
|
+
/* @__PURE__ */ jsxs10(Box10, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 3, children: [
|
|
1256
|
+
availableOptions.map((option, index) => /* @__PURE__ */ jsx11(
|
|
1257
|
+
Box10,
|
|
1113
1258
|
{
|
|
1114
1259
|
borderStyle: "round",
|
|
1115
1260
|
borderColor: focusedButton === "option" && selectedOptionIndex === index ? getVisibilityColor(option) : "gray",
|
|
@@ -1118,12 +1263,12 @@ var ChangeVisibilityModal = ({
|
|
|
1118
1263
|
alignItems: "center",
|
|
1119
1264
|
justifyContent: "center",
|
|
1120
1265
|
flexDirection: "column",
|
|
1121
|
-
children: /* @__PURE__ */
|
|
1266
|
+
children: /* @__PURE__ */ jsx11(Text11, { children: focusedButton === "option" && selectedOptionIndex === index ? chalk10[`bg${getVisibilityLabel(option) === "Public" ? "Green" : getVisibilityLabel(option) === "Private" ? "Yellow" : "Cyan"}`].black.bold(` ${getVisibilityLabel(option)} `) : chalk10[getVisibilityColor(option)](getVisibilityLabel(option)) })
|
|
1122
1267
|
},
|
|
1123
1268
|
option
|
|
1124
1269
|
)),
|
|
1125
|
-
/* @__PURE__ */
|
|
1126
|
-
|
|
1270
|
+
/* @__PURE__ */ jsx11(
|
|
1271
|
+
Box10,
|
|
1127
1272
|
{
|
|
1128
1273
|
borderStyle: "round",
|
|
1129
1274
|
borderColor: focusedButton === "cancel" ? "white" : "gray",
|
|
@@ -1132,18 +1277,18 @@ var ChangeVisibilityModal = ({
|
|
|
1132
1277
|
alignItems: "center",
|
|
1133
1278
|
justifyContent: "center",
|
|
1134
1279
|
flexDirection: "column",
|
|
1135
|
-
children: /* @__PURE__ */
|
|
1280
|
+
children: /* @__PURE__ */ jsx11(Text11, { children: focusedButton === "cancel" ? chalk10.bgGray.white.bold(" Cancel ") : chalk10.gray.bold("Cancel") })
|
|
1136
1281
|
}
|
|
1137
1282
|
)
|
|
1138
1283
|
] }),
|
|
1139
|
-
/* @__PURE__ */
|
|
1284
|
+
/* @__PURE__ */ jsx11(Box10, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs10(Text11, { color: "gray", children: [
|
|
1140
1285
|
availableOptions.length > 1 ? "\u2191\u2193 Select Option \u2022 " : "",
|
|
1141
1286
|
"\u2190 \u2192 Navigate \u2022 Press Enter to ",
|
|
1142
1287
|
focusedButton === "option" ? "Change" : "Cancel",
|
|
1143
1288
|
" \u2022 Y to confirm \u2022 C to cancel"
|
|
1144
1289
|
] }) })
|
|
1145
1290
|
] }),
|
|
1146
|
-
/* @__PURE__ */
|
|
1291
|
+
/* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx11(
|
|
1147
1292
|
TextInput2,
|
|
1148
1293
|
{
|
|
1149
1294
|
value: "",
|
|
@@ -1158,23 +1303,23 @@ var ChangeVisibilityModal = ({
|
|
|
1158
1303
|
}
|
|
1159
1304
|
}
|
|
1160
1305
|
) }),
|
|
1161
|
-
error && /* @__PURE__ */
|
|
1162
|
-
changing && /* @__PURE__ */
|
|
1306
|
+
error && /* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx11(Text11, { color: "magenta", children: error }) }),
|
|
1307
|
+
changing && /* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx11(Text11, { color: "yellow", children: "Changing visibility..." }) })
|
|
1163
1308
|
]
|
|
1164
1309
|
}
|
|
1165
1310
|
);
|
|
1166
1311
|
};
|
|
1167
1312
|
|
|
1168
1313
|
// src/ui/components/modals/CopyUrlModal.tsx
|
|
1169
|
-
import { useState as
|
|
1170
|
-
import { Box as
|
|
1171
|
-
import
|
|
1172
|
-
import { Fragment as Fragment5, jsx as
|
|
1314
|
+
import { useState as useState11 } from "react";
|
|
1315
|
+
import { Box as Box11, Text as Text12, useInput as useInput11 } from "ink";
|
|
1316
|
+
import chalk11 from "chalk";
|
|
1317
|
+
import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1173
1318
|
function CopyUrlModal({ repo, terminalWidth, onClose, onCopy }) {
|
|
1174
|
-
const [copyError, setCopyError] =
|
|
1175
|
-
const [selectedType, setSelectedType] =
|
|
1319
|
+
const [copyError, setCopyError] = useState11(null);
|
|
1320
|
+
const [selectedType, setSelectedType] = useState11("SSH");
|
|
1176
1321
|
const urlTypes = ["SSH", "HTTPS"];
|
|
1177
|
-
|
|
1322
|
+
useInput11((input, key) => {
|
|
1178
1323
|
if (!repo) return;
|
|
1179
1324
|
const ch = input?.toLowerCase();
|
|
1180
1325
|
if (key.escape || ch === "c" || ch === "q") {
|
|
@@ -1219,7 +1364,7 @@ function CopyUrlModal({ repo, terminalWidth, onClose, onCopy }) {
|
|
|
1219
1364
|
}
|
|
1220
1365
|
});
|
|
1221
1366
|
if (!repo) {
|
|
1222
|
-
return /* @__PURE__ */
|
|
1367
|
+
return /* @__PURE__ */ jsx12(Text12, { color: "red", children: "No repository selected." });
|
|
1223
1368
|
}
|
|
1224
1369
|
const sshUrl = `git@github.com:${repo.nameWithOwner}.git`;
|
|
1225
1370
|
const httpsUrl = `https://github.com/${repo.nameWithOwner}.git`;
|
|
@@ -1233,8 +1378,8 @@ function CopyUrlModal({ repo, terminalWidth, onClose, onCopy }) {
|
|
|
1233
1378
|
setCopyError(`Failed to copy ${type} URL: ${message}`);
|
|
1234
1379
|
}
|
|
1235
1380
|
};
|
|
1236
|
-
return /* @__PURE__ */
|
|
1237
|
-
|
|
1381
|
+
return /* @__PURE__ */ jsxs11(
|
|
1382
|
+
Box11,
|
|
1238
1383
|
{
|
|
1239
1384
|
flexDirection: "column",
|
|
1240
1385
|
borderStyle: "round",
|
|
@@ -1243,48 +1388,48 @@ function CopyUrlModal({ repo, terminalWidth, onClose, onCopy }) {
|
|
|
1243
1388
|
paddingY: 2,
|
|
1244
1389
|
width: Math.min(terminalWidth - 8, 80),
|
|
1245
1390
|
children: [
|
|
1246
|
-
/* @__PURE__ */
|
|
1247
|
-
/* @__PURE__ */
|
|
1248
|
-
/* @__PURE__ */
|
|
1249
|
-
/* @__PURE__ */
|
|
1250
|
-
/* @__PURE__ */
|
|
1251
|
-
/* @__PURE__ */
|
|
1252
|
-
|
|
1391
|
+
/* @__PURE__ */ jsx12(Text12, { bold: true, color: "blue", children: "Copy Repository URL" }),
|
|
1392
|
+
/* @__PURE__ */ jsx12(Box11, { height: 1, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) }),
|
|
1393
|
+
/* @__PURE__ */ jsx12(Text12, { children: chalk11.bold(repo.nameWithOwner) }),
|
|
1394
|
+
/* @__PURE__ */ jsx12(Box11, { height: 1, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) }),
|
|
1395
|
+
/* @__PURE__ */ jsx12(Text12, { color: "gray", children: "SSH URL:" }),
|
|
1396
|
+
/* @__PURE__ */ jsx12(
|
|
1397
|
+
Box11,
|
|
1253
1398
|
{
|
|
1254
1399
|
paddingX: 2,
|
|
1255
1400
|
paddingY: 1,
|
|
1256
1401
|
borderStyle: "single",
|
|
1257
1402
|
borderColor: selectedType === "SSH" ? "blue" : "gray",
|
|
1258
|
-
children: /* @__PURE__ */
|
|
1403
|
+
children: /* @__PURE__ */ jsxs11(Text12, { color: selectedType === "SSH" ? "blue" : void 0, children: [
|
|
1259
1404
|
selectedType === "SSH" ? "\u25B6 " : " ",
|
|
1260
1405
|
sshUrl
|
|
1261
1406
|
] })
|
|
1262
1407
|
}
|
|
1263
1408
|
),
|
|
1264
|
-
/* @__PURE__ */
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
/* @__PURE__ */
|
|
1267
|
-
|
|
1409
|
+
/* @__PURE__ */ jsx12(Box11, { height: 1, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) }),
|
|
1410
|
+
/* @__PURE__ */ jsx12(Text12, { color: "gray", children: "HTTPS URL:" }),
|
|
1411
|
+
/* @__PURE__ */ jsx12(
|
|
1412
|
+
Box11,
|
|
1268
1413
|
{
|
|
1269
1414
|
paddingX: 2,
|
|
1270
1415
|
paddingY: 1,
|
|
1271
1416
|
borderStyle: "single",
|
|
1272
1417
|
borderColor: selectedType === "HTTPS" ? "blue" : "gray",
|
|
1273
|
-
children: /* @__PURE__ */
|
|
1418
|
+
children: /* @__PURE__ */ jsxs11(Text12, { color: selectedType === "HTTPS" ? "blue" : void 0, children: [
|
|
1274
1419
|
selectedType === "HTTPS" ? "\u25B6 " : " ",
|
|
1275
1420
|
httpsUrl
|
|
1276
1421
|
] })
|
|
1277
1422
|
}
|
|
1278
1423
|
),
|
|
1279
|
-
/* @__PURE__ */
|
|
1280
|
-
/* @__PURE__ */
|
|
1424
|
+
/* @__PURE__ */ jsx12(Box11, { height: 1, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) }),
|
|
1425
|
+
/* @__PURE__ */ jsxs11(Text12, { color: "gray", children: [
|
|
1281
1426
|
"\u2191\u2193 Select \u2022 Enter/Y to copy ",
|
|
1282
1427
|
selectedType,
|
|
1283
1428
|
" \u2022 S copy SSH \u2022 H copy HTTPS \u2022 Esc/Q/C to close"
|
|
1284
1429
|
] }),
|
|
1285
|
-
copyError && /* @__PURE__ */
|
|
1286
|
-
/* @__PURE__ */
|
|
1287
|
-
/* @__PURE__ */
|
|
1430
|
+
copyError && /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
1431
|
+
/* @__PURE__ */ jsx12(Box11, { height: 1, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) }),
|
|
1432
|
+
/* @__PURE__ */ jsx12(Text12, { color: "red", children: copyError })
|
|
1288
1433
|
] })
|
|
1289
1434
|
]
|
|
1290
1435
|
}
|
|
@@ -1292,21 +1437,21 @@ function CopyUrlModal({ repo, terminalWidth, onClose, onCopy }) {
|
|
|
1292
1437
|
}
|
|
1293
1438
|
|
|
1294
1439
|
// src/ui/components/modals/RenameModal.tsx
|
|
1295
|
-
import { useState as
|
|
1296
|
-
import { Box as
|
|
1440
|
+
import { useState as useState12, useEffect as useEffect8 } from "react";
|
|
1441
|
+
import { Box as Box12, Text as Text13, useInput as useInput12 } from "ink";
|
|
1297
1442
|
import TextInput3 from "ink-text-input";
|
|
1298
|
-
import { Fragment as Fragment6, jsx as
|
|
1443
|
+
import { Fragment as Fragment6, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1299
1444
|
function RenameModal({ repo, onRename, onCancel }) {
|
|
1300
|
-
const [newName, setNewName] =
|
|
1301
|
-
const [renaming, setRenaming] =
|
|
1302
|
-
const [renameError, setRenameError] =
|
|
1303
|
-
|
|
1445
|
+
const [newName, setNewName] = useState12("");
|
|
1446
|
+
const [renaming, setRenaming] = useState12(false);
|
|
1447
|
+
const [renameError, setRenameError] = useState12(null);
|
|
1448
|
+
useEffect8(() => {
|
|
1304
1449
|
if (repo) {
|
|
1305
1450
|
setNewName(repo.name);
|
|
1306
1451
|
setRenameError(null);
|
|
1307
1452
|
}
|
|
1308
1453
|
}, [repo]);
|
|
1309
|
-
|
|
1454
|
+
useInput12((input, key) => {
|
|
1310
1455
|
if (renaming) return;
|
|
1311
1456
|
if (key.escape) {
|
|
1312
1457
|
onCancel();
|
|
@@ -1337,8 +1482,8 @@ function RenameModal({ repo, onRename, onCancel }) {
|
|
|
1337
1482
|
if (!repo) return null;
|
|
1338
1483
|
const owner = repo.nameWithOwner.split("/")[0];
|
|
1339
1484
|
const isDisabled = !newName.trim() || newName === repo.name;
|
|
1340
|
-
return /* @__PURE__ */
|
|
1341
|
-
|
|
1485
|
+
return /* @__PURE__ */ jsxs12(
|
|
1486
|
+
Box12,
|
|
1342
1487
|
{
|
|
1343
1488
|
flexDirection: "column",
|
|
1344
1489
|
borderStyle: "round",
|
|
@@ -1347,20 +1492,20 @@ function RenameModal({ repo, onRename, onCancel }) {
|
|
|
1347
1492
|
paddingY: 2,
|
|
1348
1493
|
width: 80,
|
|
1349
1494
|
children: [
|
|
1350
|
-
/* @__PURE__ */
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
-
/* @__PURE__ */
|
|
1495
|
+
/* @__PURE__ */ jsx13(Text13, { bold: true, color: "cyan", children: "Rename Repository" }),
|
|
1496
|
+
/* @__PURE__ */ jsx13(Box12, { height: 1, children: /* @__PURE__ */ jsx13(Text13, { children: " " }) }),
|
|
1497
|
+
/* @__PURE__ */ jsxs12(Text13, { color: "gray", children: [
|
|
1353
1498
|
"Current: ",
|
|
1354
1499
|
repo.nameWithOwner
|
|
1355
1500
|
] }),
|
|
1356
|
-
/* @__PURE__ */
|
|
1357
|
-
/* @__PURE__ */
|
|
1358
|
-
/* @__PURE__ */
|
|
1359
|
-
/* @__PURE__ */
|
|
1501
|
+
/* @__PURE__ */ jsx13(Box12, { height: 1, children: /* @__PURE__ */ jsx13(Text13, { children: " " }) }),
|
|
1502
|
+
/* @__PURE__ */ jsx13(Text13, { children: "New name:" }),
|
|
1503
|
+
/* @__PURE__ */ jsxs12(Box12, { flexDirection: "row", alignItems: "center", children: [
|
|
1504
|
+
/* @__PURE__ */ jsxs12(Text13, { children: [
|
|
1360
1505
|
owner,
|
|
1361
1506
|
"/"
|
|
1362
1507
|
] }),
|
|
1363
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ jsx13(
|
|
1364
1509
|
TextInput3,
|
|
1365
1510
|
{
|
|
1366
1511
|
value: newName,
|
|
@@ -1370,23 +1515,23 @@ function RenameModal({ repo, onRename, onCancel }) {
|
|
|
1370
1515
|
}
|
|
1371
1516
|
)
|
|
1372
1517
|
] }),
|
|
1373
|
-
renaming ? /* @__PURE__ */
|
|
1374
|
-
/* @__PURE__ */
|
|
1375
|
-
/* @__PURE__ */
|
|
1376
|
-
] }) }) : /* @__PURE__ */
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
/* @__PURE__ */
|
|
1518
|
+
renaming ? /* @__PURE__ */ jsx13(Box12, { marginTop: 2, justifyContent: "center", children: /* @__PURE__ */ jsxs12(Box12, { flexDirection: "row", children: [
|
|
1519
|
+
/* @__PURE__ */ jsx13(Box12, { marginRight: 1, children: /* @__PURE__ */ jsx13(SlowSpinner, {}) }),
|
|
1520
|
+
/* @__PURE__ */ jsx13(Text13, { color: "cyan", children: "Renaming repository..." })
|
|
1521
|
+
] }) }) : /* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
1522
|
+
/* @__PURE__ */ jsx13(Box12, { marginTop: 2, children: /* @__PURE__ */ jsx13(Text13, { color: "gray", children: isDisabled ? "Enter a different name to rename" : `Press Enter to rename to "${newName}"` }) }),
|
|
1523
|
+
/* @__PURE__ */ jsx13(Box12, { marginTop: 1, children: /* @__PURE__ */ jsx13(Text13, { color: "gray", children: "Press Esc to cancel" }) })
|
|
1379
1524
|
] }),
|
|
1380
|
-
renameError && /* @__PURE__ */
|
|
1525
|
+
renameError && /* @__PURE__ */ jsx13(Box12, { marginTop: 1, children: /* @__PURE__ */ jsx13(Text13, { color: "red", children: renameError }) })
|
|
1381
1526
|
]
|
|
1382
1527
|
}
|
|
1383
1528
|
);
|
|
1384
1529
|
}
|
|
1385
1530
|
|
|
1386
1531
|
// src/ui/components/repo/RepoRow.tsx
|
|
1387
|
-
import { Box as
|
|
1388
|
-
import
|
|
1389
|
-
import { jsx as
|
|
1532
|
+
import { Box as Box13, Text as Text14 } from "ink";
|
|
1533
|
+
import chalk12 from "chalk";
|
|
1534
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1390
1535
|
function RepoRow({
|
|
1391
1536
|
repo,
|
|
1392
1537
|
selected,
|
|
@@ -1402,50 +1547,50 @@ function RepoRow({
|
|
|
1402
1547
|
const commitsBehind = hasCommitData ? repo.parent.defaultBranchRef.target.history.totalCount - repo.defaultBranchRef.target.history.totalCount : 0;
|
|
1403
1548
|
const showCommitsBehind = forkTracking && hasCommitData;
|
|
1404
1549
|
let line1 = "";
|
|
1405
|
-
const numColor = selected ?
|
|
1406
|
-
const nameColor = selected ?
|
|
1550
|
+
const numColor = selected ? chalk12.cyan : chalk12.gray;
|
|
1551
|
+
const nameColor = selected ? chalk12.cyan.bold : chalk12.white;
|
|
1407
1552
|
line1 += numColor(`${String(index).padStart(3, " ")}.`);
|
|
1408
1553
|
line1 += nameColor(` ${repo.nameWithOwner}`);
|
|
1409
1554
|
if (repo.visibility === "INTERNAL") {
|
|
1410
|
-
line1 +=
|
|
1555
|
+
line1 += chalk12.magenta(" Internal");
|
|
1411
1556
|
} else if (repo.visibility === "PRIVATE" || repo.isPrivate && !repo.visibility) {
|
|
1412
|
-
line1 +=
|
|
1557
|
+
line1 += chalk12.yellow(" Private");
|
|
1413
1558
|
}
|
|
1414
|
-
if (repo.isArchived) line1 += " " +
|
|
1559
|
+
if (repo.isArchived) line1 += " " + chalk12.bgGray.whiteBright(" Archived ") + " ";
|
|
1415
1560
|
if (repo.isFork && repo.parent) {
|
|
1416
|
-
line1 +=
|
|
1561
|
+
line1 += chalk12.blue(` Fork of ${repo.parent.nameWithOwner}`);
|
|
1417
1562
|
if (showCommitsBehind) {
|
|
1418
1563
|
if (commitsBehind > 0) {
|
|
1419
|
-
line1 +=
|
|
1564
|
+
line1 += chalk12.yellow(` (${commitsBehind} behind)`);
|
|
1420
1565
|
} else {
|
|
1421
|
-
line1 +=
|
|
1566
|
+
line1 += chalk12.green(` (0 behind)`);
|
|
1422
1567
|
}
|
|
1423
1568
|
}
|
|
1424
1569
|
}
|
|
1425
1570
|
let line2 = " ";
|
|
1426
|
-
const metaColor = selected ?
|
|
1427
|
-
if (langName) line2 +=
|
|
1571
|
+
const metaColor = selected ? chalk12.white : chalk12.gray;
|
|
1572
|
+
if (langName) line2 += chalk12.hex(langColor)("\u25CF ") + metaColor(`${langName} `);
|
|
1428
1573
|
line2 += metaColor(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount} Updated ${formatDate(repo.updatedAt)}`);
|
|
1429
1574
|
const line3 = repo.description ? ` ${truncate(repo.description, Math.max(30, maxWidth - 10))}` : null;
|
|
1430
1575
|
let fullText = line1 + "\n" + line2;
|
|
1431
1576
|
if (line3) fullText += "\n" + metaColor(line3);
|
|
1432
1577
|
const spacingAbove = Math.floor(spacingLines / 2);
|
|
1433
1578
|
const spacingBelow = spacingLines - spacingAbove;
|
|
1434
|
-
return /* @__PURE__ */
|
|
1435
|
-
spacingAbove > 0 && /* @__PURE__ */
|
|
1436
|
-
/* @__PURE__ */
|
|
1437
|
-
spacingBelow > 0 && /* @__PURE__ */
|
|
1579
|
+
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", backgroundColor: selected ? "gray" : void 0, children: [
|
|
1580
|
+
spacingAbove > 0 && /* @__PURE__ */ jsx14(Box13, { height: spacingAbove, children: /* @__PURE__ */ jsx14(Text14, { children: " " }) }),
|
|
1581
|
+
/* @__PURE__ */ jsx14(Text14, { children: dim ? chalk12.dim(fullText) : fullText }),
|
|
1582
|
+
spacingBelow > 0 && /* @__PURE__ */ jsx14(Box13, { height: spacingBelow, children: /* @__PURE__ */ jsx14(Text14, { children: " " }) })
|
|
1438
1583
|
] });
|
|
1439
1584
|
}
|
|
1440
1585
|
|
|
1441
1586
|
// src/ui/components/repo/FilterInput.tsx
|
|
1442
|
-
import { Box as
|
|
1587
|
+
import { Box as Box14, Text as Text15 } from "ink";
|
|
1443
1588
|
import TextInput4 from "ink-text-input";
|
|
1444
|
-
import { jsx as
|
|
1589
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1445
1590
|
|
|
1446
1591
|
// src/ui/components/repo/RepoListHeader.tsx
|
|
1447
|
-
import { Box as
|
|
1448
|
-
import { Fragment as Fragment7, jsx as
|
|
1592
|
+
import { Box as Box15, Text as Text16 } from "ink";
|
|
1593
|
+
import { Fragment as Fragment7, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1449
1594
|
function RepoListHeader({
|
|
1450
1595
|
ownerContext,
|
|
1451
1596
|
sortKey,
|
|
@@ -1459,35 +1604,35 @@ function RepoListHeader({
|
|
|
1459
1604
|
}) {
|
|
1460
1605
|
const contextLabel = ownerContext === "personal" ? "Personal Account" : ownerContext?.type === "organization" ? `Organization: ${ownerContext.name ?? ownerContext.login}` : "";
|
|
1461
1606
|
const visibilityLabel = visibilityFilter === "public" ? "Public" : visibilityFilter === "private" ? isEnterprise ? "Private/Internal" : "Private" : visibilityFilter === "internal" ? "Internal" : "";
|
|
1462
|
-
return /* @__PURE__ */
|
|
1463
|
-
contextLabel && /* @__PURE__ */
|
|
1464
|
-
/* @__PURE__ */
|
|
1607
|
+
return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "row", gap: 2, marginBottom: 1, children: [
|
|
1608
|
+
contextLabel && /* @__PURE__ */ jsx16(Text16, { children: contextLabel }),
|
|
1609
|
+
/* @__PURE__ */ jsxs15(Text16, { color: "gray", dimColor: true, children: [
|
|
1465
1610
|
"Sort: ",
|
|
1466
1611
|
sortKey,
|
|
1467
1612
|
" ",
|
|
1468
1613
|
sortDir === "asc" ? "\u2191" : "\u2193"
|
|
1469
1614
|
] }),
|
|
1470
|
-
/* @__PURE__ */
|
|
1615
|
+
/* @__PURE__ */ jsxs15(Text16, { color: "gray", dimColor: true, children: [
|
|
1471
1616
|
"Fork Status - Commits Behind: ",
|
|
1472
1617
|
forkTracking ? "ON" : "OFF"
|
|
1473
1618
|
] }),
|
|
1474
|
-
!!visibilityLabel && /* @__PURE__ */
|
|
1619
|
+
!!visibilityLabel && /* @__PURE__ */ jsxs15(Text16, { color: "yellow", children: [
|
|
1475
1620
|
"Visibility: ",
|
|
1476
1621
|
visibilityLabel
|
|
1477
1622
|
] }),
|
|
1478
|
-
filter && !searchActive && /* @__PURE__ */
|
|
1623
|
+
filter && !searchActive && /* @__PURE__ */ jsxs15(Text16, { color: "cyan", children: [
|
|
1479
1624
|
'Filter: "',
|
|
1480
1625
|
filter,
|
|
1481
1626
|
'"'
|
|
1482
1627
|
] }),
|
|
1483
|
-
searchActive && /* @__PURE__ */
|
|
1484
|
-
/* @__PURE__ */
|
|
1628
|
+
searchActive && /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
1629
|
+
/* @__PURE__ */ jsxs15(Text16, { color: "cyan", children: [
|
|
1485
1630
|
'Search: "',
|
|
1486
1631
|
filter.trim(),
|
|
1487
1632
|
'"'
|
|
1488
1633
|
] }),
|
|
1489
|
-
searchLoading && /* @__PURE__ */
|
|
1490
|
-
/* @__PURE__ */
|
|
1634
|
+
searchLoading && /* @__PURE__ */ jsx16(Box15, { marginLeft: 1, children: /* @__PURE__ */ jsxs15(Text16, { color: "cyan", children: [
|
|
1635
|
+
/* @__PURE__ */ jsx16(SlowSpinner, {}),
|
|
1491
1636
|
" Searching\u2026"
|
|
1492
1637
|
] }) })
|
|
1493
1638
|
] })
|
|
@@ -1495,7 +1640,7 @@ function RepoListHeader({
|
|
|
1495
1640
|
}
|
|
1496
1641
|
|
|
1497
1642
|
// src/ui/views/RepoList.tsx
|
|
1498
|
-
import { Fragment as Fragment8, jsx as
|
|
1643
|
+
import { Fragment as Fragment8, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1499
1644
|
var getPageSize = () => {
|
|
1500
1645
|
const envValue = process.env.REPOS_PER_FETCH;
|
|
1501
1646
|
if (envValue) {
|
|
@@ -1511,17 +1656,17 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1511
1656
|
const { exit } = useApp();
|
|
1512
1657
|
const { stdout } = useStdout();
|
|
1513
1658
|
const client = useMemo(() => makeClient(token), [token]);
|
|
1514
|
-
const [debugMessages, setDebugMessages] =
|
|
1659
|
+
const [debugMessages, setDebugMessages] = useState13([]);
|
|
1515
1660
|
const addDebugMessage = useCallback((msg) => {
|
|
1516
1661
|
if (process.env.GH_MANAGER_DEBUG === "1") {
|
|
1517
1662
|
setDebugMessages((prev) => [...prev.slice(-9), msg]);
|
|
1518
1663
|
}
|
|
1519
1664
|
}, []);
|
|
1520
1665
|
const handleOrgContextChangeRef = useRef(onOrgContextChange);
|
|
1521
|
-
|
|
1666
|
+
useEffect9(() => {
|
|
1522
1667
|
handleOrgContextChangeRef.current = onOrgContextChange;
|
|
1523
1668
|
}, [onOrgContextChange]);
|
|
1524
|
-
|
|
1669
|
+
React13.useEffect(() => {
|
|
1525
1670
|
addDebugMessage(`[RepoList] Component mounted`);
|
|
1526
1671
|
logger.info("RepoList component mounted", {
|
|
1527
1672
|
token: token ? "present" : "missing",
|
|
@@ -1533,69 +1678,70 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1533
1678
|
}, []);
|
|
1534
1679
|
const terminalWidth = stdout?.columns ?? 80;
|
|
1535
1680
|
const availableHeight = maxVisibleRows ?? 20;
|
|
1536
|
-
const [items, setItems] =
|
|
1537
|
-
const [cursor, setCursor] =
|
|
1538
|
-
const [endCursor, setEndCursor] =
|
|
1539
|
-
const [hasNextPage, setHasNextPage] =
|
|
1540
|
-
const [totalCount, setTotalCount] =
|
|
1541
|
-
const [loading, setLoading] =
|
|
1542
|
-
const [sortingLoading, setSortingLoading] =
|
|
1543
|
-
const [refreshing, setRefreshing] =
|
|
1544
|
-
const [loadingMore, setLoadingMore] =
|
|
1545
|
-
const [error, setError] =
|
|
1546
|
-
const [rateLimit, setRateLimit] =
|
|
1547
|
-
const [prevRateLimit, setPrevRateLimit] =
|
|
1548
|
-
const [restRateLimit, setRestRateLimit] =
|
|
1549
|
-
const [prevRestRateLimit, setPrevRestRateLimit] =
|
|
1550
|
-
const [density, setDensity] =
|
|
1551
|
-
const [prefsLoaded, setPrefsLoaded] =
|
|
1552
|
-
const [ownerContext, setOwnerContext] =
|
|
1553
|
-
const [ownerAffiliations, setOwnerAffiliations] =
|
|
1554
|
-
const [orgSwitcherOpen, setOrgSwitcherOpen] =
|
|
1555
|
-
const [searchItems, setSearchItems] =
|
|
1556
|
-
const [searchEndCursor, setSearchEndCursor] =
|
|
1557
|
-
const [searchHasNextPage, setSearchHasNextPage] =
|
|
1558
|
-
const [searchTotalCount, setSearchTotalCount] =
|
|
1559
|
-
const [searchLoading, setSearchLoading] =
|
|
1560
|
-
const [deleteMode, setDeleteMode] =
|
|
1561
|
-
const [deleteTarget, setDeleteTarget] =
|
|
1562
|
-
const [deleteCode, setDeleteCode] =
|
|
1563
|
-
const [typedCode, setTypedCode] =
|
|
1564
|
-
const [deleting, setDeleting] =
|
|
1565
|
-
const [deleteError, setDeleteError] =
|
|
1566
|
-
const [deleteConfirmStage, setDeleteConfirmStage] =
|
|
1567
|
-
const [confirmFocus, setConfirmFocus] =
|
|
1568
|
-
const [archiveMode, setArchiveMode] =
|
|
1569
|
-
const [archiveTarget, setArchiveTarget] =
|
|
1570
|
-
const [archiving, setArchiving] =
|
|
1571
|
-
const [archiveError, setArchiveError] =
|
|
1572
|
-
const [archiveFocus, setArchiveFocus] =
|
|
1573
|
-
const [syncMode, setSyncMode] =
|
|
1574
|
-
const [syncTarget, setSyncTarget] =
|
|
1575
|
-
const [syncing, setSyncing] =
|
|
1576
|
-
const [syncError, setSyncError] =
|
|
1577
|
-
const [syncFocus, setSyncFocus] =
|
|
1578
|
-
const [renameMode, setRenameMode] =
|
|
1579
|
-
const [renameTarget, setRenameTarget] =
|
|
1580
|
-
const [copyUrlMode, setCopyUrlMode] =
|
|
1581
|
-
const [copyUrlTarget, setCopyUrlTarget] =
|
|
1582
|
-
const [copyToast, setCopyToast] =
|
|
1583
|
-
const [syncTrigger, setSyncTrigger] =
|
|
1584
|
-
const [infoMode, setInfoMode] =
|
|
1585
|
-
const [infoRepo, setInfoRepo] =
|
|
1586
|
-
const [logoutMode, setLogoutMode] =
|
|
1587
|
-
const [logoutFocus, setLogoutFocus] =
|
|
1588
|
-
const [logoutError, setLogoutError] =
|
|
1589
|
-
const [visibilityMode, setVisibilityMode] =
|
|
1590
|
-
const [isEnterpriseOrg, setIsEnterpriseOrg] =
|
|
1591
|
-
const [hasInternalRepos, setHasInternalRepos] =
|
|
1592
|
-
const [changeVisibilityMode, setChangeVisibilityMode] =
|
|
1593
|
-
const [changeVisibilityTarget, setChangeVisibilityTarget] =
|
|
1594
|
-
const [changingVisibility, setChangingVisibility] =
|
|
1595
|
-
const [changeVisibilityError, setChangeVisibilityError] =
|
|
1596
|
-
const [sortMode, setSortMode] =
|
|
1681
|
+
const [items, setItems] = useState13([]);
|
|
1682
|
+
const [cursor, setCursor] = useState13(0);
|
|
1683
|
+
const [endCursor, setEndCursor] = useState13(null);
|
|
1684
|
+
const [hasNextPage, setHasNextPage] = useState13(false);
|
|
1685
|
+
const [totalCount, setTotalCount] = useState13(0);
|
|
1686
|
+
const [loading, setLoading] = useState13(true);
|
|
1687
|
+
const [sortingLoading, setSortingLoading] = useState13(false);
|
|
1688
|
+
const [refreshing, setRefreshing] = useState13(false);
|
|
1689
|
+
const [loadingMore, setLoadingMore] = useState13(false);
|
|
1690
|
+
const [error, setError] = useState13(null);
|
|
1691
|
+
const [rateLimit, setRateLimit] = useState13(void 0);
|
|
1692
|
+
const [prevRateLimit, setPrevRateLimit] = useState13(void 0);
|
|
1693
|
+
const [restRateLimit, setRestRateLimit] = useState13(void 0);
|
|
1694
|
+
const [prevRestRateLimit, setPrevRestRateLimit] = useState13(void 0);
|
|
1695
|
+
const [density, setDensity] = useState13(2);
|
|
1696
|
+
const [prefsLoaded, setPrefsLoaded] = useState13(false);
|
|
1697
|
+
const [ownerContext, setOwnerContext] = useState13("personal");
|
|
1698
|
+
const [ownerAffiliations, setOwnerAffiliations] = useState13(["OWNER"]);
|
|
1699
|
+
const [orgSwitcherOpen, setOrgSwitcherOpen] = useState13(false);
|
|
1700
|
+
const [searchItems, setSearchItems] = useState13([]);
|
|
1701
|
+
const [searchEndCursor, setSearchEndCursor] = useState13(null);
|
|
1702
|
+
const [searchHasNextPage, setSearchHasNextPage] = useState13(false);
|
|
1703
|
+
const [searchTotalCount, setSearchTotalCount] = useState13(0);
|
|
1704
|
+
const [searchLoading, setSearchLoading] = useState13(false);
|
|
1705
|
+
const [deleteMode, setDeleteMode] = useState13(false);
|
|
1706
|
+
const [deleteTarget, setDeleteTarget] = useState13(null);
|
|
1707
|
+
const [deleteCode, setDeleteCode] = useState13("");
|
|
1708
|
+
const [typedCode, setTypedCode] = useState13("");
|
|
1709
|
+
const [deleting, setDeleting] = useState13(false);
|
|
1710
|
+
const [deleteError, setDeleteError] = useState13(null);
|
|
1711
|
+
const [deleteConfirmStage, setDeleteConfirmStage] = useState13(false);
|
|
1712
|
+
const [confirmFocus, setConfirmFocus] = useState13("delete");
|
|
1713
|
+
const [archiveMode, setArchiveMode] = useState13(false);
|
|
1714
|
+
const [archiveTarget, setArchiveTarget] = useState13(null);
|
|
1715
|
+
const [archiving, setArchiving] = useState13(false);
|
|
1716
|
+
const [archiveError, setArchiveError] = useState13(null);
|
|
1717
|
+
const [archiveFocus, setArchiveFocus] = useState13("confirm");
|
|
1718
|
+
const [syncMode, setSyncMode] = useState13(false);
|
|
1719
|
+
const [syncTarget, setSyncTarget] = useState13(null);
|
|
1720
|
+
const [syncing, setSyncing] = useState13(false);
|
|
1721
|
+
const [syncError, setSyncError] = useState13(null);
|
|
1722
|
+
const [syncFocus, setSyncFocus] = useState13("confirm");
|
|
1723
|
+
const [renameMode, setRenameMode] = useState13(false);
|
|
1724
|
+
const [renameTarget, setRenameTarget] = useState13(null);
|
|
1725
|
+
const [copyUrlMode, setCopyUrlMode] = useState13(false);
|
|
1726
|
+
const [copyUrlTarget, setCopyUrlTarget] = useState13(null);
|
|
1727
|
+
const [copyToast, setCopyToast] = useState13(null);
|
|
1728
|
+
const [syncTrigger, setSyncTrigger] = useState13(false);
|
|
1729
|
+
const [infoMode, setInfoMode] = useState13(false);
|
|
1730
|
+
const [infoRepo, setInfoRepo] = useState13(null);
|
|
1731
|
+
const [logoutMode, setLogoutMode] = useState13(false);
|
|
1732
|
+
const [logoutFocus, setLogoutFocus] = useState13("confirm");
|
|
1733
|
+
const [logoutError, setLogoutError] = useState13(null);
|
|
1734
|
+
const [visibilityMode, setVisibilityMode] = useState13(false);
|
|
1735
|
+
const [isEnterpriseOrg, setIsEnterpriseOrg] = useState13(false);
|
|
1736
|
+
const [hasInternalRepos, setHasInternalRepos] = useState13(false);
|
|
1737
|
+
const [changeVisibilityMode, setChangeVisibilityMode] = useState13(false);
|
|
1738
|
+
const [changeVisibilityTarget, setChangeVisibilityTarget] = useState13(null);
|
|
1739
|
+
const [changingVisibility, setChangingVisibility] = useState13(false);
|
|
1740
|
+
const [changeVisibilityError, setChangeVisibilityError] = useState13(null);
|
|
1741
|
+
const [sortMode, setSortMode] = useState13(false);
|
|
1742
|
+
const [sortDirectionMode, setSortDirectionMode] = useState13(false);
|
|
1597
1743
|
const appliedInitialOrg = useRef(false);
|
|
1598
|
-
|
|
1744
|
+
useEffect9(() => {
|
|
1599
1745
|
(async () => {
|
|
1600
1746
|
if (appliedInitialOrg.current) return;
|
|
1601
1747
|
if (!initialOrgSlug2) return;
|
|
@@ -1759,7 +1905,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1759
1905
|
throw error2;
|
|
1760
1906
|
}
|
|
1761
1907
|
}
|
|
1762
|
-
|
|
1908
|
+
useEffect9(() => {
|
|
1763
1909
|
return () => {
|
|
1764
1910
|
if (copyToastTimerRef.current) {
|
|
1765
1911
|
clearTimeout(copyToastTimerRef.current);
|
|
@@ -1859,12 +2005,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1859
2005
|
setDeleteError("Failed to delete repository. Ensure delete_repo scope and admin permissions.");
|
|
1860
2006
|
}
|
|
1861
2007
|
}
|
|
1862
|
-
const [filter, setFilter] =
|
|
1863
|
-
const [filterMode, setFilterMode] =
|
|
1864
|
-
const [sortKey, setSortKey] =
|
|
1865
|
-
const [sortDir, setSortDir] =
|
|
1866
|
-
const [forkTracking, setForkTracking] =
|
|
1867
|
-
const [visibilityFilter, setVisibilityFilter] =
|
|
2008
|
+
const [filter, setFilter] = useState13("");
|
|
2009
|
+
const [filterMode, setFilterMode] = useState13(false);
|
|
2010
|
+
const [sortKey, setSortKey] = useState13("updated");
|
|
2011
|
+
const [sortDir, setSortDir] = useState13("desc");
|
|
2012
|
+
const [forkTracking, setForkTracking] = useState13(true);
|
|
2013
|
+
const [visibilityFilter, setVisibilityFilter] = useState13("all");
|
|
1868
2014
|
const previousVisibilityFilter = useRef("all");
|
|
1869
2015
|
const sortFieldMap = {
|
|
1870
2016
|
"updated": "UPDATED_AT",
|
|
@@ -2025,7 +2171,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2025
2171
|
setSearchLoading(false);
|
|
2026
2172
|
}
|
|
2027
2173
|
};
|
|
2028
|
-
|
|
2174
|
+
useEffect9(() => {
|
|
2029
2175
|
const ui = getUIPrefs();
|
|
2030
2176
|
if (ui.density !== void 0) setDensity(ui.density);
|
|
2031
2177
|
if (ui.sortKey && ["updated", "pushed", "name", "stars"].includes(ui.sortKey)) {
|
|
@@ -2056,7 +2202,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2056
2202
|
}
|
|
2057
2203
|
setPrefsLoaded(true);
|
|
2058
2204
|
}, [onOrgContextChange]);
|
|
2059
|
-
|
|
2205
|
+
useEffect9(() => {
|
|
2060
2206
|
if (!prefsLoaded) return;
|
|
2061
2207
|
let policy = "cache-first";
|
|
2062
2208
|
const orgLogin = ownerContext !== "personal" ? ownerContext.login : void 0;
|
|
@@ -2076,7 +2222,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2076
2222
|
setCursor(0);
|
|
2077
2223
|
fetchPage(null, true, false, void 0, policy);
|
|
2078
2224
|
}, [client, prefsLoaded, ownerContext, ownerAffiliations]);
|
|
2079
|
-
|
|
2225
|
+
useEffect9(() => {
|
|
2080
2226
|
if (!searchActive) {
|
|
2081
2227
|
if (items.length > 0) {
|
|
2082
2228
|
let policy = "cache-first";
|
|
@@ -2115,7 +2261,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2115
2261
|
}
|
|
2116
2262
|
}
|
|
2117
2263
|
}, [sortKey, sortDir]);
|
|
2118
|
-
|
|
2264
|
+
useEffect9(() => {
|
|
2119
2265
|
if (visibilityFilter !== "all" || previousVisibilityFilter.current && previousVisibilityFilter.current !== visibilityFilter) {
|
|
2120
2266
|
if (!searchActive) {
|
|
2121
2267
|
if (items.length > 0) {
|
|
@@ -2132,7 +2278,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2132
2278
|
}
|
|
2133
2279
|
previousVisibilityFilter.current = visibilityFilter;
|
|
2134
2280
|
}, [visibilityFilter]);
|
|
2135
|
-
|
|
2281
|
+
useEffect9(() => {
|
|
2136
2282
|
if (viewerLogin && searchActive && !searchLoading && searchItems.length === 0) {
|
|
2137
2283
|
let policy = "cache-first";
|
|
2138
2284
|
try {
|
|
@@ -2153,7 +2299,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2153
2299
|
fetchSearchPage(null, true, policy);
|
|
2154
2300
|
}
|
|
2155
2301
|
}, [viewerLogin]);
|
|
2156
|
-
|
|
2302
|
+
useInput13((input, key) => {
|
|
2157
2303
|
if (error) {
|
|
2158
2304
|
if (input && input.toUpperCase() === "Q") {
|
|
2159
2305
|
try {
|
|
@@ -2313,6 +2459,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2313
2459
|
if (sortMode) {
|
|
2314
2460
|
return;
|
|
2315
2461
|
}
|
|
2462
|
+
if (sortDirectionMode) {
|
|
2463
|
+
return;
|
|
2464
|
+
}
|
|
2316
2465
|
if (filterMode) {
|
|
2317
2466
|
if (key.escape) {
|
|
2318
2467
|
setFilterMode(false);
|
|
@@ -2493,12 +2642,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2493
2642
|
return;
|
|
2494
2643
|
}
|
|
2495
2644
|
if (input && input.toUpperCase() === "D") {
|
|
2496
|
-
|
|
2497
|
-
const next = prev === "asc" ? "desc" : "asc";
|
|
2498
|
-
storeUIPrefs({ sortDir: next });
|
|
2499
|
-
return next;
|
|
2500
|
-
});
|
|
2501
|
-
setCursor(0);
|
|
2645
|
+
setSortDirectionMode(true);
|
|
2502
2646
|
return;
|
|
2503
2647
|
}
|
|
2504
2648
|
if (input && input.toUpperCase() === "O") {
|
|
@@ -2578,12 +2722,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2578
2722
|
return result;
|
|
2579
2723
|
}, [searchItems, visibilityFilter]);
|
|
2580
2724
|
const visibleItems = searchActive ? filteredSearchItems : filteredAndSorted;
|
|
2581
|
-
|
|
2725
|
+
useEffect9(() => {
|
|
2582
2726
|
if (searchActive) {
|
|
2583
2727
|
addDebugMessage(`[State] searchActive=${searchActive}, searchItems=${searchItems.length}, visibleItems=${visibleItems.length}, filter="${filter}"`);
|
|
2584
2728
|
}
|
|
2585
2729
|
}, [searchActive, searchItems.length, visibleItems.length, filter]);
|
|
2586
|
-
|
|
2730
|
+
useEffect9(() => {
|
|
2587
2731
|
setCursor((c) => Math.min(c, Math.max(0, (searchActive ? searchItems.length : items.length) - 1)));
|
|
2588
2732
|
}, [searchActive, searchItems.length, items.length]);
|
|
2589
2733
|
const headerHeight = 2;
|
|
@@ -2604,7 +2748,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2604
2748
|
const end = Math.min(total, start + visibleRepos + buffer);
|
|
2605
2749
|
return { start, end };
|
|
2606
2750
|
}, [visibleItems.length, cursor, listHeight, spacingLines]);
|
|
2607
|
-
|
|
2751
|
+
useEffect9(() => {
|
|
2608
2752
|
const prefetchThreshold = Math.floor(visibleItems.length * 0.8);
|
|
2609
2753
|
const nearEnd = visibleItems.length > 0 && cursor >= prefetchThreshold;
|
|
2610
2754
|
if (searchActive) {
|
|
@@ -2625,96 +2769,96 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2625
2769
|
exec(cmd);
|
|
2626
2770
|
}
|
|
2627
2771
|
const lowRate = rateLimit && rateLimit.remaining <= Math.ceil(rateLimit.limit * 0.1) || restRateLimit && restRateLimit.core.remaining <= Math.ceil(restRateLimit.core.limit * 0.1);
|
|
2628
|
-
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode;
|
|
2629
|
-
const headerBar = useMemo(() => /* @__PURE__ */
|
|
2630
|
-
/* @__PURE__ */
|
|
2631
|
-
/* @__PURE__ */
|
|
2772
|
+
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || sortMode || sortDirectionMode || changeVisibilityMode || copyUrlMode || renameMode;
|
|
2773
|
+
const headerBar = useMemo(() => /* @__PURE__ */ jsxs16(Box16, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: [
|
|
2774
|
+
/* @__PURE__ */ jsxs16(Box16, { flexDirection: "row", gap: 1, children: [
|
|
2775
|
+
/* @__PURE__ */ jsxs16(Text17, { color: "cyan", bold: !modalOpen, dimColor: modalOpen, children: [
|
|
2632
2776
|
" ",
|
|
2633
2777
|
ownerContext === "personal" ? "Personal" : ownerContext.name || ownerContext.login,
|
|
2634
2778
|
ownerContext !== "personal" && isEnterpriseOrg && " (ENT)"
|
|
2635
2779
|
] }),
|
|
2636
|
-
/* @__PURE__ */
|
|
2637
|
-
/* @__PURE__ */
|
|
2780
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, color: modalOpen ? "gray" : void 0, dimColor: modalOpen ? true : void 0, children: "Repositories" }),
|
|
2781
|
+
/* @__PURE__ */ jsxs16(Text17, { color: "gray", children: [
|
|
2638
2782
|
"(",
|
|
2639
2783
|
visibleItems.length,
|
|
2640
2784
|
"/",
|
|
2641
2785
|
searchActive ? searchTotalCount : totalCount,
|
|
2642
2786
|
")"
|
|
2643
2787
|
] }),
|
|
2644
|
-
(loading || searchLoading) && /* @__PURE__ */
|
|
2788
|
+
(loading || searchLoading) && /* @__PURE__ */ jsx17(Box16, { width: 2, flexShrink: 0, flexGrow: 0, marginLeft: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "yellow", children: /* @__PURE__ */ jsx17(SlowSpinner, {}) }) })
|
|
2645
2789
|
] }),
|
|
2646
|
-
(rateLimit || restRateLimit) && /* @__PURE__ */
|
|
2790
|
+
(rateLimit || restRateLimit) && /* @__PURE__ */ jsxs16(Text17, { color: lowRate ? "yellow" : "gray", children: [
|
|
2647
2791
|
"GraphQL: ",
|
|
2648
2792
|
rateLimit ? `${rateLimit.remaining}/${rateLimit.limit}` : "---/---",
|
|
2649
|
-
prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */
|
|
2793
|
+
prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */ jsx17(Text17, { color: rateLimit.remaining < prevRateLimit ? "red" : "green", children: ` (${rateLimit.remaining - prevRateLimit > 0 ? "+" : ""}${rateLimit.remaining - prevRateLimit})` }),
|
|
2650
2794
|
" | ",
|
|
2651
2795
|
"REST: ",
|
|
2652
2796
|
restRateLimit ? `${restRateLimit.core.remaining}/${restRateLimit.core.limit}` : "---/---",
|
|
2653
|
-
prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */
|
|
2797
|
+
prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */ jsx17(Text17, { color: restRateLimit.core.remaining < prevRestRateLimit ? "red" : "green", children: ` (${restRateLimit.core.remaining - prevRestRateLimit > 0 ? "+" : ""}${restRateLimit.core.remaining - prevRestRateLimit})` }),
|
|
2654
2798
|
" "
|
|
2655
2799
|
] })
|
|
2656
2800
|
] }), [visibleItems.length, searchActive, searchTotalCount, totalCount, loading, searchLoading, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg, restRateLimit, prevRestRateLimit]);
|
|
2657
2801
|
if (error) {
|
|
2658
|
-
return /* @__PURE__ */
|
|
2659
|
-
/* @__PURE__ */
|
|
2660
|
-
/* @__PURE__ */
|
|
2661
|
-
/* @__PURE__ */
|
|
2802
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", height: availableHeight, children: [
|
|
2803
|
+
/* @__PURE__ */ jsx17(Box16, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs16(Box16, { flexDirection: "row", gap: 1, children: [
|
|
2804
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, children: " Repositories" }),
|
|
2805
|
+
/* @__PURE__ */ jsx17(Text17, { color: "red", children: "(Error)" })
|
|
2662
2806
|
] }) }),
|
|
2663
|
-
/* @__PURE__ */
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2807
|
+
/* @__PURE__ */ jsx17(Box16, { borderStyle: "single", borderColor: "red", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx17(Box16, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", alignItems: "center", children: [
|
|
2808
|
+
/* @__PURE__ */ jsx17(Text17, { color: "red", children: error }),
|
|
2809
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "gray", dimColor: true, children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
2666
2810
|
] }) }) }),
|
|
2667
|
-
/* @__PURE__ */
|
|
2811
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "gray", children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
2668
2812
|
] });
|
|
2669
2813
|
}
|
|
2670
2814
|
if (loading && items.length === 0 || sortingLoading) {
|
|
2671
|
-
return /* @__PURE__ */
|
|
2672
|
-
/* @__PURE__ */
|
|
2673
|
-
/* @__PURE__ */
|
|
2674
|
-
/* @__PURE__ */
|
|
2815
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", height: availableHeight, children: [
|
|
2816
|
+
/* @__PURE__ */ jsx17(Box16, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs16(Box16, { flexDirection: "row", gap: 1, children: [
|
|
2817
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, children: " Repositories" }),
|
|
2818
|
+
/* @__PURE__ */ jsx17(Text17, { color: "gray", children: "(Loading...)" })
|
|
2675
2819
|
] }) }),
|
|
2676
|
-
/* @__PURE__ */
|
|
2677
|
-
/* @__PURE__ */
|
|
2678
|
-
/* @__PURE__ */
|
|
2679
|
-
/* @__PURE__ */
|
|
2820
|
+
/* @__PURE__ */ jsx17(Box16, { borderStyle: "single", borderColor: "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx17(Box16, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx17(Box16, { flexDirection: "column", alignItems: "center", children: /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", alignItems: "center", children: [
|
|
2821
|
+
/* @__PURE__ */ jsxs16(Box16, { height: 1, flexDirection: "row", children: [
|
|
2822
|
+
/* @__PURE__ */ jsx17(Box16, { width: 2, flexShrink: 0, flexGrow: 0, children: /* @__PURE__ */ jsx17(Text17, { color: "cyan", children: /* @__PURE__ */ jsx17(SlowSpinner, {}) }) }),
|
|
2823
|
+
/* @__PURE__ */ jsx17(Text17, { color: "cyan", children: refreshing ? "Refreshing..." : sortingLoading ? "Applying sort..." : "Loading repositories..." })
|
|
2680
2824
|
] }),
|
|
2681
|
-
/* @__PURE__ */
|
|
2825
|
+
/* @__PURE__ */ jsx17(Box16, { height: 1, marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "gray", children: refreshing ? "Fetching latest repository data" : sortingLoading ? `Sorting by ${sortKey} (${sortDir === "asc" ? "ascending" : "descending"})` : "Fetching your GitHub repositories" }) })
|
|
2682
2826
|
] }) }) }) }),
|
|
2683
|
-
/* @__PURE__ */
|
|
2827
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "gray", children: "Please wait..." }) })
|
|
2684
2828
|
] });
|
|
2685
2829
|
}
|
|
2686
|
-
return /* @__PURE__ */
|
|
2830
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", height: availableHeight, children: [
|
|
2687
2831
|
headerBar,
|
|
2688
|
-
/* @__PURE__ */
|
|
2832
|
+
/* @__PURE__ */ jsx17(Box16, { borderStyle: "single", borderColor: modalOpen ? "gray" : "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: deleteMode && deleteTarget ? (
|
|
2689
2833
|
// Centered modal; hide list content while modal is open
|
|
2690
|
-
/* @__PURE__ */
|
|
2691
|
-
/* @__PURE__ */
|
|
2692
|
-
/* @__PURE__ */
|
|
2693
|
-
/* @__PURE__ */
|
|
2834
|
+
/* @__PURE__ */ jsx17(Box16, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
2835
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, children: "Delete Confirmation" }),
|
|
2836
|
+
/* @__PURE__ */ jsx17(Text17, { color: "red", children: "\u26A0\uFE0F Delete repository?" }),
|
|
2837
|
+
/* @__PURE__ */ jsx17(Box16, { height: 2, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) }),
|
|
2694
2838
|
(() => {
|
|
2695
2839
|
const langName = deleteTarget.primaryLanguage?.name || "";
|
|
2696
2840
|
const langColor = deleteTarget.primaryLanguage?.color || "#666666";
|
|
2697
2841
|
let line1 = "";
|
|
2698
|
-
line1 +=
|
|
2699
|
-
if (deleteTarget.isPrivate) line1 +=
|
|
2700
|
-
if (deleteTarget.isArchived) line1 +=
|
|
2701
|
-
if (deleteTarget.isFork && deleteTarget.parent) line1 +=
|
|
2842
|
+
line1 += chalk13.white(deleteTarget.nameWithOwner);
|
|
2843
|
+
if (deleteTarget.isPrivate) line1 += chalk13.yellow(" Private");
|
|
2844
|
+
if (deleteTarget.isArchived) line1 += chalk13.gray.dim(" Archived");
|
|
2845
|
+
if (deleteTarget.isFork && deleteTarget.parent) line1 += chalk13.blue(` Fork of ${deleteTarget.parent.nameWithOwner}`);
|
|
2702
2846
|
let line2 = "";
|
|
2703
|
-
if (langName) line2 +=
|
|
2704
|
-
line2 +=
|
|
2705
|
-
return /* @__PURE__ */
|
|
2706
|
-
/* @__PURE__ */
|
|
2707
|
-
/* @__PURE__ */
|
|
2847
|
+
if (langName) line2 += chalk13.hex(langColor)("\u25CF ") + chalk13.gray(`${langName} `);
|
|
2848
|
+
line2 += chalk13.gray(`\u2605 ${deleteTarget.stargazerCount} \u2442 ${deleteTarget.forkCount} Updated ${formatDate(deleteTarget.updatedAt)}`);
|
|
2849
|
+
return /* @__PURE__ */ jsxs16(Fragment8, { children: [
|
|
2850
|
+
/* @__PURE__ */ jsx17(Text17, { children: line1 }),
|
|
2851
|
+
/* @__PURE__ */ jsx17(Text17, { children: line2 })
|
|
2708
2852
|
] });
|
|
2709
2853
|
})(),
|
|
2710
|
-
/* @__PURE__ */
|
|
2854
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsxs16(Text17, { children: [
|
|
2711
2855
|
"Type ",
|
|
2712
|
-
/* @__PURE__ */
|
|
2856
|
+
/* @__PURE__ */ jsx17(Text17, { color: "yellow", bold: true, children: deleteCode }),
|
|
2713
2857
|
" to confirm."
|
|
2714
2858
|
] }) }),
|
|
2715
|
-
!deleteConfirmStage && /* @__PURE__ */
|
|
2716
|
-
/* @__PURE__ */
|
|
2717
|
-
/* @__PURE__ */
|
|
2859
|
+
!deleteConfirmStage && /* @__PURE__ */ jsxs16(Box16, { marginTop: 1, children: [
|
|
2860
|
+
/* @__PURE__ */ jsx17(Text17, { children: "Confirm code: " }),
|
|
2861
|
+
/* @__PURE__ */ jsx17(
|
|
2718
2862
|
TextInput5,
|
|
2719
2863
|
{
|
|
2720
2864
|
value: typedCode,
|
|
@@ -2741,11 +2885,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2741
2885
|
}
|
|
2742
2886
|
)
|
|
2743
2887
|
] }),
|
|
2744
|
-
deleteConfirmStage && /* @__PURE__ */
|
|
2745
|
-
/* @__PURE__ */
|
|
2746
|
-
/* @__PURE__ */
|
|
2747
|
-
/* @__PURE__ */
|
|
2748
|
-
|
|
2888
|
+
deleteConfirmStage && /* @__PURE__ */ jsxs16(Box16, { marginTop: 1, flexDirection: "column", children: [
|
|
2889
|
+
/* @__PURE__ */ jsx17(Text17, { color: "red", children: "This action will permanently delete the repository. This cannot be undone." }),
|
|
2890
|
+
/* @__PURE__ */ jsxs16(Box16, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
2891
|
+
/* @__PURE__ */ jsx17(
|
|
2892
|
+
Box16,
|
|
2749
2893
|
{
|
|
2750
2894
|
borderStyle: "round",
|
|
2751
2895
|
borderColor: "red",
|
|
@@ -2754,11 +2898,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2754
2898
|
alignItems: "center",
|
|
2755
2899
|
justifyContent: "center",
|
|
2756
2900
|
flexDirection: "column",
|
|
2757
|
-
children: /* @__PURE__ */
|
|
2901
|
+
children: /* @__PURE__ */ jsx17(Text17, { children: confirmFocus === "delete" ? chalk13.bgRed.white.bold(" Delete ") : chalk13.red.bold("Delete") })
|
|
2758
2902
|
}
|
|
2759
2903
|
),
|
|
2760
|
-
/* @__PURE__ */
|
|
2761
|
-
|
|
2904
|
+
/* @__PURE__ */ jsx17(
|
|
2905
|
+
Box16,
|
|
2762
2906
|
{
|
|
2763
2907
|
borderStyle: "round",
|
|
2764
2908
|
borderColor: confirmFocus === "cancel" ? "white" : "gray",
|
|
@@ -2767,16 +2911,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2767
2911
|
alignItems: "center",
|
|
2768
2912
|
justifyContent: "center",
|
|
2769
2913
|
flexDirection: "column",
|
|
2770
|
-
children: /* @__PURE__ */
|
|
2914
|
+
children: /* @__PURE__ */ jsx17(Text17, { children: confirmFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
2771
2915
|
}
|
|
2772
2916
|
)
|
|
2773
2917
|
] }),
|
|
2774
|
-
/* @__PURE__ */
|
|
2918
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs16(Text17, { color: "gray", children: [
|
|
2775
2919
|
"Press Enter to ",
|
|
2776
2920
|
confirmFocus === "delete" ? "Delete" : "Cancel",
|
|
2777
2921
|
" | Y to Delete | C to Cancel"
|
|
2778
2922
|
] }) }),
|
|
2779
|
-
/* @__PURE__ */
|
|
2923
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(
|
|
2780
2924
|
TextInput5,
|
|
2781
2925
|
{
|
|
2782
2926
|
value: "",
|
|
@@ -2790,18 +2934,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2790
2934
|
}
|
|
2791
2935
|
) })
|
|
2792
2936
|
] }),
|
|
2793
|
-
deleteError && /* @__PURE__ */
|
|
2794
|
-
deleting && /* @__PURE__ */
|
|
2937
|
+
deleteError && /* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "magenta", children: deleteError }) }),
|
|
2938
|
+
deleting && /* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "yellow", children: "Deleting..." }) })
|
|
2795
2939
|
] }) })
|
|
2796
|
-
) : archiveMode && archiveTarget ? /* @__PURE__ */
|
|
2797
|
-
/* @__PURE__ */
|
|
2798
|
-
/* @__PURE__ */
|
|
2799
|
-
/* @__PURE__ */
|
|
2800
|
-
/* @__PURE__ */
|
|
2801
|
-
/* @__PURE__ */
|
|
2802
|
-
/* @__PURE__ */
|
|
2803
|
-
/* @__PURE__ */
|
|
2804
|
-
|
|
2940
|
+
) : archiveMode && archiveTarget ? /* @__PURE__ */ jsx17(Box16, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", borderStyle: "round", borderColor: archiveTarget.isArchived ? "green" : "yellow", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
2941
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, children: archiveTarget.isArchived ? "Unarchive Confirmation" : "Archive Confirmation" }),
|
|
2942
|
+
/* @__PURE__ */ jsx17(Text17, { color: archiveTarget.isArchived ? "green" : "yellow", children: archiveTarget.isArchived ? "\u21BA Unarchive repository?" : "\u26A0\uFE0F Archive repository?" }),
|
|
2943
|
+
/* @__PURE__ */ jsx17(Box16, { height: 1, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) }),
|
|
2944
|
+
/* @__PURE__ */ jsx17(Text17, { children: archiveTarget.nameWithOwner }),
|
|
2945
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { children: archiveTarget.isArchived ? "This will make the repository active again." : "This will make the repository read-only." }) }),
|
|
2946
|
+
/* @__PURE__ */ jsxs16(Box16, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
2947
|
+
/* @__PURE__ */ jsx17(
|
|
2948
|
+
Box16,
|
|
2805
2949
|
{
|
|
2806
2950
|
borderStyle: "round",
|
|
2807
2951
|
borderColor: archiveTarget.isArchived ? "green" : "yellow",
|
|
@@ -2810,11 +2954,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2810
2954
|
alignItems: "center",
|
|
2811
2955
|
justifyContent: "center",
|
|
2812
2956
|
flexDirection: "column",
|
|
2813
|
-
children: /* @__PURE__ */
|
|
2957
|
+
children: /* @__PURE__ */ jsx17(Text17, { children: archiveFocus === "confirm" ? chalk13.bgGreen.white.bold(` ${archiveTarget.isArchived ? "Unarchive" : "Archive"} `) : chalk13.bold[archiveTarget.isArchived ? "green" : "yellow"](archiveTarget.isArchived ? "Unarchive" : "Archive") })
|
|
2814
2958
|
}
|
|
2815
2959
|
),
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
|
|
2960
|
+
/* @__PURE__ */ jsx17(
|
|
2961
|
+
Box16,
|
|
2818
2962
|
{
|
|
2819
2963
|
borderStyle: "round",
|
|
2820
2964
|
borderColor: archiveFocus === "cancel" ? "white" : "gray",
|
|
@@ -2823,18 +2967,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2823
2967
|
alignItems: "center",
|
|
2824
2968
|
justifyContent: "center",
|
|
2825
2969
|
flexDirection: "column",
|
|
2826
|
-
children: /* @__PURE__ */
|
|
2970
|
+
children: /* @__PURE__ */ jsx17(Text17, { children: archiveFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
2827
2971
|
}
|
|
2828
2972
|
)
|
|
2829
2973
|
] }),
|
|
2830
|
-
/* @__PURE__ */
|
|
2974
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs16(Text17, { color: "gray", children: [
|
|
2831
2975
|
"Press Enter to ",
|
|
2832
2976
|
archiveFocus === "confirm" ? archiveTarget.isArchived ? "Unarchive" : "Archive" : "Cancel",
|
|
2833
2977
|
" | Y to ",
|
|
2834
2978
|
archiveTarget.isArchived ? "Unarchive" : "Archive",
|
|
2835
2979
|
" | C to Cancel"
|
|
2836
2980
|
] }) }),
|
|
2837
|
-
/* @__PURE__ */
|
|
2981
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(
|
|
2838
2982
|
TextInput5,
|
|
2839
2983
|
{
|
|
2840
2984
|
value: "",
|
|
@@ -2849,21 +2993,21 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2849
2993
|
}
|
|
2850
2994
|
}
|
|
2851
2995
|
) }),
|
|
2852
|
-
archiveError && /* @__PURE__ */
|
|
2853
|
-
archiving && /* @__PURE__ */
|
|
2854
|
-
] }) }) : syncMode && syncTarget ? /* @__PURE__ */
|
|
2855
|
-
/* @__PURE__ */
|
|
2856
|
-
/* @__PURE__ */
|
|
2857
|
-
/* @__PURE__ */
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
syncTarget.parent && /* @__PURE__ */
|
|
2996
|
+
archiveError && /* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "magenta", children: archiveError }) }),
|
|
2997
|
+
archiving && /* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "yellow", children: archiveTarget.isArchived ? "Unarchiving..." : "Archiving..." }) })
|
|
2998
|
+
] }) }) : syncMode && syncTarget ? /* @__PURE__ */ jsx17(Box16, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
2999
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, children: "Sync Fork Confirmation" }),
|
|
3000
|
+
/* @__PURE__ */ jsx17(Text17, { color: "blue", children: "\u27F2 Sync fork with upstream?" }),
|
|
3001
|
+
/* @__PURE__ */ jsx17(Box16, { height: 1, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) }),
|
|
3002
|
+
/* @__PURE__ */ jsx17(Text17, { children: syncTarget.nameWithOwner }),
|
|
3003
|
+
syncTarget.parent && /* @__PURE__ */ jsxs16(Text17, { color: "gray", children: [
|
|
2860
3004
|
"Upstream: ",
|
|
2861
3005
|
syncTarget.parent.nameWithOwner
|
|
2862
3006
|
] }),
|
|
2863
|
-
/* @__PURE__ */
|
|
2864
|
-
/* @__PURE__ */
|
|
2865
|
-
/* @__PURE__ */
|
|
2866
|
-
|
|
3007
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { children: "This will merge upstream changes into your fork." }) }),
|
|
3008
|
+
/* @__PURE__ */ jsxs16(Box16, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3009
|
+
/* @__PURE__ */ jsx17(
|
|
3010
|
+
Box16,
|
|
2867
3011
|
{
|
|
2868
3012
|
borderStyle: "round",
|
|
2869
3013
|
borderColor: "blue",
|
|
@@ -2872,11 +3016,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2872
3016
|
alignItems: "center",
|
|
2873
3017
|
justifyContent: "center",
|
|
2874
3018
|
flexDirection: "column",
|
|
2875
|
-
children: /* @__PURE__ */
|
|
3019
|
+
children: /* @__PURE__ */ jsx17(Text17, { children: syncFocus === "confirm" ? chalk13.bgBlue.white.bold(" Sync ") : chalk13.blue.bold("Sync") })
|
|
2876
3020
|
}
|
|
2877
3021
|
),
|
|
2878
|
-
/* @__PURE__ */
|
|
2879
|
-
|
|
3022
|
+
/* @__PURE__ */ jsx17(
|
|
3023
|
+
Box16,
|
|
2880
3024
|
{
|
|
2881
3025
|
borderStyle: "round",
|
|
2882
3026
|
borderColor: syncFocus === "cancel" ? "white" : "gray",
|
|
@@ -2885,16 +3029,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2885
3029
|
alignItems: "center",
|
|
2886
3030
|
justifyContent: "center",
|
|
2887
3031
|
flexDirection: "column",
|
|
2888
|
-
children: /* @__PURE__ */
|
|
3032
|
+
children: /* @__PURE__ */ jsx17(Text17, { children: syncFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
2889
3033
|
}
|
|
2890
3034
|
)
|
|
2891
3035
|
] }),
|
|
2892
|
-
/* @__PURE__ */
|
|
3036
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs16(Text17, { color: "gray", children: [
|
|
2893
3037
|
"Press Enter to ",
|
|
2894
3038
|
syncFocus === "confirm" ? "Sync" : "Cancel",
|
|
2895
3039
|
" | Y to Sync | C to Cancel"
|
|
2896
3040
|
] }) }),
|
|
2897
|
-
/* @__PURE__ */
|
|
3041
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(
|
|
2898
3042
|
TextInput5,
|
|
2899
3043
|
{
|
|
2900
3044
|
value: "",
|
|
@@ -2909,14 +3053,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2909
3053
|
}
|
|
2910
3054
|
}
|
|
2911
3055
|
) }),
|
|
2912
|
-
syncError && /* @__PURE__ */
|
|
2913
|
-
syncing && /* @__PURE__ */
|
|
2914
|
-
] }) }) : logoutMode ? /* @__PURE__ */
|
|
2915
|
-
/* @__PURE__ */
|
|
2916
|
-
/* @__PURE__ */
|
|
2917
|
-
/* @__PURE__ */
|
|
2918
|
-
/* @__PURE__ */
|
|
2919
|
-
|
|
3056
|
+
syncError && /* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "magenta", children: syncError }) }),
|
|
3057
|
+
syncing && /* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "yellow", children: "Syncing..." }) })
|
|
3058
|
+
] }) }) : logoutMode ? /* @__PURE__ */ jsx17(Box16, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
3059
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, children: "Logout Confirmation" }),
|
|
3060
|
+
/* @__PURE__ */ jsx17(Text17, { color: "cyan", children: "Are you sure you want to log out?" }),
|
|
3061
|
+
/* @__PURE__ */ jsxs16(Box16, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3062
|
+
/* @__PURE__ */ jsx17(
|
|
3063
|
+
Box16,
|
|
2920
3064
|
{
|
|
2921
3065
|
borderStyle: "round",
|
|
2922
3066
|
borderColor: "cyan",
|
|
@@ -2925,11 +3069,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2925
3069
|
alignItems: "center",
|
|
2926
3070
|
justifyContent: "center",
|
|
2927
3071
|
flexDirection: "column",
|
|
2928
|
-
children: /* @__PURE__ */
|
|
3072
|
+
children: /* @__PURE__ */ jsx17(Text17, { children: logoutFocus === "confirm" ? chalk13.bgCyan.white.bold(" Logout ") : chalk13.cyan.bold("Logout") })
|
|
2929
3073
|
}
|
|
2930
3074
|
),
|
|
2931
|
-
/* @__PURE__ */
|
|
2932
|
-
|
|
3075
|
+
/* @__PURE__ */ jsx17(
|
|
3076
|
+
Box16,
|
|
2933
3077
|
{
|
|
2934
3078
|
borderStyle: "round",
|
|
2935
3079
|
borderColor: logoutFocus === "cancel" ? "white" : "gray",
|
|
@@ -2938,16 +3082,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2938
3082
|
alignItems: "center",
|
|
2939
3083
|
justifyContent: "center",
|
|
2940
3084
|
flexDirection: "column",
|
|
2941
|
-
children: /* @__PURE__ */
|
|
3085
|
+
children: /* @__PURE__ */ jsx17(Text17, { children: logoutFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
2942
3086
|
}
|
|
2943
3087
|
)
|
|
2944
3088
|
] }),
|
|
2945
|
-
/* @__PURE__ */
|
|
3089
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs16(Text17, { color: "gray", children: [
|
|
2946
3090
|
"Press Enter to ",
|
|
2947
3091
|
logoutFocus === "confirm" ? "Logout" : "Cancel",
|
|
2948
3092
|
" | Y to Logout | C to Cancel"
|
|
2949
3093
|
] }) })
|
|
2950
|
-
] }) }) : orgSwitcherOpen ? /* @__PURE__ */
|
|
3094
|
+
] }) }) : orgSwitcherOpen ? /* @__PURE__ */ jsx17(Box16, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx17(
|
|
2951
3095
|
OrgSwitcher,
|
|
2952
3096
|
{
|
|
2953
3097
|
token,
|
|
@@ -2955,45 +3099,45 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2955
3099
|
onSelect: handleOrgContextChange,
|
|
2956
3100
|
onClose: () => setOrgSwitcherOpen(false)
|
|
2957
3101
|
}
|
|
2958
|
-
) }) : infoMode ? /* @__PURE__ */
|
|
3102
|
+
) }) : infoMode ? /* @__PURE__ */ jsx17(Box16, { height: contentHeight, alignItems: "center", justifyContent: "center", children: (() => {
|
|
2959
3103
|
const repo = infoRepo || visibleItems[cursor];
|
|
2960
|
-
if (!repo) return /* @__PURE__ */
|
|
3104
|
+
if (!repo) return /* @__PURE__ */ jsx17(Text17, { color: "red", children: "No repository selected." });
|
|
2961
3105
|
const langName = repo.primaryLanguage?.name || "N/A";
|
|
2962
3106
|
const langColor = repo.primaryLanguage?.color || "#666666";
|
|
2963
|
-
return /* @__PURE__ */
|
|
2964
|
-
/* @__PURE__ */
|
|
3107
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 90), children: [
|
|
3108
|
+
/* @__PURE__ */ jsxs16(Text17, { bold: true, children: [
|
|
2965
3109
|
"Repository Info ",
|
|
2966
|
-
infoRepo ?
|
|
3110
|
+
infoRepo ? chalk13.dim("(cached)") : ""
|
|
2967
3111
|
] }),
|
|
2968
|
-
/* @__PURE__ */
|
|
2969
|
-
/* @__PURE__ */
|
|
2970
|
-
repo.description && /* @__PURE__ */
|
|
2971
|
-
/* @__PURE__ */
|
|
2972
|
-
/* @__PURE__ */
|
|
2973
|
-
repo.visibility === "PRIVATE" ?
|
|
2974
|
-
repo.isArchived ?
|
|
2975
|
-
repo.isFork ?
|
|
3112
|
+
/* @__PURE__ */ jsx17(Box16, { height: 1, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) }),
|
|
3113
|
+
/* @__PURE__ */ jsx17(Text17, { children: chalk13.bold(repo.nameWithOwner) }),
|
|
3114
|
+
repo.description && /* @__PURE__ */ jsx17(Text17, { color: "gray", children: repo.description }),
|
|
3115
|
+
/* @__PURE__ */ jsx17(Box16, { height: 1, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) }),
|
|
3116
|
+
/* @__PURE__ */ jsxs16(Text17, { children: [
|
|
3117
|
+
repo.visibility === "PRIVATE" ? chalk13.yellow("Private") : repo.visibility === "INTERNAL" ? chalk13.magenta("Internal") : chalk13.green("Public"),
|
|
3118
|
+
repo.isArchived ? chalk13.gray(" Archived") : "",
|
|
3119
|
+
repo.isFork ? chalk13.blue(" Fork") : ""
|
|
2976
3120
|
] }),
|
|
2977
|
-
/* @__PURE__ */
|
|
2978
|
-
/* @__PURE__ */
|
|
2979
|
-
|
|
2980
|
-
|
|
3121
|
+
/* @__PURE__ */ jsx17(Text17, { children: chalk13.gray(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount}`) }),
|
|
3122
|
+
/* @__PURE__ */ jsxs16(Text17, { children: [
|
|
3123
|
+
chalk13.hex(langColor)(`\u25CF `),
|
|
3124
|
+
chalk13.gray(`${langName}`)
|
|
2981
3125
|
] }),
|
|
2982
|
-
/* @__PURE__ */
|
|
3126
|
+
/* @__PURE__ */ jsxs16(Text17, { color: "gray", children: [
|
|
2983
3127
|
"Updated: ",
|
|
2984
3128
|
formatDate(repo.updatedAt),
|
|
2985
3129
|
" \u2022 Pushed: ",
|
|
2986
3130
|
formatDate(repo.pushedAt)
|
|
2987
3131
|
] }),
|
|
2988
|
-
/* @__PURE__ */
|
|
3132
|
+
/* @__PURE__ */ jsxs16(Text17, { color: "gray", children: [
|
|
2989
3133
|
"Size: ",
|
|
2990
3134
|
repo.diskUsage,
|
|
2991
3135
|
" KB"
|
|
2992
3136
|
] }),
|
|
2993
|
-
/* @__PURE__ */
|
|
2994
|
-
/* @__PURE__ */
|
|
3137
|
+
/* @__PURE__ */ jsx17(Box16, { height: 1, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) }),
|
|
3138
|
+
/* @__PURE__ */ jsx17(Text17, { color: "gray", children: "Press Esc or I to close" })
|
|
2995
3139
|
] });
|
|
2996
|
-
})() }) : visibilityMode ? /* @__PURE__ */
|
|
3140
|
+
})() }) : visibilityMode ? /* @__PURE__ */ jsx17(Box16, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx17(
|
|
2997
3141
|
VisibilityModal,
|
|
2998
3142
|
{
|
|
2999
3143
|
currentFilter: visibilityFilter,
|
|
@@ -3006,7 +3150,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3006
3150
|
},
|
|
3007
3151
|
onCancel: () => setVisibilityMode(false)
|
|
3008
3152
|
}
|
|
3009
|
-
) }) : sortMode ? /* @__PURE__ */
|
|
3153
|
+
) }) : sortMode ? /* @__PURE__ */ jsx17(Box16, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx17(
|
|
3010
3154
|
SortModal,
|
|
3011
3155
|
{
|
|
3012
3156
|
currentSort: sortKey,
|
|
@@ -3018,7 +3162,20 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3018
3162
|
},
|
|
3019
3163
|
onCancel: () => setSortMode(false)
|
|
3020
3164
|
}
|
|
3021
|
-
) }) :
|
|
3165
|
+
) }) : sortDirectionMode ? /* @__PURE__ */ jsx17(Box16, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx17(
|
|
3166
|
+
SortDirectionModal,
|
|
3167
|
+
{
|
|
3168
|
+
currentDirection: sortDir,
|
|
3169
|
+
currentSortKey: sortKey,
|
|
3170
|
+
onSelect: (direction) => {
|
|
3171
|
+
setSortDir(direction);
|
|
3172
|
+
setSortDirectionMode(false);
|
|
3173
|
+
setCursor(0);
|
|
3174
|
+
storeUIPrefs({ sortDir: direction });
|
|
3175
|
+
},
|
|
3176
|
+
onCancel: () => setSortDirectionMode(false)
|
|
3177
|
+
}
|
|
3178
|
+
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */ jsx17(Box16, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx17(
|
|
3022
3179
|
ChangeVisibilityModal,
|
|
3023
3180
|
{
|
|
3024
3181
|
isOpen: changeVisibilityMode,
|
|
@@ -3031,14 +3188,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3031
3188
|
changing: changingVisibility,
|
|
3032
3189
|
error: changeVisibilityError
|
|
3033
3190
|
}
|
|
3034
|
-
) }) : renameMode && renameTarget ? /* @__PURE__ */
|
|
3191
|
+
) }) : renameMode && renameTarget ? /* @__PURE__ */ jsx17(Box16, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx17(
|
|
3035
3192
|
RenameModal,
|
|
3036
3193
|
{
|
|
3037
3194
|
repo: renameTarget,
|
|
3038
3195
|
onRename: executeRename,
|
|
3039
3196
|
onCancel: closeRenameModal
|
|
3040
3197
|
}
|
|
3041
|
-
) }) : copyUrlMode ? /* @__PURE__ */
|
|
3198
|
+
) }) : copyUrlMode ? /* @__PURE__ */ jsx17(Box16, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx17(
|
|
3042
3199
|
CopyUrlModal,
|
|
3043
3200
|
{
|
|
3044
3201
|
repo: copyUrlTarget,
|
|
@@ -3046,8 +3203,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3046
3203
|
onClose: closeCopyUrlModal,
|
|
3047
3204
|
onCopy: handleCopyUrl
|
|
3048
3205
|
}
|
|
3049
|
-
) }) : /* @__PURE__ */
|
|
3050
|
-
/* @__PURE__ */
|
|
3206
|
+
) }) : /* @__PURE__ */ jsxs16(Fragment8, { children: [
|
|
3207
|
+
/* @__PURE__ */ jsx17(
|
|
3051
3208
|
RepoListHeader,
|
|
3052
3209
|
{
|
|
3053
3210
|
ownerContext,
|
|
@@ -3061,9 +3218,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3061
3218
|
isEnterprise: isEnterpriseOrg
|
|
3062
3219
|
}
|
|
3063
3220
|
),
|
|
3064
|
-
filterMode && /* @__PURE__ */
|
|
3065
|
-
/* @__PURE__ */
|
|
3066
|
-
/* @__PURE__ */
|
|
3221
|
+
filterMode && /* @__PURE__ */ jsxs16(Box16, { marginBottom: 1, children: [
|
|
3222
|
+
/* @__PURE__ */ jsx17(Text17, { children: "Search: " }),
|
|
3223
|
+
/* @__PURE__ */ jsx17(
|
|
3067
3224
|
TextInput5,
|
|
3068
3225
|
{
|
|
3069
3226
|
value: filter,
|
|
@@ -3103,10 +3260,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3103
3260
|
}
|
|
3104
3261
|
)
|
|
3105
3262
|
] }),
|
|
3106
|
-
/* @__PURE__ */
|
|
3107
|
-
filterMode && filter.trim().length > 0 && filter.trim().length < 3 ? /* @__PURE__ */
|
|
3263
|
+
/* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", height: listHeight, children: [
|
|
3264
|
+
filterMode && filter.trim().length > 0 && filter.trim().length < 3 ? /* @__PURE__ */ jsx17(Box16, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "gray", dimColor: true, children: "Type at least 3 characters to search" }) }) : visibleItems.slice(windowed.start, windowed.end).map((repo, i) => {
|
|
3108
3265
|
const idx = windowed.start + i;
|
|
3109
|
-
return /* @__PURE__ */
|
|
3266
|
+
return /* @__PURE__ */ jsx17(
|
|
3110
3267
|
RepoRow,
|
|
3111
3268
|
{
|
|
3112
3269
|
repo,
|
|
@@ -3119,34 +3276,34 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3119
3276
|
repo.nameWithOwner
|
|
3120
3277
|
);
|
|
3121
3278
|
}),
|
|
3122
|
-
loadingMore && hasNextPage && /* @__PURE__ */
|
|
3123
|
-
/* @__PURE__ */
|
|
3124
|
-
/* @__PURE__ */
|
|
3279
|
+
loadingMore && hasNextPage && /* @__PURE__ */ jsx17(Box16, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs16(Box16, { flexDirection: "row", children: [
|
|
3280
|
+
/* @__PURE__ */ jsx17(Box16, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "cyan", children: /* @__PURE__ */ jsx17(SlowSpinner, {}) }) }),
|
|
3281
|
+
/* @__PURE__ */ jsx17(Text17, { color: "cyan", children: "Loading more repositories..." })
|
|
3125
3282
|
] }) }),
|
|
3126
|
-
!loading && !searchLoading && visibleItems.length === 0 && /* @__PURE__ */
|
|
3283
|
+
!loading && !searchLoading && visibleItems.length === 0 && /* @__PURE__ */ jsx17(Box16, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx17(Text17, { color: "gray", dimColor: true, children: searchActive ? "No repositories match your search" : filter ? "No repositories match your filter" : "No repositories found" }) })
|
|
3127
3284
|
] })
|
|
3128
3285
|
] }) }),
|
|
3129
|
-
/* @__PURE__ */
|
|
3130
|
-
/* @__PURE__ */
|
|
3131
|
-
/* @__PURE__ */
|
|
3132
|
-
/* @__PURE__ */
|
|
3133
|
-
/* @__PURE__ */
|
|
3286
|
+
/* @__PURE__ */ jsxs16(Box16, { marginTop: 1, paddingX: 1, flexDirection: "column", children: [
|
|
3287
|
+
/* @__PURE__ */ jsx17(Box16, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx17(Text17, { color: "gray", dimColor: modalOpen ? true : void 0, children: "\u2191\u2193 Navigate \u2022 Ctrl+G Top \u2022 G Bottom \u2022 \u23CE/O Open \u2022 R Refresh" }) }),
|
|
3288
|
+
/* @__PURE__ */ jsx17(Box16, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx17(Text17, { color: "gray", dimColor: modalOpen ? true : void 0, children: "/ Search \u2022 S Sort \u2022 D Direction \u2022 T Density \u2022 F Fork Status \u2022 V Visibility" }) }),
|
|
3289
|
+
/* @__PURE__ */ jsx17(Box16, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx17(Text17, { color: "gray", dimColor: modalOpen ? true : void 0, children: "I Info \u2022 C Copy URL \u2022 Ctrl+R Rename \u2022 Ctrl+A Un/Archive \u2022 Ctrl+V Change Visibility \u2022 Ctrl+S Sync Fork" }) }),
|
|
3290
|
+
/* @__PURE__ */ jsx17(Box16, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx17(Text17, { color: "gray", dimColor: modalOpen ? true : void 0, children: "K Cache Info \u2022 W Org Switch \u2022 Del/Backspace Delete \u2022 Ctrl+L Logout \u2022 Q Quit" }) })
|
|
3134
3291
|
] }),
|
|
3135
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
3136
|
-
/* @__PURE__ */
|
|
3137
|
-
debugMessages.length === 0 ? /* @__PURE__ */
|
|
3292
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsxs16(Box16, { marginTop: 1, borderStyle: "single", borderColor: "yellow", paddingX: 1, flexDirection: "column", children: [
|
|
3293
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, color: "yellow", children: "Debug Messages:" }),
|
|
3294
|
+
debugMessages.length === 0 ? /* @__PURE__ */ jsx17(Text17, { color: "gray", children: "No debug messages yet..." }) : debugMessages.map((msg, i) => /* @__PURE__ */ jsx17(Text17, { color: "gray", children: msg }, i))
|
|
3138
3295
|
] }),
|
|
3139
|
-
copyToast && /* @__PURE__ */
|
|
3296
|
+
copyToast && /* @__PURE__ */ jsx17(Box16, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx17(Box16, { borderStyle: "round", borderColor: copyToast.includes("Failed") ? "red" : "green", paddingX: 2, paddingY: 0, children: /* @__PURE__ */ jsx17(Text17, { color: copyToast.includes("Failed") ? "red" : "green", children: copyToast }) }) })
|
|
3140
3297
|
] });
|
|
3141
3298
|
}
|
|
3142
3299
|
|
|
3143
3300
|
// src/ui/components/auth/AuthMethodSelector.tsx
|
|
3144
|
-
import { useState as
|
|
3145
|
-
import { Box as
|
|
3146
|
-
import
|
|
3147
|
-
import { jsx as
|
|
3301
|
+
import { useState as useState14 } from "react";
|
|
3302
|
+
import { Box as Box17, Text as Text18, useInput as useInput14 } from "ink";
|
|
3303
|
+
import chalk14 from "chalk";
|
|
3304
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3148
3305
|
function AuthMethodSelector({ onSelect, onQuit }) {
|
|
3149
|
-
const [selectedIndex, setSelectedIndex] =
|
|
3306
|
+
const [selectedIndex, setSelectedIndex] = useState14(0);
|
|
3150
3307
|
const methods = [
|
|
3151
3308
|
{
|
|
3152
3309
|
key: "oauth",
|
|
@@ -3159,7 +3316,7 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3159
3316
|
description: "Manually enter a GitHub Personal Access Token"
|
|
3160
3317
|
}
|
|
3161
3318
|
];
|
|
3162
|
-
|
|
3319
|
+
useInput14((input, key) => {
|
|
3163
3320
|
if (key.escape || input?.toLowerCase() === "q") {
|
|
3164
3321
|
if (onQuit) {
|
|
3165
3322
|
onQuit();
|
|
@@ -3178,33 +3335,33 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3178
3335
|
onSelect("pat");
|
|
3179
3336
|
}
|
|
3180
3337
|
});
|
|
3181
|
-
return /* @__PURE__ */
|
|
3182
|
-
/* @__PURE__ */
|
|
3183
|
-
/* @__PURE__ */
|
|
3338
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, children: [
|
|
3339
|
+
/* @__PURE__ */ jsx18(Text18, { bold: true, marginBottom: 1, children: "Choose Authentication Method" }),
|
|
3340
|
+
/* @__PURE__ */ jsx18(Box17, { flexDirection: "column", marginY: 1, children: methods.map((method, index) => {
|
|
3184
3341
|
const isSelected = index === selectedIndex;
|
|
3185
|
-
const prefix = isSelected ?
|
|
3342
|
+
const prefix = isSelected ? chalk14.cyan("\u203A") : " ";
|
|
3186
3343
|
const numberPrefix = `${index + 1}.`;
|
|
3187
|
-
return /* @__PURE__ */
|
|
3188
|
-
/* @__PURE__ */
|
|
3344
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", marginBottom: 1, children: [
|
|
3345
|
+
/* @__PURE__ */ jsx18(Text18, { children: /* @__PURE__ */ jsxs17(Text18, { color: isSelected ? "cyan" : void 0, bold: isSelected, children: [
|
|
3189
3346
|
prefix,
|
|
3190
3347
|
" ",
|
|
3191
3348
|
numberPrefix,
|
|
3192
3349
|
" ",
|
|
3193
3350
|
method.label
|
|
3194
3351
|
] }) }),
|
|
3195
|
-
/* @__PURE__ */
|
|
3352
|
+
/* @__PURE__ */ jsxs17(Text18, { color: "gray", dimColor: true, children: [
|
|
3196
3353
|
" ",
|
|
3197
3354
|
method.description
|
|
3198
3355
|
] })
|
|
3199
3356
|
] }, method.key);
|
|
3200
3357
|
}) }),
|
|
3201
|
-
/* @__PURE__ */
|
|
3358
|
+
/* @__PURE__ */ jsx18(Text18, { color: "gray", dimColor: true, marginTop: 1, children: "Use arrow keys to navigate, Enter to select, or press 1/2 \u2022 Q/Esc to quit" })
|
|
3202
3359
|
] });
|
|
3203
3360
|
}
|
|
3204
3361
|
|
|
3205
3362
|
// src/ui/components/auth/OAuthProgress.tsx
|
|
3206
|
-
import { Box as
|
|
3207
|
-
import { jsx as
|
|
3363
|
+
import { Box as Box18, Text as Text19 } from "ink";
|
|
3364
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3208
3365
|
function OAuthProgress({ status, error, deviceCode }) {
|
|
3209
3366
|
const statusMessages = {
|
|
3210
3367
|
initializing: {
|
|
@@ -3241,69 +3398,69 @@ function OAuthProgress({ status, error, deviceCode }) {
|
|
|
3241
3398
|
}
|
|
3242
3399
|
};
|
|
3243
3400
|
const { message, showSpinner } = statusMessages[status];
|
|
3244
|
-
return /* @__PURE__ */
|
|
3245
|
-
/* @__PURE__ */
|
|
3246
|
-
/* @__PURE__ */
|
|
3247
|
-
/* @__PURE__ */
|
|
3248
|
-
/* @__PURE__ */
|
|
3401
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "single", borderColor: status === "error" ? "red" : "cyan", paddingX: 2, paddingY: 1, children: [
|
|
3402
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, marginBottom: 1, children: "GitHub OAuth Authentication" }),
|
|
3403
|
+
/* @__PURE__ */ jsx19(Box18, { marginY: 1, children: showSpinner ? /* @__PURE__ */ jsxs18(Box18, { children: [
|
|
3404
|
+
/* @__PURE__ */ jsx19(Text19, { color: "green", children: /* @__PURE__ */ jsx19(SlowSpinner, { interval: 2e3 }) }),
|
|
3405
|
+
/* @__PURE__ */ jsxs18(Text19, { children: [
|
|
3249
3406
|
" ",
|
|
3250
3407
|
message
|
|
3251
3408
|
] })
|
|
3252
|
-
] }) : /* @__PURE__ */
|
|
3409
|
+
] }) : /* @__PURE__ */ jsxs18(Text19, { color: status === "error" ? "red" : "green", children: [
|
|
3253
3410
|
status === "error" ? "\u2717" : "\u2713",
|
|
3254
3411
|
" ",
|
|
3255
3412
|
message
|
|
3256
3413
|
] }) }),
|
|
3257
|
-
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */
|
|
3258
|
-
/* @__PURE__ */
|
|
3259
|
-
/* @__PURE__ */
|
|
3260
|
-
/* @__PURE__ */
|
|
3261
|
-
/* @__PURE__ */
|
|
3414
|
+
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */ jsxs18(Box18, { marginY: 1, flexDirection: "column", children: [
|
|
3415
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, color: "cyan", marginBottom: 1, children: "\u{1F4CB} Please complete these steps:" }),
|
|
3416
|
+
/* @__PURE__ */ jsxs18(Box18, { marginBottom: 1, children: [
|
|
3417
|
+
/* @__PURE__ */ jsx19(Text19, { children: "1. Visit: " }),
|
|
3418
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, color: "blue", children: deviceCode.verification_uri })
|
|
3262
3419
|
] }),
|
|
3263
|
-
/* @__PURE__ */
|
|
3264
|
-
/* @__PURE__ */
|
|
3265
|
-
/* @__PURE__ */
|
|
3420
|
+
/* @__PURE__ */ jsxs18(Box18, { marginBottom: 1, flexDirection: "column", children: [
|
|
3421
|
+
/* @__PURE__ */ jsx19(Text19, { children: "2. Enter this code:" }),
|
|
3422
|
+
/* @__PURE__ */ jsx19(Box18, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { bold: true, color: "yellow", children: deviceCode.user_code }) })
|
|
3266
3423
|
] }),
|
|
3267
|
-
status === "waiting_for_authorization" && /* @__PURE__ */
|
|
3268
|
-
status === "polling_for_token" && /* @__PURE__ */
|
|
3269
|
-
/* @__PURE__ */
|
|
3270
|
-
/* @__PURE__ */
|
|
3424
|
+
status === "waiting_for_authorization" && /* @__PURE__ */ jsx19(Text19, { color: "gray", marginTop: 1, children: "Your browser should open automatically." }),
|
|
3425
|
+
status === "polling_for_token" && /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", marginTop: 1, children: [
|
|
3426
|
+
/* @__PURE__ */ jsx19(Text19, { color: "gray", children: "Waiting for you to complete authorization in your browser..." }),
|
|
3427
|
+
/* @__PURE__ */ jsx19(Text19, { color: "gray", dimColor: true, marginTop: 1, children: "This will timeout in 15 minutes. Press Esc to cancel." })
|
|
3271
3428
|
] })
|
|
3272
3429
|
] }),
|
|
3273
|
-
status === "error" && error && /* @__PURE__ */
|
|
3274
|
-
/* @__PURE__ */
|
|
3275
|
-
/* @__PURE__ */
|
|
3430
|
+
status === "error" && error && /* @__PURE__ */ jsxs18(Box18, { marginY: 1, flexDirection: "column", children: [
|
|
3431
|
+
/* @__PURE__ */ jsx19(Text19, { color: "red", children: error }),
|
|
3432
|
+
/* @__PURE__ */ jsx19(Text19, { color: "gray", marginTop: 1, children: "Press Esc to go back and try again." })
|
|
3276
3433
|
] }),
|
|
3277
|
-
status === "success" && /* @__PURE__ */
|
|
3434
|
+
status === "success" && /* @__PURE__ */ jsx19(Text19, { color: "gray", marginTop: 1, children: "Returning to application..." })
|
|
3278
3435
|
] });
|
|
3279
3436
|
}
|
|
3280
3437
|
|
|
3281
3438
|
// src/ui/App.tsx
|
|
3282
|
-
import { jsx as
|
|
3439
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3283
3440
|
var packageJson = require_package();
|
|
3284
3441
|
function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlineTokenEphemeral }) {
|
|
3285
3442
|
const { exit } = useApp2();
|
|
3286
3443
|
const { stdout } = useStdout2();
|
|
3287
|
-
const [mode, setMode] =
|
|
3288
|
-
const [token, setToken] =
|
|
3289
|
-
const [input, setInput] =
|
|
3290
|
-
const [error, setError] =
|
|
3291
|
-
const [viewer, setViewer] =
|
|
3292
|
-
const [rateLimitReset, setRateLimitReset] =
|
|
3293
|
-
const [wasRateLimited, setWasRateLimited] =
|
|
3294
|
-
const [orgContext, setOrgContext] =
|
|
3295
|
-
const [authMethod, setAuthMethod] =
|
|
3296
|
-
const [oauthStatus, setOAuthStatus] =
|
|
3297
|
-
const [tokenSource, setTokenSource] =
|
|
3298
|
-
const [sessionTokenOrigin, setSessionTokenOrigin] =
|
|
3299
|
-
const [deviceCodeResponse, setDeviceCodeResponse] =
|
|
3300
|
-
const [oauthDeviceCode, setOauthDeviceCode] =
|
|
3301
|
-
const [dims, setDims] =
|
|
3444
|
+
const [mode, setMode] = useState15("checking");
|
|
3445
|
+
const [token, setToken] = useState15(null);
|
|
3446
|
+
const [input, setInput] = useState15("");
|
|
3447
|
+
const [error, setError] = useState15(null);
|
|
3448
|
+
const [viewer, setViewer] = useState15(null);
|
|
3449
|
+
const [rateLimitReset, setRateLimitReset] = useState15(null);
|
|
3450
|
+
const [wasRateLimited, setWasRateLimited] = useState15(false);
|
|
3451
|
+
const [orgContext, setOrgContext] = useState15("personal");
|
|
3452
|
+
const [authMethod, setAuthMethod] = useState15("pat");
|
|
3453
|
+
const [oauthStatus, setOAuthStatus] = useState15("initializing");
|
|
3454
|
+
const [tokenSource, setTokenSource] = useState15("pat");
|
|
3455
|
+
const [sessionTokenOrigin, setSessionTokenOrigin] = useState15("stored");
|
|
3456
|
+
const [deviceCodeResponse, setDeviceCodeResponse] = useState15(null);
|
|
3457
|
+
const [oauthDeviceCode, setOauthDeviceCode] = useState15(null);
|
|
3458
|
+
const [dims, setDims] = useState15(() => {
|
|
3302
3459
|
const cols = stdout?.columns ?? 100;
|
|
3303
3460
|
const rows = stdout?.rows ?? 30;
|
|
3304
3461
|
return { cols, rows };
|
|
3305
3462
|
});
|
|
3306
|
-
|
|
3463
|
+
useEffect10(() => {
|
|
3307
3464
|
if (!stdout) return;
|
|
3308
3465
|
const onResize = () => {
|
|
3309
3466
|
const cols = stdout.columns ?? 100;
|
|
@@ -3315,7 +3472,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3315
3472
|
stdout.off?.("resize", onResize);
|
|
3316
3473
|
};
|
|
3317
3474
|
}, [stdout]);
|
|
3318
|
-
|
|
3475
|
+
useEffect10(() => {
|
|
3319
3476
|
const env = getTokenFromEnv();
|
|
3320
3477
|
const stored = getStoredToken();
|
|
3321
3478
|
const source = getTokenSource();
|
|
@@ -3339,7 +3496,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3339
3496
|
setMode("auth_method_selection");
|
|
3340
3497
|
}
|
|
3341
3498
|
}, [inlineToken2]);
|
|
3342
|
-
|
|
3499
|
+
useEffect10(() => {
|
|
3343
3500
|
if (mode !== "oauth_flow") return;
|
|
3344
3501
|
(async () => {
|
|
3345
3502
|
try {
|
|
@@ -3391,7 +3548,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3391
3548
|
setMode("oauth_flow");
|
|
3392
3549
|
}
|
|
3393
3550
|
};
|
|
3394
|
-
|
|
3551
|
+
useEffect10(() => {
|
|
3395
3552
|
(async () => {
|
|
3396
3553
|
if (mode !== "validating" || !token) return;
|
|
3397
3554
|
const timeoutId = setTimeout(() => {
|
|
@@ -3503,7 +3660,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3503
3660
|
setTokenSource("pat");
|
|
3504
3661
|
setMode("auth_method_selection");
|
|
3505
3662
|
};
|
|
3506
|
-
|
|
3663
|
+
useInput15((input2, key) => {
|
|
3507
3664
|
if ((mode === "prompt" || mode === "auth_method_selection") && key.escape) {
|
|
3508
3665
|
exit();
|
|
3509
3666
|
}
|
|
@@ -3534,20 +3691,20 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3534
3691
|
setInput("");
|
|
3535
3692
|
}
|
|
3536
3693
|
});
|
|
3537
|
-
const verticalPadding = Math.floor(dims.rows * 0.
|
|
3538
|
-
const header = useMemo2(() => /* @__PURE__ */
|
|
3539
|
-
/* @__PURE__ */
|
|
3540
|
-
/* @__PURE__ */
|
|
3694
|
+
const verticalPadding = Math.floor(dims.rows * 0.05);
|
|
3695
|
+
const header = useMemo2(() => /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", justifyContent: "space-between", marginBottom: 1, children: [
|
|
3696
|
+
/* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", gap: 1, children: [
|
|
3697
|
+
/* @__PURE__ */ jsxs19(Text20, { bold: true, color: "cyan", children: [
|
|
3541
3698
|
" ",
|
|
3542
3699
|
"GitHub Repository Manager"
|
|
3543
3700
|
] }),
|
|
3544
|
-
/* @__PURE__ */
|
|
3701
|
+
/* @__PURE__ */ jsxs19(Text20, { color: "gray", dimColor: true, children: [
|
|
3545
3702
|
"v",
|
|
3546
3703
|
packageJson.version
|
|
3547
3704
|
] }),
|
|
3548
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
3705
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsx20(Text20, { backgroundColor: "blue", color: "white", children: " debug mode " })
|
|
3549
3706
|
] }),
|
|
3550
|
-
viewer && /* @__PURE__ */
|
|
3707
|
+
viewer && /* @__PURE__ */ jsx20(Text20, { color: "gray", children: orgContext !== "personal" && orgContext.login ? `${orgContext.login}/@${viewer} ` : `@${viewer} ` })
|
|
3551
3708
|
] }), [viewer, orgContext]);
|
|
3552
3709
|
if (mode === "rate_limited") {
|
|
3553
3710
|
const formatResetTime = (resetTime) => {
|
|
@@ -3570,70 +3727,70 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3570
3727
|
return "Unknown";
|
|
3571
3728
|
}
|
|
3572
3729
|
};
|
|
3573
|
-
return /* @__PURE__ */
|
|
3730
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3574
3731
|
header,
|
|
3575
|
-
/* @__PURE__ */
|
|
3576
|
-
/* @__PURE__ */
|
|
3577
|
-
/* @__PURE__ */
|
|
3578
|
-
/* @__PURE__ */
|
|
3579
|
-
rateLimitReset && /* @__PURE__ */
|
|
3580
|
-
/* @__PURE__ */
|
|
3581
|
-
/* @__PURE__ */
|
|
3732
|
+
/* @__PURE__ */ jsx20(Box19, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs19(Box19, { borderStyle: "single", borderColor: "yellow", paddingX: 3, paddingY: 2, flexDirection: "column", width: Math.min(dims.cols - 8, 80), children: [
|
|
3733
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, color: "yellow", marginBottom: 1, children: "\u26A0\uFE0F Rate Limit Exceeded" }),
|
|
3734
|
+
/* @__PURE__ */ jsx20(Text20, { color: "gray", marginBottom: 1, children: "You've hit GitHub's API rate limit for your token." }),
|
|
3735
|
+
/* @__PURE__ */ jsx20(Text20, { color: "gray", marginBottom: 1, children: "This happens when you make too many requests in a short time." }),
|
|
3736
|
+
rateLimitReset && /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, marginBottom: 1, children: [
|
|
3737
|
+
/* @__PURE__ */ jsxs19(Text20, { children: [
|
|
3738
|
+
/* @__PURE__ */ jsx20(Text20, { color: "cyan", children: "Reset in:" }),
|
|
3582
3739
|
" ",
|
|
3583
|
-
/* @__PURE__ */
|
|
3740
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, children: formatResetTime(rateLimitReset) })
|
|
3584
3741
|
] }),
|
|
3585
|
-
/* @__PURE__ */
|
|
3742
|
+
/* @__PURE__ */ jsxs19(Text20, { color: "gray", dimColor: true, children: [
|
|
3586
3743
|
"(",
|
|
3587
3744
|
new Date(rateLimitReset).toLocaleTimeString(),
|
|
3588
3745
|
")"
|
|
3589
3746
|
] })
|
|
3590
3747
|
] }),
|
|
3591
|
-
/* @__PURE__ */
|
|
3592
|
-
/* @__PURE__ */
|
|
3593
|
-
/* @__PURE__ */
|
|
3594
|
-
/* @__PURE__ */
|
|
3595
|
-
/* @__PURE__ */
|
|
3748
|
+
/* @__PURE__ */ jsxs19(Box19, { marginTop: 2, flexDirection: "column", gap: 1, children: [
|
|
3749
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, children: "What would you like to do?" }),
|
|
3750
|
+
/* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", paddingLeft: 2, children: [
|
|
3751
|
+
/* @__PURE__ */ jsxs19(Text20, { children: [
|
|
3752
|
+
/* @__PURE__ */ jsx20(Text20, { color: "cyan", bold: true, children: "R" }),
|
|
3596
3753
|
" - Retry now ",
|
|
3597
3754
|
rateLimitReset && formatResetTime(rateLimitReset) !== "Now (should be reset)" ? "(likely to fail until reset)" : "(should work now)"
|
|
3598
3755
|
] }),
|
|
3599
|
-
/* @__PURE__ */
|
|
3600
|
-
/* @__PURE__ */
|
|
3756
|
+
/* @__PURE__ */ jsxs19(Text20, { children: [
|
|
3757
|
+
/* @__PURE__ */ jsx20(Text20, { color: "cyan", bold: true, children: "L" }),
|
|
3601
3758
|
" - Logout and choose authentication method"
|
|
3602
3759
|
] }),
|
|
3603
|
-
/* @__PURE__ */
|
|
3604
|
-
/* @__PURE__ */
|
|
3760
|
+
/* @__PURE__ */ jsxs19(Text20, { children: [
|
|
3761
|
+
/* @__PURE__ */ jsx20(Text20, { color: "gray", bold: true, children: "Q/Esc" }),
|
|
3605
3762
|
" - Quit application"
|
|
3606
3763
|
] })
|
|
3607
3764
|
] })
|
|
3608
3765
|
] }),
|
|
3609
|
-
/* @__PURE__ */
|
|
3766
|
+
/* @__PURE__ */ jsx20(Text20, { color: "gray", dimColor: true, marginTop: 2, children: "Tip: Using multiple tokens or waiting between requests can help avoid rate limits." })
|
|
3610
3767
|
] }) })
|
|
3611
3768
|
] });
|
|
3612
3769
|
}
|
|
3613
3770
|
if (mode === "auth_method_selection") {
|
|
3614
|
-
return /* @__PURE__ */
|
|
3771
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3615
3772
|
header,
|
|
3616
|
-
/* @__PURE__ */
|
|
3617
|
-
/* @__PURE__ */
|
|
3618
|
-
error && /* @__PURE__ */
|
|
3773
|
+
/* @__PURE__ */ jsx20(Box19, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", alignItems: "center", children: [
|
|
3774
|
+
/* @__PURE__ */ jsx20(AuthMethodSelector, { onSelect: handleAuthMethodSelect }),
|
|
3775
|
+
error && /* @__PURE__ */ jsx20(Text20, { color: "red", marginTop: 1, children: error })
|
|
3619
3776
|
] }) })
|
|
3620
3777
|
] });
|
|
3621
3778
|
}
|
|
3622
3779
|
if (mode === "oauth_flow") {
|
|
3623
|
-
return /* @__PURE__ */
|
|
3780
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3624
3781
|
header,
|
|
3625
|
-
/* @__PURE__ */
|
|
3782
|
+
/* @__PURE__ */ jsx20(Box19, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx20(OAuthProgress, { status: oauthStatus, error: error || void 0, deviceCode: oauthDeviceCode || void 0 }) })
|
|
3626
3783
|
] });
|
|
3627
3784
|
}
|
|
3628
3785
|
if (mode === "prompt") {
|
|
3629
|
-
return /* @__PURE__ */
|
|
3786
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3630
3787
|
header,
|
|
3631
|
-
/* @__PURE__ */
|
|
3632
|
-
/* @__PURE__ */
|
|
3633
|
-
/* @__PURE__ */
|
|
3634
|
-
/* @__PURE__ */
|
|
3635
|
-
/* @__PURE__ */
|
|
3636
|
-
/* @__PURE__ */
|
|
3788
|
+
/* @__PURE__ */ jsx20(Box19, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs19(Box19, { borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, flexDirection: "column", children: [
|
|
3789
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, marginBottom: 1, children: "Authentication Required" }),
|
|
3790
|
+
/* @__PURE__ */ jsx20(Text20, { color: "gray", marginBottom: 1, children: "Enter your GitHub Personal Access Token" }),
|
|
3791
|
+
/* @__PURE__ */ jsxs19(Box19, { children: [
|
|
3792
|
+
/* @__PURE__ */ jsx20(Text20, { children: "Token: " }),
|
|
3793
|
+
/* @__PURE__ */ jsx20(
|
|
3637
3794
|
TextInput6,
|
|
3638
3795
|
{
|
|
3639
3796
|
value: input,
|
|
@@ -3643,30 +3800,30 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3643
3800
|
}
|
|
3644
3801
|
)
|
|
3645
3802
|
] }),
|
|
3646
|
-
error && /* @__PURE__ */
|
|
3647
|
-
/* @__PURE__ */
|
|
3648
|
-
/* @__PURE__ */
|
|
3803
|
+
error && /* @__PURE__ */ jsx20(Text20, { color: "red", marginTop: 1, children: error }),
|
|
3804
|
+
/* @__PURE__ */ jsx20(Text20, { color: "gray", dimColor: true, marginTop: 1, children: "The token will be stored securely in your local config" }),
|
|
3805
|
+
/* @__PURE__ */ jsx20(Text20, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to go back" })
|
|
3649
3806
|
] }) })
|
|
3650
3807
|
] });
|
|
3651
3808
|
}
|
|
3652
3809
|
if (mode === "validating" || mode === "checking") {
|
|
3653
|
-
return /* @__PURE__ */
|
|
3810
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3654
3811
|
header,
|
|
3655
|
-
/* @__PURE__ */
|
|
3656
|
-
/* @__PURE__ */
|
|
3657
|
-
mode === "validating" && /* @__PURE__ */
|
|
3812
|
+
/* @__PURE__ */ jsx20(Box19, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", alignItems: "center", children: [
|
|
3813
|
+
/* @__PURE__ */ jsx20(Text20, { color: "yellow", children: "Validating token..." }),
|
|
3814
|
+
mode === "validating" && /* @__PURE__ */ jsx20(Text20, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to cancel" })
|
|
3658
3815
|
] }) })
|
|
3659
3816
|
] });
|
|
3660
3817
|
}
|
|
3661
3818
|
if (mode === "error") {
|
|
3662
|
-
return /* @__PURE__ */
|
|
3819
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3663
3820
|
header,
|
|
3664
|
-
/* @__PURE__ */
|
|
3821
|
+
/* @__PURE__ */ jsx20(Box19, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx20(Text20, { color: "red", children: error ?? "Unexpected error" }) })
|
|
3665
3822
|
] });
|
|
3666
3823
|
}
|
|
3667
|
-
return /* @__PURE__ */
|
|
3824
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3668
3825
|
header,
|
|
3669
|
-
/* @__PURE__ */
|
|
3826
|
+
/* @__PURE__ */ jsx20(
|
|
3670
3827
|
RepoList,
|
|
3671
3828
|
{
|
|
3672
3829
|
token,
|
|
@@ -3681,7 +3838,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3681
3838
|
}
|
|
3682
3839
|
|
|
3683
3840
|
// src/index.tsx
|
|
3684
|
-
import { jsx as
|
|
3841
|
+
import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3685
3842
|
var argv = process.argv.slice(2);
|
|
3686
3843
|
var getFlagValue = (name) => {
|
|
3687
3844
|
const idx = argv.findIndex((a) => a === `--${name}` || a.startsWith(`--${name}=`));
|
|
@@ -3778,8 +3935,8 @@ var inlineToken = (() => {
|
|
|
3778
3935
|
})();
|
|
3779
3936
|
logger.debug("Rendering UI");
|
|
3780
3937
|
var { unmount } = render(
|
|
3781
|
-
/* @__PURE__ */
|
|
3782
|
-
/* @__PURE__ */
|
|
3783
|
-
/* @__PURE__ */
|
|
3938
|
+
/* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", children: [
|
|
3939
|
+
/* @__PURE__ */ jsx21(App, { initialOrgSlug, inlineToken, inlineTokenEphemeral: Boolean(inlineToken) }),
|
|
3940
|
+
/* @__PURE__ */ jsx21(Text21, { color: "gray" })
|
|
3784
3941
|
] })
|
|
3785
3942
|
);
|