gh-manager-cli 1.45.0 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +7 -0
- package/dist/index.js +1564 -551
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ var require_package = __commonJS({
|
|
|
37
37
|
"package.json"(exports, module) {
|
|
38
38
|
module.exports = {
|
|
39
39
|
name: "gh-manager-cli",
|
|
40
|
-
version: "1.
|
|
40
|
+
version: "1.46.0",
|
|
41
41
|
private: false,
|
|
42
42
|
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",
|
|
43
43
|
license: "MIT",
|
|
@@ -157,13 +157,13 @@ var require_package = __commonJS({
|
|
|
157
157
|
|
|
158
158
|
// src/index.tsx
|
|
159
159
|
var import_package = __toESM(require_package(), 1);
|
|
160
|
-
import { render, Box as
|
|
160
|
+
import { render, Box as Box32, Text as Text33 } from "ink";
|
|
161
161
|
import "dotenv/config";
|
|
162
162
|
|
|
163
163
|
// src/ui/App.tsx
|
|
164
|
-
import { useEffect as useEffect14, useMemo as useMemo3, useState as
|
|
165
|
-
import { Box as
|
|
166
|
-
import
|
|
164
|
+
import { useEffect as useEffect14, useMemo as useMemo3, useState as useState26 } from "react";
|
|
165
|
+
import { Box as Box31, Text as Text32, useApp as useApp2, useStdout as useStdout2, useInput as useInput26 } from "ink";
|
|
166
|
+
import TextInput9 from "ink-text-input";
|
|
167
167
|
|
|
168
168
|
// src/config/config.ts
|
|
169
169
|
import fs from "fs";
|
|
@@ -411,10 +411,10 @@ async function openGitHubAuthorizationPage() {
|
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
// src/ui/views/RepoList.tsx
|
|
414
|
-
import
|
|
415
|
-
import { Box as
|
|
416
|
-
import
|
|
417
|
-
import
|
|
414
|
+
import React24, { useEffect as useEffect13, useMemo as useMemo2, useState as useState24, useRef as useRef8, useCallback } from "react";
|
|
415
|
+
import { Box as Box28, Text as Text29, useApp, useInput as useInput24, useStdout } from "ink";
|
|
416
|
+
import TextInput8 from "ink-text-input";
|
|
417
|
+
import chalk20 from "chalk";
|
|
418
418
|
|
|
419
419
|
// src/config/themes.ts
|
|
420
420
|
var THEMES = {
|
|
@@ -813,7 +813,7 @@ function ArchiveFilterModal({
|
|
|
813
813
|
}
|
|
814
814
|
|
|
815
815
|
// src/ui/components/modals/DeleteModal.tsx
|
|
816
|
-
import {
|
|
816
|
+
import { useEffect as useEffect4, useRef, useState as useState4 } from "react";
|
|
817
817
|
import { Box as Box3, Text as Text4, useInput as useInput3 } from "ink";
|
|
818
818
|
import TextInput from "ink-text-input";
|
|
819
819
|
import chalk4 from "chalk";
|
|
@@ -838,13 +838,13 @@ function SlowSpinner({ interval = 500 } = {}) {
|
|
|
838
838
|
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
839
839
|
|
|
840
840
|
// src/ui/components/modals/ArchiveModal.tsx
|
|
841
|
-
import { useState as useState5 } from "react";
|
|
841
|
+
import { useRef as useRef2, useState as useState5 } from "react";
|
|
842
842
|
import { Box as Box4, Text as Text5, useInput as useInput4 } from "ink";
|
|
843
843
|
import chalk5 from "chalk";
|
|
844
844
|
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
845
845
|
|
|
846
846
|
// src/ui/components/modals/SyncModal.tsx
|
|
847
|
-
import { useState as useState6 } from "react";
|
|
847
|
+
import { useRef as useRef3, useState as useState6 } from "react";
|
|
848
848
|
import { Box as Box5, Text as Text6, useInput as useInput5 } from "ink";
|
|
849
849
|
import chalk6 from "chalk";
|
|
850
850
|
import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
@@ -1370,6 +1370,7 @@ var ChangeVisibilityModal = ({
|
|
|
1370
1370
|
}, [isOpen, isFork]);
|
|
1371
1371
|
useInput11((input, key) => {
|
|
1372
1372
|
if (!isOpen) return;
|
|
1373
|
+
if (changing) return;
|
|
1373
1374
|
if (key.escape || input?.toLowerCase() === "c") {
|
|
1374
1375
|
onClose();
|
|
1375
1376
|
return;
|
|
@@ -1523,6 +1524,7 @@ var ChangeVisibilityModal = ({
|
|
|
1523
1524
|
onChange: () => {
|
|
1524
1525
|
},
|
|
1525
1526
|
onSubmit: () => {
|
|
1527
|
+
if (changing) return;
|
|
1526
1528
|
if (isFork || focusedButton === "cancel") {
|
|
1527
1529
|
onClose();
|
|
1528
1530
|
} else {
|
|
@@ -1666,7 +1668,7 @@ function CopyUrlModal({ repo, terminalWidth, onClose, onCopy, theme: themeProp }
|
|
|
1666
1668
|
}
|
|
1667
1669
|
|
|
1668
1670
|
// src/ui/components/modals/RenameModal.tsx
|
|
1669
|
-
import {
|
|
1671
|
+
import { useEffect as useEffect9, useRef as useRef4, useState as useState13 } from "react";
|
|
1670
1672
|
import { Box as Box13, Text as Text14, useInput as useInput13 } from "ink";
|
|
1671
1673
|
import TextInput3 from "ink-text-input";
|
|
1672
1674
|
import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
@@ -1674,6 +1676,7 @@ function RenameModal({ repo, onRename, onCancel, theme: themeProp }) {
|
|
|
1674
1676
|
const { theme } = useTheme(themeProp?.name ?? "default");
|
|
1675
1677
|
const [newName, setNewName] = useState13("");
|
|
1676
1678
|
const [renaming, setRenaming] = useState13(false);
|
|
1679
|
+
const renamingRef = useRef4(false);
|
|
1677
1680
|
const [renameError, setRenameError] = useState13(null);
|
|
1678
1681
|
useEffect9(() => {
|
|
1679
1682
|
if (repo) {
|
|
@@ -1682,7 +1685,7 @@ function RenameModal({ repo, onRename, onCancel, theme: themeProp }) {
|
|
|
1682
1685
|
}
|
|
1683
1686
|
}, [repo]);
|
|
1684
1687
|
useInput13((input, key) => {
|
|
1685
|
-
if (
|
|
1688
|
+
if (renamingRef.current) return;
|
|
1686
1689
|
if (key.escape) {
|
|
1687
1690
|
onCancel();
|
|
1688
1691
|
return;
|
|
@@ -1695,13 +1698,15 @@ function RenameModal({ repo, onRename, onCancel, theme: themeProp }) {
|
|
|
1695
1698
|
}
|
|
1696
1699
|
});
|
|
1697
1700
|
const handleRenameConfirm = async () => {
|
|
1698
|
-
if (!repo ||
|
|
1701
|
+
if (!repo || renamingRef.current || !newName.trim() || newName === repo.name) return;
|
|
1699
1702
|
try {
|
|
1703
|
+
renamingRef.current = true;
|
|
1700
1704
|
setRenaming(true);
|
|
1701
1705
|
setRenameError(null);
|
|
1702
1706
|
await onRename(repo, newName.trim());
|
|
1703
1707
|
} catch (e) {
|
|
1704
1708
|
setRenameError(e.message || "Failed to rename repository");
|
|
1709
|
+
renamingRef.current = false;
|
|
1705
1710
|
setRenaming(false);
|
|
1706
1711
|
}
|
|
1707
1712
|
};
|
|
@@ -1777,6 +1782,7 @@ function StarModal({
|
|
|
1777
1782
|
const [focusedButton, setFocusedButton] = useState14("cancel");
|
|
1778
1783
|
useInput14((input, key) => {
|
|
1779
1784
|
if (!visible) return;
|
|
1785
|
+
if (isStarring) return;
|
|
1780
1786
|
if (key.escape || input === "c" || input === "C") {
|
|
1781
1787
|
onCancel();
|
|
1782
1788
|
return;
|
|
@@ -1882,16 +1888,699 @@ function StarModal({
|
|
|
1882
1888
|
);
|
|
1883
1889
|
}
|
|
1884
1890
|
|
|
1885
|
-
// src/ui/components/modals/
|
|
1891
|
+
// src/ui/components/modals/BulkReviewModal.tsx
|
|
1886
1892
|
import { useState as useState15 } from "react";
|
|
1887
1893
|
import { Box as Box15, Text as Text16, useInput as useInput15 } from "ink";
|
|
1888
|
-
import
|
|
1894
|
+
import chalk14 from "chalk";
|
|
1895
|
+
import { Fragment as Fragment8, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1896
|
+
function BulkReviewModal({
|
|
1897
|
+
selectedRepos,
|
|
1898
|
+
actionLabel,
|
|
1899
|
+
actionColor,
|
|
1900
|
+
onConfirm,
|
|
1901
|
+
onCancel,
|
|
1902
|
+
terminalWidth = 80,
|
|
1903
|
+
maxHeight = 20
|
|
1904
|
+
}) {
|
|
1905
|
+
const repos = Array.from(selectedRepos.values());
|
|
1906
|
+
const [localSelection, setLocalSelection] = useState15(
|
|
1907
|
+
new Map(selectedRepos)
|
|
1908
|
+
);
|
|
1909
|
+
const [listCursor, setListCursor] = useState15(0);
|
|
1910
|
+
const [focusArea, setFocusArea] = useState15("list");
|
|
1911
|
+
const [buttonFocus, setButtonFocus] = useState15("confirm");
|
|
1912
|
+
const localRepos = Array.from(localSelection.values());
|
|
1913
|
+
const maxListHeight = Math.max(3, maxHeight - 10);
|
|
1914
|
+
const listStart = Math.max(0, listCursor - Math.floor(maxListHeight / 2));
|
|
1915
|
+
const listEnd = Math.min(localRepos.length, listStart + maxListHeight);
|
|
1916
|
+
const bgColor = `bg${actionColor.charAt(0).toUpperCase()}${actionColor.slice(1)}`;
|
|
1917
|
+
useInput15((input, key) => {
|
|
1918
|
+
if (key.escape || input.toLowerCase() === "c") {
|
|
1919
|
+
onCancel();
|
|
1920
|
+
return;
|
|
1921
|
+
}
|
|
1922
|
+
if (focusArea === "list") {
|
|
1923
|
+
if (key.upArrow) {
|
|
1924
|
+
setListCursor((c) => Math.max(0, c - 1));
|
|
1925
|
+
return;
|
|
1926
|
+
}
|
|
1927
|
+
if (key.downArrow) {
|
|
1928
|
+
setListCursor((c) => Math.min(localRepos.length - 1, c + 1));
|
|
1929
|
+
return;
|
|
1930
|
+
}
|
|
1931
|
+
if (input === " ") {
|
|
1932
|
+
const repo = localRepos[listCursor];
|
|
1933
|
+
if (repo) {
|
|
1934
|
+
const next = new Map(localSelection);
|
|
1935
|
+
next.delete(repo.id);
|
|
1936
|
+
if (next.size === 0) {
|
|
1937
|
+
onCancel();
|
|
1938
|
+
return;
|
|
1939
|
+
}
|
|
1940
|
+
setLocalSelection(next);
|
|
1941
|
+
setListCursor((c) => Math.min(c, Math.max(0, next.size - 1)));
|
|
1942
|
+
}
|
|
1943
|
+
return;
|
|
1944
|
+
}
|
|
1945
|
+
if (key.tab || key.return) {
|
|
1946
|
+
if (localSelection.size === 0) {
|
|
1947
|
+
onCancel();
|
|
1948
|
+
return;
|
|
1949
|
+
}
|
|
1950
|
+
setFocusArea("buttons");
|
|
1951
|
+
return;
|
|
1952
|
+
}
|
|
1953
|
+
return;
|
|
1954
|
+
}
|
|
1955
|
+
if (key.leftArrow) {
|
|
1956
|
+
setButtonFocus("confirm");
|
|
1957
|
+
return;
|
|
1958
|
+
}
|
|
1959
|
+
if (key.rightArrow) {
|
|
1960
|
+
setButtonFocus("cancel");
|
|
1961
|
+
return;
|
|
1962
|
+
}
|
|
1963
|
+
if (key.tab) {
|
|
1964
|
+
setButtonFocus((f) => f === "confirm" ? "cancel" : "confirm");
|
|
1965
|
+
return;
|
|
1966
|
+
}
|
|
1967
|
+
if (input.toLowerCase() === "y" || key.return && buttonFocus === "confirm") {
|
|
1968
|
+
if (localSelection.size > 0) onConfirm(localSelection);
|
|
1969
|
+
return;
|
|
1970
|
+
}
|
|
1971
|
+
if (key.return && buttonFocus === "cancel") {
|
|
1972
|
+
onCancel();
|
|
1973
|
+
return;
|
|
1974
|
+
}
|
|
1975
|
+
if (key.upArrow) {
|
|
1976
|
+
setFocusArea("list");
|
|
1977
|
+
return;
|
|
1978
|
+
}
|
|
1979
|
+
});
|
|
1980
|
+
const modalWidth = Math.min(terminalWidth - 4, 72);
|
|
1981
|
+
return /* @__PURE__ */ jsxs15(
|
|
1982
|
+
Box15,
|
|
1983
|
+
{
|
|
1984
|
+
flexDirection: "column",
|
|
1985
|
+
borderStyle: "round",
|
|
1986
|
+
borderColor: actionColor,
|
|
1987
|
+
paddingX: 2,
|
|
1988
|
+
paddingY: 1,
|
|
1989
|
+
width: modalWidth,
|
|
1990
|
+
children: [
|
|
1991
|
+
/* @__PURE__ */ jsxs15(Text16, { bold: true, color: actionColor, children: [
|
|
1992
|
+
"Bulk ",
|
|
1993
|
+
actionLabel,
|
|
1994
|
+
" \u2014 Review Selection"
|
|
1995
|
+
] }),
|
|
1996
|
+
/* @__PURE__ */ jsx16(Box15, { height: 1, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) }),
|
|
1997
|
+
/* @__PURE__ */ jsx16(Text16, { children: localRepos.length === 0 ? chalk14.gray("No repositories selected.") : `${localRepos.length} repositor${localRepos.length === 1 ? "y" : "ies"} selected:` }),
|
|
1998
|
+
/* @__PURE__ */ jsx16(Box15, { height: 1, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) }),
|
|
1999
|
+
localRepos.length > 0 && /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", children: [
|
|
2000
|
+
localRepos.slice(listStart, listEnd).map((repo, relIdx) => {
|
|
2001
|
+
const absIdx = listStart + relIdx;
|
|
2002
|
+
const isCursorRow = focusArea === "list" && absIdx === listCursor;
|
|
2003
|
+
let line = "";
|
|
2004
|
+
if (isCursorRow) {
|
|
2005
|
+
line += chalk14.bgCyan.black(` \u2713 ${repo.nameWithOwner.padEnd(Math.max(0, modalWidth - 10))} `);
|
|
2006
|
+
} else {
|
|
2007
|
+
line += chalk14.cyan(" \u2713 ") + chalk14.white(repo.nameWithOwner);
|
|
2008
|
+
}
|
|
2009
|
+
if (repo.isPrivate) line += chalk14.yellow(" Private");
|
|
2010
|
+
else if (repo.visibility === "INTERNAL") line += chalk14.magenta(" Internal");
|
|
2011
|
+
if (repo.isArchived) line += chalk14.gray(" Archived");
|
|
2012
|
+
return /* @__PURE__ */ jsx16(Box15, { children: /* @__PURE__ */ jsx16(Text16, { children: line }) }, repo.id);
|
|
2013
|
+
}),
|
|
2014
|
+
localRepos.length > maxListHeight && /* @__PURE__ */ jsx16(Text16, { color: "gray", children: ` \u2026 ${listStart > 0 ? `${listStart} above \xB7 ` : ""}${localRepos.length - listEnd > 0 ? `${localRepos.length - listEnd} below` : ""}` })
|
|
2015
|
+
] }),
|
|
2016
|
+
/* @__PURE__ */ jsx16(Box15, { height: 1, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) }),
|
|
2017
|
+
/* @__PURE__ */ jsx16(Text16, { color: "gray", children: "\u2191\u2193 navigate \xB7 Space unselect \xB7 Tab to buttons" }),
|
|
2018
|
+
/* @__PURE__ */ jsx16(Box15, { height: 1, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) }),
|
|
2019
|
+
localRepos.length === 0 ? /* @__PURE__ */ jsx16(Box15, { flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsx16(Text16, { color: "gray", children: "All repos removed from selection \u2014 press Esc to cancel" }) }) : /* @__PURE__ */ jsxs15(Fragment8, { children: [
|
|
2020
|
+
/* @__PURE__ */ jsxs15(Box15, { flexDirection: "row", justifyContent: "center", gap: 4, children: [
|
|
2021
|
+
/* @__PURE__ */ jsx16(
|
|
2022
|
+
Box15,
|
|
2023
|
+
{
|
|
2024
|
+
borderStyle: "round",
|
|
2025
|
+
borderColor: focusArea === "buttons" && buttonFocus === "confirm" ? actionColor : "gray",
|
|
2026
|
+
height: 3,
|
|
2027
|
+
width: 22,
|
|
2028
|
+
alignItems: "center",
|
|
2029
|
+
justifyContent: "center",
|
|
2030
|
+
children: /* @__PURE__ */ jsx16(Text16, { children: focusArea === "buttons" && buttonFocus === "confirm" ? chalk14[bgColor].black.bold(` ${actionLabel} all `) : chalk14[actionColor].bold(`${actionLabel} all`) })
|
|
2031
|
+
}
|
|
2032
|
+
),
|
|
2033
|
+
/* @__PURE__ */ jsx16(
|
|
2034
|
+
Box15,
|
|
2035
|
+
{
|
|
2036
|
+
borderStyle: "round",
|
|
2037
|
+
borderColor: focusArea === "buttons" && buttonFocus === "cancel" ? "white" : "gray",
|
|
2038
|
+
height: 3,
|
|
2039
|
+
width: 22,
|
|
2040
|
+
alignItems: "center",
|
|
2041
|
+
justifyContent: "center",
|
|
2042
|
+
children: /* @__PURE__ */ jsx16(Text16, { children: focusArea === "buttons" && buttonFocus === "cancel" ? chalk14.bgGray.white.bold(" Cancel ") : chalk14.gray.bold("Cancel") })
|
|
2043
|
+
}
|
|
2044
|
+
)
|
|
2045
|
+
] }),
|
|
2046
|
+
/* @__PURE__ */ jsx16(Box15, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs15(Text16, { color: "gray", children: [
|
|
2047
|
+
"Tab/\u2191\u2193 navigate \xB7 Enter confirm \xB7 Y to ",
|
|
2048
|
+
actionLabel,
|
|
2049
|
+
" \xB7 C to Cancel"
|
|
2050
|
+
] }) })
|
|
2051
|
+
] })
|
|
2052
|
+
]
|
|
2053
|
+
}
|
|
2054
|
+
);
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
// src/ui/components/modals/BulkConfirmModal.tsx
|
|
2058
|
+
import { useRef as useRef5, useState as useState16 } from "react";
|
|
2059
|
+
import { Box as Box16, Text as Text17, useInput as useInput16 } from "ink";
|
|
2060
|
+
import chalk15 from "chalk";
|
|
2061
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2062
|
+
function BulkConfirmModal({
|
|
2063
|
+
count,
|
|
2064
|
+
actionLabel,
|
|
2065
|
+
actionColor,
|
|
2066
|
+
actionVerb,
|
|
2067
|
+
onConfirm,
|
|
2068
|
+
onCancel,
|
|
2069
|
+
terminalWidth = 80
|
|
2070
|
+
}) {
|
|
2071
|
+
const [buttonFocus, setButtonFocus] = useState16("confirm");
|
|
2072
|
+
const settledRef = useRef5(false);
|
|
2073
|
+
const confirmOnce = () => {
|
|
2074
|
+
if (settledRef.current) return;
|
|
2075
|
+
settledRef.current = true;
|
|
2076
|
+
onConfirm();
|
|
2077
|
+
};
|
|
2078
|
+
const cancelOnce = () => {
|
|
2079
|
+
if (settledRef.current) return;
|
|
2080
|
+
settledRef.current = true;
|
|
2081
|
+
onCancel();
|
|
2082
|
+
};
|
|
2083
|
+
const bgColor = `bg${actionColor.charAt(0).toUpperCase()}${actionColor.slice(1)}`;
|
|
2084
|
+
useInput16((input, key) => {
|
|
2085
|
+
if (key.escape || input.toLowerCase() === "c") {
|
|
2086
|
+
cancelOnce();
|
|
2087
|
+
return;
|
|
2088
|
+
}
|
|
2089
|
+
if (key.leftArrow) {
|
|
2090
|
+
setButtonFocus("confirm");
|
|
2091
|
+
return;
|
|
2092
|
+
}
|
|
2093
|
+
if (key.rightArrow) {
|
|
2094
|
+
setButtonFocus("cancel");
|
|
2095
|
+
return;
|
|
2096
|
+
}
|
|
2097
|
+
if (input.toLowerCase() === "y" || key.return && buttonFocus === "confirm") {
|
|
2098
|
+
confirmOnce();
|
|
2099
|
+
return;
|
|
2100
|
+
}
|
|
2101
|
+
if (key.return && buttonFocus === "cancel") {
|
|
2102
|
+
cancelOnce();
|
|
2103
|
+
return;
|
|
2104
|
+
}
|
|
2105
|
+
});
|
|
2106
|
+
const modalWidth = Math.min(terminalWidth - 4, 68);
|
|
2107
|
+
return /* @__PURE__ */ jsxs16(
|
|
2108
|
+
Box16,
|
|
2109
|
+
{
|
|
2110
|
+
flexDirection: "column",
|
|
2111
|
+
borderStyle: "round",
|
|
2112
|
+
borderColor: actionColor,
|
|
2113
|
+
paddingX: 2,
|
|
2114
|
+
paddingY: 1,
|
|
2115
|
+
width: modalWidth,
|
|
2116
|
+
children: [
|
|
2117
|
+
/* @__PURE__ */ jsxs16(Text17, { bold: true, color: actionColor, children: [
|
|
2118
|
+
"Bulk ",
|
|
2119
|
+
actionLabel,
|
|
2120
|
+
" Confirmation"
|
|
2121
|
+
] }),
|
|
2122
|
+
/* @__PURE__ */ jsx17(Box16, { height: 1, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) }),
|
|
2123
|
+
/* @__PURE__ */ jsxs16(Text17, { children: [
|
|
2124
|
+
"About to",
|
|
2125
|
+
" ",
|
|
2126
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, color: actionColor, children: actionVerb }),
|
|
2127
|
+
" ",
|
|
2128
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, children: count }),
|
|
2129
|
+
" ",
|
|
2130
|
+
"repositor",
|
|
2131
|
+
count === 1 ? "y" : "ies",
|
|
2132
|
+
"."
|
|
2133
|
+
] }),
|
|
2134
|
+
/* @__PURE__ */ jsx17(Box16, { height: 1, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) }),
|
|
2135
|
+
/* @__PURE__ */ jsxs16(Box16, { flexDirection: "row", justifyContent: "center", gap: 4, children: [
|
|
2136
|
+
/* @__PURE__ */ jsx17(
|
|
2137
|
+
Box16,
|
|
2138
|
+
{
|
|
2139
|
+
borderStyle: "round",
|
|
2140
|
+
borderColor: buttonFocus === "confirm" ? actionColor : "gray",
|
|
2141
|
+
height: 3,
|
|
2142
|
+
width: 22,
|
|
2143
|
+
alignItems: "center",
|
|
2144
|
+
justifyContent: "center",
|
|
2145
|
+
children: /* @__PURE__ */ jsx17(Text17, { children: buttonFocus === "confirm" ? chalk15[bgColor].black.bold(` ${actionLabel} `) : chalk15[actionColor].bold(actionLabel) })
|
|
2146
|
+
}
|
|
2147
|
+
),
|
|
2148
|
+
/* @__PURE__ */ jsx17(
|
|
2149
|
+
Box16,
|
|
2150
|
+
{
|
|
2151
|
+
borderStyle: "round",
|
|
2152
|
+
borderColor: buttonFocus === "cancel" ? "white" : "gray",
|
|
2153
|
+
height: 3,
|
|
2154
|
+
width: 22,
|
|
2155
|
+
alignItems: "center",
|
|
2156
|
+
justifyContent: "center",
|
|
2157
|
+
children: /* @__PURE__ */ jsx17(Text17, { children: buttonFocus === "cancel" ? chalk15.bgGray.white.bold(" Cancel ") : chalk15.gray.bold("Cancel") })
|
|
2158
|
+
}
|
|
2159
|
+
)
|
|
2160
|
+
] }),
|
|
2161
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsx17(Text17, { color: "gray", children: "\u2190\u2192 navigate \xB7 Enter confirm \xB7 Y to proceed \xB7 C to Cancel" }) })
|
|
2162
|
+
]
|
|
2163
|
+
}
|
|
2164
|
+
);
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
// src/ui/components/modals/BulkDeleteCodeModal.tsx
|
|
2168
|
+
import { useState as useState17 } from "react";
|
|
2169
|
+
import { Box as Box17, Text as Text18, useInput as useInput17 } from "ink";
|
|
2170
|
+
import TextInput4 from "ink-text-input";
|
|
2171
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2172
|
+
function BulkDeleteCodeModal({
|
|
2173
|
+
count,
|
|
2174
|
+
onConfirm,
|
|
2175
|
+
onCancel,
|
|
2176
|
+
terminalWidth = 80
|
|
2177
|
+
}) {
|
|
2178
|
+
const [code] = useState17(() => {
|
|
2179
|
+
const chars = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
2180
|
+
return Array.from({ length: 4 }, () => chars[Math.floor(Math.random() * chars.length)]).join("");
|
|
2181
|
+
});
|
|
2182
|
+
const [typedCode, setTypedCode] = useState17("");
|
|
2183
|
+
const [error, setError] = useState17(null);
|
|
2184
|
+
useInput17((_input, key) => {
|
|
2185
|
+
if (key.escape) {
|
|
2186
|
+
onCancel();
|
|
2187
|
+
return;
|
|
2188
|
+
}
|
|
2189
|
+
});
|
|
2190
|
+
const modalWidth = Math.min(terminalWidth - 4, 68);
|
|
2191
|
+
return /* @__PURE__ */ jsxs17(
|
|
2192
|
+
Box17,
|
|
2193
|
+
{
|
|
2194
|
+
flexDirection: "column",
|
|
2195
|
+
borderStyle: "round",
|
|
2196
|
+
borderColor: "red",
|
|
2197
|
+
paddingX: 2,
|
|
2198
|
+
paddingY: 1,
|
|
2199
|
+
width: modalWidth,
|
|
2200
|
+
children: [
|
|
2201
|
+
/* @__PURE__ */ jsx18(Text18, { bold: true, color: "red", children: "\u26A0\uFE0F Confirm Bulk Delete" }),
|
|
2202
|
+
/* @__PURE__ */ jsx18(Box17, { height: 1, children: /* @__PURE__ */ jsx18(Text18, { children: " " }) }),
|
|
2203
|
+
/* @__PURE__ */ jsxs17(Text18, { children: [
|
|
2204
|
+
"You are about to ",
|
|
2205
|
+
/* @__PURE__ */ jsx18(Text18, { bold: true, color: "red", children: "permanently delete" }),
|
|
2206
|
+
" ",
|
|
2207
|
+
/* @__PURE__ */ jsx18(Text18, { bold: true, children: count }),
|
|
2208
|
+
" repositor",
|
|
2209
|
+
count === 1 ? "y" : "ies",
|
|
2210
|
+
"."
|
|
2211
|
+
] }),
|
|
2212
|
+
/* @__PURE__ */ jsxs17(Text18, { color: "red", children: [
|
|
2213
|
+
"This action ",
|
|
2214
|
+
/* @__PURE__ */ jsx18(Text18, { bold: true, children: "CANNOT" }),
|
|
2215
|
+
" be undone."
|
|
2216
|
+
] }),
|
|
2217
|
+
/* @__PURE__ */ jsx18(Box17, { height: 1, children: /* @__PURE__ */ jsx18(Text18, { children: " " }) }),
|
|
2218
|
+
/* @__PURE__ */ jsxs17(Text18, { children: [
|
|
2219
|
+
"To confirm, type ",
|
|
2220
|
+
/* @__PURE__ */ jsx18(Text18, { bold: true, color: "yellow", children: code }),
|
|
2221
|
+
":"
|
|
2222
|
+
] }),
|
|
2223
|
+
/* @__PURE__ */ jsxs17(Box17, { marginTop: 1, children: [
|
|
2224
|
+
/* @__PURE__ */ jsx18(Text18, { children: "Verification code: " }),
|
|
2225
|
+
/* @__PURE__ */ jsx18(
|
|
2226
|
+
TextInput4,
|
|
2227
|
+
{
|
|
2228
|
+
value: typedCode,
|
|
2229
|
+
onChange: (v) => {
|
|
2230
|
+
const up = v.toUpperCase().slice(0, 4);
|
|
2231
|
+
setTypedCode(up);
|
|
2232
|
+
setError(null);
|
|
2233
|
+
if (up.length === 4) {
|
|
2234
|
+
if (up === code) {
|
|
2235
|
+
onConfirm();
|
|
2236
|
+
} else {
|
|
2237
|
+
setError("Code does not match. Try again.");
|
|
2238
|
+
setTypedCode("");
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
},
|
|
2242
|
+
onSubmit: () => {
|
|
2243
|
+
},
|
|
2244
|
+
placeholder: code
|
|
2245
|
+
}
|
|
2246
|
+
)
|
|
2247
|
+
] }),
|
|
2248
|
+
error && /* @__PURE__ */ jsx18(Box17, { marginTop: 1, children: /* @__PURE__ */ jsx18(Text18, { color: "red", children: error }) }),
|
|
2249
|
+
/* @__PURE__ */ jsx18(Box17, { marginTop: 1, children: /* @__PURE__ */ jsx18(Text18, { color: "gray", children: "Press Esc to cancel" }) })
|
|
2250
|
+
]
|
|
2251
|
+
}
|
|
2252
|
+
);
|
|
2253
|
+
}
|
|
2254
|
+
|
|
2255
|
+
// src/ui/components/modals/BulkIntentModal.tsx
|
|
2256
|
+
import { useState as useState18 } from "react";
|
|
2257
|
+
import { Box as Box18, Text as Text19, useInput as useInput18 } from "ink";
|
|
2258
|
+
import chalk16 from "chalk";
|
|
2259
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2260
|
+
function BulkIntentModal({
|
|
2261
|
+
kind,
|
|
2262
|
+
count,
|
|
2263
|
+
onChoose,
|
|
2264
|
+
onCancel,
|
|
2265
|
+
terminalWidth = 80
|
|
2266
|
+
}) {
|
|
2267
|
+
const options = kind === "archive" ? [
|
|
2268
|
+
{ action: "archive", label: "Archive all", color: "yellow" },
|
|
2269
|
+
{ action: "unarchive", label: "Unarchive all", color: "green" }
|
|
2270
|
+
] : [
|
|
2271
|
+
{ action: "star", label: "Star all", color: "cyan" },
|
|
2272
|
+
{ action: "unstar", label: "Unstar all", color: "magenta" }
|
|
2273
|
+
];
|
|
2274
|
+
const cancelIndex = options.length;
|
|
2275
|
+
const [focus, setFocus] = useState18(0);
|
|
2276
|
+
useInput18((input, key) => {
|
|
2277
|
+
if (key.escape || input.toLowerCase() === "c") {
|
|
2278
|
+
onCancel();
|
|
2279
|
+
return;
|
|
2280
|
+
}
|
|
2281
|
+
if (key.leftArrow) {
|
|
2282
|
+
setFocus((f) => Math.max(0, f - 1));
|
|
2283
|
+
return;
|
|
2284
|
+
}
|
|
2285
|
+
if (key.rightArrow) {
|
|
2286
|
+
setFocus((f) => Math.min(cancelIndex, f + 1));
|
|
2287
|
+
return;
|
|
2288
|
+
}
|
|
2289
|
+
if (key.return) {
|
|
2290
|
+
if (focus === cancelIndex) onCancel();
|
|
2291
|
+
else onChoose(options[focus].action);
|
|
2292
|
+
return;
|
|
2293
|
+
}
|
|
2294
|
+
});
|
|
2295
|
+
const modalWidth = Math.min(terminalWidth - 4, 72);
|
|
2296
|
+
const noun = kind === "archive" ? "archived" : "starred";
|
|
2297
|
+
return /* @__PURE__ */ jsxs18(
|
|
2298
|
+
Box18,
|
|
2299
|
+
{
|
|
2300
|
+
flexDirection: "column",
|
|
2301
|
+
borderStyle: "round",
|
|
2302
|
+
borderColor: "cyan",
|
|
2303
|
+
paddingX: 2,
|
|
2304
|
+
paddingY: 1,
|
|
2305
|
+
width: modalWidth,
|
|
2306
|
+
children: [
|
|
2307
|
+
/* @__PURE__ */ jsxs18(Text19, { bold: true, color: "cyan", children: [
|
|
2308
|
+
"Mixed ",
|
|
2309
|
+
kind === "archive" ? "Archive" : "Star",
|
|
2310
|
+
" State"
|
|
2311
|
+
] }),
|
|
2312
|
+
/* @__PURE__ */ jsx19(Box18, { height: 1, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
2313
|
+
/* @__PURE__ */ jsxs18(Text19, { children: [
|
|
2314
|
+
"The ",
|
|
2315
|
+
count,
|
|
2316
|
+
" selected repositor",
|
|
2317
|
+
count === 1 ? "y has" : "ies have",
|
|
2318
|
+
" a mix of ",
|
|
2319
|
+
noun,
|
|
2320
|
+
" and",
|
|
2321
|
+
" ",
|
|
2322
|
+
"not-",
|
|
2323
|
+
noun,
|
|
2324
|
+
" states. Choose the state to apply to all of them:"
|
|
2325
|
+
] }),
|
|
2326
|
+
/* @__PURE__ */ jsx19(Box18, { height: 1, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
2327
|
+
/* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", justifyContent: "center", gap: 3, children: [
|
|
2328
|
+
options.map((opt, idx) => {
|
|
2329
|
+
const bg = `bg${opt.color.charAt(0).toUpperCase()}${opt.color.slice(1)}`;
|
|
2330
|
+
return /* @__PURE__ */ jsx19(
|
|
2331
|
+
Box18,
|
|
2332
|
+
{
|
|
2333
|
+
borderStyle: "round",
|
|
2334
|
+
borderColor: focus === idx ? opt.color : "gray",
|
|
2335
|
+
height: 3,
|
|
2336
|
+
width: 18,
|
|
2337
|
+
alignItems: "center",
|
|
2338
|
+
justifyContent: "center",
|
|
2339
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: focus === idx ? chalk16[bg].black.bold(` ${opt.label} `) : chalk16[opt.color].bold(opt.label) })
|
|
2340
|
+
},
|
|
2341
|
+
opt.action
|
|
2342
|
+
);
|
|
2343
|
+
}),
|
|
2344
|
+
/* @__PURE__ */ jsx19(
|
|
2345
|
+
Box18,
|
|
2346
|
+
{
|
|
2347
|
+
borderStyle: "round",
|
|
2348
|
+
borderColor: focus === cancelIndex ? "white" : "gray",
|
|
2349
|
+
height: 3,
|
|
2350
|
+
width: 14,
|
|
2351
|
+
alignItems: "center",
|
|
2352
|
+
justifyContent: "center",
|
|
2353
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: focus === cancelIndex ? chalk16.bgGray.white.bold(" Cancel ") : chalk16.gray.bold("Cancel") })
|
|
2354
|
+
}
|
|
2355
|
+
)
|
|
2356
|
+
] }),
|
|
2357
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsx19(Text19, { color: "gray", children: "\u2190\u2192 navigate \xB7 Enter select \xB7 C/Esc cancel" }) })
|
|
2358
|
+
]
|
|
2359
|
+
}
|
|
2360
|
+
);
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
// src/ui/components/modals/BulkVisibilityModal.tsx
|
|
2364
|
+
import { useState as useState19 } from "react";
|
|
2365
|
+
import { Box as Box19, Text as Text20, useInput as useInput19 } from "ink";
|
|
2366
|
+
import chalk17 from "chalk";
|
|
2367
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2368
|
+
function BulkVisibilityModal({
|
|
2369
|
+
count,
|
|
2370
|
+
isEnterprise = false,
|
|
2371
|
+
onChoose,
|
|
2372
|
+
onCancel,
|
|
2373
|
+
terminalWidth = 80
|
|
2374
|
+
}) {
|
|
2375
|
+
const options = [
|
|
2376
|
+
{ target: "PUBLIC", label: "Public", color: "green" },
|
|
2377
|
+
{ target: "PRIVATE", label: "Private", color: "yellow" },
|
|
2378
|
+
...isEnterprise ? [{ target: "INTERNAL", label: "Internal", color: "cyan" }] : []
|
|
2379
|
+
];
|
|
2380
|
+
const cancelIndex = options.length;
|
|
2381
|
+
const [focus, setFocus] = useState19(0);
|
|
2382
|
+
useInput19((input, key) => {
|
|
2383
|
+
if (key.escape || input.toLowerCase() === "c") {
|
|
2384
|
+
onCancel();
|
|
2385
|
+
return;
|
|
2386
|
+
}
|
|
2387
|
+
if (key.leftArrow) {
|
|
2388
|
+
setFocus((f) => Math.max(0, f - 1));
|
|
2389
|
+
return;
|
|
2390
|
+
}
|
|
2391
|
+
if (key.rightArrow) {
|
|
2392
|
+
setFocus((f) => Math.min(cancelIndex, f + 1));
|
|
2393
|
+
return;
|
|
2394
|
+
}
|
|
2395
|
+
if (key.return) {
|
|
2396
|
+
if (focus === cancelIndex) onCancel();
|
|
2397
|
+
else onChoose(options[focus].target);
|
|
2398
|
+
return;
|
|
2399
|
+
}
|
|
2400
|
+
});
|
|
2401
|
+
const modalWidth = Math.min(terminalWidth - 4, 72);
|
|
2402
|
+
return /* @__PURE__ */ jsxs19(
|
|
2403
|
+
Box19,
|
|
2404
|
+
{
|
|
2405
|
+
flexDirection: "column",
|
|
2406
|
+
borderStyle: "round",
|
|
2407
|
+
borderColor: "cyan",
|
|
2408
|
+
paddingX: 2,
|
|
2409
|
+
paddingY: 1,
|
|
2410
|
+
width: modalWidth,
|
|
2411
|
+
children: [
|
|
2412
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, color: "cyan", children: "Bulk Change Visibility" }),
|
|
2413
|
+
/* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
|
|
2414
|
+
/* @__PURE__ */ jsxs19(Text20, { children: [
|
|
2415
|
+
"Set the visibility of the ",
|
|
2416
|
+
count,
|
|
2417
|
+
" selected repositor",
|
|
2418
|
+
count === 1 ? "y" : "ies",
|
|
2419
|
+
" to:"
|
|
2420
|
+
] }),
|
|
2421
|
+
/* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
|
|
2422
|
+
/* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", justifyContent: "center", gap: 3, children: [
|
|
2423
|
+
options.map((opt, idx) => {
|
|
2424
|
+
const bg = `bg${opt.color.charAt(0).toUpperCase()}${opt.color.slice(1)}`;
|
|
2425
|
+
return /* @__PURE__ */ jsx20(
|
|
2426
|
+
Box19,
|
|
2427
|
+
{
|
|
2428
|
+
borderStyle: "round",
|
|
2429
|
+
borderColor: focus === idx ? opt.color : "gray",
|
|
2430
|
+
height: 3,
|
|
2431
|
+
width: 16,
|
|
2432
|
+
alignItems: "center",
|
|
2433
|
+
justifyContent: "center",
|
|
2434
|
+
children: /* @__PURE__ */ jsx20(Text20, { children: focus === idx ? chalk17[bg].black.bold(` ${opt.label} `) : chalk17[opt.color].bold(opt.label) })
|
|
2435
|
+
},
|
|
2436
|
+
opt.target
|
|
2437
|
+
);
|
|
2438
|
+
}),
|
|
2439
|
+
/* @__PURE__ */ jsx20(
|
|
2440
|
+
Box19,
|
|
2441
|
+
{
|
|
2442
|
+
borderStyle: "round",
|
|
2443
|
+
borderColor: focus === cancelIndex ? "white" : "gray",
|
|
2444
|
+
height: 3,
|
|
2445
|
+
width: 14,
|
|
2446
|
+
alignItems: "center",
|
|
2447
|
+
justifyContent: "center",
|
|
2448
|
+
children: /* @__PURE__ */ jsx20(Text20, { children: focus === cancelIndex ? chalk17.bgGray.white.bold(" Cancel ") : chalk17.gray.bold("Cancel") })
|
|
2449
|
+
}
|
|
2450
|
+
)
|
|
2451
|
+
] }),
|
|
2452
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsx20(Text20, { color: "gray", children: "\u2190\u2192 navigate \xB7 Enter select \xB7 C/Esc cancel" }) })
|
|
2453
|
+
]
|
|
2454
|
+
}
|
|
2455
|
+
);
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2458
|
+
// src/ui/components/modals/BulkProgressModal.tsx
|
|
2459
|
+
import { Box as Box20, Text as Text21 } from "ink";
|
|
2460
|
+
import chalk18 from "chalk";
|
|
2461
|
+
import { Fragment as Fragment9, jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2462
|
+
function BulkProgressModal({
|
|
2463
|
+
state,
|
|
2464
|
+
actionLabel,
|
|
2465
|
+
gerund,
|
|
2466
|
+
pastVerb,
|
|
2467
|
+
actionColor,
|
|
2468
|
+
terminalWidth = 80
|
|
2469
|
+
}) {
|
|
2470
|
+
const succeeded = state.completed - state.failed.length;
|
|
2471
|
+
const modalWidth = Math.min(terminalWidth - 4, 68);
|
|
2472
|
+
return /* @__PURE__ */ jsxs20(
|
|
2473
|
+
Box20,
|
|
2474
|
+
{
|
|
2475
|
+
flexDirection: "column",
|
|
2476
|
+
borderStyle: "round",
|
|
2477
|
+
borderColor: state.done ? state.failed.length === 0 ? "green" : "yellow" : actionColor,
|
|
2478
|
+
paddingX: 2,
|
|
2479
|
+
paddingY: 1,
|
|
2480
|
+
width: modalWidth,
|
|
2481
|
+
children: [
|
|
2482
|
+
/* @__PURE__ */ jsxs20(Text21, { bold: true, color: state.done ? state.failed.length === 0 ? "green" : "yellow" : actionColor, children: [
|
|
2483
|
+
"Bulk ",
|
|
2484
|
+
actionLabel,
|
|
2485
|
+
" Progress"
|
|
2486
|
+
] }),
|
|
2487
|
+
/* @__PURE__ */ jsx21(Box20, { height: 1, children: /* @__PURE__ */ jsx21(Text21, { children: " " }) }),
|
|
2488
|
+
!state.done ? /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
2489
|
+
/* @__PURE__ */ jsxs20(Box20, { flexDirection: "row", children: [
|
|
2490
|
+
/* @__PURE__ */ jsx21(Box20, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "cyan", children: /* @__PURE__ */ jsx21(SlowSpinner, {}) }) }),
|
|
2491
|
+
/* @__PURE__ */ jsxs20(Text21, { children: [
|
|
2492
|
+
gerund,
|
|
2493
|
+
" ",
|
|
2494
|
+
Math.min(state.completed + 1, state.total),
|
|
2495
|
+
" of ",
|
|
2496
|
+
state.total,
|
|
2497
|
+
state.currentRepo ? `: ${chalk18.cyan(state.currentRepo.nameWithOwner)}` : "\u2026"
|
|
2498
|
+
] })
|
|
2499
|
+
] }),
|
|
2500
|
+
state.failed.length > 0 && /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "column", children: [
|
|
2501
|
+
/* @__PURE__ */ jsx21(Text21, { color: "yellow", children: "Failures so far:" }),
|
|
2502
|
+
state.failed.map(({ repo, error }) => /* @__PURE__ */ jsxs20(Text21, { color: "red", children: [
|
|
2503
|
+
" \u2717 ",
|
|
2504
|
+
repo.nameWithOwner,
|
|
2505
|
+
": ",
|
|
2506
|
+
error
|
|
2507
|
+
] }, repo.id))
|
|
2508
|
+
] })
|
|
2509
|
+
] }) : /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
2510
|
+
state.failed.length === 0 ? /* @__PURE__ */ jsxs20(Text21, { color: "green", children: [
|
|
2511
|
+
"\u2713 All ",
|
|
2512
|
+
state.total,
|
|
2513
|
+
" repositor",
|
|
2514
|
+
state.total === 1 ? "y" : "ies",
|
|
2515
|
+
" ",
|
|
2516
|
+
pastVerb,
|
|
2517
|
+
" successfully."
|
|
2518
|
+
] }) : /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
2519
|
+
/* @__PURE__ */ jsxs20(Text21, { color: "yellow", children: [
|
|
2520
|
+
succeeded,
|
|
2521
|
+
"/",
|
|
2522
|
+
state.total,
|
|
2523
|
+
" repositor",
|
|
2524
|
+
state.total === 1 ? "y" : "ies",
|
|
2525
|
+
" ",
|
|
2526
|
+
pastVerb,
|
|
2527
|
+
" successfully."
|
|
2528
|
+
] }),
|
|
2529
|
+
/* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "column", children: [
|
|
2530
|
+
/* @__PURE__ */ jsxs20(Text21, { color: "red", children: [
|
|
2531
|
+
state.failed.length,
|
|
2532
|
+
" failed:"
|
|
2533
|
+
] }),
|
|
2534
|
+
state.failed.map(({ repo, error }) => /* @__PURE__ */ jsxs20(Text21, { color: "red", children: [
|
|
2535
|
+
" \u2717 ",
|
|
2536
|
+
repo.nameWithOwner,
|
|
2537
|
+
": ",
|
|
2538
|
+
error
|
|
2539
|
+
] }, repo.id))
|
|
2540
|
+
] })
|
|
2541
|
+
] }),
|
|
2542
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "gray", children: "Press any key to continue" }) })
|
|
2543
|
+
] })
|
|
2544
|
+
]
|
|
2545
|
+
}
|
|
2546
|
+
);
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
// src/ui/components/modals/bulkActions.ts
|
|
2550
|
+
function visibilityLabel(target) {
|
|
2551
|
+
return target === "PUBLIC" ? "Public" : target === "PRIVATE" ? "Private" : "Internal";
|
|
2552
|
+
}
|
|
2553
|
+
function bulkActionMeta(action, visibilityTarget) {
|
|
2554
|
+
switch (action) {
|
|
2555
|
+
case "delete":
|
|
2556
|
+
return { label: "Delete", gerund: "Deleting", color: "red", pastVerb: "deleted" };
|
|
2557
|
+
case "archive":
|
|
2558
|
+
return { label: "Archive", gerund: "Archiving", color: "yellow", pastVerb: "archived" };
|
|
2559
|
+
case "unarchive":
|
|
2560
|
+
return { label: "Unarchive", gerund: "Unarchiving", color: "green", pastVerb: "unarchived" };
|
|
2561
|
+
case "star":
|
|
2562
|
+
return { label: "Star", gerund: "Starring", color: "cyan", pastVerb: "starred" };
|
|
2563
|
+
case "unstar":
|
|
2564
|
+
return { label: "Unstar", gerund: "Unstarring", color: "magenta", pastVerb: "unstarred" };
|
|
2565
|
+
case "visibility": {
|
|
2566
|
+
const target = visibilityTarget ?? "PRIVATE";
|
|
2567
|
+
const name = visibilityLabel(target);
|
|
2568
|
+
const color = target === "PUBLIC" ? "green" : target === "PRIVATE" ? "yellow" : "cyan";
|
|
2569
|
+
return { label: `Make ${name}`, gerund: `Making ${name}`, color, pastVerb: `made ${name.toLowerCase()}` };
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
// src/ui/components/modals/OpenInBrowserModal.tsx
|
|
2575
|
+
import { useState as useState20 } from "react";
|
|
2576
|
+
import { Box as Box21, Text as Text22, useInput as useInput20 } from "ink";
|
|
2577
|
+
import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1889
2578
|
function OpenInBrowserModal({ repo, onOpen, onCancel, theme: themeProp }) {
|
|
1890
2579
|
const { theme, c } = useTheme(themeProp?.name ?? "default");
|
|
1891
|
-
const [focus, setFocus] =
|
|
2580
|
+
const [focus, setFocus] = useState20("this");
|
|
1892
2581
|
const forkUrl = `https://github.com/${repo.nameWithOwner}`;
|
|
1893
2582
|
const upstreamUrl = repo.parent ? `https://github.com/${repo.parent.nameWithOwner}` : null;
|
|
1894
|
-
|
|
2583
|
+
useInput20((input, key) => {
|
|
1895
2584
|
if (key.escape || input.toLowerCase() === "c") {
|
|
1896
2585
|
onCancel();
|
|
1897
2586
|
return;
|
|
@@ -1917,8 +2606,8 @@ function OpenInBrowserModal({ repo, onOpen, onCancel, theme: themeProp }) {
|
|
|
1917
2606
|
return;
|
|
1918
2607
|
}
|
|
1919
2608
|
});
|
|
1920
|
-
return /* @__PURE__ */
|
|
1921
|
-
|
|
2609
|
+
return /* @__PURE__ */ jsxs21(
|
|
2610
|
+
Box21,
|
|
1922
2611
|
{
|
|
1923
2612
|
flexDirection: "column",
|
|
1924
2613
|
borderStyle: "round",
|
|
@@ -1927,41 +2616,41 @@ function OpenInBrowserModal({ repo, onOpen, onCancel, theme: themeProp }) {
|
|
|
1927
2616
|
paddingY: 2,
|
|
1928
2617
|
width: 62,
|
|
1929
2618
|
children: [
|
|
1930
|
-
/* @__PURE__ */
|
|
1931
|
-
/* @__PURE__ */
|
|
1932
|
-
/* @__PURE__ */
|
|
1933
|
-
repo.parent && /* @__PURE__ */
|
|
2619
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, color: theme.primary, children: "Open in Browser" }),
|
|
2620
|
+
/* @__PURE__ */ jsx22(Box21, { height: 1, children: /* @__PURE__ */ jsx22(Text22, { children: " " }) }),
|
|
2621
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, children: repo.nameWithOwner }),
|
|
2622
|
+
repo.parent && /* @__PURE__ */ jsxs21(Text22, { color: theme.muted, children: [
|
|
1934
2623
|
"Fork of ",
|
|
1935
2624
|
repo.parent.nameWithOwner
|
|
1936
2625
|
] }),
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
/* @__PURE__ */
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
1941
|
-
/* @__PURE__ */
|
|
1942
|
-
/* @__PURE__ */
|
|
2626
|
+
/* @__PURE__ */ jsx22(Box21, { height: 1, children: /* @__PURE__ */ jsx22(Text22, { children: " " }) }),
|
|
2627
|
+
/* @__PURE__ */ jsx22(Text22, { children: "Which repository would you like to open?" }),
|
|
2628
|
+
/* @__PURE__ */ jsx22(Box21, { height: 1, children: /* @__PURE__ */ jsx22(Text22, { children: " " }) }),
|
|
2629
|
+
/* @__PURE__ */ jsxs21(Box21, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 4, children: [
|
|
2630
|
+
/* @__PURE__ */ jsx22(Box21, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx22(Text22, { children: focus === "this" ? c.primary.inverse.bold(" This Repository ") : c.primary.bold("This Repository") }) }),
|
|
2631
|
+
/* @__PURE__ */ jsx22(Box21, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx22(Text22, { children: focus === "upstream" ? c.success.inverse.bold(" Parent/Upstream ") : c.success.bold("Parent/Upstream") }) })
|
|
1943
2632
|
] }),
|
|
1944
|
-
/* @__PURE__ */
|
|
2633
|
+
/* @__PURE__ */ jsx22(Box21, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsx22(Text22, { color: theme.muted, children: "\u2190/\u2192 Choose \u2022 Enter to Open \u2022 T This \u2022 U Upstream \u2022 C/Esc Cancel" }) })
|
|
1945
2634
|
]
|
|
1946
2635
|
}
|
|
1947
2636
|
);
|
|
1948
2637
|
}
|
|
1949
2638
|
|
|
1950
2639
|
// src/ui/components/modals/CreateRepoModal.tsx
|
|
1951
|
-
import { useState as
|
|
1952
|
-
import { Box as
|
|
1953
|
-
import
|
|
1954
|
-
import { Fragment as
|
|
2640
|
+
import { useState as useState21, useRef as useRef6 } from "react";
|
|
2641
|
+
import { Box as Box22, Text as Text23, useInput as useInput21 } from "ink";
|
|
2642
|
+
import TextInput5 from "ink-text-input";
|
|
2643
|
+
import { Fragment as Fragment10, jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1955
2644
|
function CreateRepoModal({ ownerSlug, isOrg, isEnterprise, onCreate, onCancel, theme: themeProp }) {
|
|
1956
2645
|
const { theme, c } = useTheme(themeProp?.name ?? "default");
|
|
1957
|
-
const [name, setName] =
|
|
1958
|
-
const [visibility, setVisibility] =
|
|
1959
|
-
const [creating, setCreating] =
|
|
1960
|
-
const [error, setError] =
|
|
1961
|
-
const submittingRef =
|
|
2646
|
+
const [name, setName] = useState21("");
|
|
2647
|
+
const [visibility, setVisibility] = useState21("PRIVATE");
|
|
2648
|
+
const [creating, setCreating] = useState21(false);
|
|
2649
|
+
const [error, setError] = useState21(null);
|
|
2650
|
+
const submittingRef = useRef6(false);
|
|
1962
2651
|
const visibilities = isOrg && isEnterprise ? ["PRIVATE", "PUBLIC", "INTERNAL"] : ["PRIVATE", "PUBLIC"];
|
|
1963
|
-
|
|
1964
|
-
if (
|
|
2652
|
+
useInput21((input, key) => {
|
|
2653
|
+
if (submittingRef.current) return;
|
|
1965
2654
|
if (key.escape) {
|
|
1966
2655
|
onCancel();
|
|
1967
2656
|
return;
|
|
@@ -1997,8 +2686,8 @@ function CreateRepoModal({ ownerSlug, isOrg, isEnterprise, onCreate, onCancel, t
|
|
|
1997
2686
|
};
|
|
1998
2687
|
const visLabel = (v) => v === "PUBLIC" ? "Public" : v === "PRIVATE" ? "Private" : "Internal";
|
|
1999
2688
|
const isDisabled = !name.trim();
|
|
2000
|
-
return /* @__PURE__ */
|
|
2001
|
-
|
|
2689
|
+
return /* @__PURE__ */ jsxs22(
|
|
2690
|
+
Box22,
|
|
2002
2691
|
{
|
|
2003
2692
|
flexDirection: "column",
|
|
2004
2693
|
borderStyle: "round",
|
|
@@ -2007,23 +2696,23 @@ function CreateRepoModal({ ownerSlug, isOrg, isEnterprise, onCreate, onCancel, t
|
|
|
2007
2696
|
paddingY: 2,
|
|
2008
2697
|
width: 80,
|
|
2009
2698
|
children: [
|
|
2010
|
-
/* @__PURE__ */
|
|
2011
|
-
/* @__PURE__ */
|
|
2012
|
-
/* @__PURE__ */
|
|
2699
|
+
/* @__PURE__ */ jsx23(Text23, { bold: true, color: theme.primary, children: "Create New Repository" }),
|
|
2700
|
+
/* @__PURE__ */ jsx23(Box22, { height: 1, children: /* @__PURE__ */ jsx23(Text23, { children: " " }) }),
|
|
2701
|
+
/* @__PURE__ */ jsxs22(Text23, { color: theme.muted, children: [
|
|
2013
2702
|
"Owner: ",
|
|
2014
2703
|
ownerSlug,
|
|
2015
2704
|
" ",
|
|
2016
2705
|
isOrg ? "(organisation)" : "(personal)"
|
|
2017
2706
|
] }),
|
|
2018
|
-
/* @__PURE__ */
|
|
2019
|
-
/* @__PURE__ */
|
|
2020
|
-
/* @__PURE__ */
|
|
2021
|
-
/* @__PURE__ */
|
|
2707
|
+
/* @__PURE__ */ jsx23(Box22, { height: 1, children: /* @__PURE__ */ jsx23(Text23, { children: " " }) }),
|
|
2708
|
+
/* @__PURE__ */ jsx23(Text23, { children: "Repository name:" }),
|
|
2709
|
+
/* @__PURE__ */ jsxs22(Box22, { flexDirection: "row", alignItems: "center", children: [
|
|
2710
|
+
/* @__PURE__ */ jsxs22(Text23, { children: [
|
|
2022
2711
|
ownerSlug,
|
|
2023
2712
|
"/"
|
|
2024
2713
|
] }),
|
|
2025
|
-
/* @__PURE__ */
|
|
2026
|
-
|
|
2714
|
+
/* @__PURE__ */ jsx23(
|
|
2715
|
+
TextInput5,
|
|
2027
2716
|
{
|
|
2028
2717
|
value: name,
|
|
2029
2718
|
onChange: handleNameChange,
|
|
@@ -2032,42 +2721,42 @@ function CreateRepoModal({ ownerSlug, isOrg, isEnterprise, onCreate, onCancel, t
|
|
|
2032
2721
|
}
|
|
2033
2722
|
)
|
|
2034
2723
|
] }),
|
|
2035
|
-
/* @__PURE__ */
|
|
2036
|
-
/* @__PURE__ */
|
|
2037
|
-
/* @__PURE__ */
|
|
2038
|
-
visibilities.map((v, i) => /* @__PURE__ */
|
|
2724
|
+
/* @__PURE__ */ jsx23(Box22, { height: 1, children: /* @__PURE__ */ jsx23(Text23, { children: " " }) }),
|
|
2725
|
+
/* @__PURE__ */ jsxs22(Box22, { flexDirection: "row", children: [
|
|
2726
|
+
/* @__PURE__ */ jsx23(Text23, { children: "Visibility: " }),
|
|
2727
|
+
visibilities.map((v, i) => /* @__PURE__ */ jsxs22(Text23, { children: [
|
|
2039
2728
|
v === visibility ? c.btnPrimary(` ${visLabel(v)} `) : c.muted(visLabel(v)),
|
|
2040
2729
|
i < visibilities.length - 1 ? " " : ""
|
|
2041
2730
|
] }, v))
|
|
2042
2731
|
] }),
|
|
2043
|
-
creating ? /* @__PURE__ */
|
|
2044
|
-
/* @__PURE__ */
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
] }) }) : /* @__PURE__ */
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
/* @__PURE__ */
|
|
2732
|
+
creating ? /* @__PURE__ */ jsx23(Box22, { marginTop: 2, justifyContent: "center", children: /* @__PURE__ */ jsxs22(Box22, { flexDirection: "row", children: [
|
|
2733
|
+
/* @__PURE__ */ jsx23(Box22, { marginRight: 1, children: /* @__PURE__ */ jsx23(SlowSpinner, {}) }),
|
|
2734
|
+
/* @__PURE__ */ jsx23(Text23, { color: theme.primary, children: "Creating repository..." })
|
|
2735
|
+
] }) }) : /* @__PURE__ */ jsxs22(Fragment10, { children: [
|
|
2736
|
+
/* @__PURE__ */ jsx23(Box22, { marginTop: 2, children: /* @__PURE__ */ jsx23(Text23, { color: theme.muted, children: isDisabled ? "Enter a name to create the repository" : `Press Enter to create "${ownerSlug}/${name}"` }) }),
|
|
2737
|
+
/* @__PURE__ */ jsx23(Box22, { marginTop: 1, children: /* @__PURE__ */ jsx23(Text23, { color: theme.muted, children: "Tab to change visibility \u2022 Esc to cancel" }) })
|
|
2049
2738
|
] }),
|
|
2050
|
-
error && /* @__PURE__ */
|
|
2739
|
+
error && /* @__PURE__ */ jsx23(Box22, { marginTop: 1, children: /* @__PURE__ */ jsx23(Text23, { color: theme.error, children: error }) })
|
|
2051
2740
|
]
|
|
2052
2741
|
}
|
|
2053
2742
|
);
|
|
2054
2743
|
}
|
|
2055
2744
|
|
|
2056
2745
|
// src/ui/components/modals/TransferModal.tsx
|
|
2057
|
-
import { useState as
|
|
2058
|
-
import { Box as
|
|
2059
|
-
import
|
|
2060
|
-
import { Fragment as
|
|
2746
|
+
import { useState as useState22, useRef as useRef7, useEffect as useEffect11 } from "react";
|
|
2747
|
+
import { Box as Box23, Text as Text24, useInput as useInput22 } from "ink";
|
|
2748
|
+
import TextInput6 from "ink-text-input";
|
|
2749
|
+
import { Fragment as Fragment11, jsx as jsx24, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2061
2750
|
function TransferModal({ repo, onTransfer, onCancel, theme: themeProp }) {
|
|
2062
2751
|
const { theme, c } = useTheme(themeProp?.name ?? "default");
|
|
2063
|
-
const [newOwner, setNewOwner] =
|
|
2064
|
-
const [stage, setStage] =
|
|
2065
|
-
const [focus, setFocus] =
|
|
2066
|
-
const [transferring, setTransferring] =
|
|
2067
|
-
const [error, setError] =
|
|
2068
|
-
const [transferCode, setTransferCode] =
|
|
2069
|
-
const [typedCode, setTypedCode] =
|
|
2070
|
-
const submittingRef =
|
|
2752
|
+
const [newOwner, setNewOwner] = useState22("");
|
|
2753
|
+
const [stage, setStage] = useState22("input");
|
|
2754
|
+
const [focus, setFocus] = useState22("cancel");
|
|
2755
|
+
const [transferring, setTransferring] = useState22(false);
|
|
2756
|
+
const [error, setError] = useState22(null);
|
|
2757
|
+
const [transferCode, setTransferCode] = useState22("");
|
|
2758
|
+
const [typedCode, setTypedCode] = useState22("");
|
|
2759
|
+
const submittingRef = useRef7(false);
|
|
2071
2760
|
const owner = repo ? repo.nameWithOwner.split("/")[0] : "";
|
|
2072
2761
|
useEffect11(() => {
|
|
2073
2762
|
if (repo) {
|
|
@@ -2083,8 +2772,8 @@ function TransferModal({ repo, onTransfer, onCancel, theme: themeProp }) {
|
|
|
2083
2772
|
setError(null);
|
|
2084
2773
|
}
|
|
2085
2774
|
}, [repo]);
|
|
2086
|
-
|
|
2087
|
-
if (
|
|
2775
|
+
useInput22((input, key) => {
|
|
2776
|
+
if (submittingRef.current || !repo) return;
|
|
2088
2777
|
if (key.escape) {
|
|
2089
2778
|
onCancel();
|
|
2090
2779
|
return;
|
|
@@ -2158,8 +2847,8 @@ function TransferModal({ repo, onTransfer, onCancel, theme: themeProp }) {
|
|
|
2158
2847
|
};
|
|
2159
2848
|
const isInputDisabled = !newOwner.trim() || newOwner.trim().toLowerCase() === owner.toLowerCase();
|
|
2160
2849
|
if (!repo) return null;
|
|
2161
|
-
return /* @__PURE__ */
|
|
2162
|
-
|
|
2850
|
+
return /* @__PURE__ */ jsxs23(
|
|
2851
|
+
Box23,
|
|
2163
2852
|
{
|
|
2164
2853
|
flexDirection: "column",
|
|
2165
2854
|
borderStyle: "round",
|
|
@@ -2168,18 +2857,18 @@ function TransferModal({ repo, onTransfer, onCancel, theme: themeProp }) {
|
|
|
2168
2857
|
paddingY: 2,
|
|
2169
2858
|
width: 80,
|
|
2170
2859
|
children: [
|
|
2171
|
-
/* @__PURE__ */
|
|
2172
|
-
/* @__PURE__ */
|
|
2173
|
-
/* @__PURE__ */
|
|
2860
|
+
/* @__PURE__ */ jsx24(Text24, { bold: true, color: theme.warning, children: "Transfer Repository" }),
|
|
2861
|
+
/* @__PURE__ */ jsx24(Box23, { height: 1, children: /* @__PURE__ */ jsx24(Text24, { children: " " }) }),
|
|
2862
|
+
/* @__PURE__ */ jsxs23(Text24, { color: theme.muted, children: [
|
|
2174
2863
|
"Repository: ",
|
|
2175
2864
|
repo.nameWithOwner
|
|
2176
2865
|
] }),
|
|
2177
|
-
stage === "input" && /* @__PURE__ */
|
|
2178
|
-
/* @__PURE__ */
|
|
2179
|
-
/* @__PURE__ */
|
|
2180
|
-
/* @__PURE__ */
|
|
2181
|
-
/* @__PURE__ */
|
|
2182
|
-
|
|
2866
|
+
stage === "input" && /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
2867
|
+
/* @__PURE__ */ jsx24(Box23, { height: 1, children: /* @__PURE__ */ jsx24(Text24, { children: " " }) }),
|
|
2868
|
+
/* @__PURE__ */ jsx24(Text24, { children: "New owner (username or organisation):" }),
|
|
2869
|
+
/* @__PURE__ */ jsxs23(Box23, { flexDirection: "row", alignItems: "center", children: [
|
|
2870
|
+
/* @__PURE__ */ jsx24(
|
|
2871
|
+
TextInput6,
|
|
2183
2872
|
{
|
|
2184
2873
|
value: newOwner,
|
|
2185
2874
|
onChange: handleOwnerChange,
|
|
@@ -2187,17 +2876,17 @@ function TransferModal({ repo, onTransfer, onCancel, theme: themeProp }) {
|
|
|
2187
2876
|
focus: !transferring
|
|
2188
2877
|
}
|
|
2189
2878
|
),
|
|
2190
|
-
/* @__PURE__ */
|
|
2879
|
+
/* @__PURE__ */ jsxs23(Text24, { children: [
|
|
2191
2880
|
"/",
|
|
2192
2881
|
repo.name
|
|
2193
2882
|
] })
|
|
2194
2883
|
] }),
|
|
2195
|
-
/* @__PURE__ */
|
|
2196
|
-
/* @__PURE__ */
|
|
2884
|
+
/* @__PURE__ */ jsx24(Box23, { marginTop: 2, children: /* @__PURE__ */ jsx24(Text24, { color: theme.muted, children: isInputDisabled ? "Enter a different owner to continue" : `Press Enter to review the transfer to "${newOwner}/${repo.name}"` }) }),
|
|
2885
|
+
/* @__PURE__ */ jsx24(Box23, { marginTop: 1, children: /* @__PURE__ */ jsx24(Text24, { color: theme.muted, children: "Press Esc to cancel" }) })
|
|
2197
2886
|
] }),
|
|
2198
|
-
stage === "code" && /* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
/* @__PURE__ */
|
|
2887
|
+
stage === "code" && /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
2888
|
+
/* @__PURE__ */ jsx24(Box23, { height: 1, children: /* @__PURE__ */ jsx24(Text24, { children: " " }) }),
|
|
2889
|
+
/* @__PURE__ */ jsxs23(Text24, { children: [
|
|
2201
2890
|
"Transfer ",
|
|
2202
2891
|
c.text.bold(repo.nameWithOwner),
|
|
2203
2892
|
" ",
|
|
@@ -2205,12 +2894,12 @@ function TransferModal({ repo, onTransfer, onCancel, theme: themeProp }) {
|
|
|
2205
2894
|
" ",
|
|
2206
2895
|
c.warning.bold(`${newOwner}/${repo.name}`)
|
|
2207
2896
|
] }),
|
|
2208
|
-
/* @__PURE__ */
|
|
2209
|
-
/* @__PURE__ */
|
|
2210
|
-
/* @__PURE__ */
|
|
2211
|
-
/* @__PURE__ */
|
|
2212
|
-
/* @__PURE__ */
|
|
2213
|
-
|
|
2897
|
+
/* @__PURE__ */ jsx24(Box23, { height: 1, children: /* @__PURE__ */ jsx24(Text24, { children: " " }) }),
|
|
2898
|
+
/* @__PURE__ */ jsx24(Text24, { children: `To confirm, please type ${c.warning.bold(transferCode)} below:` }),
|
|
2899
|
+
/* @__PURE__ */ jsxs23(Box23, { marginTop: 1, flexDirection: "row", alignItems: "center", children: [
|
|
2900
|
+
/* @__PURE__ */ jsx24(Text24, { children: "Verification code: " }),
|
|
2901
|
+
/* @__PURE__ */ jsx24(
|
|
2902
|
+
TextInput6,
|
|
2214
2903
|
{
|
|
2215
2904
|
value: typedCode,
|
|
2216
2905
|
onChange: handleCodeChange,
|
|
@@ -2219,11 +2908,11 @@ function TransferModal({ repo, onTransfer, onCancel, theme: themeProp }) {
|
|
|
2219
2908
|
}
|
|
2220
2909
|
)
|
|
2221
2910
|
] }),
|
|
2222
|
-
/* @__PURE__ */
|
|
2911
|
+
/* @__PURE__ */ jsx24(Box23, { marginTop: 1, children: /* @__PURE__ */ jsx24(Text24, { color: theme.muted, children: "Type the code to continue \u2022 Esc to cancel" }) })
|
|
2223
2912
|
] }),
|
|
2224
|
-
stage === "confirm" && /* @__PURE__ */
|
|
2225
|
-
/* @__PURE__ */
|
|
2226
|
-
/* @__PURE__ */
|
|
2913
|
+
stage === "confirm" && /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
2914
|
+
/* @__PURE__ */ jsx24(Box23, { height: 1, children: /* @__PURE__ */ jsx24(Text24, { children: " " }) }),
|
|
2915
|
+
/* @__PURE__ */ jsxs23(Text24, { children: [
|
|
2227
2916
|
"Transfer ",
|
|
2228
2917
|
c.text.bold(repo.nameWithOwner),
|
|
2229
2918
|
" ",
|
|
@@ -2231,18 +2920,18 @@ function TransferModal({ repo, onTransfer, onCancel, theme: themeProp }) {
|
|
|
2231
2920
|
" ",
|
|
2232
2921
|
c.warning.bold(`${newOwner}/${repo.name}`)
|
|
2233
2922
|
] }),
|
|
2234
|
-
/* @__PURE__ */
|
|
2923
|
+
/* @__PURE__ */ jsx24(Box23, { marginTop: 1, children: /* @__PURE__ */ jsxs23(Text24, { color: theme.warning, children: [
|
|
2235
2924
|
"\u26A0\uFE0F This hands ownership to ",
|
|
2236
2925
|
newOwner,
|
|
2237
2926
|
". You may lose admin access, and only the new owner can transfer it back."
|
|
2238
2927
|
] }) }),
|
|
2239
|
-
transferring ? /* @__PURE__ */
|
|
2240
|
-
/* @__PURE__ */
|
|
2241
|
-
/* @__PURE__ */
|
|
2242
|
-
] }) }) : /* @__PURE__ */
|
|
2243
|
-
/* @__PURE__ */
|
|
2244
|
-
/* @__PURE__ */
|
|
2245
|
-
|
|
2928
|
+
transferring ? /* @__PURE__ */ jsx24(Box23, { marginTop: 2, justifyContent: "center", children: /* @__PURE__ */ jsxs23(Box23, { flexDirection: "row", children: [
|
|
2929
|
+
/* @__PURE__ */ jsx24(Box23, { marginRight: 1, children: /* @__PURE__ */ jsx24(SlowSpinner, {}) }),
|
|
2930
|
+
/* @__PURE__ */ jsx24(Text24, { color: theme.warning, children: "Transferring repository..." })
|
|
2931
|
+
] }) }) : /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
2932
|
+
/* @__PURE__ */ jsxs23(Box23, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
2933
|
+
/* @__PURE__ */ jsx24(
|
|
2934
|
+
Box23,
|
|
2246
2935
|
{
|
|
2247
2936
|
borderStyle: "round",
|
|
2248
2937
|
borderColor: focus === "transfer" ? theme.warning : theme.muted,
|
|
@@ -2251,11 +2940,11 @@ function TransferModal({ repo, onTransfer, onCancel, theme: themeProp }) {
|
|
|
2251
2940
|
alignItems: "center",
|
|
2252
2941
|
justifyContent: "center",
|
|
2253
2942
|
flexDirection: "column",
|
|
2254
|
-
children: /* @__PURE__ */
|
|
2943
|
+
children: /* @__PURE__ */ jsx24(Text24, { children: focus === "transfer" ? c.btnPrimary(" Transfer ") : c.warning.bold("Transfer") })
|
|
2255
2944
|
}
|
|
2256
2945
|
),
|
|
2257
|
-
/* @__PURE__ */
|
|
2258
|
-
|
|
2946
|
+
/* @__PURE__ */ jsx24(
|
|
2947
|
+
Box23,
|
|
2259
2948
|
{
|
|
2260
2949
|
borderStyle: "round",
|
|
2261
2950
|
borderColor: focus === "cancel" ? "white" : theme.muted,
|
|
@@ -2264,28 +2953,28 @@ function TransferModal({ repo, onTransfer, onCancel, theme: themeProp }) {
|
|
|
2264
2953
|
alignItems: "center",
|
|
2265
2954
|
justifyContent: "center",
|
|
2266
2955
|
flexDirection: "column",
|
|
2267
|
-
children: /* @__PURE__ */
|
|
2956
|
+
children: /* @__PURE__ */ jsx24(Text24, { children: focus === "cancel" ? c.btnMuted(" Cancel ") : c.muted.bold("Cancel") })
|
|
2268
2957
|
}
|
|
2269
2958
|
)
|
|
2270
2959
|
] }),
|
|
2271
|
-
/* @__PURE__ */
|
|
2960
|
+
/* @__PURE__ */ jsx24(Box23, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs23(Text24, { color: theme.muted, children: [
|
|
2272
2961
|
"\u2190/\u2192 Focus \u2022 Enter to ",
|
|
2273
2962
|
focus === "transfer" ? "Transfer" : "Cancel",
|
|
2274
2963
|
" \u2022 Y Transfer \u2022 C/Esc Cancel"
|
|
2275
2964
|
] }) })
|
|
2276
2965
|
] })
|
|
2277
2966
|
] }),
|
|
2278
|
-
error && /* @__PURE__ */
|
|
2967
|
+
error && /* @__PURE__ */ jsx24(Box23, { marginTop: 1, children: /* @__PURE__ */ jsx24(Text24, { color: theme.error, children: error }) })
|
|
2279
2968
|
]
|
|
2280
2969
|
}
|
|
2281
2970
|
);
|
|
2282
2971
|
}
|
|
2283
2972
|
|
|
2284
2973
|
// src/ui/components/modals/UnstarModal.tsx
|
|
2285
|
-
import { useEffect as useEffect12, useState as
|
|
2286
|
-
import { Box as
|
|
2287
|
-
import { useInput as
|
|
2288
|
-
import { Fragment as
|
|
2974
|
+
import { useEffect as useEffect12, useState as useState23 } from "react";
|
|
2975
|
+
import { Box as Box24, Text as Text25 } from "ink";
|
|
2976
|
+
import { useInput as useInput23 } from "ink";
|
|
2977
|
+
import { Fragment as Fragment12, jsx as jsx25, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2289
2978
|
function UnstarModal({
|
|
2290
2979
|
visible,
|
|
2291
2980
|
repo,
|
|
@@ -2296,9 +2985,10 @@ function UnstarModal({
|
|
|
2296
2985
|
theme: themeProp
|
|
2297
2986
|
}) {
|
|
2298
2987
|
const { theme } = useTheme(themeProp?.name ?? "default");
|
|
2299
|
-
const [focusedButton, setFocusedButton] =
|
|
2300
|
-
|
|
2988
|
+
const [focusedButton, setFocusedButton] = useState23("cancel");
|
|
2989
|
+
useInput23((input, key) => {
|
|
2301
2990
|
if (!visible) return;
|
|
2991
|
+
if (isUnstarring) return;
|
|
2302
2992
|
if (key.escape || input === "c" || input === "C") {
|
|
2303
2993
|
onCancel();
|
|
2304
2994
|
return;
|
|
@@ -2319,8 +3009,8 @@ function UnstarModal({
|
|
|
2319
3009
|
if (visible) setFocusedButton("cancel");
|
|
2320
3010
|
}, [visible]);
|
|
2321
3011
|
if (!visible || !repo) return null;
|
|
2322
|
-
return /* @__PURE__ */
|
|
2323
|
-
|
|
3012
|
+
return /* @__PURE__ */ jsxs24(
|
|
3013
|
+
Box24,
|
|
2324
3014
|
{
|
|
2325
3015
|
flexDirection: "column",
|
|
2326
3016
|
borderStyle: "round",
|
|
@@ -2329,28 +3019,28 @@ function UnstarModal({
|
|
|
2329
3019
|
paddingY: 1,
|
|
2330
3020
|
marginTop: 1,
|
|
2331
3021
|
children: [
|
|
2332
|
-
/* @__PURE__ */
|
|
2333
|
-
/* @__PURE__ */
|
|
3022
|
+
/* @__PURE__ */ jsx25(Box24, { marginBottom: 1, children: /* @__PURE__ */ jsx25(Text25, { bold: true, color: theme.warning, children: "\u2B50 Unstar Repository" }) }),
|
|
3023
|
+
/* @__PURE__ */ jsx25(Box24, { marginBottom: 1, children: /* @__PURE__ */ jsxs24(Text25, { children: [
|
|
2334
3024
|
"Are you sure you want to unstar",
|
|
2335
3025
|
" ",
|
|
2336
|
-
/* @__PURE__ */
|
|
3026
|
+
/* @__PURE__ */ jsx25(Text25, { bold: true, color: theme.primary, children: repo.nameWithOwner }),
|
|
2337
3027
|
"?"
|
|
2338
3028
|
] }) }),
|
|
2339
|
-
repo.description && /* @__PURE__ */
|
|
2340
|
-
/* @__PURE__ */
|
|
3029
|
+
repo.description && /* @__PURE__ */ jsx25(Box24, { marginBottom: 1, children: /* @__PURE__ */ jsx25(Text25, { dimColor: true, wrap: "wrap", children: repo.description }) }),
|
|
3030
|
+
/* @__PURE__ */ jsx25(Box24, { marginBottom: 1, children: /* @__PURE__ */ jsxs24(Text25, { dimColor: true, children: [
|
|
2341
3031
|
"Stars: ",
|
|
2342
3032
|
repo.stargazerCount,
|
|
2343
3033
|
" \u2022 Forks: ",
|
|
2344
3034
|
repo.forkCount
|
|
2345
3035
|
] }) }),
|
|
2346
|
-
error && /* @__PURE__ */
|
|
3036
|
+
error && /* @__PURE__ */ jsx25(Box24, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs24(Text25, { color: theme.error, wrap: "wrap", children: [
|
|
2347
3037
|
error.includes("OAuth access restrictions") ? "\u26A0\uFE0F " : "Error: ",
|
|
2348
3038
|
error
|
|
2349
3039
|
] }) }),
|
|
2350
|
-
isUnstarring ? /* @__PURE__ */
|
|
2351
|
-
/* @__PURE__ */
|
|
2352
|
-
/* @__PURE__ */
|
|
2353
|
-
|
|
3040
|
+
isUnstarring ? /* @__PURE__ */ jsx25(Box24, { children: /* @__PURE__ */ jsx25(Text25, { color: theme.warning, children: "Unstarring..." }) }) : /* @__PURE__ */ jsxs24(Fragment12, { children: [
|
|
3041
|
+
/* @__PURE__ */ jsxs24(Box24, { gap: 2, children: [
|
|
3042
|
+
/* @__PURE__ */ jsx25(Box24, { children: /* @__PURE__ */ jsxs24(
|
|
3043
|
+
Text25,
|
|
2354
3044
|
{
|
|
2355
3045
|
backgroundColor: focusedButton === "cancel" ? "white" : void 0,
|
|
2356
3046
|
color: focusedButton === "cancel" ? "black" : "white",
|
|
@@ -2362,8 +3052,8 @@ function UnstarModal({
|
|
|
2362
3052
|
]
|
|
2363
3053
|
}
|
|
2364
3054
|
) }),
|
|
2365
|
-
/* @__PURE__ */
|
|
2366
|
-
|
|
3055
|
+
/* @__PURE__ */ jsx25(Box24, { children: /* @__PURE__ */ jsxs24(
|
|
3056
|
+
Text25,
|
|
2367
3057
|
{
|
|
2368
3058
|
backgroundColor: focusedButton === "unstar" ? "yellow" : void 0,
|
|
2369
3059
|
color: focusedButton === "unstar" ? "black" : theme.warning,
|
|
@@ -2376,7 +3066,7 @@ function UnstarModal({
|
|
|
2376
3066
|
}
|
|
2377
3067
|
) })
|
|
2378
3068
|
] }),
|
|
2379
|
-
/* @__PURE__ */
|
|
3069
|
+
/* @__PURE__ */ jsx25(Box24, { marginTop: 1, children: /* @__PURE__ */ jsx25(Text25, { dimColor: true, children: "Use \u2190 \u2192 to navigate, Enter to select" }) })
|
|
2380
3070
|
] })
|
|
2381
3071
|
]
|
|
2382
3072
|
}
|
|
@@ -2384,9 +3074,9 @@ function UnstarModal({
|
|
|
2384
3074
|
}
|
|
2385
3075
|
|
|
2386
3076
|
// src/ui/components/repo/RepoRow.tsx
|
|
2387
|
-
import { Box as
|
|
2388
|
-
import
|
|
2389
|
-
import { jsx as
|
|
3077
|
+
import { Box as Box25, Text as Text26 } from "ink";
|
|
3078
|
+
import chalk19 from "chalk";
|
|
3079
|
+
import { jsx as jsx26, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2390
3080
|
function RepoRow({
|
|
2391
3081
|
repo,
|
|
2392
3082
|
selected,
|
|
@@ -2396,6 +3086,8 @@ function RepoRow({
|
|
|
2396
3086
|
dim,
|
|
2397
3087
|
forkTracking,
|
|
2398
3088
|
starsMode = false,
|
|
3089
|
+
multiSelectMode = false,
|
|
3090
|
+
isChecked = false,
|
|
2399
3091
|
theme: themeProp
|
|
2400
3092
|
}) {
|
|
2401
3093
|
const { theme, c } = useTheme(themeProp?.name ?? "default");
|
|
@@ -2410,6 +3102,13 @@ function RepoRow({
|
|
|
2410
3102
|
let line1 = "";
|
|
2411
3103
|
const numColor = selected ? c.selected : c.muted;
|
|
2412
3104
|
const nameColor = selected ? c.selected.bold : c.text;
|
|
3105
|
+
if (multiSelectMode) {
|
|
3106
|
+
if (isChecked) {
|
|
3107
|
+
line1 += c.success("[\u2713] ");
|
|
3108
|
+
} else {
|
|
3109
|
+
line1 += c.muted("[ ] ");
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
2413
3112
|
line1 += numColor(`${String(index).padStart(3, " ")}.`);
|
|
2414
3113
|
if (repo.viewerHasStarred) {
|
|
2415
3114
|
line1 += c.warning(" \u2B50");
|
|
@@ -2423,7 +3122,7 @@ function RepoRow({
|
|
|
2423
3122
|
if (starsMode && repo.owner && repo.owner.__typename === "Organization") {
|
|
2424
3123
|
line1 += c.muted(" [org]");
|
|
2425
3124
|
}
|
|
2426
|
-
if (repo.isArchived) line1 += " " +
|
|
3125
|
+
if (repo.isArchived) line1 += " " + chalk19.bgGray.whiteBright(" Archived ") + " ";
|
|
2427
3126
|
if (repo.isFork && repo.parent) {
|
|
2428
3127
|
line1 += c.fork(` Fork of ${repo.parent.nameWithOwner}`);
|
|
2429
3128
|
if (showCommitData) {
|
|
@@ -2439,28 +3138,28 @@ function RepoRow({
|
|
|
2439
3138
|
}
|
|
2440
3139
|
let line2 = " ";
|
|
2441
3140
|
const metaColor = selected ? c.text : c.muted;
|
|
2442
|
-
if (langName) line2 +=
|
|
3141
|
+
if (langName) line2 += chalk19.hex(langColor)("\u25CF ") + metaColor(`${langName} `);
|
|
2443
3142
|
line2 += metaColor(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount} Updated ${formatDate(repo.updatedAt)}`);
|
|
2444
3143
|
const line3 = repo.description ? ` ${truncate(repo.description, Math.max(30, maxWidth - 10))}` : null;
|
|
2445
3144
|
let fullText = line1 + "\n" + line2;
|
|
2446
3145
|
if (line3) fullText += "\n" + metaColor(line3);
|
|
2447
3146
|
const spacingAbove = Math.floor(spacingLines / 2);
|
|
2448
3147
|
const spacingBelow = spacingLines - spacingAbove;
|
|
2449
|
-
return /* @__PURE__ */
|
|
2450
|
-
spacingAbove > 0 && /* @__PURE__ */
|
|
2451
|
-
/* @__PURE__ */
|
|
2452
|
-
spacingBelow > 0 && /* @__PURE__ */
|
|
3148
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", backgroundColor: selected ? theme.selectedBg : void 0, children: [
|
|
3149
|
+
spacingAbove > 0 && /* @__PURE__ */ jsx26(Box25, { height: spacingAbove, children: /* @__PURE__ */ jsx26(Text26, { children: " " }) }),
|
|
3150
|
+
/* @__PURE__ */ jsx26(Text26, { children: dim ? chalk19.dim(fullText) : fullText }),
|
|
3151
|
+
spacingBelow > 0 && /* @__PURE__ */ jsx26(Box25, { height: spacingBelow, children: /* @__PURE__ */ jsx26(Text26, { children: " " }) })
|
|
2453
3152
|
] });
|
|
2454
3153
|
}
|
|
2455
3154
|
|
|
2456
3155
|
// src/ui/components/repo/FilterInput.tsx
|
|
2457
|
-
import { Box as
|
|
2458
|
-
import
|
|
2459
|
-
import { jsx as
|
|
3156
|
+
import { Box as Box26, Text as Text27 } from "ink";
|
|
3157
|
+
import TextInput7 from "ink-text-input";
|
|
3158
|
+
import { jsx as jsx27, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2460
3159
|
|
|
2461
3160
|
// src/ui/components/repo/RepoListHeader.tsx
|
|
2462
|
-
import { Box as
|
|
2463
|
-
import { jsx as
|
|
3161
|
+
import { Box as Box27, Text as Text28 } from "ink";
|
|
3162
|
+
import { jsx as jsx28, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2464
3163
|
function RepoListHeader({
|
|
2465
3164
|
ownerContext,
|
|
2466
3165
|
sortKey,
|
|
@@ -2476,27 +3175,27 @@ function RepoListHeader({
|
|
|
2476
3175
|
}) {
|
|
2477
3176
|
const { theme } = useTheme(themeProp?.name ?? "default");
|
|
2478
3177
|
const contextLabel = ownerContext === "personal" ? "Personal Account" : ownerContext?.type === "organization" ? `Organisation: ${ownerContext.name ?? ownerContext.login}` : "";
|
|
2479
|
-
const
|
|
2480
|
-
return /* @__PURE__ */
|
|
2481
|
-
contextLabel && /* @__PURE__ */
|
|
2482
|
-
starsMode && /* @__PURE__ */
|
|
2483
|
-
/* @__PURE__ */
|
|
3178
|
+
const visibilityLabel2 = visibilityFilter === "public" ? "Public" : visibilityFilter === "private" ? isEnterprise ? "Private/Internal" : "Private" : visibilityFilter === "internal" ? "Internal" : "";
|
|
3179
|
+
return /* @__PURE__ */ jsxs27(Box27, { flexDirection: "row", gap: 2, marginBottom: 1, children: [
|
|
3180
|
+
contextLabel && /* @__PURE__ */ jsx28(Text28, { children: contextLabel }),
|
|
3181
|
+
starsMode && /* @__PURE__ */ jsx28(Text28, { color: theme.warning, bold: true, children: "\u2B50 Stars Mode" }),
|
|
3182
|
+
/* @__PURE__ */ jsxs27(Text28, { color: theme.muted, dimColor: true, children: [
|
|
2484
3183
|
"Sort: ",
|
|
2485
3184
|
filterActive ? "relevance" : `${sortKey} ${sortDir === "asc" ? "\u2191" : "\u2193"}`
|
|
2486
3185
|
] }),
|
|
2487
|
-
/* @__PURE__ */
|
|
3186
|
+
/* @__PURE__ */ jsxs27(Text28, { color: theme.muted, dimColor: true, children: [
|
|
2488
3187
|
"Fork Status - Commits Behind: ",
|
|
2489
3188
|
forkTracking ? "ON" : "OFF"
|
|
2490
3189
|
] }),
|
|
2491
|
-
!!
|
|
3190
|
+
!!visibilityLabel2 && !starsMode && /* @__PURE__ */ jsxs27(Text28, { color: theme.warning, children: [
|
|
2492
3191
|
"Visibility: ",
|
|
2493
|
-
|
|
3192
|
+
visibilityLabel2
|
|
2494
3193
|
] }),
|
|
2495
|
-
archiveFilter !== "all" && /* @__PURE__ */
|
|
3194
|
+
archiveFilter !== "all" && /* @__PURE__ */ jsxs27(Text28, { color: theme.primary, children: [
|
|
2496
3195
|
"Archive: ",
|
|
2497
3196
|
archiveFilter === "archived" ? "Archived" : "Unarchived"
|
|
2498
3197
|
] }),
|
|
2499
|
-
(filterActive || starsMode && filter.trim().length > 0) && /* @__PURE__ */
|
|
3198
|
+
(filterActive || starsMode && filter.trim().length > 0) && /* @__PURE__ */ jsxs27(Text28, { color: theme.primary, children: [
|
|
2500
3199
|
starsMode ? "Filter" : "Search",
|
|
2501
3200
|
': "',
|
|
2502
3201
|
filter.trim(),
|
|
@@ -2506,7 +3205,7 @@ function RepoListHeader({
|
|
|
2506
3205
|
}
|
|
2507
3206
|
|
|
2508
3207
|
// src/ui/views/RepoList.tsx
|
|
2509
|
-
import { Fragment as
|
|
3208
|
+
import { Fragment as Fragment13, jsx as jsx29, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2510
3209
|
var getPageSize = () => {
|
|
2511
3210
|
const envValue = process.env.REPOS_PER_FETCH;
|
|
2512
3211
|
if (envValue) {
|
|
@@ -2522,17 +3221,17 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2522
3221
|
const { exit } = useApp();
|
|
2523
3222
|
const { stdout } = useStdout();
|
|
2524
3223
|
const client = useMemo2(() => makeClient(token), [token]);
|
|
2525
|
-
const [debugMessages, setDebugMessages] =
|
|
3224
|
+
const [debugMessages, setDebugMessages] = useState24([]);
|
|
2526
3225
|
const addDebugMessage = useCallback((msg) => {
|
|
2527
3226
|
if (process.env.GH_MANAGER_DEBUG === "1") {
|
|
2528
3227
|
setDebugMessages((prev) => [...prev.slice(-9), msg]);
|
|
2529
3228
|
}
|
|
2530
3229
|
}, []);
|
|
2531
|
-
const handleOrgContextChangeRef =
|
|
3230
|
+
const handleOrgContextChangeRef = useRef8(onOrgContextChange);
|
|
2532
3231
|
useEffect13(() => {
|
|
2533
3232
|
handleOrgContextChangeRef.current = onOrgContextChange;
|
|
2534
3233
|
}, [onOrgContextChange]);
|
|
2535
|
-
|
|
3234
|
+
React24.useEffect(() => {
|
|
2536
3235
|
addDebugMessage(`[RepoList] Component mounted`);
|
|
2537
3236
|
logger.info("RepoList component mounted", {
|
|
2538
3237
|
token: token ? "present" : "missing",
|
|
@@ -2544,92 +3243,110 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2544
3243
|
}, []);
|
|
2545
3244
|
const terminalWidth = stdout?.columns ?? 80;
|
|
2546
3245
|
const availableHeight = maxVisibleRows ?? 20;
|
|
2547
|
-
const [items, setItems] =
|
|
2548
|
-
const [cursor, setCursor] =
|
|
2549
|
-
const [endCursor, setEndCursor] =
|
|
2550
|
-
const [hasNextPage, setHasNextPage] =
|
|
2551
|
-
const [totalCount, setTotalCount] =
|
|
2552
|
-
const [loading, setLoading] =
|
|
2553
|
-
const [sortingLoading, setSortingLoading] =
|
|
2554
|
-
const [refreshing, setRefreshing] =
|
|
2555
|
-
const [loadingMore, setLoadingMore] =
|
|
2556
|
-
const [error, setError] =
|
|
2557
|
-
const [rateLimit, setRateLimit] =
|
|
2558
|
-
const [prevRateLimit, setPrevRateLimit] =
|
|
2559
|
-
const [restRateLimit, setRestRateLimit] =
|
|
2560
|
-
const [prevRestRateLimit, setPrevRestRateLimit] =
|
|
2561
|
-
const [density, setDensity] =
|
|
2562
|
-
const [prefsLoaded, setPrefsLoaded] =
|
|
2563
|
-
const [themeName, setThemeName] =
|
|
2564
|
-
const [themeToast, setThemeToast] =
|
|
2565
|
-
const themeToastTimerRef =
|
|
3246
|
+
const [items, setItems] = useState24([]);
|
|
3247
|
+
const [cursor, setCursor] = useState24(0);
|
|
3248
|
+
const [endCursor, setEndCursor] = useState24(null);
|
|
3249
|
+
const [hasNextPage, setHasNextPage] = useState24(false);
|
|
3250
|
+
const [totalCount, setTotalCount] = useState24(0);
|
|
3251
|
+
const [loading, setLoading] = useState24(true);
|
|
3252
|
+
const [sortingLoading, setSortingLoading] = useState24(false);
|
|
3253
|
+
const [refreshing, setRefreshing] = useState24(false);
|
|
3254
|
+
const [loadingMore, setLoadingMore] = useState24(false);
|
|
3255
|
+
const [error, setError] = useState24(null);
|
|
3256
|
+
const [rateLimit, setRateLimit] = useState24(void 0);
|
|
3257
|
+
const [prevRateLimit, setPrevRateLimit] = useState24(void 0);
|
|
3258
|
+
const [restRateLimit, setRestRateLimit] = useState24(void 0);
|
|
3259
|
+
const [prevRestRateLimit, setPrevRestRateLimit] = useState24(void 0);
|
|
3260
|
+
const [density, setDensity] = useState24(2);
|
|
3261
|
+
const [prefsLoaded, setPrefsLoaded] = useState24(false);
|
|
3262
|
+
const [themeName, setThemeName] = useState24("default");
|
|
3263
|
+
const [themeToast, setThemeToast] = useState24(null);
|
|
3264
|
+
const themeToastTimerRef = useRef8(null);
|
|
2566
3265
|
const { theme, c: tc } = useTheme(themeName);
|
|
2567
|
-
const [ownerContext, setOwnerContext] =
|
|
2568
|
-
const [ownerAffiliations, setOwnerAffiliations] =
|
|
2569
|
-
const [orgSwitcherOpen, setOrgSwitcherOpen] =
|
|
2570
|
-
const [operationCount, setOperationCount] =
|
|
2571
|
-
const [showSponsorReminder, setShowSponsorReminder] =
|
|
2572
|
-
const [deleteMode, setDeleteMode] =
|
|
2573
|
-
const [deleteTarget, setDeleteTarget] =
|
|
2574
|
-
const [deleteCode, setDeleteCode] =
|
|
2575
|
-
const [typedCode, setTypedCode] =
|
|
2576
|
-
const [deleting, setDeleting] =
|
|
2577
|
-
const [deleteError, setDeleteError] =
|
|
2578
|
-
const [deleteConfirmStage, setDeleteConfirmStage] =
|
|
2579
|
-
const [confirmFocus, setConfirmFocus] =
|
|
2580
|
-
const [archiveMode, setArchiveMode] =
|
|
2581
|
-
const [archiveTarget, setArchiveTarget] =
|
|
2582
|
-
const [archiving, setArchiving] =
|
|
2583
|
-
const [archiveError, setArchiveError] =
|
|
2584
|
-
const [archiveFocus, setArchiveFocus] =
|
|
2585
|
-
const [syncMode, setSyncMode] =
|
|
2586
|
-
const [syncTarget, setSyncTarget] =
|
|
2587
|
-
const [syncing, setSyncing] =
|
|
2588
|
-
const [syncError, setSyncError] =
|
|
2589
|
-
const [syncFocus, setSyncFocus] =
|
|
2590
|
-
const [renameMode, setRenameMode] =
|
|
2591
|
-
const [renameTarget, setRenameTarget] =
|
|
2592
|
-
const [createMode, setCreateMode] =
|
|
2593
|
-
const [transferMode, setTransferMode] =
|
|
2594
|
-
const [transferTarget, setTransferTarget] =
|
|
2595
|
-
const [copyUrlMode, setCopyUrlMode] =
|
|
2596
|
-
const [copyUrlTarget, setCopyUrlTarget] =
|
|
2597
|
-
const [copyToast, setCopyToast] =
|
|
2598
|
-
const [syncTrigger, setSyncTrigger] =
|
|
2599
|
-
const [infoMode, setInfoMode] =
|
|
2600
|
-
const [infoRepo, setInfoRepo] =
|
|
2601
|
-
const [logoutMode, setLogoutMode] =
|
|
2602
|
-
const [logoutFocus, setLogoutFocus] =
|
|
2603
|
-
const [logoutError, setLogoutError] =
|
|
2604
|
-
const [archiveFilterMode, setArchiveFilterMode] =
|
|
2605
|
-
const [visibilityMode, setVisibilityMode] =
|
|
2606
|
-
const [isEnterpriseOrg, setIsEnterpriseOrg] =
|
|
2607
|
-
const [hasInternalRepos, setHasInternalRepos] =
|
|
2608
|
-
const [changeVisibilityMode, setChangeVisibilityMode] =
|
|
2609
|
-
const [changeVisibilityTarget, setChangeVisibilityTarget] =
|
|
2610
|
-
const [changingVisibility, setChangingVisibility] =
|
|
2611
|
-
const [changeVisibilityError, setChangeVisibilityError] =
|
|
2612
|
-
const [sortMode, setSortMode] =
|
|
2613
|
-
const [sortDirectionMode, setSortDirectionMode] =
|
|
2614
|
-
const [starsMode, setStarsMode] =
|
|
2615
|
-
const [starredItems, setStarredItems] =
|
|
2616
|
-
const [starredEndCursor, setStarredEndCursor] =
|
|
2617
|
-
const [starredHasNextPage, setStarredHasNextPage] =
|
|
2618
|
-
const [starredTotalCount, setStarredTotalCount] =
|
|
2619
|
-
const [starredLoading, setStarredLoading] =
|
|
2620
|
-
const [unstarMode, setUnstarMode] =
|
|
2621
|
-
const [unstarTarget, setUnstarTarget] =
|
|
2622
|
-
const [unstarring, setUnstarring] =
|
|
2623
|
-
const [unstarError, setUnstarError] =
|
|
2624
|
-
const [starMode, setStarMode] =
|
|
2625
|
-
const [starTarget, setStarTarget] =
|
|
2626
|
-
const [starring, setStarring] =
|
|
2627
|
-
const [starError, setStarError] =
|
|
2628
|
-
const [
|
|
2629
|
-
const [
|
|
2630
|
-
const [
|
|
2631
|
-
const
|
|
2632
|
-
const
|
|
3266
|
+
const [ownerContext, setOwnerContext] = useState24("personal");
|
|
3267
|
+
const [ownerAffiliations, setOwnerAffiliations] = useState24(["OWNER"]);
|
|
3268
|
+
const [orgSwitcherOpen, setOrgSwitcherOpen] = useState24(false);
|
|
3269
|
+
const [operationCount, setOperationCount] = useState24(0);
|
|
3270
|
+
const [showSponsorReminder, setShowSponsorReminder] = useState24(false);
|
|
3271
|
+
const [deleteMode, setDeleteMode] = useState24(false);
|
|
3272
|
+
const [deleteTarget, setDeleteTarget] = useState24(null);
|
|
3273
|
+
const [deleteCode, setDeleteCode] = useState24("");
|
|
3274
|
+
const [typedCode, setTypedCode] = useState24("");
|
|
3275
|
+
const [deleting, setDeleting] = useState24(false);
|
|
3276
|
+
const [deleteError, setDeleteError] = useState24(null);
|
|
3277
|
+
const [deleteConfirmStage, setDeleteConfirmStage] = useState24(false);
|
|
3278
|
+
const [confirmFocus, setConfirmFocus] = useState24("delete");
|
|
3279
|
+
const [archiveMode, setArchiveMode] = useState24(false);
|
|
3280
|
+
const [archiveTarget, setArchiveTarget] = useState24(null);
|
|
3281
|
+
const [archiving, setArchiving] = useState24(false);
|
|
3282
|
+
const [archiveError, setArchiveError] = useState24(null);
|
|
3283
|
+
const [archiveFocus, setArchiveFocus] = useState24("confirm");
|
|
3284
|
+
const [syncMode, setSyncMode] = useState24(false);
|
|
3285
|
+
const [syncTarget, setSyncTarget] = useState24(null);
|
|
3286
|
+
const [syncing, setSyncing] = useState24(false);
|
|
3287
|
+
const [syncError, setSyncError] = useState24(null);
|
|
3288
|
+
const [syncFocus, setSyncFocus] = useState24("confirm");
|
|
3289
|
+
const [renameMode, setRenameMode] = useState24(false);
|
|
3290
|
+
const [renameTarget, setRenameTarget] = useState24(null);
|
|
3291
|
+
const [createMode, setCreateMode] = useState24(false);
|
|
3292
|
+
const [transferMode, setTransferMode] = useState24(false);
|
|
3293
|
+
const [transferTarget, setTransferTarget] = useState24(null);
|
|
3294
|
+
const [copyUrlMode, setCopyUrlMode] = useState24(false);
|
|
3295
|
+
const [copyUrlTarget, setCopyUrlTarget] = useState24(null);
|
|
3296
|
+
const [copyToast, setCopyToast] = useState24(null);
|
|
3297
|
+
const [syncTrigger, setSyncTrigger] = useState24(false);
|
|
3298
|
+
const [infoMode, setInfoMode] = useState24(false);
|
|
3299
|
+
const [infoRepo, setInfoRepo] = useState24(null);
|
|
3300
|
+
const [logoutMode, setLogoutMode] = useState24(false);
|
|
3301
|
+
const [logoutFocus, setLogoutFocus] = useState24("confirm");
|
|
3302
|
+
const [logoutError, setLogoutError] = useState24(null);
|
|
3303
|
+
const [archiveFilterMode, setArchiveFilterMode] = useState24(false);
|
|
3304
|
+
const [visibilityMode, setVisibilityMode] = useState24(false);
|
|
3305
|
+
const [isEnterpriseOrg, setIsEnterpriseOrg] = useState24(false);
|
|
3306
|
+
const [hasInternalRepos, setHasInternalRepos] = useState24(false);
|
|
3307
|
+
const [changeVisibilityMode, setChangeVisibilityMode] = useState24(false);
|
|
3308
|
+
const [changeVisibilityTarget, setChangeVisibilityTarget] = useState24(null);
|
|
3309
|
+
const [changingVisibility, setChangingVisibility] = useState24(false);
|
|
3310
|
+
const [changeVisibilityError, setChangeVisibilityError] = useState24(null);
|
|
3311
|
+
const [sortMode, setSortMode] = useState24(false);
|
|
3312
|
+
const [sortDirectionMode, setSortDirectionMode] = useState24(false);
|
|
3313
|
+
const [starsMode, setStarsMode] = useState24(false);
|
|
3314
|
+
const [starredItems, setStarredItems] = useState24([]);
|
|
3315
|
+
const [starredEndCursor, setStarredEndCursor] = useState24(null);
|
|
3316
|
+
const [starredHasNextPage, setStarredHasNextPage] = useState24(false);
|
|
3317
|
+
const [starredTotalCount, setStarredTotalCount] = useState24(0);
|
|
3318
|
+
const [starredLoading, setStarredLoading] = useState24(false);
|
|
3319
|
+
const [unstarMode, setUnstarMode] = useState24(false);
|
|
3320
|
+
const [unstarTarget, setUnstarTarget] = useState24(null);
|
|
3321
|
+
const [unstarring, setUnstarring] = useState24(false);
|
|
3322
|
+
const [unstarError, setUnstarError] = useState24(null);
|
|
3323
|
+
const [starMode, setStarMode] = useState24(false);
|
|
3324
|
+
const [starTarget, setStarTarget] = useState24(null);
|
|
3325
|
+
const [starring, setStarring] = useState24(false);
|
|
3326
|
+
const [starError, setStarError] = useState24(null);
|
|
3327
|
+
const [multiSelectMode, setMultiSelectMode] = useState24(false);
|
|
3328
|
+
const [selectedRepos, setSelectedRepos] = useState24(/* @__PURE__ */ new Map());
|
|
3329
|
+
const [bulkAction, setBulkAction] = useState24(null);
|
|
3330
|
+
const [bulkVisibilityTarget, setBulkVisibilityTarget] = useState24(null);
|
|
3331
|
+
const [bulkIntentKind, setBulkIntentKind] = useState24(null);
|
|
3332
|
+
const [bulkVisibilityOpen, setBulkVisibilityOpen] = useState24(false);
|
|
3333
|
+
const [bulkReviewOpen, setBulkReviewOpen] = useState24(false);
|
|
3334
|
+
const [bulkConfirmOpen, setBulkConfirmOpen] = useState24(false);
|
|
3335
|
+
const [bulkDeleteCodeOpen, setBulkDeleteCodeOpen] = useState24(false);
|
|
3336
|
+
const [bulkProgressOpen, setBulkProgressOpen] = useState24(false);
|
|
3337
|
+
const [bulkFinalSelection, setBulkFinalSelection] = useState24(/* @__PURE__ */ new Map());
|
|
3338
|
+
const [bulkProgress, setBulkProgress] = useState24({
|
|
3339
|
+
total: 0,
|
|
3340
|
+
completed: 0,
|
|
3341
|
+
failed: [],
|
|
3342
|
+
currentRepo: null,
|
|
3343
|
+
done: false
|
|
3344
|
+
});
|
|
3345
|
+
const [openInBrowserMode, setOpenInBrowserMode] = useState24(false);
|
|
3346
|
+
const [openInBrowserTarget, setOpenInBrowserTarget] = useState24(null);
|
|
3347
|
+
const [enrichingForks, setEnrichingForks] = useState24(false);
|
|
3348
|
+
const enrichmentDoneRef = useRef8(/* @__PURE__ */ new Set());
|
|
3349
|
+
const appliedInitialOrg = useRef8(false);
|
|
2633
3350
|
useEffect13(() => {
|
|
2634
3351
|
(async () => {
|
|
2635
3352
|
if (appliedInitialOrg.current) return;
|
|
@@ -2853,6 +3570,120 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2853
3570
|
setArchiveError("Failed to update archive state. Check permissions.");
|
|
2854
3571
|
}
|
|
2855
3572
|
}
|
|
3573
|
+
function enterMultiSelectMode() {
|
|
3574
|
+
setMultiSelectMode(true);
|
|
3575
|
+
}
|
|
3576
|
+
function exitMultiSelectMode(clearSelection = true) {
|
|
3577
|
+
setMultiSelectMode(false);
|
|
3578
|
+
if (clearSelection) {
|
|
3579
|
+
setSelectedRepos(/* @__PURE__ */ new Map());
|
|
3580
|
+
}
|
|
3581
|
+
}
|
|
3582
|
+
function toggleRepoSelection(repo) {
|
|
3583
|
+
setSelectedRepos((prev) => {
|
|
3584
|
+
const next = new Map(prev);
|
|
3585
|
+
if (next.has(repo.id)) {
|
|
3586
|
+
next.delete(repo.id);
|
|
3587
|
+
} else {
|
|
3588
|
+
next.set(repo.id, repo);
|
|
3589
|
+
}
|
|
3590
|
+
return next;
|
|
3591
|
+
});
|
|
3592
|
+
}
|
|
3593
|
+
async function executeBulkOperation(repos, action, visTarget) {
|
|
3594
|
+
const total = repos.length;
|
|
3595
|
+
setBulkProgress({ total, completed: 0, failed: [], currentRepo: null, done: false });
|
|
3596
|
+
setBulkProgressOpen(true);
|
|
3597
|
+
const failed = [];
|
|
3598
|
+
for (let i = 0; i < repos.length; i++) {
|
|
3599
|
+
const repo = repos[i];
|
|
3600
|
+
setBulkProgress((prev) => ({ ...prev, currentRepo: repo, completed: i }));
|
|
3601
|
+
try {
|
|
3602
|
+
if (action === "delete") {
|
|
3603
|
+
const [owner, repoName] = repo.nameWithOwner.split("/");
|
|
3604
|
+
await deleteRepositoryRest(token, owner, repoName);
|
|
3605
|
+
await updateCacheAfterDelete(token, repo.id);
|
|
3606
|
+
setItems((prev) => prev.filter((r) => r.id !== repo.id));
|
|
3607
|
+
setTotalCount((c) => Math.max(0, c - 1));
|
|
3608
|
+
} else if (action === "archive") {
|
|
3609
|
+
await archiveRepositoryById(client, repo.id);
|
|
3610
|
+
await updateCacheAfterArchive(token, repo.id, true);
|
|
3611
|
+
const updateRepo = (r) => r.id === repo.id ? { ...r, isArchived: true } : r;
|
|
3612
|
+
setItems((prev) => prev.map(updateRepo));
|
|
3613
|
+
} else if (action === "unarchive") {
|
|
3614
|
+
await unarchiveRepositoryById(client, repo.id);
|
|
3615
|
+
await updateCacheAfterArchive(token, repo.id, false);
|
|
3616
|
+
const updateRepo = (r) => r.id === repo.id ? { ...r, isArchived: false } : r;
|
|
3617
|
+
setItems((prev) => prev.map(updateRepo));
|
|
3618
|
+
} else if (action === "star" || action === "unstar") {
|
|
3619
|
+
const wantStarred = action === "star";
|
|
3620
|
+
if (wantStarred) await starRepository(client, repo.id);
|
|
3621
|
+
else await unstarRepository(client, repo.id);
|
|
3622
|
+
const updateRepo = (r) => r.id === repo.id ? { ...r, viewerHasStarred: wantStarred, stargazerCount: r.stargazerCount + (wantStarred ? r.viewerHasStarred ? 0 : 1 : r.viewerHasStarred ? -1 : 0) } : r;
|
|
3623
|
+
setItems((prev) => prev.map(updateRepo));
|
|
3624
|
+
} else if (action === "visibility" && visTarget) {
|
|
3625
|
+
await changeRepositoryVisibility(client, repo.id, visTarget, token);
|
|
3626
|
+
await updateCacheAfterVisibilityChange(token, repo.id, visTarget);
|
|
3627
|
+
const shouldRemove = visibilityFilter === "public" && visTarget !== "PUBLIC" || visibilityFilter === "private" && visTarget !== "PRIVATE" && visTarget !== "INTERNAL";
|
|
3628
|
+
if (shouldRemove) {
|
|
3629
|
+
setItems((prev) => prev.filter((r) => r.id !== repo.id));
|
|
3630
|
+
setTotalCount((c) => Math.max(0, c - 1));
|
|
3631
|
+
} else {
|
|
3632
|
+
const updateRepo = (r) => r.id === repo.id ? { ...r, visibility: visTarget, isPrivate: visTarget !== "PUBLIC" } : r;
|
|
3633
|
+
setItems((prev) => prev.map(updateRepo));
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3636
|
+
trackSuccessfulOperation();
|
|
3637
|
+
} catch (e) {
|
|
3638
|
+
failed.push({ repo, error: e.message || "Unknown error" });
|
|
3639
|
+
}
|
|
3640
|
+
setBulkProgress((prev) => ({ ...prev, completed: i + 1, failed: [...failed] }));
|
|
3641
|
+
}
|
|
3642
|
+
setBulkProgress((prev) => ({ ...prev, currentRepo: null, done: true, failed: [...failed] }));
|
|
3643
|
+
setSelectedRepos(/* @__PURE__ */ new Map());
|
|
3644
|
+
setMultiSelectMode(false);
|
|
3645
|
+
setCursor((c) => Math.max(0, Math.min(c, visibleItems.length - 1)));
|
|
3646
|
+
}
|
|
3647
|
+
function resetBulkFlow() {
|
|
3648
|
+
setBulkIntentKind(null);
|
|
3649
|
+
setBulkVisibilityOpen(false);
|
|
3650
|
+
setBulkReviewOpen(false);
|
|
3651
|
+
setBulkConfirmOpen(false);
|
|
3652
|
+
setBulkDeleteCodeOpen(false);
|
|
3653
|
+
setBulkAction(null);
|
|
3654
|
+
setBulkVisibilityTarget(null);
|
|
3655
|
+
setBulkFinalSelection(/* @__PURE__ */ new Map());
|
|
3656
|
+
}
|
|
3657
|
+
function beginBulkReview(action) {
|
|
3658
|
+
if (selectedRepos.size === 0) return;
|
|
3659
|
+
setBulkAction(action);
|
|
3660
|
+
setBulkReviewOpen(true);
|
|
3661
|
+
}
|
|
3662
|
+
function startBulkDelete() {
|
|
3663
|
+
beginBulkReview("delete");
|
|
3664
|
+
}
|
|
3665
|
+
function startBulkArchive() {
|
|
3666
|
+
const repos = Array.from(selectedRepos.values());
|
|
3667
|
+
if (repos.length === 0) return;
|
|
3668
|
+
const allArchived = repos.every((r) => r.isArchived);
|
|
3669
|
+
const noneArchived = repos.every((r) => !r.isArchived);
|
|
3670
|
+
if (allArchived) beginBulkReview("unarchive");
|
|
3671
|
+
else if (noneArchived) beginBulkReview("archive");
|
|
3672
|
+
else setBulkIntentKind("archive");
|
|
3673
|
+
}
|
|
3674
|
+
function startBulkStar() {
|
|
3675
|
+
const repos = Array.from(selectedRepos.values());
|
|
3676
|
+
if (repos.length === 0) return;
|
|
3677
|
+
const allStarred = repos.every((r) => r.viewerHasStarred);
|
|
3678
|
+
const noneStarred = repos.every((r) => !r.viewerHasStarred);
|
|
3679
|
+
if (allStarred) beginBulkReview("unstar");
|
|
3680
|
+
else if (noneStarred) beginBulkReview("star");
|
|
3681
|
+
else setBulkIntentKind("star");
|
|
3682
|
+
}
|
|
3683
|
+
function startBulkVisibility() {
|
|
3684
|
+
if (selectedRepos.size === 0) return;
|
|
3685
|
+
setBulkVisibilityOpen(true);
|
|
3686
|
+
}
|
|
2856
3687
|
async function executeRename(repo, newName) {
|
|
2857
3688
|
if (!repo || !newName.trim()) return;
|
|
2858
3689
|
try {
|
|
@@ -2923,7 +3754,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2923
3754
|
trackSuccessfulOperation();
|
|
2924
3755
|
closeTransferModal();
|
|
2925
3756
|
}
|
|
2926
|
-
const copyToastTimerRef =
|
|
3757
|
+
const copyToastTimerRef = useRef8(null);
|
|
2927
3758
|
async function handleCopyUrl(url, type) {
|
|
2928
3759
|
try {
|
|
2929
3760
|
if (copyToastTimerRef.current) {
|
|
@@ -2985,6 +3816,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2985
3816
|
setOrgSwitcherOpen(false);
|
|
2986
3817
|
setItems([]);
|
|
2987
3818
|
setTotalCount(0);
|
|
3819
|
+
setSelectedRepos(/* @__PURE__ */ new Map());
|
|
3820
|
+
setMultiSelectMode(false);
|
|
2988
3821
|
setFilter("");
|
|
2989
3822
|
setFilterMode(false);
|
|
2990
3823
|
setVisibilityFilter("all");
|
|
@@ -3045,11 +3878,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3045
3878
|
setDeleteError("Failed to delete repository. Ensure delete_repo scope and admin permissions.");
|
|
3046
3879
|
}
|
|
3047
3880
|
}
|
|
3048
|
-
const [filter, setFilter] =
|
|
3049
|
-
const [filterMode, setFilterMode] =
|
|
3050
|
-
const [sortKey, setSortKey] =
|
|
3051
|
-
const [sortDir, setSortDir] =
|
|
3052
|
-
const [forkTracking, setForkTracking] =
|
|
3881
|
+
const [filter, setFilter] = useState24("");
|
|
3882
|
+
const [filterMode, setFilterMode] = useState24(false);
|
|
3883
|
+
const [sortKey, setSortKey] = useState24("updated");
|
|
3884
|
+
const [sortDir, setSortDir] = useState24("desc");
|
|
3885
|
+
const [forkTracking, setForkTracking] = useState24(true);
|
|
3053
3886
|
useEffect13(() => {
|
|
3054
3887
|
if (loading || loadingMore || hasNextPage || items.length === 0) return;
|
|
3055
3888
|
if (!forkTracking) return;
|
|
@@ -3126,10 +3959,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3126
3959
|
logger.error("Failed to fetch upstream repository", { error: err?.message, parentNameWithOwner });
|
|
3127
3960
|
}
|
|
3128
3961
|
}
|
|
3129
|
-
const [visibilityFilter, setVisibilityFilter] =
|
|
3130
|
-
const previousVisibilityFilter =
|
|
3131
|
-
const pendingFocusRef =
|
|
3132
|
-
const [archiveFilter, setArchiveFilter] =
|
|
3962
|
+
const [visibilityFilter, setVisibilityFilter] = useState24("all");
|
|
3963
|
+
const previousVisibilityFilter = useRef8("all");
|
|
3964
|
+
const pendingFocusRef = useRef8(null);
|
|
3965
|
+
const [archiveFilter, setArchiveFilter] = useState24("all");
|
|
3133
3966
|
const sortFieldMap = {
|
|
3134
3967
|
"updated": "UPDATED_AT",
|
|
3135
3968
|
"pushed": "PUSHED_AT",
|
|
@@ -3300,7 +4133,31 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3300
4133
|
}
|
|
3301
4134
|
previousVisibilityFilter.current = visibilityFilter;
|
|
3302
4135
|
}, [visibilityFilter]);
|
|
3303
|
-
|
|
4136
|
+
useInput24((input, key) => {
|
|
4137
|
+
if (bulkProgressOpen && bulkProgress.done) {
|
|
4138
|
+
setBulkProgressOpen(false);
|
|
4139
|
+
setBulkProgress({ total: 0, completed: 0, failed: [], currentRepo: null, done: false });
|
|
4140
|
+
setBulkAction(null);
|
|
4141
|
+
setBulkVisibilityTarget(null);
|
|
4142
|
+
setBulkFinalSelection(/* @__PURE__ */ new Map());
|
|
4143
|
+
return;
|
|
4144
|
+
}
|
|
4145
|
+
if (bulkProgressOpen) return;
|
|
4146
|
+
if (bulkIntentKind) {
|
|
4147
|
+
return;
|
|
4148
|
+
}
|
|
4149
|
+
if (bulkVisibilityOpen) {
|
|
4150
|
+
return;
|
|
4151
|
+
}
|
|
4152
|
+
if (bulkReviewOpen) {
|
|
4153
|
+
return;
|
|
4154
|
+
}
|
|
4155
|
+
if (bulkConfirmOpen) {
|
|
4156
|
+
return;
|
|
4157
|
+
}
|
|
4158
|
+
if (bulkDeleteCodeOpen) {
|
|
4159
|
+
return;
|
|
4160
|
+
}
|
|
3304
4161
|
if (error) {
|
|
3305
4162
|
if (input && input.toUpperCase() === "Q") {
|
|
3306
4163
|
try {
|
|
@@ -3511,6 +4368,72 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3511
4368
|
addDebugMessage("[ESC] Cleared filter and returned to normal listing");
|
|
3512
4369
|
return;
|
|
3513
4370
|
}
|
|
4371
|
+
if (input && input.toUpperCase() === "B" && !key.ctrl && !key.shift) {
|
|
4372
|
+
if (multiSelectMode) {
|
|
4373
|
+
exitMultiSelectMode(true);
|
|
4374
|
+
} else {
|
|
4375
|
+
enterMultiSelectMode();
|
|
4376
|
+
}
|
|
4377
|
+
return;
|
|
4378
|
+
}
|
|
4379
|
+
if (key.escape && multiSelectMode) {
|
|
4380
|
+
exitMultiSelectMode(true);
|
|
4381
|
+
return;
|
|
4382
|
+
}
|
|
4383
|
+
if (multiSelectMode) {
|
|
4384
|
+
if (key.downArrow) {
|
|
4385
|
+
setCursor((c) => Math.min(c + 1, visibleItems.length - 1));
|
|
4386
|
+
return;
|
|
4387
|
+
}
|
|
4388
|
+
if (key.upArrow) {
|
|
4389
|
+
setCursor((c) => Math.max(c - 1, 0));
|
|
4390
|
+
return;
|
|
4391
|
+
}
|
|
4392
|
+
if (key.pageDown) {
|
|
4393
|
+
setCursor((c) => Math.min(c + 10, visibleItems.length - 1));
|
|
4394
|
+
return;
|
|
4395
|
+
}
|
|
4396
|
+
if (key.pageUp) {
|
|
4397
|
+
setCursor((c) => Math.max(c - 10, 0));
|
|
4398
|
+
return;
|
|
4399
|
+
}
|
|
4400
|
+
if (key.ctrl && (input === "g" || input === "G")) {
|
|
4401
|
+
setCursor(0);
|
|
4402
|
+
return;
|
|
4403
|
+
}
|
|
4404
|
+
if (!key.ctrl && input && input.toUpperCase() === "G") {
|
|
4405
|
+
setCursor(visibleItems.length - 1);
|
|
4406
|
+
return;
|
|
4407
|
+
}
|
|
4408
|
+
if (input === " ") {
|
|
4409
|
+
const repo = visibleItems[cursor];
|
|
4410
|
+
if (repo) toggleRepoSelection(repo);
|
|
4411
|
+
return;
|
|
4412
|
+
}
|
|
4413
|
+
if (!key.ctrl && input && input.toUpperCase() === "X") {
|
|
4414
|
+
setSelectedRepos(/* @__PURE__ */ new Map());
|
|
4415
|
+
return;
|
|
4416
|
+
}
|
|
4417
|
+
if (selectedRepos.size > 0) {
|
|
4418
|
+
if (key.ctrl && (input === "s" || input === "S")) {
|
|
4419
|
+
startBulkStar();
|
|
4420
|
+
return;
|
|
4421
|
+
}
|
|
4422
|
+
if (key.ctrl && (input === "a" || input === "A")) {
|
|
4423
|
+
startBulkArchive();
|
|
4424
|
+
return;
|
|
4425
|
+
}
|
|
4426
|
+
if (key.ctrl && (input === "v" || input === "V")) {
|
|
4427
|
+
startBulkVisibility();
|
|
4428
|
+
return;
|
|
4429
|
+
}
|
|
4430
|
+
if (key.delete || key.backspace) {
|
|
4431
|
+
startBulkDelete();
|
|
4432
|
+
return;
|
|
4433
|
+
}
|
|
4434
|
+
}
|
|
4435
|
+
return;
|
|
4436
|
+
}
|
|
3514
4437
|
if (input && input.toUpperCase() === "Q") {
|
|
3515
4438
|
try {
|
|
3516
4439
|
const seq = "\x1B[2J\x1B[3J\x1B[H";
|
|
@@ -3525,7 +4448,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3525
4448
|
if (key.upArrow) setCursor((c) => Math.max(c - 1, 0));
|
|
3526
4449
|
if (key.pageDown) setCursor((c) => Math.min(c + 10, visibleItems.length - 1));
|
|
3527
4450
|
if (key.pageUp) setCursor((c) => Math.max(c - 10, 0));
|
|
3528
|
-
if (key.return) {
|
|
4451
|
+
if (key.return && !multiSelectMode) {
|
|
3529
4452
|
const repo = visibleItems[cursor];
|
|
3530
4453
|
if (repo) {
|
|
3531
4454
|
if (repo.isFork && repo.parent) {
|
|
@@ -3536,7 +4459,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3536
4459
|
}
|
|
3537
4460
|
}
|
|
3538
4461
|
}
|
|
3539
|
-
if (key.delete || key.backspace) {
|
|
4462
|
+
if ((key.delete || key.backspace) && !multiSelectMode) {
|
|
3540
4463
|
const repo = visibleItems[cursor];
|
|
3541
4464
|
if (repo) {
|
|
3542
4465
|
setDeleteTarget(repo);
|
|
@@ -3576,7 +4499,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3576
4499
|
setOrgSwitcherOpen(true);
|
|
3577
4500
|
return;
|
|
3578
4501
|
}
|
|
3579
|
-
if (key.ctrl && (input === "a" || input === "A")) {
|
|
4502
|
+
if (key.ctrl && (input === "a" || input === "A") && !multiSelectMode) {
|
|
3580
4503
|
const repo = visibleItems[cursor];
|
|
3581
4504
|
if (repo) {
|
|
3582
4505
|
setArchiveTarget(repo);
|
|
@@ -3687,6 +4610,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3687
4610
|
const newStarsMode = !starsMode;
|
|
3688
4611
|
setStarsMode(newStarsMode);
|
|
3689
4612
|
setCursor(0);
|
|
4613
|
+
setSelectedRepos(/* @__PURE__ */ new Map());
|
|
4614
|
+
setMultiSelectMode(false);
|
|
3690
4615
|
setFilter("");
|
|
3691
4616
|
setFilterMode(false);
|
|
3692
4617
|
if (newStarsMode) {
|
|
@@ -3876,79 +4801,80 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3876
4801
|
exec(cmd);
|
|
3877
4802
|
}
|
|
3878
4803
|
const lowRate = rateLimit && rateLimit.remaining <= Math.ceil(rateLimit.limit * 0.1) || restRateLimit && restRateLimit.core.remaining <= Math.ceil(restRateLimit.core.limit * 0.1);
|
|
3879
|
-
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || archiveFilterMode || sortMode || sortDirectionMode || changeVisibilityMode || copyUrlMode || renameMode || openInBrowserMode || createMode || transferMode;
|
|
3880
|
-
const
|
|
3881
|
-
|
|
3882
|
-
|
|
4804
|
+
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || archiveFilterMode || sortMode || sortDirectionMode || changeVisibilityMode || copyUrlMode || renameMode || bulkIntentKind !== null || bulkVisibilityOpen || bulkReviewOpen || bulkConfirmOpen || bulkDeleteCodeOpen || bulkProgressOpen || openInBrowserMode || createMode || transferMode;
|
|
4805
|
+
const bulkMeta = bulkAction ? bulkActionMeta(bulkAction, bulkVisibilityTarget ?? void 0) : null;
|
|
4806
|
+
const headerBar = useMemo2(() => /* @__PURE__ */ jsxs28(Box28, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: [
|
|
4807
|
+
/* @__PURE__ */ jsxs28(Box28, { flexDirection: "row", gap: 1, children: [
|
|
4808
|
+
/* @__PURE__ */ jsxs28(Text29, { color: theme.primary, bold: !modalOpen, dimColor: modalOpen, children: [
|
|
3883
4809
|
" ",
|
|
3884
4810
|
ownerContext === "personal" ? "Personal" : ownerContext.name || ownerContext.login,
|
|
3885
4811
|
ownerContext !== "personal" && isEnterpriseOrg && " (ENT)"
|
|
3886
4812
|
] }),
|
|
3887
|
-
/* @__PURE__ */
|
|
3888
|
-
/* @__PURE__ */
|
|
4813
|
+
/* @__PURE__ */ jsx29(Text29, { bold: true, color: modalOpen ? theme.muted : void 0, dimColor: modalOpen ? true : void 0, children: "Repositories" }),
|
|
4814
|
+
/* @__PURE__ */ jsxs28(Text29, { color: theme.muted, children: [
|
|
3889
4815
|
"(",
|
|
3890
4816
|
visibleItems.length,
|
|
3891
4817
|
"/",
|
|
3892
4818
|
totalCount,
|
|
3893
4819
|
")"
|
|
3894
4820
|
] }),
|
|
3895
|
-
loadingMore && hasNextPage && !starsMode && totalCount > 0 && /* @__PURE__ */
|
|
3896
|
-
enrichingForks && /* @__PURE__ */
|
|
3897
|
-
(loading || loadingMore) && /* @__PURE__ */
|
|
4821
|
+
loadingMore && hasNextPage && !starsMode && totalCount > 0 && /* @__PURE__ */ jsx29(Text29, { color: theme.primary, children: ` \xB7 loading ${items.length}/${totalCount}` }),
|
|
4822
|
+
enrichingForks && /* @__PURE__ */ jsx29(Text29, { color: theme.muted, children: ` \xB7 enriching forks\u2026` }),
|
|
4823
|
+
(loading || loadingMore) && /* @__PURE__ */ jsx29(Box28, { width: 2, flexShrink: 0, flexGrow: 0, marginLeft: 1, children: /* @__PURE__ */ jsx29(Text29, { color: theme.warning, children: /* @__PURE__ */ jsx29(SlowSpinner, {}) }) })
|
|
3898
4824
|
] }),
|
|
3899
|
-
(rateLimit || restRateLimit) && /* @__PURE__ */
|
|
4825
|
+
(rateLimit || restRateLimit) && /* @__PURE__ */ jsxs28(Text29, { color: lowRate ? theme.warning : theme.muted, children: [
|
|
3900
4826
|
"GraphQL: ",
|
|
3901
4827
|
rateLimit ? `${rateLimit.remaining}/${rateLimit.limit}` : "---/---",
|
|
3902
|
-
prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */
|
|
4828
|
+
prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */ jsx29(Text29, { color: rateLimit.remaining < prevRateLimit ? theme.error : theme.success, children: ` (${rateLimit.remaining - prevRateLimit > 0 ? "+" : ""}${rateLimit.remaining - prevRateLimit})` }),
|
|
3903
4829
|
" | ",
|
|
3904
4830
|
"REST: ",
|
|
3905
4831
|
restRateLimit ? `${restRateLimit.core.remaining}/${restRateLimit.core.limit}` : "---/---",
|
|
3906
|
-
prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */
|
|
4832
|
+
prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */ jsx29(Text29, { color: restRateLimit.core.remaining < prevRestRateLimit ? theme.error : theme.success, children: ` (${restRateLimit.core.remaining - prevRestRateLimit > 0 ? "+" : ""}${restRateLimit.core.remaining - prevRestRateLimit})` }),
|
|
3907
4833
|
" "
|
|
3908
4834
|
] })
|
|
3909
4835
|
] }), [visibleItems.length, totalCount, loading, loadingMore, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg, restRateLimit, prevRestRateLimit, enrichingForks, starsMode, hasNextPage, items.length, theme]);
|
|
3910
4836
|
if (error) {
|
|
3911
|
-
return /* @__PURE__ */
|
|
3912
|
-
/* @__PURE__ */
|
|
3913
|
-
/* @__PURE__ */
|
|
3914
|
-
/* @__PURE__ */
|
|
4837
|
+
return /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", height: availableHeight, children: [
|
|
4838
|
+
/* @__PURE__ */ jsx29(Box28, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs28(Box28, { flexDirection: "row", gap: 1, children: [
|
|
4839
|
+
/* @__PURE__ */ jsx29(Text29, { bold: true, children: " Repositories" }),
|
|
4840
|
+
/* @__PURE__ */ jsx29(Text29, { color: "red", children: "(Error)" })
|
|
3915
4841
|
] }) }),
|
|
3916
|
-
/* @__PURE__ */
|
|
3917
|
-
/* @__PURE__ */
|
|
3918
|
-
/* @__PURE__ */
|
|
4842
|
+
/* @__PURE__ */ jsx29(Box28, { borderStyle: "single", borderColor: "red", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx29(Box28, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", alignItems: "center", children: [
|
|
4843
|
+
/* @__PURE__ */ jsx29(Text29, { color: "red", children: error }),
|
|
4844
|
+
/* @__PURE__ */ jsx29(Box28, { marginTop: 1, children: /* @__PURE__ */ jsx29(Text29, { color: "gray", dimColor: true, children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
3919
4845
|
] }) }) }),
|
|
3920
|
-
/* @__PURE__ */
|
|
4846
|
+
/* @__PURE__ */ jsx29(Box28, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx29(Text29, { color: "gray", children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
3921
4847
|
] });
|
|
3922
4848
|
}
|
|
3923
4849
|
if (loading && items.length === 0 || sortingLoading) {
|
|
3924
|
-
return /* @__PURE__ */
|
|
3925
|
-
/* @__PURE__ */
|
|
3926
|
-
/* @__PURE__ */
|
|
3927
|
-
/* @__PURE__ */
|
|
4850
|
+
return /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", height: availableHeight, children: [
|
|
4851
|
+
/* @__PURE__ */ jsx29(Box28, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs28(Box28, { flexDirection: "row", gap: 1, children: [
|
|
4852
|
+
/* @__PURE__ */ jsx29(Text29, { bold: true, children: " Repositories" }),
|
|
4853
|
+
/* @__PURE__ */ jsx29(Text29, { color: "gray", children: "(Loading...)" })
|
|
3928
4854
|
] }) }),
|
|
3929
|
-
/* @__PURE__ */
|
|
3930
|
-
/* @__PURE__ */
|
|
3931
|
-
/* @__PURE__ */
|
|
3932
|
-
/* @__PURE__ */
|
|
4855
|
+
/* @__PURE__ */ jsx29(Box28, { borderStyle: "single", borderColor: "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx29(Box28, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx29(Box28, { flexDirection: "column", alignItems: "center", children: /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", alignItems: "center", children: [
|
|
4856
|
+
/* @__PURE__ */ jsxs28(Box28, { height: 1, flexDirection: "row", children: [
|
|
4857
|
+
/* @__PURE__ */ jsx29(Box28, { width: 2, flexShrink: 0, flexGrow: 0, children: /* @__PURE__ */ jsx29(Text29, { color: "cyan", children: /* @__PURE__ */ jsx29(SlowSpinner, {}) }) }),
|
|
4858
|
+
/* @__PURE__ */ jsx29(Text29, { color: "cyan", children: refreshing ? "Refreshing..." : sortingLoading ? "Applying sort..." : "Loading repositories..." })
|
|
3933
4859
|
] }),
|
|
3934
|
-
/* @__PURE__ */
|
|
4860
|
+
/* @__PURE__ */ jsx29(Box28, { height: 1, marginTop: 1, children: /* @__PURE__ */ jsx29(Text29, { color: "gray", children: refreshing ? "Fetching latest repository data" : sortingLoading ? `Sorting by ${sortKey} (${sortDir === "asc" ? "ascending" : "descending"})` : "Fetching your GitHub repositories" }) })
|
|
3935
4861
|
] }) }) }) }),
|
|
3936
|
-
/* @__PURE__ */
|
|
4862
|
+
/* @__PURE__ */ jsx29(Box28, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx29(Text29, { color: "gray", children: "Please wait..." }) })
|
|
3937
4863
|
] });
|
|
3938
4864
|
}
|
|
3939
|
-
return /* @__PURE__ */
|
|
4865
|
+
return /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", height: availableHeight, children: [
|
|
3940
4866
|
headerBar,
|
|
3941
|
-
showSponsorReminder && /* @__PURE__ */
|
|
3942
|
-
/* @__PURE__ */
|
|
3943
|
-
/* @__PURE__ */
|
|
3944
|
-
/* @__PURE__ */
|
|
4867
|
+
showSponsorReminder && /* @__PURE__ */ jsx29(Box28, { marginX: 1, marginBottom: 1, children: /* @__PURE__ */ jsx29(Box28, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", alignItems: "center", children: [
|
|
4868
|
+
/* @__PURE__ */ jsx29(Text29, { color: "yellow", children: "\u{1F49A} Thanks for using gh-manager-cli!" }),
|
|
4869
|
+
/* @__PURE__ */ jsx29(Text29, { color: "gray", children: "Your support helps craft more open-source tools" }),
|
|
4870
|
+
/* @__PURE__ */ jsx29(Text29, { color: "cyan", children: "\u{1F496} github.com/sponsors/wiiiimm" })
|
|
3945
4871
|
] }) }) }),
|
|
3946
|
-
/* @__PURE__ */
|
|
4872
|
+
/* @__PURE__ */ jsx29(Box28, { borderStyle: "single", borderColor: modalOpen ? theme.muted : theme.warning, paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: deleteMode && deleteTarget ? (
|
|
3947
4873
|
// Centered modal; hide list content while modal is open
|
|
3948
|
-
/* @__PURE__ */
|
|
3949
|
-
/* @__PURE__ */
|
|
3950
|
-
/* @__PURE__ */
|
|
3951
|
-
/* @__PURE__ */
|
|
4874
|
+
/* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
4875
|
+
/* @__PURE__ */ jsx29(Text29, { bold: true, children: "Delete Confirmation" }),
|
|
4876
|
+
/* @__PURE__ */ jsx29(Text29, { color: "red", children: "\u26A0\uFE0F Delete repository?" }),
|
|
4877
|
+
/* @__PURE__ */ jsx29(Box28, { height: 2, children: /* @__PURE__ */ jsx29(Text29, { children: " " }) }),
|
|
3952
4878
|
(() => {
|
|
3953
4879
|
const langName = deleteTarget.primaryLanguage?.name || "";
|
|
3954
4880
|
const langColor = deleteTarget.primaryLanguage?.color || "#666666";
|
|
@@ -3958,22 +4884,22 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3958
4884
|
if (deleteTarget.isArchived) line1 += tc.archived.dim(" Archived");
|
|
3959
4885
|
if (deleteTarget.isFork && deleteTarget.parent) line1 += tc.fork(` Fork of ${deleteTarget.parent.nameWithOwner}`);
|
|
3960
4886
|
let line2 = "";
|
|
3961
|
-
if (langName) line2 +=
|
|
4887
|
+
if (langName) line2 += chalk20.hex(langColor)("\u25CF ") + tc.muted(`${langName} `);
|
|
3962
4888
|
line2 += tc.muted(`\u2605 ${deleteTarget.stargazerCount} \u2442 ${deleteTarget.forkCount} Updated ${formatDate(deleteTarget.updatedAt)}`);
|
|
3963
|
-
return /* @__PURE__ */
|
|
3964
|
-
/* @__PURE__ */
|
|
3965
|
-
/* @__PURE__ */
|
|
4889
|
+
return /* @__PURE__ */ jsxs28(Fragment13, { children: [
|
|
4890
|
+
/* @__PURE__ */ jsx29(Text29, { children: line1 }),
|
|
4891
|
+
/* @__PURE__ */ jsx29(Text29, { children: line2 })
|
|
3966
4892
|
] });
|
|
3967
4893
|
})(),
|
|
3968
|
-
/* @__PURE__ */
|
|
4894
|
+
/* @__PURE__ */ jsx29(Box28, { marginTop: 1, children: /* @__PURE__ */ jsxs28(Text29, { children: [
|
|
3969
4895
|
"Type ",
|
|
3970
|
-
/* @__PURE__ */
|
|
4896
|
+
/* @__PURE__ */ jsx29(Text29, { color: "yellow", bold: true, children: deleteCode }),
|
|
3971
4897
|
" to confirm."
|
|
3972
4898
|
] }) }),
|
|
3973
|
-
!deleteConfirmStage && /* @__PURE__ */
|
|
3974
|
-
/* @__PURE__ */
|
|
3975
|
-
/* @__PURE__ */
|
|
3976
|
-
|
|
4899
|
+
!deleteConfirmStage && /* @__PURE__ */ jsxs28(Box28, { marginTop: 1, children: [
|
|
4900
|
+
/* @__PURE__ */ jsx29(Text29, { children: "Confirm code: " }),
|
|
4901
|
+
/* @__PURE__ */ jsx29(
|
|
4902
|
+
TextInput8,
|
|
3977
4903
|
{
|
|
3978
4904
|
value: typedCode,
|
|
3979
4905
|
onChange: (v) => {
|
|
@@ -3999,11 +4925,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3999
4925
|
}
|
|
4000
4926
|
)
|
|
4001
4927
|
] }),
|
|
4002
|
-
deleteConfirmStage && /* @__PURE__ */
|
|
4003
|
-
/* @__PURE__ */
|
|
4004
|
-
/* @__PURE__ */
|
|
4005
|
-
/* @__PURE__ */
|
|
4006
|
-
|
|
4928
|
+
deleteConfirmStage && /* @__PURE__ */ jsxs28(Box28, { marginTop: 1, flexDirection: "column", children: [
|
|
4929
|
+
/* @__PURE__ */ jsx29(Text29, { color: "red", children: "This action will permanently delete the repository. This cannot be undone." }),
|
|
4930
|
+
/* @__PURE__ */ jsxs28(Box28, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
4931
|
+
/* @__PURE__ */ jsx29(
|
|
4932
|
+
Box28,
|
|
4007
4933
|
{
|
|
4008
4934
|
borderStyle: "round",
|
|
4009
4935
|
borderColor: "red",
|
|
@@ -4012,11 +4938,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4012
4938
|
alignItems: "center",
|
|
4013
4939
|
justifyContent: "center",
|
|
4014
4940
|
flexDirection: "column",
|
|
4015
|
-
children: /* @__PURE__ */
|
|
4941
|
+
children: /* @__PURE__ */ jsx29(Text29, { children: confirmFocus === "delete" ? chalk20.bgRed.white.bold(" Delete ") : tc.error.bold("Delete") })
|
|
4016
4942
|
}
|
|
4017
4943
|
),
|
|
4018
|
-
/* @__PURE__ */
|
|
4019
|
-
|
|
4944
|
+
/* @__PURE__ */ jsx29(
|
|
4945
|
+
Box28,
|
|
4020
4946
|
{
|
|
4021
4947
|
borderStyle: "round",
|
|
4022
4948
|
borderColor: confirmFocus === "cancel" ? "white" : "gray",
|
|
@@ -4025,17 +4951,17 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4025
4951
|
alignItems: "center",
|
|
4026
4952
|
justifyContent: "center",
|
|
4027
4953
|
flexDirection: "column",
|
|
4028
|
-
children: /* @__PURE__ */
|
|
4954
|
+
children: /* @__PURE__ */ jsx29(Text29, { children: confirmFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
|
|
4029
4955
|
}
|
|
4030
4956
|
)
|
|
4031
4957
|
] }),
|
|
4032
|
-
/* @__PURE__ */
|
|
4958
|
+
/* @__PURE__ */ jsx29(Box28, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs28(Text29, { color: "gray", children: [
|
|
4033
4959
|
"Press Enter to ",
|
|
4034
4960
|
confirmFocus === "delete" ? "Delete" : "Cancel",
|
|
4035
4961
|
" | Y to Delete | C to Cancel"
|
|
4036
4962
|
] }) }),
|
|
4037
|
-
/* @__PURE__ */
|
|
4038
|
-
|
|
4963
|
+
/* @__PURE__ */ jsx29(Box28, { marginTop: 1, children: /* @__PURE__ */ jsx29(
|
|
4964
|
+
TextInput8,
|
|
4039
4965
|
{
|
|
4040
4966
|
value: "",
|
|
4041
4967
|
onChange: () => {
|
|
@@ -4048,18 +4974,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4048
4974
|
}
|
|
4049
4975
|
) })
|
|
4050
4976
|
] }),
|
|
4051
|
-
deleteError && /* @__PURE__ */
|
|
4052
|
-
deleting && /* @__PURE__ */
|
|
4977
|
+
deleteError && /* @__PURE__ */ jsx29(Box28, { marginTop: 1, children: /* @__PURE__ */ jsx29(Text29, { color: "magenta", children: deleteError }) }),
|
|
4978
|
+
deleting && /* @__PURE__ */ jsx29(Box28, { marginTop: 1, children: /* @__PURE__ */ jsx29(Text29, { color: "yellow", children: "Deleting..." }) })
|
|
4053
4979
|
] }) })
|
|
4054
|
-
) : archiveMode && archiveTarget ? /* @__PURE__ */
|
|
4055
|
-
/* @__PURE__ */
|
|
4056
|
-
/* @__PURE__ */
|
|
4057
|
-
/* @__PURE__ */
|
|
4058
|
-
/* @__PURE__ */
|
|
4059
|
-
/* @__PURE__ */
|
|
4060
|
-
/* @__PURE__ */
|
|
4061
|
-
/* @__PURE__ */
|
|
4062
|
-
|
|
4980
|
+
) : archiveMode && archiveTarget ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", borderStyle: "round", borderColor: archiveTarget.isArchived ? "green" : "yellow", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
4981
|
+
/* @__PURE__ */ jsx29(Text29, { bold: true, children: archiveTarget.isArchived ? "Unarchive Confirmation" : "Archive Confirmation" }),
|
|
4982
|
+
/* @__PURE__ */ jsx29(Text29, { color: archiveTarget.isArchived ? "green" : "yellow", children: archiveTarget.isArchived ? "\u21BA Unarchive repository?" : "\u26A0\uFE0F Archive repository?" }),
|
|
4983
|
+
/* @__PURE__ */ jsx29(Box28, { height: 1, children: /* @__PURE__ */ jsx29(Text29, { children: " " }) }),
|
|
4984
|
+
/* @__PURE__ */ jsx29(Text29, { children: archiveTarget.nameWithOwner }),
|
|
4985
|
+
/* @__PURE__ */ jsx29(Box28, { marginTop: 1, children: /* @__PURE__ */ jsx29(Text29, { children: archiveTarget.isArchived ? "This will make the repository active again." : "This will make the repository read-only." }) }),
|
|
4986
|
+
/* @__PURE__ */ jsxs28(Box28, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
4987
|
+
/* @__PURE__ */ jsx29(
|
|
4988
|
+
Box28,
|
|
4063
4989
|
{
|
|
4064
4990
|
borderStyle: "round",
|
|
4065
4991
|
borderColor: archiveTarget.isArchived ? "green" : "yellow",
|
|
@@ -4068,11 +4994,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4068
4994
|
alignItems: "center",
|
|
4069
4995
|
justifyContent: "center",
|
|
4070
4996
|
flexDirection: "column",
|
|
4071
|
-
children: /* @__PURE__ */
|
|
4997
|
+
children: /* @__PURE__ */ jsx29(Text29, { children: archiveFocus === "confirm" ? chalk20.bgGreen.white.bold(` ${archiveTarget.isArchived ? "Unarchive" : "Archive"} `) : (archiveTarget.isArchived ? tc.success : tc.warning).bold(archiveTarget.isArchived ? "Unarchive" : "Archive") })
|
|
4072
4998
|
}
|
|
4073
4999
|
),
|
|
4074
|
-
/* @__PURE__ */
|
|
4075
|
-
|
|
5000
|
+
/* @__PURE__ */ jsx29(
|
|
5001
|
+
Box28,
|
|
4076
5002
|
{
|
|
4077
5003
|
borderStyle: "round",
|
|
4078
5004
|
borderColor: archiveFocus === "cancel" ? "white" : "gray",
|
|
@@ -4081,19 +5007,19 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4081
5007
|
alignItems: "center",
|
|
4082
5008
|
justifyContent: "center",
|
|
4083
5009
|
flexDirection: "column",
|
|
4084
|
-
children: /* @__PURE__ */
|
|
5010
|
+
children: /* @__PURE__ */ jsx29(Text29, { children: archiveFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
|
|
4085
5011
|
}
|
|
4086
5012
|
)
|
|
4087
5013
|
] }),
|
|
4088
|
-
/* @__PURE__ */
|
|
5014
|
+
/* @__PURE__ */ jsx29(Box28, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs28(Text29, { color: theme.muted, children: [
|
|
4089
5015
|
"Press Enter to ",
|
|
4090
5016
|
archiveFocus === "confirm" ? archiveTarget.isArchived ? "Unarchive" : "Archive" : "Cancel",
|
|
4091
5017
|
" | Y to ",
|
|
4092
5018
|
archiveTarget.isArchived ? "Unarchive" : "Archive",
|
|
4093
5019
|
" | C to Cancel"
|
|
4094
5020
|
] }) }),
|
|
4095
|
-
/* @__PURE__ */
|
|
4096
|
-
|
|
5021
|
+
/* @__PURE__ */ jsx29(Box28, { marginTop: 1, children: /* @__PURE__ */ jsx29(
|
|
5022
|
+
TextInput8,
|
|
4097
5023
|
{
|
|
4098
5024
|
value: "",
|
|
4099
5025
|
onChange: () => {
|
|
@@ -4107,14 +5033,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4107
5033
|
}
|
|
4108
5034
|
}
|
|
4109
5035
|
) }),
|
|
4110
|
-
archiveError && /* @__PURE__ */
|
|
4111
|
-
archiving && /* @__PURE__ */
|
|
4112
|
-
] }) }) : syncMode && syncTarget ? /* @__PURE__ */
|
|
4113
|
-
/* @__PURE__ */
|
|
4114
|
-
/* @__PURE__ */
|
|
4115
|
-
/* @__PURE__ */
|
|
4116
|
-
/* @__PURE__ */
|
|
4117
|
-
syncTarget.parent && /* @__PURE__ */
|
|
5036
|
+
archiveError && /* @__PURE__ */ jsx29(Box28, { marginTop: 1, children: /* @__PURE__ */ jsx29(Text29, { color: "magenta", children: archiveError }) }),
|
|
5037
|
+
archiving && /* @__PURE__ */ jsx29(Box28, { marginTop: 1, children: /* @__PURE__ */ jsx29(Text29, { color: "yellow", children: archiveTarget.isArchived ? "Unarchiving..." : "Archiving..." }) })
|
|
5038
|
+
] }) }) : syncMode && syncTarget ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
5039
|
+
/* @__PURE__ */ jsx29(Text29, { bold: true, children: "Sync Fork Confirmation" }),
|
|
5040
|
+
/* @__PURE__ */ jsx29(Text29, { color: "blue", children: "\u27F2 Sync fork with upstream?" }),
|
|
5041
|
+
/* @__PURE__ */ jsx29(Box28, { height: 1, children: /* @__PURE__ */ jsx29(Text29, { children: " " }) }),
|
|
5042
|
+
/* @__PURE__ */ jsx29(Text29, { children: syncTarget.nameWithOwner }),
|
|
5043
|
+
syncTarget.parent && /* @__PURE__ */ jsxs28(Text29, { color: "gray", children: [
|
|
4118
5044
|
"Upstream: ",
|
|
4119
5045
|
syncTarget.parent.nameWithOwner
|
|
4120
5046
|
] }),
|
|
@@ -4126,15 +5052,15 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4126
5052
|
const behind = Math.max(0, parentC - forkC);
|
|
4127
5053
|
const ahead = Math.max(0, forkC - parentC);
|
|
4128
5054
|
const parts = [];
|
|
4129
|
-
if (ahead > 0) parts.push(
|
|
4130
|
-
if (behind > 0) parts.push(
|
|
4131
|
-
const statusText = parts.length === 0 ?
|
|
4132
|
-
return /* @__PURE__ */
|
|
5055
|
+
if (ahead > 0) parts.push(chalk20.green(`${ahead} ahead`));
|
|
5056
|
+
if (behind > 0) parts.push(chalk20.yellow(`${behind} behind`));
|
|
5057
|
+
const statusText = parts.length === 0 ? chalk20.green("Your fork is up to date with upstream.") : `This fork is ${parts.join(", ")} of upstream.`;
|
|
5058
|
+
return /* @__PURE__ */ jsx29(Text29, { children: statusText });
|
|
4133
5059
|
})(),
|
|
4134
|
-
/* @__PURE__ */
|
|
4135
|
-
/* @__PURE__ */
|
|
4136
|
-
/* @__PURE__ */
|
|
4137
|
-
|
|
5060
|
+
/* @__PURE__ */ jsx29(Box28, { marginTop: 1, children: /* @__PURE__ */ jsx29(Text29, { children: "This will merge upstream changes into your fork." }) }),
|
|
5061
|
+
/* @__PURE__ */ jsxs28(Box28, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
5062
|
+
/* @__PURE__ */ jsx29(
|
|
5063
|
+
Box28,
|
|
4138
5064
|
{
|
|
4139
5065
|
borderStyle: "round",
|
|
4140
5066
|
borderColor: "blue",
|
|
@@ -4143,11 +5069,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4143
5069
|
alignItems: "center",
|
|
4144
5070
|
justifyContent: "center",
|
|
4145
5071
|
flexDirection: "column",
|
|
4146
|
-
children: /* @__PURE__ */
|
|
5072
|
+
children: /* @__PURE__ */ jsx29(Text29, { children: syncFocus === "confirm" ? tc.btnPrimary(" Sync ") : tc.primary.bold("Sync") })
|
|
4147
5073
|
}
|
|
4148
5074
|
),
|
|
4149
|
-
/* @__PURE__ */
|
|
4150
|
-
|
|
5075
|
+
/* @__PURE__ */ jsx29(
|
|
5076
|
+
Box28,
|
|
4151
5077
|
{
|
|
4152
5078
|
borderStyle: "round",
|
|
4153
5079
|
borderColor: syncFocus === "cancel" ? "white" : "gray",
|
|
@@ -4156,17 +5082,17 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4156
5082
|
alignItems: "center",
|
|
4157
5083
|
justifyContent: "center",
|
|
4158
5084
|
flexDirection: "column",
|
|
4159
|
-
children: /* @__PURE__ */
|
|
5085
|
+
children: /* @__PURE__ */ jsx29(Text29, { children: syncFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
|
|
4160
5086
|
}
|
|
4161
5087
|
)
|
|
4162
5088
|
] }),
|
|
4163
|
-
/* @__PURE__ */
|
|
5089
|
+
/* @__PURE__ */ jsx29(Box28, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs28(Text29, { color: theme.muted, children: [
|
|
4164
5090
|
"Press Enter to ",
|
|
4165
5091
|
syncFocus === "confirm" ? "Sync" : "Cancel",
|
|
4166
5092
|
" | Y to Sync | C to Cancel"
|
|
4167
5093
|
] }) }),
|
|
4168
|
-
/* @__PURE__ */
|
|
4169
|
-
|
|
5094
|
+
/* @__PURE__ */ jsx29(Box28, { marginTop: 1, children: /* @__PURE__ */ jsx29(
|
|
5095
|
+
TextInput8,
|
|
4170
5096
|
{
|
|
4171
5097
|
value: "",
|
|
4172
5098
|
onChange: () => {
|
|
@@ -4180,14 +5106,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4180
5106
|
}
|
|
4181
5107
|
}
|
|
4182
5108
|
) }),
|
|
4183
|
-
syncError && /* @__PURE__ */
|
|
4184
|
-
syncing && /* @__PURE__ */
|
|
4185
|
-
] }) }) : logoutMode ? /* @__PURE__ */
|
|
4186
|
-
/* @__PURE__ */
|
|
4187
|
-
/* @__PURE__ */
|
|
4188
|
-
/* @__PURE__ */
|
|
4189
|
-
/* @__PURE__ */
|
|
4190
|
-
|
|
5109
|
+
syncError && /* @__PURE__ */ jsx29(Box28, { marginTop: 1, children: /* @__PURE__ */ jsx29(Text29, { color: theme.error, children: syncError }) }),
|
|
5110
|
+
syncing && /* @__PURE__ */ jsx29(Box28, { marginTop: 1, children: /* @__PURE__ */ jsx29(Text29, { color: theme.warning, children: "Syncing..." }) })
|
|
5111
|
+
] }) }) : logoutMode ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", borderStyle: "round", borderColor: theme.primary, paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
5112
|
+
/* @__PURE__ */ jsx29(Text29, { bold: true, children: "Logout Confirmation" }),
|
|
5113
|
+
/* @__PURE__ */ jsx29(Text29, { color: theme.primary, children: "Are you sure you want to log out?" }),
|
|
5114
|
+
/* @__PURE__ */ jsxs28(Box28, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
5115
|
+
/* @__PURE__ */ jsx29(
|
|
5116
|
+
Box28,
|
|
4191
5117
|
{
|
|
4192
5118
|
borderStyle: "round",
|
|
4193
5119
|
borderColor: theme.primary,
|
|
@@ -4196,11 +5122,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4196
5122
|
alignItems: "center",
|
|
4197
5123
|
justifyContent: "center",
|
|
4198
5124
|
flexDirection: "column",
|
|
4199
|
-
children: /* @__PURE__ */
|
|
5125
|
+
children: /* @__PURE__ */ jsx29(Text29, { children: logoutFocus === "confirm" ? tc.btnPrimary(" Logout ") : tc.primary.bold("Logout") })
|
|
4200
5126
|
}
|
|
4201
5127
|
),
|
|
4202
|
-
/* @__PURE__ */
|
|
4203
|
-
|
|
5128
|
+
/* @__PURE__ */ jsx29(
|
|
5129
|
+
Box28,
|
|
4204
5130
|
{
|
|
4205
5131
|
borderStyle: "round",
|
|
4206
5132
|
borderColor: logoutFocus === "cancel" ? "white" : theme.muted,
|
|
@@ -4209,16 +5135,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4209
5135
|
alignItems: "center",
|
|
4210
5136
|
justifyContent: "center",
|
|
4211
5137
|
flexDirection: "column",
|
|
4212
|
-
children: /* @__PURE__ */
|
|
5138
|
+
children: /* @__PURE__ */ jsx29(Text29, { children: logoutFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
|
|
4213
5139
|
}
|
|
4214
5140
|
)
|
|
4215
5141
|
] }),
|
|
4216
|
-
/* @__PURE__ */
|
|
5142
|
+
/* @__PURE__ */ jsx29(Box28, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs28(Text29, { color: theme.muted, children: [
|
|
4217
5143
|
"Press Enter to ",
|
|
4218
5144
|
logoutFocus === "confirm" ? "Logout" : "Cancel",
|
|
4219
5145
|
" | Y to Logout | C to Cancel"
|
|
4220
5146
|
] }) })
|
|
4221
|
-
] }) }) : orgSwitcherOpen ? /* @__PURE__ */
|
|
5147
|
+
] }) }) : orgSwitcherOpen ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
4222
5148
|
OrgSwitcher,
|
|
4223
5149
|
{
|
|
4224
5150
|
token,
|
|
@@ -4226,45 +5152,45 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4226
5152
|
onSelect: handleOrgContextChange,
|
|
4227
5153
|
onClose: () => setOrgSwitcherOpen(false)
|
|
4228
5154
|
}
|
|
4229
|
-
) }) : infoMode ? /* @__PURE__ */
|
|
5155
|
+
) }) : infoMode ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: (() => {
|
|
4230
5156
|
const repo = infoRepo || visibleItems[cursor];
|
|
4231
|
-
if (!repo) return /* @__PURE__ */
|
|
5157
|
+
if (!repo) return /* @__PURE__ */ jsx29(Text29, { color: theme.error, children: "No repository selected." });
|
|
4232
5158
|
const langName = repo.primaryLanguage?.name || "N/A";
|
|
4233
5159
|
const langColor = repo.primaryLanguage?.color || "#666666";
|
|
4234
|
-
return /* @__PURE__ */
|
|
4235
|
-
/* @__PURE__ */
|
|
5160
|
+
return /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", borderStyle: "round", borderColor: theme.internal, paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 90), children: [
|
|
5161
|
+
/* @__PURE__ */ jsxs28(Text29, { bold: true, children: [
|
|
4236
5162
|
"Repository Info ",
|
|
4237
5163
|
infoRepo ? tc.muted("(cached)") : ""
|
|
4238
5164
|
] }),
|
|
4239
|
-
/* @__PURE__ */
|
|
4240
|
-
/* @__PURE__ */
|
|
4241
|
-
repo.description && /* @__PURE__ */
|
|
4242
|
-
/* @__PURE__ */
|
|
4243
|
-
/* @__PURE__ */
|
|
5165
|
+
/* @__PURE__ */ jsx29(Box28, { height: 1, children: /* @__PURE__ */ jsx29(Text29, { children: " " }) }),
|
|
5166
|
+
/* @__PURE__ */ jsx29(Text29, { children: tc.text.bold(repo.nameWithOwner) }),
|
|
5167
|
+
repo.description && /* @__PURE__ */ jsx29(Text29, { color: theme.muted, children: repo.description }),
|
|
5168
|
+
/* @__PURE__ */ jsx29(Box28, { height: 1, children: /* @__PURE__ */ jsx29(Text29, { children: " " }) }),
|
|
5169
|
+
/* @__PURE__ */ jsxs28(Text29, { children: [
|
|
4244
5170
|
repo.visibility === "PRIVATE" ? tc.private("Private") : repo.visibility === "INTERNAL" ? tc.internal("Internal") : tc.success("Public"),
|
|
4245
5171
|
repo.isArchived ? tc.archived(" Archived") : "",
|
|
4246
5172
|
repo.isFork ? tc.fork(" Fork") : ""
|
|
4247
5173
|
] }),
|
|
4248
|
-
/* @__PURE__ */
|
|
4249
|
-
/* @__PURE__ */
|
|
4250
|
-
|
|
5174
|
+
/* @__PURE__ */ jsx29(Text29, { children: tc.muted(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount}`) }),
|
|
5175
|
+
/* @__PURE__ */ jsxs28(Text29, { children: [
|
|
5176
|
+
chalk20.hex(langColor)(`\u25CF `),
|
|
4251
5177
|
tc.muted(`${langName}`)
|
|
4252
5178
|
] }),
|
|
4253
|
-
/* @__PURE__ */
|
|
5179
|
+
/* @__PURE__ */ jsxs28(Text29, { color: theme.muted, children: [
|
|
4254
5180
|
"Updated: ",
|
|
4255
5181
|
formatDate(repo.updatedAt),
|
|
4256
5182
|
" \u2022 Pushed: ",
|
|
4257
5183
|
formatDate(repo.pushedAt)
|
|
4258
5184
|
] }),
|
|
4259
|
-
/* @__PURE__ */
|
|
5185
|
+
/* @__PURE__ */ jsxs28(Text29, { color: theme.muted, children: [
|
|
4260
5186
|
"Size: ",
|
|
4261
5187
|
repo.diskUsage,
|
|
4262
5188
|
" KB"
|
|
4263
5189
|
] }),
|
|
4264
|
-
/* @__PURE__ */
|
|
4265
|
-
/* @__PURE__ */
|
|
5190
|
+
/* @__PURE__ */ jsx29(Box28, { height: 1, children: /* @__PURE__ */ jsx29(Text29, { children: " " }) }),
|
|
5191
|
+
/* @__PURE__ */ jsx29(Text29, { color: theme.muted, children: "Press Esc or I to close" })
|
|
4266
5192
|
] });
|
|
4267
|
-
})() }) : archiveFilterMode ? /* @__PURE__ */
|
|
5193
|
+
})() }) : archiveFilterMode ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
4268
5194
|
ArchiveFilterModal,
|
|
4269
5195
|
{
|
|
4270
5196
|
currentFilter: archiveFilter,
|
|
@@ -4277,7 +5203,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4277
5203
|
onCancel: () => setArchiveFilterMode(false),
|
|
4278
5204
|
theme
|
|
4279
5205
|
}
|
|
4280
|
-
) }) : visibilityMode ? /* @__PURE__ */
|
|
5206
|
+
) }) : visibilityMode ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
4281
5207
|
VisibilityModal,
|
|
4282
5208
|
{
|
|
4283
5209
|
currentFilter: visibilityFilter,
|
|
@@ -4291,7 +5217,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4291
5217
|
onCancel: () => setVisibilityMode(false),
|
|
4292
5218
|
theme
|
|
4293
5219
|
}
|
|
4294
|
-
) }) : sortMode ? /* @__PURE__ */
|
|
5220
|
+
) }) : sortMode ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
4295
5221
|
SortModal,
|
|
4296
5222
|
{
|
|
4297
5223
|
currentSort: sortKey,
|
|
@@ -4304,7 +5230,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4304
5230
|
onCancel: () => setSortMode(false),
|
|
4305
5231
|
theme
|
|
4306
5232
|
}
|
|
4307
|
-
) }) : sortDirectionMode ? /* @__PURE__ */
|
|
5233
|
+
) }) : sortDirectionMode ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
4308
5234
|
SortDirectionModal,
|
|
4309
5235
|
{
|
|
4310
5236
|
currentDirection: sortDir,
|
|
@@ -4318,7 +5244,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4318
5244
|
onCancel: () => setSortDirectionMode(false),
|
|
4319
5245
|
theme
|
|
4320
5246
|
}
|
|
4321
|
-
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */
|
|
5247
|
+
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
4322
5248
|
ChangeVisibilityModal,
|
|
4323
5249
|
{
|
|
4324
5250
|
isOpen: changeVisibilityMode,
|
|
@@ -4332,7 +5258,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4332
5258
|
error: changeVisibilityError,
|
|
4333
5259
|
theme
|
|
4334
5260
|
}
|
|
4335
|
-
) }) : renameMode && renameTarget ? /* @__PURE__ */
|
|
5261
|
+
) }) : renameMode && renameTarget ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
4336
5262
|
RenameModal,
|
|
4337
5263
|
{
|
|
4338
5264
|
repo: renameTarget,
|
|
@@ -4340,7 +5266,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4340
5266
|
onCancel: closeRenameModal,
|
|
4341
5267
|
theme
|
|
4342
5268
|
}
|
|
4343
|
-
) }) : createMode ? /* @__PURE__ */
|
|
5269
|
+
) }) : createMode ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
4344
5270
|
CreateRepoModal,
|
|
4345
5271
|
{
|
|
4346
5272
|
ownerSlug: ownerContext === "personal" ? viewerLogin || "me" : ownerContext.login,
|
|
@@ -4350,7 +5276,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4350
5276
|
onCancel: () => setCreateMode(false),
|
|
4351
5277
|
theme
|
|
4352
5278
|
}
|
|
4353
|
-
) }) : transferMode && transferTarget ? /* @__PURE__ */
|
|
5279
|
+
) }) : transferMode && transferTarget ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
4354
5280
|
TransferModal,
|
|
4355
5281
|
{
|
|
4356
5282
|
repo: transferTarget,
|
|
@@ -4358,7 +5284,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4358
5284
|
onCancel: closeTransferModal,
|
|
4359
5285
|
theme
|
|
4360
5286
|
}
|
|
4361
|
-
) }) : copyUrlMode ? /* @__PURE__ */
|
|
5287
|
+
) }) : copyUrlMode ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
4362
5288
|
CopyUrlModal,
|
|
4363
5289
|
{
|
|
4364
5290
|
repo: copyUrlTarget,
|
|
@@ -4367,7 +5293,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4367
5293
|
onCopy: handleCopyUrl,
|
|
4368
5294
|
theme
|
|
4369
5295
|
}
|
|
4370
|
-
) }) : unstarMode && unstarTarget ? /* @__PURE__ */
|
|
5296
|
+
) }) : unstarMode && unstarTarget ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
4371
5297
|
UnstarModal,
|
|
4372
5298
|
{
|
|
4373
5299
|
visible: unstarMode,
|
|
@@ -4378,7 +5304,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4378
5304
|
error: unstarError,
|
|
4379
5305
|
theme
|
|
4380
5306
|
}
|
|
4381
|
-
) }) : starMode && starTarget ? /* @__PURE__ */
|
|
5307
|
+
) }) : starMode && starTarget ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
4382
5308
|
StarModal,
|
|
4383
5309
|
{
|
|
4384
5310
|
visible: starMode,
|
|
@@ -4390,7 +5316,87 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4390
5316
|
error: starError,
|
|
4391
5317
|
theme
|
|
4392
5318
|
}
|
|
4393
|
-
) }) :
|
|
5319
|
+
) }) : bulkProgressOpen && bulkMeta ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
5320
|
+
BulkProgressModal,
|
|
5321
|
+
{
|
|
5322
|
+
state: bulkProgress,
|
|
5323
|
+
actionLabel: bulkMeta.label,
|
|
5324
|
+
gerund: bulkMeta.gerund,
|
|
5325
|
+
pastVerb: bulkMeta.pastVerb,
|
|
5326
|
+
actionColor: bulkMeta.color,
|
|
5327
|
+
terminalWidth
|
|
5328
|
+
}
|
|
5329
|
+
) }) : bulkDeleteCodeOpen ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
5330
|
+
BulkDeleteCodeModal,
|
|
5331
|
+
{
|
|
5332
|
+
count: bulkFinalSelection.size,
|
|
5333
|
+
terminalWidth,
|
|
5334
|
+
onConfirm: () => {
|
|
5335
|
+
setBulkDeleteCodeOpen(false);
|
|
5336
|
+
executeBulkOperation(Array.from(bulkFinalSelection.values()), "delete");
|
|
5337
|
+
},
|
|
5338
|
+
onCancel: resetBulkFlow
|
|
5339
|
+
}
|
|
5340
|
+
) }) : bulkConfirmOpen && bulkAction && bulkMeta ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
5341
|
+
BulkConfirmModal,
|
|
5342
|
+
{
|
|
5343
|
+
count: bulkFinalSelection.size,
|
|
5344
|
+
actionLabel: bulkMeta.label,
|
|
5345
|
+
actionColor: bulkMeta.color,
|
|
5346
|
+
actionVerb: bulkMeta.label.toLowerCase(),
|
|
5347
|
+
terminalWidth,
|
|
5348
|
+
onConfirm: () => {
|
|
5349
|
+
setBulkConfirmOpen(false);
|
|
5350
|
+
if (bulkAction === "delete") {
|
|
5351
|
+
setBulkDeleteCodeOpen(true);
|
|
5352
|
+
} else {
|
|
5353
|
+
executeBulkOperation(Array.from(bulkFinalSelection.values()), bulkAction, bulkVisibilityTarget);
|
|
5354
|
+
}
|
|
5355
|
+
},
|
|
5356
|
+
onCancel: resetBulkFlow
|
|
5357
|
+
}
|
|
5358
|
+
) }) : bulkReviewOpen && bulkAction && bulkMeta ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
5359
|
+
BulkReviewModal,
|
|
5360
|
+
{
|
|
5361
|
+
selectedRepos,
|
|
5362
|
+
actionLabel: bulkMeta.label,
|
|
5363
|
+
actionColor: bulkMeta.color,
|
|
5364
|
+
terminalWidth,
|
|
5365
|
+
maxHeight: contentHeight,
|
|
5366
|
+
onConfirm: (finalSelection) => {
|
|
5367
|
+
setSelectedRepos(finalSelection);
|
|
5368
|
+
setBulkFinalSelection(finalSelection);
|
|
5369
|
+
setBulkReviewOpen(false);
|
|
5370
|
+
setBulkConfirmOpen(true);
|
|
5371
|
+
},
|
|
5372
|
+
onCancel: resetBulkFlow
|
|
5373
|
+
}
|
|
5374
|
+
) }) : bulkVisibilityOpen ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
5375
|
+
BulkVisibilityModal,
|
|
5376
|
+
{
|
|
5377
|
+
count: selectedRepos.size,
|
|
5378
|
+
isEnterprise: isEnterpriseOrg,
|
|
5379
|
+
terminalWidth,
|
|
5380
|
+
onChoose: (target) => {
|
|
5381
|
+
setBulkVisibilityTarget(target);
|
|
5382
|
+
setBulkVisibilityOpen(false);
|
|
5383
|
+
beginBulkReview("visibility");
|
|
5384
|
+
},
|
|
5385
|
+
onCancel: resetBulkFlow
|
|
5386
|
+
}
|
|
5387
|
+
) }) : bulkIntentKind ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
5388
|
+
BulkIntentModal,
|
|
5389
|
+
{
|
|
5390
|
+
kind: bulkIntentKind,
|
|
5391
|
+
count: selectedRepos.size,
|
|
5392
|
+
terminalWidth,
|
|
5393
|
+
onChoose: (action) => {
|
|
5394
|
+
setBulkIntentKind(null);
|
|
5395
|
+
beginBulkReview(action);
|
|
5396
|
+
},
|
|
5397
|
+
onCancel: resetBulkFlow
|
|
5398
|
+
}
|
|
5399
|
+
) }) : openInBrowserMode && openInBrowserTarget ? /* @__PURE__ */ jsx29(Box28, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx29(
|
|
4394
5400
|
OpenInBrowserModal,
|
|
4395
5401
|
{
|
|
4396
5402
|
repo: openInBrowserTarget,
|
|
@@ -4405,8 +5411,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4405
5411
|
},
|
|
4406
5412
|
theme
|
|
4407
5413
|
}
|
|
4408
|
-
) }) : /* @__PURE__ */
|
|
4409
|
-
/* @__PURE__ */
|
|
5414
|
+
) }) : /* @__PURE__ */ jsxs28(Fragment13, { children: [
|
|
5415
|
+
/* @__PURE__ */ jsx29(
|
|
4410
5416
|
RepoListHeader,
|
|
4411
5417
|
{
|
|
4412
5418
|
ownerContext,
|
|
@@ -4422,10 +5428,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4422
5428
|
theme
|
|
4423
5429
|
}
|
|
4424
5430
|
),
|
|
4425
|
-
|
|
4426
|
-
/* @__PURE__ */
|
|
4427
|
-
/* @__PURE__ */
|
|
4428
|
-
|
|
5431
|
+
multiSelectMode && /* @__PURE__ */ jsxs28(Box28, { marginBottom: 1, flexDirection: "row", justifyContent: "space-between", children: [
|
|
5432
|
+
/* @__PURE__ */ jsx29(Text29, { color: "cyan", bold: true, children: `[BULK SELECT] ${selectedRepos.size > 0 ? `${selectedRepos.size} selected` : "No selection"}` }),
|
|
5433
|
+
/* @__PURE__ */ jsx29(Text29, { color: "gray", children: selectedRepos.size > 0 ? "Space select \xB7 X unselect all \xB7 Ctrl+S star \xB7 Ctrl+A archive \xB7 Ctrl+V visibility \xB7 Del delete \xB7 B/Esc exit" : "Space select \xB7 B/Esc exit" })
|
|
5434
|
+
] }),
|
|
5435
|
+
filterMode && /* @__PURE__ */ jsxs28(Box28, { marginBottom: 1, children: [
|
|
5436
|
+
/* @__PURE__ */ jsx29(Text29, { children: "Search: " }),
|
|
5437
|
+
/* @__PURE__ */ jsx29(
|
|
5438
|
+
TextInput8,
|
|
4429
5439
|
{
|
|
4430
5440
|
value: filter,
|
|
4431
5441
|
onChange: (val) => {
|
|
@@ -4438,10 +5448,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4438
5448
|
}
|
|
4439
5449
|
)
|
|
4440
5450
|
] }),
|
|
4441
|
-
/* @__PURE__ */
|
|
4442
|
-
visibleItems.slice(windowed.start, windowed.end).map((repo, i) => {
|
|
5451
|
+
/* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", height: listHeight, children: [
|
|
5452
|
+
filterMode && filter.trim().length > 0 && filter.trim().length < 3 ? /* @__PURE__ */ jsx29(Box28, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx29(Text29, { color: "gray", dimColor: true, children: "Type at least 3 characters to search" }) }) : visibleItems.slice(windowed.start, windowed.end).map((repo, i) => {
|
|
4443
5453
|
const idx = windowed.start + i;
|
|
4444
|
-
return /* @__PURE__ */
|
|
5454
|
+
return /* @__PURE__ */ jsx29(
|
|
4445
5455
|
RepoRow,
|
|
4446
5456
|
{
|
|
4447
5457
|
repo,
|
|
@@ -4451,64 +5461,67 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
4451
5461
|
spacingLines,
|
|
4452
5462
|
forkTracking,
|
|
4453
5463
|
starsMode,
|
|
5464
|
+
multiSelectMode,
|
|
5465
|
+
isChecked: selectedRepos.has(repo.id),
|
|
4454
5466
|
theme
|
|
4455
5467
|
},
|
|
4456
5468
|
repo.nameWithOwner
|
|
4457
5469
|
);
|
|
4458
5470
|
}),
|
|
4459
|
-
loadingMore && hasNextPage && !starsMode && /* @__PURE__ */
|
|
4460
|
-
/* @__PURE__ */
|
|
4461
|
-
/* @__PURE__ */
|
|
5471
|
+
loadingMore && hasNextPage && !starsMode && /* @__PURE__ */ jsx29(Box28, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs28(Box28, { flexDirection: "row", children: [
|
|
5472
|
+
/* @__PURE__ */ jsx29(Box28, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx29(Text29, { color: "cyan", children: /* @__PURE__ */ jsx29(SlowSpinner, {}) }) }),
|
|
5473
|
+
/* @__PURE__ */ jsxs28(Text29, { color: "cyan", children: [
|
|
4462
5474
|
"Loading repositories\u2026 ",
|
|
4463
5475
|
totalCount > 0 ? `(${items.length}/${totalCount})` : `(${items.length})`
|
|
4464
5476
|
] })
|
|
4465
5477
|
] }) }),
|
|
4466
|
-
loadingMore && hasNextPage && starsMode && /* @__PURE__ */
|
|
4467
|
-
/* @__PURE__ */
|
|
4468
|
-
/* @__PURE__ */
|
|
5478
|
+
loadingMore && hasNextPage && starsMode && /* @__PURE__ */ jsx29(Box28, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs28(Box28, { flexDirection: "row", children: [
|
|
5479
|
+
/* @__PURE__ */ jsx29(Box28, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx29(Text29, { color: "cyan", children: /* @__PURE__ */ jsx29(SlowSpinner, {}) }) }),
|
|
5480
|
+
/* @__PURE__ */ jsx29(Text29, { color: "cyan", children: "Loading more repositories..." })
|
|
4469
5481
|
] }) }),
|
|
4470
|
-
filterActive && hasNextPage && !starsMode && /* @__PURE__ */
|
|
5482
|
+
filterActive && hasNextPage && !starsMode && /* @__PURE__ */ jsx29(Box28, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs28(Text29, { color: "yellow", dimColor: true, children: [
|
|
4471
5483
|
"Still loading repos (",
|
|
4472
5484
|
items.length,
|
|
4473
5485
|
"/",
|
|
4474
5486
|
totalCount > 0 ? totalCount : "?",
|
|
4475
5487
|
") \u2014 fuzzy results may be incomplete"
|
|
4476
5488
|
] }) }),
|
|
4477
|
-
!loading && visibleItems.length === 0 && !(filterActive && hasNextPage && !starsMode) && /* @__PURE__ */
|
|
5489
|
+
!loading && visibleItems.length === 0 && !(filterActive && hasNextPage && !starsMode) && /* @__PURE__ */ jsx29(Box28, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx29(Text29, { color: "gray", dimColor: true, children: filter ? "No repositories match your search" : "No repositories found" }) })
|
|
4478
5490
|
] })
|
|
4479
5491
|
] }) }),
|
|
4480
|
-
/* @__PURE__ */
|
|
4481
|
-
/* @__PURE__ */
|
|
4482
|
-
/* @__PURE__ */
|
|
5492
|
+
/* @__PURE__ */ jsxs28(Box28, { marginTop: 1, paddingX: 1, flexDirection: "column", children: [
|
|
5493
|
+
/* @__PURE__ */ jsx29(Box28, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx29(Text29, { color: theme.muted, dimColor: modalOpen ? true : void 0, children: "\u2191\u2193 Navigate \u2022 Ctrl+G Top \u2022 G Bottom \u2022 \u23CE/O Open \u2022 R Refresh" }) }),
|
|
5494
|
+
/* @__PURE__ */ jsx29(Box28, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsxs28(Text29, { color: theme.muted, dimColor: modalOpen ? true : void 0, children: [
|
|
4483
5495
|
"/ Search",
|
|
4484
5496
|
!filterActive && " \u2022 S Sort \u2022 D Direction",
|
|
4485
5497
|
" \u2022 T Density \u2022 Shift+T Theme \u2022 A Archive Filter",
|
|
4486
5498
|
!starsMode && " \u2022 V Visibility Filter"
|
|
4487
5499
|
] }) }),
|
|
4488
|
-
/* @__PURE__ */
|
|
4489
|
-
/* @__PURE__ */
|
|
5500
|
+
/* @__PURE__ */ jsx29(Box28, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx29(Text29, { color: theme.muted, dimColor: modalOpen ? true : void 0, children: starsMode ? "Shift+S My Repos \u2022 I Info \u2022 C Copy URL \u2022 U Unstar Repository" : `${ownerContext === "personal" ? "Shift+S Starred \u2022 " : ""}I Info \u2022 C Copy URL \u2022 Ctrl+S Un/Star \u2022 Ctrl+R Rename \u2022 Shift+M Transfer \u2022 Ctrl+A Un/Archive \u2022 Ctrl+V Change Visibility \u2022 Ctrl+F Sync Fork \u2022 P Jump to upstream` }) }),
|
|
5501
|
+
/* @__PURE__ */ jsx29(Box28, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsxs28(Text29, { color: theme.muted, dimColor: modalOpen ? true : void 0, children: [
|
|
4490
5502
|
"K Cache Info \u2022 W Org Switch",
|
|
4491
5503
|
!starsMode ? " \u2022 Ctrl+N New Repo" : "",
|
|
4492
5504
|
" \u2022 Del/Backspace Delete \u2022 Ctrl+L Logout \u2022 Q Quit"
|
|
4493
5505
|
] }) }),
|
|
4494
|
-
/* @__PURE__ */
|
|
5506
|
+
!modalOpen && /* @__PURE__ */ jsx29(Box28, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx29(Text29, { color: multiSelectMode ? "cyan" : "gray", dimColor: !multiSelectMode, children: multiSelectMode ? selectedRepos.size > 0 ? `Space select \u2022 X unselect all \u2022 Ctrl+S star \u2022 Ctrl+A archive \u2022 Ctrl+V visibility \u2022 Del delete \u2022 B/Esc exit (${selectedRepos.size} selected)` : "B/Esc exit bulk select \u2022 Space select (no selection)" : "B Bulk Select mode (star/archive/visibility/delete)" }) }),
|
|
5507
|
+
/* @__PURE__ */ jsx29(Box28, { width: terminalWidth, justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx29(Text29, { color: theme.warning, dimColor: modalOpen ? true : void 0, children: "\u{1F496} Sponsor on GitHub: github.com/sponsors/wiiiimm" }) })
|
|
4495
5508
|
] }),
|
|
4496
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
4497
|
-
/* @__PURE__ */
|
|
4498
|
-
debugMessages.length === 0 ? /* @__PURE__ */
|
|
5509
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsxs28(Box28, { marginTop: 1, borderStyle: "single", borderColor: "yellow", paddingX: 1, flexDirection: "column", children: [
|
|
5510
|
+
/* @__PURE__ */ jsx29(Text29, { bold: true, color: "yellow", children: "Debug Messages:" }),
|
|
5511
|
+
debugMessages.length === 0 ? /* @__PURE__ */ jsx29(Text29, { color: "gray", children: "No debug messages yet..." }) : debugMessages.map((msg, i) => /* @__PURE__ */ jsx29(Text29, { color: "gray", children: msg }, i))
|
|
4499
5512
|
] }),
|
|
4500
|
-
themeToast && /* @__PURE__ */
|
|
4501
|
-
copyToast && /* @__PURE__ */
|
|
5513
|
+
themeToast && /* @__PURE__ */ jsx29(Box28, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx29(Box28, { borderStyle: "round", borderColor: theme.primary, paddingX: 2, paddingY: 0, children: /* @__PURE__ */ jsx29(Text29, { color: theme.primary, children: themeToast }) }) }),
|
|
5514
|
+
copyToast && /* @__PURE__ */ jsx29(Box28, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx29(Box28, { borderStyle: "round", borderColor: copyToast.includes("Failed") ? "red" : "green", paddingX: 2, paddingY: 0, children: /* @__PURE__ */ jsx29(Text29, { color: copyToast.includes("Failed") ? "red" : "green", children: copyToast }) }) })
|
|
4502
5515
|
] });
|
|
4503
5516
|
}
|
|
4504
5517
|
|
|
4505
5518
|
// src/ui/components/auth/AuthMethodSelector.tsx
|
|
4506
|
-
import { useState as
|
|
4507
|
-
import { Box as
|
|
4508
|
-
import
|
|
4509
|
-
import { jsx as
|
|
5519
|
+
import { useState as useState25 } from "react";
|
|
5520
|
+
import { Box as Box29, Text as Text30, useInput as useInput25 } from "ink";
|
|
5521
|
+
import chalk21 from "chalk";
|
|
5522
|
+
import { jsx as jsx30, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
4510
5523
|
function AuthMethodSelector({ onSelect, onQuit }) {
|
|
4511
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5524
|
+
const [selectedIndex, setSelectedIndex] = useState25(0);
|
|
4512
5525
|
const methods = [
|
|
4513
5526
|
{
|
|
4514
5527
|
key: "oauth",
|
|
@@ -4521,7 +5534,7 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
4521
5534
|
description: "Manually enter a GitHub Personal Access Token"
|
|
4522
5535
|
}
|
|
4523
5536
|
];
|
|
4524
|
-
|
|
5537
|
+
useInput25((input, key) => {
|
|
4525
5538
|
if (key.escape || input?.toLowerCase() === "q") {
|
|
4526
5539
|
if (onQuit) {
|
|
4527
5540
|
onQuit();
|
|
@@ -4540,33 +5553,33 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
4540
5553
|
onSelect("pat");
|
|
4541
5554
|
}
|
|
4542
5555
|
});
|
|
4543
|
-
return /* @__PURE__ */
|
|
4544
|
-
/* @__PURE__ */
|
|
4545
|
-
/* @__PURE__ */
|
|
5556
|
+
return /* @__PURE__ */ jsxs29(Box29, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, children: [
|
|
5557
|
+
/* @__PURE__ */ jsx30(Text30, { bold: true, marginBottom: 1, children: "Choose Authentication Method" }),
|
|
5558
|
+
/* @__PURE__ */ jsx30(Box29, { flexDirection: "column", marginY: 1, children: methods.map((method, index) => {
|
|
4546
5559
|
const isSelected = index === selectedIndex;
|
|
4547
|
-
const prefix = isSelected ?
|
|
5560
|
+
const prefix = isSelected ? chalk21.cyan("\u203A") : " ";
|
|
4548
5561
|
const numberPrefix = `${index + 1}.`;
|
|
4549
|
-
return /* @__PURE__ */
|
|
4550
|
-
/* @__PURE__ */
|
|
5562
|
+
return /* @__PURE__ */ jsxs29(Box29, { flexDirection: "column", marginBottom: 1, children: [
|
|
5563
|
+
/* @__PURE__ */ jsx30(Text30, { children: /* @__PURE__ */ jsxs29(Text30, { color: isSelected ? "cyan" : void 0, bold: isSelected, children: [
|
|
4551
5564
|
prefix,
|
|
4552
5565
|
" ",
|
|
4553
5566
|
numberPrefix,
|
|
4554
5567
|
" ",
|
|
4555
5568
|
method.label
|
|
4556
5569
|
] }) }),
|
|
4557
|
-
/* @__PURE__ */
|
|
5570
|
+
/* @__PURE__ */ jsxs29(Text30, { color: "gray", dimColor: true, children: [
|
|
4558
5571
|
" ",
|
|
4559
5572
|
method.description
|
|
4560
5573
|
] })
|
|
4561
5574
|
] }, method.key);
|
|
4562
5575
|
}) }),
|
|
4563
|
-
/* @__PURE__ */
|
|
5576
|
+
/* @__PURE__ */ jsx30(Text30, { color: "gray", dimColor: true, marginTop: 1, children: "Use arrow keys to navigate, Enter to select, or press 1/2 \u2022 Q/Esc to quit" })
|
|
4564
5577
|
] });
|
|
4565
5578
|
}
|
|
4566
5579
|
|
|
4567
5580
|
// src/ui/components/auth/OAuthProgress.tsx
|
|
4568
|
-
import { Box as
|
|
4569
|
-
import { jsx as
|
|
5581
|
+
import { Box as Box30, Text as Text31 } from "ink";
|
|
5582
|
+
import { jsx as jsx31, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
4570
5583
|
function OAuthProgress({ status, error, deviceCode }) {
|
|
4571
5584
|
const statusMessages = {
|
|
4572
5585
|
initializing: {
|
|
@@ -4603,64 +5616,64 @@ function OAuthProgress({ status, error, deviceCode }) {
|
|
|
4603
5616
|
}
|
|
4604
5617
|
};
|
|
4605
5618
|
const { message, showSpinner } = statusMessages[status];
|
|
4606
|
-
return /* @__PURE__ */
|
|
4607
|
-
/* @__PURE__ */
|
|
4608
|
-
/* @__PURE__ */
|
|
4609
|
-
/* @__PURE__ */
|
|
4610
|
-
/* @__PURE__ */
|
|
5619
|
+
return /* @__PURE__ */ jsxs30(Box30, { flexDirection: "column", borderStyle: "single", borderColor: status === "error" ? "red" : "cyan", paddingX: 2, paddingY: 1, children: [
|
|
5620
|
+
/* @__PURE__ */ jsx31(Text31, { bold: true, marginBottom: 1, children: "GitHub OAuth Authentication" }),
|
|
5621
|
+
/* @__PURE__ */ jsx31(Box30, { marginY: 1, children: showSpinner ? /* @__PURE__ */ jsxs30(Box30, { children: [
|
|
5622
|
+
/* @__PURE__ */ jsx31(Text31, { color: "green", children: /* @__PURE__ */ jsx31(SlowSpinner, { interval: 2e3 }) }),
|
|
5623
|
+
/* @__PURE__ */ jsxs30(Text31, { children: [
|
|
4611
5624
|
" ",
|
|
4612
5625
|
message
|
|
4613
5626
|
] })
|
|
4614
|
-
] }) : /* @__PURE__ */
|
|
5627
|
+
] }) : /* @__PURE__ */ jsxs30(Text31, { color: status === "error" ? "red" : "green", children: [
|
|
4615
5628
|
status === "error" ? "\u2717" : "\u2713",
|
|
4616
5629
|
" ",
|
|
4617
5630
|
message
|
|
4618
5631
|
] }) }),
|
|
4619
|
-
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */
|
|
4620
|
-
/* @__PURE__ */
|
|
4621
|
-
/* @__PURE__ */
|
|
4622
|
-
/* @__PURE__ */
|
|
4623
|
-
/* @__PURE__ */
|
|
5632
|
+
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */ jsxs30(Box30, { marginY: 1, flexDirection: "column", children: [
|
|
5633
|
+
/* @__PURE__ */ jsx31(Text31, { bold: true, color: "cyan", marginBottom: 1, children: "\u{1F4CB} Please complete these steps:" }),
|
|
5634
|
+
/* @__PURE__ */ jsxs30(Box30, { marginBottom: 1, children: [
|
|
5635
|
+
/* @__PURE__ */ jsx31(Text31, { children: "1. Visit: " }),
|
|
5636
|
+
/* @__PURE__ */ jsx31(Text31, { bold: true, color: "blue", children: deviceCode.verification_uri })
|
|
4624
5637
|
] }),
|
|
4625
|
-
/* @__PURE__ */
|
|
4626
|
-
/* @__PURE__ */
|
|
4627
|
-
/* @__PURE__ */
|
|
5638
|
+
/* @__PURE__ */ jsxs30(Box30, { marginBottom: 1, flexDirection: "column", children: [
|
|
5639
|
+
/* @__PURE__ */ jsx31(Text31, { children: "2. Enter this code:" }),
|
|
5640
|
+
/* @__PURE__ */ jsx31(Box30, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, marginTop: 1, children: /* @__PURE__ */ jsx31(Text31, { bold: true, color: "yellow", children: deviceCode.user_code }) })
|
|
4628
5641
|
] }),
|
|
4629
|
-
status === "waiting_for_authorization" && /* @__PURE__ */
|
|
4630
|
-
status === "polling_for_token" && /* @__PURE__ */
|
|
4631
|
-
/* @__PURE__ */
|
|
4632
|
-
/* @__PURE__ */
|
|
5642
|
+
status === "waiting_for_authorization" && /* @__PURE__ */ jsx31(Text31, { color: "gray", marginTop: 1, children: "Your browser should open automatically." }),
|
|
5643
|
+
status === "polling_for_token" && /* @__PURE__ */ jsxs30(Box30, { flexDirection: "column", marginTop: 1, children: [
|
|
5644
|
+
/* @__PURE__ */ jsx31(Text31, { color: "gray", children: "Waiting for you to complete authorization in your browser..." }),
|
|
5645
|
+
/* @__PURE__ */ jsx31(Text31, { color: "gray", dimColor: true, marginTop: 1, children: "This will timeout in 15 minutes. Press Esc to cancel." })
|
|
4633
5646
|
] })
|
|
4634
5647
|
] }),
|
|
4635
|
-
status === "error" && error && /* @__PURE__ */
|
|
4636
|
-
/* @__PURE__ */
|
|
4637
|
-
/* @__PURE__ */
|
|
5648
|
+
status === "error" && error && /* @__PURE__ */ jsxs30(Box30, { marginY: 1, flexDirection: "column", children: [
|
|
5649
|
+
/* @__PURE__ */ jsx31(Text31, { color: "red", children: error }),
|
|
5650
|
+
/* @__PURE__ */ jsx31(Text31, { color: "gray", marginTop: 1, children: "Press Esc to go back and try again." })
|
|
4638
5651
|
] }),
|
|
4639
|
-
status === "success" && /* @__PURE__ */
|
|
5652
|
+
status === "success" && /* @__PURE__ */ jsx31(Text31, { color: "gray", marginTop: 1, children: "Returning to application..." })
|
|
4640
5653
|
] });
|
|
4641
5654
|
}
|
|
4642
5655
|
|
|
4643
5656
|
// src/ui/App.tsx
|
|
4644
|
-
import { jsx as
|
|
5657
|
+
import { jsx as jsx32, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4645
5658
|
var packageJson = require_package();
|
|
4646
5659
|
function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlineTokenEphemeral }) {
|
|
4647
5660
|
const { exit } = useApp2();
|
|
4648
5661
|
const { stdout } = useStdout2();
|
|
4649
|
-
const [mode, setMode] =
|
|
4650
|
-
const [token, setToken] =
|
|
4651
|
-
const [input, setInput] =
|
|
4652
|
-
const [error, setError] =
|
|
4653
|
-
const [viewer, setViewer] =
|
|
4654
|
-
const [rateLimitReset, setRateLimitReset] =
|
|
4655
|
-
const [wasRateLimited, setWasRateLimited] =
|
|
4656
|
-
const [orgContext, setOrgContext] =
|
|
4657
|
-
const [authMethod, setAuthMethod] =
|
|
4658
|
-
const [oauthStatus, setOAuthStatus] =
|
|
4659
|
-
const [tokenSource, setTokenSource] =
|
|
4660
|
-
const [sessionTokenOrigin, setSessionTokenOrigin] =
|
|
4661
|
-
const [deviceCodeResponse, setDeviceCodeResponse] =
|
|
4662
|
-
const [oauthDeviceCode, setOauthDeviceCode] =
|
|
4663
|
-
const [dims, setDims] =
|
|
5662
|
+
const [mode, setMode] = useState26("checking");
|
|
5663
|
+
const [token, setToken] = useState26(null);
|
|
5664
|
+
const [input, setInput] = useState26("");
|
|
5665
|
+
const [error, setError] = useState26(null);
|
|
5666
|
+
const [viewer, setViewer] = useState26(null);
|
|
5667
|
+
const [rateLimitReset, setRateLimitReset] = useState26(null);
|
|
5668
|
+
const [wasRateLimited, setWasRateLimited] = useState26(false);
|
|
5669
|
+
const [orgContext, setOrgContext] = useState26("personal");
|
|
5670
|
+
const [authMethod, setAuthMethod] = useState26("pat");
|
|
5671
|
+
const [oauthStatus, setOAuthStatus] = useState26("initializing");
|
|
5672
|
+
const [tokenSource, setTokenSource] = useState26("pat");
|
|
5673
|
+
const [sessionTokenOrigin, setSessionTokenOrigin] = useState26("stored");
|
|
5674
|
+
const [deviceCodeResponse, setDeviceCodeResponse] = useState26(null);
|
|
5675
|
+
const [oauthDeviceCode, setOauthDeviceCode] = useState26(null);
|
|
5676
|
+
const [dims, setDims] = useState26(() => {
|
|
4664
5677
|
const cols = stdout?.columns ?? 100;
|
|
4665
5678
|
const rows = stdout?.rows ?? 30;
|
|
4666
5679
|
return { cols, rows };
|
|
@@ -4865,7 +5878,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4865
5878
|
setTokenSource("pat");
|
|
4866
5879
|
setMode("auth_method_selection");
|
|
4867
5880
|
};
|
|
4868
|
-
|
|
5881
|
+
useInput26((input2, key) => {
|
|
4869
5882
|
if ((mode === "prompt" || mode === "auth_method_selection") && key.escape) {
|
|
4870
5883
|
exit();
|
|
4871
5884
|
}
|
|
@@ -4897,19 +5910,19 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4897
5910
|
}
|
|
4898
5911
|
});
|
|
4899
5912
|
const verticalPadding = Math.floor(dims.rows * 0.05);
|
|
4900
|
-
const header = useMemo3(() => /* @__PURE__ */
|
|
4901
|
-
/* @__PURE__ */
|
|
4902
|
-
/* @__PURE__ */
|
|
5913
|
+
const header = useMemo3(() => /* @__PURE__ */ jsxs31(Box31, { flexDirection: "row", justifyContent: "space-between", marginBottom: 1, children: [
|
|
5914
|
+
/* @__PURE__ */ jsxs31(Box31, { flexDirection: "row", gap: 1, children: [
|
|
5915
|
+
/* @__PURE__ */ jsxs31(Text32, { bold: true, color: "cyan", children: [
|
|
4903
5916
|
" ",
|
|
4904
5917
|
"GitHub Repository Manager"
|
|
4905
5918
|
] }),
|
|
4906
|
-
/* @__PURE__ */
|
|
5919
|
+
/* @__PURE__ */ jsxs31(Text32, { color: "gray", dimColor: true, children: [
|
|
4907
5920
|
"v",
|
|
4908
5921
|
packageJson.version
|
|
4909
5922
|
] }),
|
|
4910
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
5923
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsx32(Text32, { backgroundColor: "blue", color: "white", children: " debug mode " })
|
|
4911
5924
|
] }),
|
|
4912
|
-
viewer && /* @__PURE__ */
|
|
5925
|
+
viewer && /* @__PURE__ */ jsx32(Text32, { color: "gray", children: orgContext !== "personal" && orgContext.login ? `${orgContext.login}/@${viewer} ` : `@${viewer} ` })
|
|
4913
5926
|
] }), [viewer, orgContext]);
|
|
4914
5927
|
if (mode === "rate_limited") {
|
|
4915
5928
|
const formatResetTime = (resetTime) => {
|
|
@@ -4932,71 +5945,71 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4932
5945
|
return "Unknown";
|
|
4933
5946
|
}
|
|
4934
5947
|
};
|
|
4935
|
-
return /* @__PURE__ */
|
|
5948
|
+
return /* @__PURE__ */ jsxs31(Box31, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4936
5949
|
header,
|
|
4937
|
-
/* @__PURE__ */
|
|
4938
|
-
/* @__PURE__ */
|
|
4939
|
-
/* @__PURE__ */
|
|
4940
|
-
/* @__PURE__ */
|
|
4941
|
-
rateLimitReset && /* @__PURE__ */
|
|
4942
|
-
/* @__PURE__ */
|
|
4943
|
-
/* @__PURE__ */
|
|
5950
|
+
/* @__PURE__ */ jsx32(Box31, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs31(Box31, { borderStyle: "single", borderColor: "yellow", paddingX: 3, paddingY: 2, flexDirection: "column", width: Math.min(dims.cols - 8, 80), children: [
|
|
5951
|
+
/* @__PURE__ */ jsx32(Text32, { bold: true, color: "yellow", marginBottom: 1, children: "\u26A0\uFE0F Rate Limit Exceeded" }),
|
|
5952
|
+
/* @__PURE__ */ jsx32(Text32, { color: "gray", marginBottom: 1, children: "You've hit GitHub's API rate limit for your token." }),
|
|
5953
|
+
/* @__PURE__ */ jsx32(Text32, { color: "gray", marginBottom: 1, children: "This happens when you make too many requests in a short time." }),
|
|
5954
|
+
rateLimitReset && /* @__PURE__ */ jsxs31(Box31, { marginTop: 1, marginBottom: 1, children: [
|
|
5955
|
+
/* @__PURE__ */ jsxs31(Text32, { children: [
|
|
5956
|
+
/* @__PURE__ */ jsx32(Text32, { color: "cyan", children: "Reset in:" }),
|
|
4944
5957
|
" ",
|
|
4945
|
-
/* @__PURE__ */
|
|
5958
|
+
/* @__PURE__ */ jsx32(Text32, { bold: true, children: formatResetTime(rateLimitReset) })
|
|
4946
5959
|
] }),
|
|
4947
|
-
/* @__PURE__ */
|
|
5960
|
+
/* @__PURE__ */ jsxs31(Text32, { color: "gray", dimColor: true, children: [
|
|
4948
5961
|
"(",
|
|
4949
5962
|
new Date(rateLimitReset).toLocaleTimeString(),
|
|
4950
5963
|
")"
|
|
4951
5964
|
] })
|
|
4952
5965
|
] }),
|
|
4953
|
-
/* @__PURE__ */
|
|
4954
|
-
/* @__PURE__ */
|
|
4955
|
-
/* @__PURE__ */
|
|
4956
|
-
/* @__PURE__ */
|
|
4957
|
-
/* @__PURE__ */
|
|
5966
|
+
/* @__PURE__ */ jsxs31(Box31, { marginTop: 2, flexDirection: "column", gap: 1, children: [
|
|
5967
|
+
/* @__PURE__ */ jsx32(Text32, { bold: true, children: "What would you like to do?" }),
|
|
5968
|
+
/* @__PURE__ */ jsxs31(Box31, { flexDirection: "column", paddingLeft: 2, children: [
|
|
5969
|
+
/* @__PURE__ */ jsxs31(Text32, { children: [
|
|
5970
|
+
/* @__PURE__ */ jsx32(Text32, { color: "cyan", bold: true, children: "R" }),
|
|
4958
5971
|
" - Retry now ",
|
|
4959
5972
|
rateLimitReset && formatResetTime(rateLimitReset) !== "Now (should be reset)" ? "(likely to fail until reset)" : "(should work now)"
|
|
4960
5973
|
] }),
|
|
4961
|
-
/* @__PURE__ */
|
|
4962
|
-
/* @__PURE__ */
|
|
5974
|
+
/* @__PURE__ */ jsxs31(Text32, { children: [
|
|
5975
|
+
/* @__PURE__ */ jsx32(Text32, { color: "cyan", bold: true, children: "L" }),
|
|
4963
5976
|
" - Logout and choose authentication method"
|
|
4964
5977
|
] }),
|
|
4965
|
-
/* @__PURE__ */
|
|
4966
|
-
/* @__PURE__ */
|
|
5978
|
+
/* @__PURE__ */ jsxs31(Text32, { children: [
|
|
5979
|
+
/* @__PURE__ */ jsx32(Text32, { color: "gray", bold: true, children: "Q/Esc" }),
|
|
4967
5980
|
" - Quit application"
|
|
4968
5981
|
] })
|
|
4969
5982
|
] })
|
|
4970
5983
|
] }),
|
|
4971
|
-
/* @__PURE__ */
|
|
5984
|
+
/* @__PURE__ */ jsx32(Text32, { color: "gray", dimColor: true, marginTop: 2, children: "Tip: Using multiple tokens or waiting between requests can help avoid rate limits." })
|
|
4972
5985
|
] }) })
|
|
4973
5986
|
] });
|
|
4974
5987
|
}
|
|
4975
5988
|
if (mode === "auth_method_selection") {
|
|
4976
|
-
return /* @__PURE__ */
|
|
5989
|
+
return /* @__PURE__ */ jsxs31(Box31, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4977
5990
|
header,
|
|
4978
|
-
/* @__PURE__ */
|
|
4979
|
-
/* @__PURE__ */
|
|
4980
|
-
error && /* @__PURE__ */
|
|
5991
|
+
/* @__PURE__ */ jsx32(Box31, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs31(Box31, { flexDirection: "column", alignItems: "center", children: [
|
|
5992
|
+
/* @__PURE__ */ jsx32(AuthMethodSelector, { onSelect: handleAuthMethodSelect }),
|
|
5993
|
+
error && /* @__PURE__ */ jsx32(Text32, { color: "red", marginTop: 1, children: error })
|
|
4981
5994
|
] }) })
|
|
4982
5995
|
] });
|
|
4983
5996
|
}
|
|
4984
5997
|
if (mode === "oauth_flow") {
|
|
4985
|
-
return /* @__PURE__ */
|
|
5998
|
+
return /* @__PURE__ */ jsxs31(Box31, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4986
5999
|
header,
|
|
4987
|
-
/* @__PURE__ */
|
|
6000
|
+
/* @__PURE__ */ jsx32(Box31, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx32(OAuthProgress, { status: oauthStatus, error: error || void 0, deviceCode: oauthDeviceCode || void 0 }) })
|
|
4988
6001
|
] });
|
|
4989
6002
|
}
|
|
4990
6003
|
if (mode === "prompt") {
|
|
4991
|
-
return /* @__PURE__ */
|
|
6004
|
+
return /* @__PURE__ */ jsxs31(Box31, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4992
6005
|
header,
|
|
4993
|
-
/* @__PURE__ */
|
|
4994
|
-
/* @__PURE__ */
|
|
4995
|
-
/* @__PURE__ */
|
|
4996
|
-
/* @__PURE__ */
|
|
4997
|
-
/* @__PURE__ */
|
|
4998
|
-
/* @__PURE__ */
|
|
4999
|
-
|
|
6006
|
+
/* @__PURE__ */ jsx32(Box31, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs31(Box31, { borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, flexDirection: "column", children: [
|
|
6007
|
+
/* @__PURE__ */ jsx32(Text32, { bold: true, marginBottom: 1, children: "Authentication Required" }),
|
|
6008
|
+
/* @__PURE__ */ jsx32(Text32, { color: "gray", marginBottom: 1, children: "Enter your GitHub Personal Access Token" }),
|
|
6009
|
+
/* @__PURE__ */ jsxs31(Box31, { children: [
|
|
6010
|
+
/* @__PURE__ */ jsx32(Text32, { children: "Token: " }),
|
|
6011
|
+
/* @__PURE__ */ jsx32(
|
|
6012
|
+
TextInput9,
|
|
5000
6013
|
{
|
|
5001
6014
|
value: input,
|
|
5002
6015
|
onChange: setInput,
|
|
@@ -5005,30 +6018,30 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
5005
6018
|
}
|
|
5006
6019
|
)
|
|
5007
6020
|
] }),
|
|
5008
|
-
error && /* @__PURE__ */
|
|
5009
|
-
/* @__PURE__ */
|
|
5010
|
-
/* @__PURE__ */
|
|
6021
|
+
error && /* @__PURE__ */ jsx32(Text32, { color: "red", marginTop: 1, children: error }),
|
|
6022
|
+
/* @__PURE__ */ jsx32(Text32, { color: "gray", dimColor: true, marginTop: 1, children: "The token will be stored securely in your local config" }),
|
|
6023
|
+
/* @__PURE__ */ jsx32(Text32, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to go back" })
|
|
5011
6024
|
] }) })
|
|
5012
6025
|
] });
|
|
5013
6026
|
}
|
|
5014
6027
|
if (mode === "validating" || mode === "checking") {
|
|
5015
|
-
return /* @__PURE__ */
|
|
6028
|
+
return /* @__PURE__ */ jsxs31(Box31, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
5016
6029
|
header,
|
|
5017
|
-
/* @__PURE__ */
|
|
5018
|
-
/* @__PURE__ */
|
|
5019
|
-
mode === "validating" && /* @__PURE__ */
|
|
6030
|
+
/* @__PURE__ */ jsx32(Box31, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs31(Box31, { flexDirection: "column", alignItems: "center", children: [
|
|
6031
|
+
/* @__PURE__ */ jsx32(Text32, { color: "yellow", children: "Validating token..." }),
|
|
6032
|
+
mode === "validating" && /* @__PURE__ */ jsx32(Text32, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to cancel" })
|
|
5020
6033
|
] }) })
|
|
5021
6034
|
] });
|
|
5022
6035
|
}
|
|
5023
6036
|
if (mode === "error") {
|
|
5024
|
-
return /* @__PURE__ */
|
|
6037
|
+
return /* @__PURE__ */ jsxs31(Box31, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
5025
6038
|
header,
|
|
5026
|
-
/* @__PURE__ */
|
|
6039
|
+
/* @__PURE__ */ jsx32(Box31, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx32(Text32, { color: "red", children: error ?? "Unexpected error" }) })
|
|
5027
6040
|
] });
|
|
5028
6041
|
}
|
|
5029
|
-
return /* @__PURE__ */
|
|
6042
|
+
return /* @__PURE__ */ jsxs31(Box31, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
5030
6043
|
header,
|
|
5031
|
-
/* @__PURE__ */
|
|
6044
|
+
/* @__PURE__ */ jsx32(
|
|
5032
6045
|
RepoList,
|
|
5033
6046
|
{
|
|
5034
6047
|
token,
|
|
@@ -5043,7 +6056,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
5043
6056
|
}
|
|
5044
6057
|
|
|
5045
6058
|
// src/index.tsx
|
|
5046
|
-
import { jsx as
|
|
6059
|
+
import { jsx as jsx33, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5047
6060
|
var argv = process.argv.slice(2);
|
|
5048
6061
|
var getFlagValue = (name) => {
|
|
5049
6062
|
const idx = argv.findIndex((a) => a === `--${name}` || a.startsWith(`--${name}=`));
|
|
@@ -5156,8 +6169,8 @@ var inlineToken = (() => {
|
|
|
5156
6169
|
})();
|
|
5157
6170
|
logger.debug("Rendering UI");
|
|
5158
6171
|
var { unmount } = render(
|
|
5159
|
-
/* @__PURE__ */
|
|
5160
|
-
/* @__PURE__ */
|
|
5161
|
-
/* @__PURE__ */
|
|
6172
|
+
/* @__PURE__ */ jsxs32(Box32, { flexDirection: "column", children: [
|
|
6173
|
+
/* @__PURE__ */ jsx33(App, { initialOrgSlug, inlineToken, inlineTokenEphemeral: Boolean(inlineToken) }),
|
|
6174
|
+
/* @__PURE__ */ jsx33(Text33, { color: "gray" })
|
|
5162
6175
|
] })
|
|
5163
6176
|
);
|