gh-manager-cli 1.42.0 → 1.44.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 +11 -9
- package/dist/{chunk-UOGN2QJU.js → chunk-MKIUBPVD.js} +119 -1
- package/dist/{github-ASGTM4ZX.js → github-6HD7I2UI.js} +5 -1
- package/dist/index.js +632 -407
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
changeRepositoryVisibility,
|
|
7
7
|
checkOrganizationIsEnterprise,
|
|
8
8
|
deleteRepositoryRest,
|
|
9
|
+
enrichForksWithAheadBehind,
|
|
10
|
+
fetchRepositoryByOwnerAndName,
|
|
9
11
|
fetchRestRateLimits,
|
|
10
12
|
fetchViewerOrganizations,
|
|
11
13
|
fetchViewerReposPageUnified,
|
|
@@ -26,14 +28,14 @@ import {
|
|
|
26
28
|
updateCacheAfterRename,
|
|
27
29
|
updateCacheAfterVisibilityChange,
|
|
28
30
|
updateCacheWithRepository
|
|
29
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-MKIUBPVD.js";
|
|
30
32
|
|
|
31
33
|
// package.json
|
|
32
34
|
var require_package = __commonJS({
|
|
33
35
|
"package.json"(exports, module) {
|
|
34
36
|
module.exports = {
|
|
35
37
|
name: "gh-manager-cli",
|
|
36
|
-
version: "1.
|
|
38
|
+
version: "1.44.0",
|
|
37
39
|
private: false,
|
|
38
40
|
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",
|
|
39
41
|
license: "MIT",
|
|
@@ -153,12 +155,12 @@ var require_package = __commonJS({
|
|
|
153
155
|
|
|
154
156
|
// src/index.tsx
|
|
155
157
|
var import_package = __toESM(require_package(), 1);
|
|
156
|
-
import { render, Box as
|
|
158
|
+
import { render, Box as Box24, Text as Text25 } from "ink";
|
|
157
159
|
import "dotenv/config";
|
|
158
160
|
|
|
159
161
|
// src/ui/App.tsx
|
|
160
|
-
import { useEffect as useEffect13, useMemo as useMemo3, useState as
|
|
161
|
-
import { Box as
|
|
162
|
+
import { useEffect as useEffect13, useMemo as useMemo3, useState as useState19 } from "react";
|
|
163
|
+
import { Box as Box23, Text as Text24, useApp as useApp2, useStdout as useStdout2, useInput as useInput19 } from "ink";
|
|
162
164
|
import TextInput6 from "ink-text-input";
|
|
163
165
|
|
|
164
166
|
// src/config/config.ts
|
|
@@ -407,8 +409,8 @@ async function openGitHubAuthorizationPage() {
|
|
|
407
409
|
}
|
|
408
410
|
|
|
409
411
|
// src/ui/views/RepoList.tsx
|
|
410
|
-
import
|
|
411
|
-
import { Box as
|
|
412
|
+
import React17, { useEffect as useEffect12, useMemo as useMemo2, useState as useState17, useRef, useCallback } from "react";
|
|
413
|
+
import { Box as Box20, Text as Text21, useApp, useInput as useInput17, useStdout } from "ink";
|
|
412
414
|
import TextInput5 from "ink-text-input";
|
|
413
415
|
import chalk15 from "chalk";
|
|
414
416
|
|
|
@@ -425,6 +427,8 @@ var THEMES = {
|
|
|
425
427
|
muted: "gray",
|
|
426
428
|
text: "white",
|
|
427
429
|
selected: "cyan",
|
|
430
|
+
selectedBg: "#1f4a57",
|
|
431
|
+
// dark teal — contrasts the cyan/white selected text
|
|
428
432
|
private: "yellow",
|
|
429
433
|
archived: "gray",
|
|
430
434
|
internal: "magenta",
|
|
@@ -442,6 +446,8 @@ var THEMES = {
|
|
|
442
446
|
muted: "blue",
|
|
443
447
|
text: "whiteBright",
|
|
444
448
|
selected: "blueBright",
|
|
449
|
+
selectedBg: "#11294d",
|
|
450
|
+
// deep blue — sits behind the bright blue/white text
|
|
445
451
|
private: "cyan",
|
|
446
452
|
archived: "blue",
|
|
447
453
|
internal: "magenta",
|
|
@@ -459,6 +465,8 @@ var THEMES = {
|
|
|
459
465
|
muted: "gray",
|
|
460
466
|
text: "white",
|
|
461
467
|
selected: "green",
|
|
468
|
+
selectedBg: "#14391f",
|
|
469
|
+
// deep forest green behind the green/white text
|
|
462
470
|
private: "yellow",
|
|
463
471
|
archived: "gray",
|
|
464
472
|
internal: "magenta",
|
|
@@ -476,6 +484,8 @@ var THEMES = {
|
|
|
476
484
|
muted: "gray",
|
|
477
485
|
text: "white",
|
|
478
486
|
selected: "whiteBright",
|
|
487
|
+
selectedBg: "#333333",
|
|
488
|
+
// neutral dark grey — darker than the old bright grey
|
|
479
489
|
private: "white",
|
|
480
490
|
archived: "gray",
|
|
481
491
|
internal: "white",
|
|
@@ -619,7 +629,7 @@ function OrgSwitcher({ token, currentContext, onSelect, onClose }) {
|
|
|
619
629
|
try {
|
|
620
630
|
setLoading(true);
|
|
621
631
|
setError(null);
|
|
622
|
-
const client = await import("./github-
|
|
632
|
+
const client = await import("./github-6HD7I2UI.js").then((m) => m.makeClient(token));
|
|
623
633
|
const orgs = await fetchViewerOrganizations(client);
|
|
624
634
|
setOrganizations(orgs);
|
|
625
635
|
const entOrgs = /* @__PURE__ */ new Set();
|
|
@@ -1870,11 +1880,76 @@ function StarModal({
|
|
|
1870
1880
|
);
|
|
1871
1881
|
}
|
|
1872
1882
|
|
|
1883
|
+
// src/ui/components/modals/OpenInBrowserModal.tsx
|
|
1884
|
+
import { useState as useState15 } from "react";
|
|
1885
|
+
import { Box as Box15, Text as Text16, useInput as useInput15 } from "ink";
|
|
1886
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1887
|
+
function OpenInBrowserModal({ repo, onOpen, onCancel, theme: themeProp }) {
|
|
1888
|
+
const { theme, c } = useTheme(themeProp?.name ?? "default");
|
|
1889
|
+
const [focus, setFocus] = useState15("this");
|
|
1890
|
+
const forkUrl = `https://github.com/${repo.nameWithOwner}`;
|
|
1891
|
+
const upstreamUrl = repo.parent ? `https://github.com/${repo.parent.nameWithOwner}` : null;
|
|
1892
|
+
useInput15((input, key) => {
|
|
1893
|
+
if (key.escape || input.toLowerCase() === "c") {
|
|
1894
|
+
onCancel();
|
|
1895
|
+
return;
|
|
1896
|
+
}
|
|
1897
|
+
if (key.leftArrow || key.rightArrow) {
|
|
1898
|
+
setFocus((prev) => prev === "this" ? "upstream" : "this");
|
|
1899
|
+
return;
|
|
1900
|
+
}
|
|
1901
|
+
if (key.return) {
|
|
1902
|
+
if (focus === "this") {
|
|
1903
|
+
onOpen(forkUrl);
|
|
1904
|
+
} else if (upstreamUrl) {
|
|
1905
|
+
onOpen(upstreamUrl);
|
|
1906
|
+
}
|
|
1907
|
+
return;
|
|
1908
|
+
}
|
|
1909
|
+
if (input.toLowerCase() === "t") {
|
|
1910
|
+
onOpen(forkUrl);
|
|
1911
|
+
return;
|
|
1912
|
+
}
|
|
1913
|
+
if (input.toLowerCase() === "u" && upstreamUrl) {
|
|
1914
|
+
onOpen(upstreamUrl);
|
|
1915
|
+
return;
|
|
1916
|
+
}
|
|
1917
|
+
});
|
|
1918
|
+
return /* @__PURE__ */ jsxs15(
|
|
1919
|
+
Box15,
|
|
1920
|
+
{
|
|
1921
|
+
flexDirection: "column",
|
|
1922
|
+
borderStyle: "round",
|
|
1923
|
+
borderColor: theme.primary,
|
|
1924
|
+
paddingX: 3,
|
|
1925
|
+
paddingY: 2,
|
|
1926
|
+
width: 62,
|
|
1927
|
+
children: [
|
|
1928
|
+
/* @__PURE__ */ jsx16(Text16, { bold: true, color: theme.primary, children: "Open in Browser" }),
|
|
1929
|
+
/* @__PURE__ */ jsx16(Box15, { height: 1, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) }),
|
|
1930
|
+
/* @__PURE__ */ jsx16(Text16, { bold: true, children: repo.nameWithOwner }),
|
|
1931
|
+
repo.parent && /* @__PURE__ */ jsxs15(Text16, { color: theme.muted, children: [
|
|
1932
|
+
"Fork of ",
|
|
1933
|
+
repo.parent.nameWithOwner
|
|
1934
|
+
] }),
|
|
1935
|
+
/* @__PURE__ */ jsx16(Box15, { height: 1, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) }),
|
|
1936
|
+
/* @__PURE__ */ jsx16(Text16, { children: "Which repository would you like to open?" }),
|
|
1937
|
+
/* @__PURE__ */ jsx16(Box15, { height: 1, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) }),
|
|
1938
|
+
/* @__PURE__ */ jsxs15(Box15, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 4, children: [
|
|
1939
|
+
/* @__PURE__ */ jsx16(Box15, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx16(Text16, { children: focus === "this" ? c.primary.inverse.bold(" This Repository ") : c.primary.bold("This Repository") }) }),
|
|
1940
|
+
/* @__PURE__ */ jsx16(Box15, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx16(Text16, { children: focus === "upstream" ? c.success.inverse.bold(" Parent/Upstream ") : c.success.bold("Parent/Upstream") }) })
|
|
1941
|
+
] }),
|
|
1942
|
+
/* @__PURE__ */ jsx16(Box15, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsx16(Text16, { color: theme.muted, children: "\u2190/\u2192 Choose \u2022 Enter to Open \u2022 T This \u2022 U Upstream \u2022 C/Esc Cancel" }) })
|
|
1943
|
+
]
|
|
1944
|
+
}
|
|
1945
|
+
);
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1873
1948
|
// src/ui/components/modals/UnstarModal.tsx
|
|
1874
|
-
import { useEffect as useEffect11, useState as
|
|
1875
|
-
import { Box as
|
|
1876
|
-
import { useInput as
|
|
1877
|
-
import { Fragment as Fragment8, jsx as
|
|
1949
|
+
import { useEffect as useEffect11, useState as useState16 } from "react";
|
|
1950
|
+
import { Box as Box16, Text as Text17 } from "ink";
|
|
1951
|
+
import { useInput as useInput16 } from "ink";
|
|
1952
|
+
import { Fragment as Fragment8, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1878
1953
|
function UnstarModal({
|
|
1879
1954
|
visible,
|
|
1880
1955
|
repo,
|
|
@@ -1885,8 +1960,8 @@ function UnstarModal({
|
|
|
1885
1960
|
theme: themeProp
|
|
1886
1961
|
}) {
|
|
1887
1962
|
const { theme } = useTheme(themeProp?.name ?? "default");
|
|
1888
|
-
const [focusedButton, setFocusedButton] =
|
|
1889
|
-
|
|
1963
|
+
const [focusedButton, setFocusedButton] = useState16("cancel");
|
|
1964
|
+
useInput16((input, key) => {
|
|
1890
1965
|
if (!visible) return;
|
|
1891
1966
|
if (key.escape || input === "c" || input === "C") {
|
|
1892
1967
|
onCancel();
|
|
@@ -1908,8 +1983,8 @@ function UnstarModal({
|
|
|
1908
1983
|
if (visible) setFocusedButton("cancel");
|
|
1909
1984
|
}, [visible]);
|
|
1910
1985
|
if (!visible || !repo) return null;
|
|
1911
|
-
return /* @__PURE__ */
|
|
1912
|
-
|
|
1986
|
+
return /* @__PURE__ */ jsxs16(
|
|
1987
|
+
Box16,
|
|
1913
1988
|
{
|
|
1914
1989
|
flexDirection: "column",
|
|
1915
1990
|
borderStyle: "round",
|
|
@@ -1918,28 +1993,28 @@ function UnstarModal({
|
|
|
1918
1993
|
paddingY: 1,
|
|
1919
1994
|
marginTop: 1,
|
|
1920
1995
|
children: [
|
|
1921
|
-
/* @__PURE__ */
|
|
1922
|
-
/* @__PURE__ */
|
|
1996
|
+
/* @__PURE__ */ jsx17(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsx17(Text17, { bold: true, color: theme.warning, children: "\u2B50 Unstar Repository" }) }),
|
|
1997
|
+
/* @__PURE__ */ jsx17(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsxs16(Text17, { children: [
|
|
1923
1998
|
"Are you sure you want to unstar",
|
|
1924
1999
|
" ",
|
|
1925
|
-
/* @__PURE__ */
|
|
2000
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, color: theme.primary, children: repo.nameWithOwner }),
|
|
1926
2001
|
"?"
|
|
1927
2002
|
] }) }),
|
|
1928
|
-
repo.description && /* @__PURE__ */
|
|
1929
|
-
/* @__PURE__ */
|
|
2003
|
+
repo.description && /* @__PURE__ */ jsx17(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsx17(Text17, { dimColor: true, wrap: "wrap", children: repo.description }) }),
|
|
2004
|
+
/* @__PURE__ */ jsx17(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsxs16(Text17, { dimColor: true, children: [
|
|
1930
2005
|
"Stars: ",
|
|
1931
2006
|
repo.stargazerCount,
|
|
1932
2007
|
" \u2022 Forks: ",
|
|
1933
2008
|
repo.forkCount
|
|
1934
2009
|
] }) }),
|
|
1935
|
-
error && /* @__PURE__ */
|
|
2010
|
+
error && /* @__PURE__ */ jsx17(Box16, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs16(Text17, { color: theme.error, wrap: "wrap", children: [
|
|
1936
2011
|
error.includes("OAuth access restrictions") ? "\u26A0\uFE0F " : "Error: ",
|
|
1937
2012
|
error
|
|
1938
2013
|
] }) }),
|
|
1939
|
-
isUnstarring ? /* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
1941
|
-
/* @__PURE__ */
|
|
1942
|
-
|
|
2014
|
+
isUnstarring ? /* @__PURE__ */ jsx17(Box16, { children: /* @__PURE__ */ jsx17(Text17, { color: theme.warning, children: "Unstarring..." }) }) : /* @__PURE__ */ jsxs16(Fragment8, { children: [
|
|
2015
|
+
/* @__PURE__ */ jsxs16(Box16, { gap: 2, children: [
|
|
2016
|
+
/* @__PURE__ */ jsx17(Box16, { children: /* @__PURE__ */ jsxs16(
|
|
2017
|
+
Text17,
|
|
1943
2018
|
{
|
|
1944
2019
|
backgroundColor: focusedButton === "cancel" ? "white" : void 0,
|
|
1945
2020
|
color: focusedButton === "cancel" ? "black" : "white",
|
|
@@ -1951,8 +2026,8 @@ function UnstarModal({
|
|
|
1951
2026
|
]
|
|
1952
2027
|
}
|
|
1953
2028
|
) }),
|
|
1954
|
-
/* @__PURE__ */
|
|
1955
|
-
|
|
2029
|
+
/* @__PURE__ */ jsx17(Box16, { children: /* @__PURE__ */ jsxs16(
|
|
2030
|
+
Text17,
|
|
1956
2031
|
{
|
|
1957
2032
|
backgroundColor: focusedButton === "unstar" ? "yellow" : void 0,
|
|
1958
2033
|
color: focusedButton === "unstar" ? "black" : theme.warning,
|
|
@@ -1965,7 +2040,7 @@ function UnstarModal({
|
|
|
1965
2040
|
}
|
|
1966
2041
|
) })
|
|
1967
2042
|
] }),
|
|
1968
|
-
/* @__PURE__ */
|
|
2043
|
+
/* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "Use \u2190 \u2192 to navigate, Enter to select" }) })
|
|
1969
2044
|
] })
|
|
1970
2045
|
]
|
|
1971
2046
|
}
|
|
@@ -1973,9 +2048,9 @@ function UnstarModal({
|
|
|
1973
2048
|
}
|
|
1974
2049
|
|
|
1975
2050
|
// src/ui/components/repo/RepoRow.tsx
|
|
1976
|
-
import { Box as
|
|
2051
|
+
import { Box as Box17, Text as Text18 } from "ink";
|
|
1977
2052
|
import chalk14 from "chalk";
|
|
1978
|
-
import { jsx as
|
|
2053
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1979
2054
|
function RepoRow({
|
|
1980
2055
|
repo,
|
|
1981
2056
|
selected,
|
|
@@ -1991,8 +2066,11 @@ function RepoRow({
|
|
|
1991
2066
|
const langName = repo.primaryLanguage?.name || "";
|
|
1992
2067
|
const langColor = repo.primaryLanguage?.color || "#666666";
|
|
1993
2068
|
const hasCommitData = repo.isFork && repo.parent && repo.defaultBranchRef && repo.parent.defaultBranchRef && repo.parent.defaultBranchRef.target?.history && repo.defaultBranchRef.target?.history;
|
|
1994
|
-
const
|
|
1995
|
-
const
|
|
2069
|
+
const forkCount = hasCommitData ? repo.defaultBranchRef.target.history.totalCount : 0;
|
|
2070
|
+
const parentCount = hasCommitData ? repo.parent.defaultBranchRef.target.history.totalCount : 0;
|
|
2071
|
+
const commitsBehind = hasCommitData ? Math.max(0, parentCount - forkCount) : 0;
|
|
2072
|
+
const commitsAhead = hasCommitData ? Math.max(0, forkCount - parentCount) : 0;
|
|
2073
|
+
const showCommitData = forkTracking && hasCommitData;
|
|
1996
2074
|
let line1 = "";
|
|
1997
2075
|
const numColor = selected ? c.selected : c.muted;
|
|
1998
2076
|
const nameColor = selected ? c.selected.bold : c.text;
|
|
@@ -2012,11 +2090,14 @@ function RepoRow({
|
|
|
2012
2090
|
if (repo.isArchived) line1 += " " + chalk14.bgGray.whiteBright(" Archived ") + " ";
|
|
2013
2091
|
if (repo.isFork && repo.parent) {
|
|
2014
2092
|
line1 += c.fork(` Fork of ${repo.parent.nameWithOwner}`);
|
|
2015
|
-
if (
|
|
2016
|
-
|
|
2017
|
-
|
|
2093
|
+
if (showCommitData) {
|
|
2094
|
+
const parts = [];
|
|
2095
|
+
if (commitsAhead > 0) parts.push(c.success(`${commitsAhead} ahead`));
|
|
2096
|
+
if (commitsBehind > 0) parts.push(c.warning(`${commitsBehind} behind`));
|
|
2097
|
+
if (parts.length > 0) {
|
|
2098
|
+
line1 += c.muted(` (${parts.join(", ")})`);
|
|
2018
2099
|
} else {
|
|
2019
|
-
line1 += c.success(` (
|
|
2100
|
+
line1 += c.success(` (up to date)`);
|
|
2020
2101
|
}
|
|
2021
2102
|
}
|
|
2022
2103
|
}
|
|
@@ -2029,21 +2110,21 @@ function RepoRow({
|
|
|
2029
2110
|
if (line3) fullText += "\n" + metaColor(line3);
|
|
2030
2111
|
const spacingAbove = Math.floor(spacingLines / 2);
|
|
2031
2112
|
const spacingBelow = spacingLines - spacingAbove;
|
|
2032
|
-
return /* @__PURE__ */
|
|
2033
|
-
spacingAbove > 0 && /* @__PURE__ */
|
|
2034
|
-
/* @__PURE__ */
|
|
2035
|
-
spacingBelow > 0 && /* @__PURE__ */
|
|
2113
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", backgroundColor: selected ? theme.selectedBg : void 0, children: [
|
|
2114
|
+
spacingAbove > 0 && /* @__PURE__ */ jsx18(Box17, { height: spacingAbove, children: /* @__PURE__ */ jsx18(Text18, { children: " " }) }),
|
|
2115
|
+
/* @__PURE__ */ jsx18(Text18, { children: dim ? chalk14.dim(fullText) : fullText }),
|
|
2116
|
+
spacingBelow > 0 && /* @__PURE__ */ jsx18(Box17, { height: spacingBelow, children: /* @__PURE__ */ jsx18(Text18, { children: " " }) })
|
|
2036
2117
|
] });
|
|
2037
2118
|
}
|
|
2038
2119
|
|
|
2039
2120
|
// src/ui/components/repo/FilterInput.tsx
|
|
2040
|
-
import { Box as
|
|
2121
|
+
import { Box as Box18, Text as Text19 } from "ink";
|
|
2041
2122
|
import TextInput4 from "ink-text-input";
|
|
2042
|
-
import { jsx as
|
|
2123
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2043
2124
|
|
|
2044
2125
|
// src/ui/components/repo/RepoListHeader.tsx
|
|
2045
|
-
import { Box as
|
|
2046
|
-
import { jsx as
|
|
2126
|
+
import { Box as Box19, Text as Text20 } from "ink";
|
|
2127
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2047
2128
|
function RepoListHeader({
|
|
2048
2129
|
ownerContext,
|
|
2049
2130
|
sortKey,
|
|
@@ -2060,26 +2141,26 @@ function RepoListHeader({
|
|
|
2060
2141
|
const { theme } = useTheme(themeProp?.name ?? "default");
|
|
2061
2142
|
const contextLabel = ownerContext === "personal" ? "Personal Account" : ownerContext?.type === "organization" ? `Organisation: ${ownerContext.name ?? ownerContext.login}` : "";
|
|
2062
2143
|
const visibilityLabel = visibilityFilter === "public" ? "Public" : visibilityFilter === "private" ? isEnterprise ? "Private/Internal" : "Private" : visibilityFilter === "internal" ? "Internal" : "";
|
|
2063
|
-
return /* @__PURE__ */
|
|
2064
|
-
contextLabel && /* @__PURE__ */
|
|
2065
|
-
starsMode && /* @__PURE__ */
|
|
2066
|
-
/* @__PURE__ */
|
|
2144
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", gap: 2, marginBottom: 1, children: [
|
|
2145
|
+
contextLabel && /* @__PURE__ */ jsx20(Text20, { children: contextLabel }),
|
|
2146
|
+
starsMode && /* @__PURE__ */ jsx20(Text20, { color: theme.warning, bold: true, children: "\u2B50 Stars Mode" }),
|
|
2147
|
+
/* @__PURE__ */ jsxs19(Text20, { color: theme.muted, dimColor: true, children: [
|
|
2067
2148
|
"Sort: ",
|
|
2068
2149
|
filterActive ? "relevance" : `${sortKey} ${sortDir === "asc" ? "\u2191" : "\u2193"}`
|
|
2069
2150
|
] }),
|
|
2070
|
-
/* @__PURE__ */
|
|
2151
|
+
/* @__PURE__ */ jsxs19(Text20, { color: theme.muted, dimColor: true, children: [
|
|
2071
2152
|
"Fork Status - Commits Behind: ",
|
|
2072
2153
|
forkTracking ? "ON" : "OFF"
|
|
2073
2154
|
] }),
|
|
2074
|
-
!!visibilityLabel && !starsMode && /* @__PURE__ */
|
|
2155
|
+
!!visibilityLabel && !starsMode && /* @__PURE__ */ jsxs19(Text20, { color: theme.warning, children: [
|
|
2075
2156
|
"Visibility: ",
|
|
2076
2157
|
visibilityLabel
|
|
2077
2158
|
] }),
|
|
2078
|
-
archiveFilter !== "all" && /* @__PURE__ */
|
|
2159
|
+
archiveFilter !== "all" && /* @__PURE__ */ jsxs19(Text20, { color: theme.primary, children: [
|
|
2079
2160
|
"Archive: ",
|
|
2080
2161
|
archiveFilter === "archived" ? "Archived" : "Unarchived"
|
|
2081
2162
|
] }),
|
|
2082
|
-
(filterActive || starsMode && filter.trim().length > 0) && /* @__PURE__ */
|
|
2163
|
+
(filterActive || starsMode && filter.trim().length > 0) && /* @__PURE__ */ jsxs19(Text20, { color: theme.primary, children: [
|
|
2083
2164
|
starsMode ? "Filter" : "Search",
|
|
2084
2165
|
': "',
|
|
2085
2166
|
filter.trim(),
|
|
@@ -2089,7 +2170,7 @@ function RepoListHeader({
|
|
|
2089
2170
|
}
|
|
2090
2171
|
|
|
2091
2172
|
// src/ui/views/RepoList.tsx
|
|
2092
|
-
import { Fragment as Fragment9, jsx as
|
|
2173
|
+
import { Fragment as Fragment9, jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2093
2174
|
var getPageSize = () => {
|
|
2094
2175
|
const envValue = process.env.REPOS_PER_FETCH;
|
|
2095
2176
|
if (envValue) {
|
|
@@ -2105,7 +2186,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2105
2186
|
const { exit } = useApp();
|
|
2106
2187
|
const { stdout } = useStdout();
|
|
2107
2188
|
const client = useMemo2(() => makeClient(token), [token]);
|
|
2108
|
-
const [debugMessages, setDebugMessages] =
|
|
2189
|
+
const [debugMessages, setDebugMessages] = useState17([]);
|
|
2109
2190
|
const addDebugMessage = useCallback((msg) => {
|
|
2110
2191
|
if (process.env.GH_MANAGER_DEBUG === "1") {
|
|
2111
2192
|
setDebugMessages((prev) => [...prev.slice(-9), msg]);
|
|
@@ -2115,7 +2196,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2115
2196
|
useEffect12(() => {
|
|
2116
2197
|
handleOrgContextChangeRef.current = onOrgContextChange;
|
|
2117
2198
|
}, [onOrgContextChange]);
|
|
2118
|
-
|
|
2199
|
+
React17.useEffect(() => {
|
|
2119
2200
|
addDebugMessage(`[RepoList] Component mounted`);
|
|
2120
2201
|
logger.info("RepoList component mounted", {
|
|
2121
2202
|
token: token ? "present" : "missing",
|
|
@@ -2127,84 +2208,88 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2127
2208
|
}, []);
|
|
2128
2209
|
const terminalWidth = stdout?.columns ?? 80;
|
|
2129
2210
|
const availableHeight = maxVisibleRows ?? 20;
|
|
2130
|
-
const [items, setItems] =
|
|
2131
|
-
const [cursor, setCursor] =
|
|
2132
|
-
const [endCursor, setEndCursor] =
|
|
2133
|
-
const [hasNextPage, setHasNextPage] =
|
|
2134
|
-
const [totalCount, setTotalCount] =
|
|
2135
|
-
const [loading, setLoading] =
|
|
2136
|
-
const [sortingLoading, setSortingLoading] =
|
|
2137
|
-
const [refreshing, setRefreshing] =
|
|
2138
|
-
const [loadingMore, setLoadingMore] =
|
|
2139
|
-
const [error, setError] =
|
|
2140
|
-
const [rateLimit, setRateLimit] =
|
|
2141
|
-
const [prevRateLimit, setPrevRateLimit] =
|
|
2142
|
-
const [restRateLimit, setRestRateLimit] =
|
|
2143
|
-
const [prevRestRateLimit, setPrevRestRateLimit] =
|
|
2144
|
-
const [density, setDensity] =
|
|
2145
|
-
const [prefsLoaded, setPrefsLoaded] =
|
|
2146
|
-
const [themeName, setThemeName] =
|
|
2147
|
-
const [themeToast, setThemeToast] =
|
|
2211
|
+
const [items, setItems] = useState17([]);
|
|
2212
|
+
const [cursor, setCursor] = useState17(0);
|
|
2213
|
+
const [endCursor, setEndCursor] = useState17(null);
|
|
2214
|
+
const [hasNextPage, setHasNextPage] = useState17(false);
|
|
2215
|
+
const [totalCount, setTotalCount] = useState17(0);
|
|
2216
|
+
const [loading, setLoading] = useState17(true);
|
|
2217
|
+
const [sortingLoading, setSortingLoading] = useState17(false);
|
|
2218
|
+
const [refreshing, setRefreshing] = useState17(false);
|
|
2219
|
+
const [loadingMore, setLoadingMore] = useState17(false);
|
|
2220
|
+
const [error, setError] = useState17(null);
|
|
2221
|
+
const [rateLimit, setRateLimit] = useState17(void 0);
|
|
2222
|
+
const [prevRateLimit, setPrevRateLimit] = useState17(void 0);
|
|
2223
|
+
const [restRateLimit, setRestRateLimit] = useState17(void 0);
|
|
2224
|
+
const [prevRestRateLimit, setPrevRestRateLimit] = useState17(void 0);
|
|
2225
|
+
const [density, setDensity] = useState17(2);
|
|
2226
|
+
const [prefsLoaded, setPrefsLoaded] = useState17(false);
|
|
2227
|
+
const [themeName, setThemeName] = useState17("default");
|
|
2228
|
+
const [themeToast, setThemeToast] = useState17(null);
|
|
2148
2229
|
const themeToastTimerRef = useRef(null);
|
|
2149
2230
|
const { theme, c: tc } = useTheme(themeName);
|
|
2150
|
-
const [ownerContext, setOwnerContext] =
|
|
2151
|
-
const [ownerAffiliations, setOwnerAffiliations] =
|
|
2152
|
-
const [orgSwitcherOpen, setOrgSwitcherOpen] =
|
|
2153
|
-
const [operationCount, setOperationCount] =
|
|
2154
|
-
const [showSponsorReminder, setShowSponsorReminder] =
|
|
2155
|
-
const [deleteMode, setDeleteMode] =
|
|
2156
|
-
const [deleteTarget, setDeleteTarget] =
|
|
2157
|
-
const [deleteCode, setDeleteCode] =
|
|
2158
|
-
const [typedCode, setTypedCode] =
|
|
2159
|
-
const [deleting, setDeleting] =
|
|
2160
|
-
const [deleteError, setDeleteError] =
|
|
2161
|
-
const [deleteConfirmStage, setDeleteConfirmStage] =
|
|
2162
|
-
const [confirmFocus, setConfirmFocus] =
|
|
2163
|
-
const [archiveMode, setArchiveMode] =
|
|
2164
|
-
const [archiveTarget, setArchiveTarget] =
|
|
2165
|
-
const [archiving, setArchiving] =
|
|
2166
|
-
const [archiveError, setArchiveError] =
|
|
2167
|
-
const [archiveFocus, setArchiveFocus] =
|
|
2168
|
-
const [syncMode, setSyncMode] =
|
|
2169
|
-
const [syncTarget, setSyncTarget] =
|
|
2170
|
-
const [syncing, setSyncing] =
|
|
2171
|
-
const [syncError, setSyncError] =
|
|
2172
|
-
const [syncFocus, setSyncFocus] =
|
|
2173
|
-
const [renameMode, setRenameMode] =
|
|
2174
|
-
const [renameTarget, setRenameTarget] =
|
|
2175
|
-
const [copyUrlMode, setCopyUrlMode] =
|
|
2176
|
-
const [copyUrlTarget, setCopyUrlTarget] =
|
|
2177
|
-
const [copyToast, setCopyToast] =
|
|
2178
|
-
const [syncTrigger, setSyncTrigger] =
|
|
2179
|
-
const [infoMode, setInfoMode] =
|
|
2180
|
-
const [infoRepo, setInfoRepo] =
|
|
2181
|
-
const [logoutMode, setLogoutMode] =
|
|
2182
|
-
const [logoutFocus, setLogoutFocus] =
|
|
2183
|
-
const [logoutError, setLogoutError] =
|
|
2184
|
-
const [archiveFilterMode, setArchiveFilterMode] =
|
|
2185
|
-
const [visibilityMode, setVisibilityMode] =
|
|
2186
|
-
const [isEnterpriseOrg, setIsEnterpriseOrg] =
|
|
2187
|
-
const [hasInternalRepos, setHasInternalRepos] =
|
|
2188
|
-
const [changeVisibilityMode, setChangeVisibilityMode] =
|
|
2189
|
-
const [changeVisibilityTarget, setChangeVisibilityTarget] =
|
|
2190
|
-
const [changingVisibility, setChangingVisibility] =
|
|
2191
|
-
const [changeVisibilityError, setChangeVisibilityError] =
|
|
2192
|
-
const [sortMode, setSortMode] =
|
|
2193
|
-
const [sortDirectionMode, setSortDirectionMode] =
|
|
2194
|
-
const [starsMode, setStarsMode] =
|
|
2195
|
-
const [starredItems, setStarredItems] =
|
|
2196
|
-
const [starredEndCursor, setStarredEndCursor] =
|
|
2197
|
-
const [starredHasNextPage, setStarredHasNextPage] =
|
|
2198
|
-
const [starredTotalCount, setStarredTotalCount] =
|
|
2199
|
-
const [starredLoading, setStarredLoading] =
|
|
2200
|
-
const [unstarMode, setUnstarMode] =
|
|
2201
|
-
const [unstarTarget, setUnstarTarget] =
|
|
2202
|
-
const [unstarring, setUnstarring] =
|
|
2203
|
-
const [unstarError, setUnstarError] =
|
|
2204
|
-
const [starMode, setStarMode] =
|
|
2205
|
-
const [starTarget, setStarTarget] =
|
|
2206
|
-
const [starring, setStarring] =
|
|
2207
|
-
const [starError, setStarError] =
|
|
2231
|
+
const [ownerContext, setOwnerContext] = useState17("personal");
|
|
2232
|
+
const [ownerAffiliations, setOwnerAffiliations] = useState17(["OWNER"]);
|
|
2233
|
+
const [orgSwitcherOpen, setOrgSwitcherOpen] = useState17(false);
|
|
2234
|
+
const [operationCount, setOperationCount] = useState17(0);
|
|
2235
|
+
const [showSponsorReminder, setShowSponsorReminder] = useState17(false);
|
|
2236
|
+
const [deleteMode, setDeleteMode] = useState17(false);
|
|
2237
|
+
const [deleteTarget, setDeleteTarget] = useState17(null);
|
|
2238
|
+
const [deleteCode, setDeleteCode] = useState17("");
|
|
2239
|
+
const [typedCode, setTypedCode] = useState17("");
|
|
2240
|
+
const [deleting, setDeleting] = useState17(false);
|
|
2241
|
+
const [deleteError, setDeleteError] = useState17(null);
|
|
2242
|
+
const [deleteConfirmStage, setDeleteConfirmStage] = useState17(false);
|
|
2243
|
+
const [confirmFocus, setConfirmFocus] = useState17("delete");
|
|
2244
|
+
const [archiveMode, setArchiveMode] = useState17(false);
|
|
2245
|
+
const [archiveTarget, setArchiveTarget] = useState17(null);
|
|
2246
|
+
const [archiving, setArchiving] = useState17(false);
|
|
2247
|
+
const [archiveError, setArchiveError] = useState17(null);
|
|
2248
|
+
const [archiveFocus, setArchiveFocus] = useState17("confirm");
|
|
2249
|
+
const [syncMode, setSyncMode] = useState17(false);
|
|
2250
|
+
const [syncTarget, setSyncTarget] = useState17(null);
|
|
2251
|
+
const [syncing, setSyncing] = useState17(false);
|
|
2252
|
+
const [syncError, setSyncError] = useState17(null);
|
|
2253
|
+
const [syncFocus, setSyncFocus] = useState17("confirm");
|
|
2254
|
+
const [renameMode, setRenameMode] = useState17(false);
|
|
2255
|
+
const [renameTarget, setRenameTarget] = useState17(null);
|
|
2256
|
+
const [copyUrlMode, setCopyUrlMode] = useState17(false);
|
|
2257
|
+
const [copyUrlTarget, setCopyUrlTarget] = useState17(null);
|
|
2258
|
+
const [copyToast, setCopyToast] = useState17(null);
|
|
2259
|
+
const [syncTrigger, setSyncTrigger] = useState17(false);
|
|
2260
|
+
const [infoMode, setInfoMode] = useState17(false);
|
|
2261
|
+
const [infoRepo, setInfoRepo] = useState17(null);
|
|
2262
|
+
const [logoutMode, setLogoutMode] = useState17(false);
|
|
2263
|
+
const [logoutFocus, setLogoutFocus] = useState17("confirm");
|
|
2264
|
+
const [logoutError, setLogoutError] = useState17(null);
|
|
2265
|
+
const [archiveFilterMode, setArchiveFilterMode] = useState17(false);
|
|
2266
|
+
const [visibilityMode, setVisibilityMode] = useState17(false);
|
|
2267
|
+
const [isEnterpriseOrg, setIsEnterpriseOrg] = useState17(false);
|
|
2268
|
+
const [hasInternalRepos, setHasInternalRepos] = useState17(false);
|
|
2269
|
+
const [changeVisibilityMode, setChangeVisibilityMode] = useState17(false);
|
|
2270
|
+
const [changeVisibilityTarget, setChangeVisibilityTarget] = useState17(null);
|
|
2271
|
+
const [changingVisibility, setChangingVisibility] = useState17(false);
|
|
2272
|
+
const [changeVisibilityError, setChangeVisibilityError] = useState17(null);
|
|
2273
|
+
const [sortMode, setSortMode] = useState17(false);
|
|
2274
|
+
const [sortDirectionMode, setSortDirectionMode] = useState17(false);
|
|
2275
|
+
const [starsMode, setStarsMode] = useState17(false);
|
|
2276
|
+
const [starredItems, setStarredItems] = useState17([]);
|
|
2277
|
+
const [starredEndCursor, setStarredEndCursor] = useState17(null);
|
|
2278
|
+
const [starredHasNextPage, setStarredHasNextPage] = useState17(false);
|
|
2279
|
+
const [starredTotalCount, setStarredTotalCount] = useState17(0);
|
|
2280
|
+
const [starredLoading, setStarredLoading] = useState17(false);
|
|
2281
|
+
const [unstarMode, setUnstarMode] = useState17(false);
|
|
2282
|
+
const [unstarTarget, setUnstarTarget] = useState17(null);
|
|
2283
|
+
const [unstarring, setUnstarring] = useState17(false);
|
|
2284
|
+
const [unstarError, setUnstarError] = useState17(null);
|
|
2285
|
+
const [starMode, setStarMode] = useState17(false);
|
|
2286
|
+
const [starTarget, setStarTarget] = useState17(null);
|
|
2287
|
+
const [starring, setStarring] = useState17(false);
|
|
2288
|
+
const [starError, setStarError] = useState17(null);
|
|
2289
|
+
const [openInBrowserMode, setOpenInBrowserMode] = useState17(false);
|
|
2290
|
+
const [openInBrowserTarget, setOpenInBrowserTarget] = useState17(null);
|
|
2291
|
+
const [enrichingForks, setEnrichingForks] = useState17(false);
|
|
2292
|
+
const enrichmentDoneRef = useRef(/* @__PURE__ */ new Set());
|
|
2208
2293
|
const appliedInitialOrg = useRef(false);
|
|
2209
2294
|
useEffect12(() => {
|
|
2210
2295
|
(async () => {
|
|
@@ -2566,14 +2651,86 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2566
2651
|
setDeleteError("Failed to delete repository. Ensure delete_repo scope and admin permissions.");
|
|
2567
2652
|
}
|
|
2568
2653
|
}
|
|
2569
|
-
const [filter, setFilter] =
|
|
2570
|
-
const [filterMode, setFilterMode] =
|
|
2571
|
-
const [sortKey, setSortKey] =
|
|
2572
|
-
const [sortDir, setSortDir] =
|
|
2573
|
-
const [forkTracking, setForkTracking] =
|
|
2574
|
-
|
|
2654
|
+
const [filter, setFilter] = useState17("");
|
|
2655
|
+
const [filterMode, setFilterMode] = useState17(false);
|
|
2656
|
+
const [sortKey, setSortKey] = useState17("updated");
|
|
2657
|
+
const [sortDir, setSortDir] = useState17("desc");
|
|
2658
|
+
const [forkTracking, setForkTracking] = useState17(true);
|
|
2659
|
+
useEffect12(() => {
|
|
2660
|
+
if (loading || loadingMore || hasNextPage || items.length === 0) return;
|
|
2661
|
+
if (!forkTracking) return;
|
|
2662
|
+
const unenriched = items.filter(
|
|
2663
|
+
(r) => r.isFork && r.parent?.nameWithOwner && !enrichmentDoneRef.current.has(r.id) && !(r.defaultBranchRef?.target?.history && r.parent?.defaultBranchRef?.target?.history)
|
|
2664
|
+
);
|
|
2665
|
+
if (unenriched.length === 0) return;
|
|
2666
|
+
let cancelled = false;
|
|
2667
|
+
setEnrichingForks(true);
|
|
2668
|
+
;
|
|
2669
|
+
(async () => {
|
|
2670
|
+
const BATCH_DELAY_MS = 200;
|
|
2671
|
+
try {
|
|
2672
|
+
const BATCH_SIZE = 5;
|
|
2673
|
+
for (let i = 0; i < unenriched.length; i += BATCH_SIZE) {
|
|
2674
|
+
if (cancelled) break;
|
|
2675
|
+
const slice = unenriched.slice(i, i + BATCH_SIZE);
|
|
2676
|
+
const batch = slice.map((r) => ({
|
|
2677
|
+
id: r.id,
|
|
2678
|
+
parentNameWithOwner: r.parent.nameWithOwner
|
|
2679
|
+
}));
|
|
2680
|
+
const enriched = await enrichForksWithAheadBehind(client, batch);
|
|
2681
|
+
if (cancelled) break;
|
|
2682
|
+
slice.forEach((r) => enrichmentDoneRef.current.add(r.id));
|
|
2683
|
+
setItems((prev) => prev.map((repo) => {
|
|
2684
|
+
const hit = enriched.find((e) => e.id === repo.id);
|
|
2685
|
+
if (!hit || hit.forkHistoryCount === null || hit.parentHistoryCount === null) return repo;
|
|
2686
|
+
return {
|
|
2687
|
+
...repo,
|
|
2688
|
+
defaultBranchRef: repo.defaultBranchRef ? {
|
|
2689
|
+
...repo.defaultBranchRef,
|
|
2690
|
+
target: {
|
|
2691
|
+
...repo.defaultBranchRef.target || {},
|
|
2692
|
+
history: { totalCount: hit.forkHistoryCount }
|
|
2693
|
+
}
|
|
2694
|
+
} : { name: void 0, target: { history: { totalCount: hit.forkHistoryCount } } },
|
|
2695
|
+
parent: repo.parent ? {
|
|
2696
|
+
...repo.parent,
|
|
2697
|
+
defaultBranchRef: {
|
|
2698
|
+
...repo.parent.defaultBranchRef || {},
|
|
2699
|
+
target: {
|
|
2700
|
+
...repo.parent.defaultBranchRef?.target || {},
|
|
2701
|
+
history: { totalCount: hit.parentHistoryCount }
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
} : repo.parent
|
|
2705
|
+
};
|
|
2706
|
+
}));
|
|
2707
|
+
if (i + BATCH_SIZE < unenriched.length) {
|
|
2708
|
+
await new Promise((resolve) => setTimeout(resolve, BATCH_DELAY_MS));
|
|
2709
|
+
}
|
|
2710
|
+
}
|
|
2711
|
+
} catch (err) {
|
|
2712
|
+
logger.error("Fork enrichment failed", { error: err.message });
|
|
2713
|
+
} finally {
|
|
2714
|
+
if (!cancelled) setEnrichingForks(false);
|
|
2715
|
+
}
|
|
2716
|
+
})();
|
|
2717
|
+
return () => {
|
|
2718
|
+
cancelled = true;
|
|
2719
|
+
setEnrichingForks(false);
|
|
2720
|
+
};
|
|
2721
|
+
}, [loading, loadingMore, hasNextPage, items.length, forkTracking]);
|
|
2722
|
+
async function jumpToUpstreamRepo(parentNameWithOwner) {
|
|
2723
|
+
const [parentOwner, parentName] = parentNameWithOwner.split("/");
|
|
2724
|
+
if (!parentOwner || !parentName) return;
|
|
2725
|
+
const repo = await fetchRepositoryByOwnerAndName(client, parentOwner, parentName);
|
|
2726
|
+
if (repo) {
|
|
2727
|
+
setInfoRepo(repo);
|
|
2728
|
+
setInfoMode(true);
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2731
|
+
const [visibilityFilter, setVisibilityFilter] = useState17("all");
|
|
2575
2732
|
const previousVisibilityFilter = useRef("all");
|
|
2576
|
-
const [archiveFilter, setArchiveFilter] =
|
|
2733
|
+
const [archiveFilter, setArchiveFilter] = useState17("all");
|
|
2577
2734
|
const sortFieldMap = {
|
|
2578
2735
|
"updated": "UPDATED_AT",
|
|
2579
2736
|
"pushed": "PUSHED_AT",
|
|
@@ -2617,6 +2774,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2617
2774
|
orgLogin,
|
|
2618
2775
|
privacy
|
|
2619
2776
|
);
|
|
2777
|
+
if (reset || !after) {
|
|
2778
|
+
enrichmentDoneRef.current.clear();
|
|
2779
|
+
}
|
|
2620
2780
|
setItems((prev) => reset || !after ? page.nodes : [...prev, ...page.nodes]);
|
|
2621
2781
|
setEndCursor(page.endCursor);
|
|
2622
2782
|
setHasNextPage(page.hasNextPage);
|
|
@@ -2739,7 +2899,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2739
2899
|
}
|
|
2740
2900
|
previousVisibilityFilter.current = visibilityFilter;
|
|
2741
2901
|
}, [visibilityFilter]);
|
|
2742
|
-
|
|
2902
|
+
useInput17((input, key) => {
|
|
2743
2903
|
if (error) {
|
|
2744
2904
|
if (input && input.toUpperCase() === "Q") {
|
|
2745
2905
|
try {
|
|
@@ -2901,6 +3061,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2901
3061
|
if (renameMode) {
|
|
2902
3062
|
return;
|
|
2903
3063
|
}
|
|
3064
|
+
if (openInBrowserMode) {
|
|
3065
|
+
return;
|
|
3066
|
+
}
|
|
2904
3067
|
if (copyUrlMode) {
|
|
2905
3068
|
return;
|
|
2906
3069
|
}
|
|
@@ -2957,7 +3120,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2957
3120
|
if (key.pageUp) setCursor((c) => Math.max(c - 10, 0));
|
|
2958
3121
|
if (key.return) {
|
|
2959
3122
|
const repo = visibleItems[cursor];
|
|
2960
|
-
if (repo)
|
|
3123
|
+
if (repo) {
|
|
3124
|
+
if (repo.isFork && repo.parent) {
|
|
3125
|
+
setOpenInBrowserTarget(repo);
|
|
3126
|
+
setOpenInBrowserMode(true);
|
|
3127
|
+
} else {
|
|
3128
|
+
openInBrowser(`https://github.com/${repo.nameWithOwner}`);
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
2961
3131
|
}
|
|
2962
3132
|
if (key.delete || key.backspace) {
|
|
2963
3133
|
const repo = visibleItems[cursor];
|
|
@@ -3128,7 +3298,33 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3128
3298
|
}
|
|
3129
3299
|
if (input && input.toUpperCase() === "O") {
|
|
3130
3300
|
const repo = visibleItems[cursor];
|
|
3131
|
-
if (repo)
|
|
3301
|
+
if (repo) {
|
|
3302
|
+
if (repo.isFork && repo.parent) {
|
|
3303
|
+
setOpenInBrowserTarget(repo);
|
|
3304
|
+
setOpenInBrowserMode(true);
|
|
3305
|
+
} else {
|
|
3306
|
+
openInBrowser(`https://github.com/${repo.nameWithOwner}`);
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3309
|
+
return;
|
|
3310
|
+
}
|
|
3311
|
+
if (input && input.toUpperCase() === "P") {
|
|
3312
|
+
const repo = visibleItems[cursor];
|
|
3313
|
+
if (repo && repo.isFork && repo.parent?.nameWithOwner) {
|
|
3314
|
+
const parentName = repo.parent.nameWithOwner;
|
|
3315
|
+
const parentIdx = visibleItems.findIndex((r) => r.nameWithOwner === parentName);
|
|
3316
|
+
if (parentIdx >= 0) {
|
|
3317
|
+
setCursor(parentIdx);
|
|
3318
|
+
} else {
|
|
3319
|
+
const cachedParent = items.find((r) => r.nameWithOwner === parentName) || starredItems.find((r) => r.nameWithOwner === parentName);
|
|
3320
|
+
if (cachedParent) {
|
|
3321
|
+
setInfoRepo(cachedParent);
|
|
3322
|
+
setInfoMode(true);
|
|
3323
|
+
} else {
|
|
3324
|
+
jumpToUpstreamRepo(parentName);
|
|
3325
|
+
}
|
|
3326
|
+
}
|
|
3327
|
+
}
|
|
3132
3328
|
return;
|
|
3133
3329
|
}
|
|
3134
3330
|
if (key.shift && input === "T") {
|
|
@@ -3252,78 +3448,79 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3252
3448
|
exec(cmd);
|
|
3253
3449
|
}
|
|
3254
3450
|
const lowRate = rateLimit && rateLimit.remaining <= Math.ceil(rateLimit.limit * 0.1) || restRateLimit && restRateLimit.core.remaining <= Math.ceil(restRateLimit.core.limit * 0.1);
|
|
3255
|
-
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || archiveFilterMode || sortMode || sortDirectionMode || changeVisibilityMode || copyUrlMode || renameMode;
|
|
3256
|
-
const headerBar = useMemo2(() => /* @__PURE__ */
|
|
3257
|
-
/* @__PURE__ */
|
|
3258
|
-
/* @__PURE__ */
|
|
3451
|
+
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || archiveFilterMode || sortMode || sortDirectionMode || changeVisibilityMode || copyUrlMode || renameMode || openInBrowserMode;
|
|
3452
|
+
const headerBar = useMemo2(() => /* @__PURE__ */ jsxs20(Box20, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: [
|
|
3453
|
+
/* @__PURE__ */ jsxs20(Box20, { flexDirection: "row", gap: 1, children: [
|
|
3454
|
+
/* @__PURE__ */ jsxs20(Text21, { color: theme.primary, bold: !modalOpen, dimColor: modalOpen, children: [
|
|
3259
3455
|
" ",
|
|
3260
3456
|
ownerContext === "personal" ? "Personal" : ownerContext.name || ownerContext.login,
|
|
3261
3457
|
ownerContext !== "personal" && isEnterpriseOrg && " (ENT)"
|
|
3262
3458
|
] }),
|
|
3263
|
-
/* @__PURE__ */
|
|
3264
|
-
/* @__PURE__ */
|
|
3459
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, color: modalOpen ? theme.muted : void 0, dimColor: modalOpen ? true : void 0, children: "Repositories" }),
|
|
3460
|
+
/* @__PURE__ */ jsxs20(Text21, { color: theme.muted, children: [
|
|
3265
3461
|
"(",
|
|
3266
3462
|
visibleItems.length,
|
|
3267
3463
|
"/",
|
|
3268
3464
|
totalCount,
|
|
3269
3465
|
")"
|
|
3270
3466
|
] }),
|
|
3271
|
-
loadingMore && hasNextPage && !starsMode && totalCount > 0 && /* @__PURE__ */
|
|
3272
|
-
|
|
3467
|
+
loadingMore && hasNextPage && !starsMode && totalCount > 0 && /* @__PURE__ */ jsx21(Text21, { color: theme.primary, children: ` \xB7 loading ${items.length}/${totalCount}` }),
|
|
3468
|
+
enrichingForks && /* @__PURE__ */ jsx21(Text21, { color: theme.muted, children: ` \xB7 enriching forks\u2026` }),
|
|
3469
|
+
(loading || loadingMore) && /* @__PURE__ */ jsx21(Box20, { width: 2, flexShrink: 0, flexGrow: 0, marginLeft: 1, children: /* @__PURE__ */ jsx21(Text21, { color: theme.warning, children: /* @__PURE__ */ jsx21(SlowSpinner, {}) }) })
|
|
3273
3470
|
] }),
|
|
3274
|
-
(rateLimit || restRateLimit) && /* @__PURE__ */
|
|
3471
|
+
(rateLimit || restRateLimit) && /* @__PURE__ */ jsxs20(Text21, { color: lowRate ? theme.warning : theme.muted, children: [
|
|
3275
3472
|
"GraphQL: ",
|
|
3276
3473
|
rateLimit ? `${rateLimit.remaining}/${rateLimit.limit}` : "---/---",
|
|
3277
|
-
prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */
|
|
3474
|
+
prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */ jsx21(Text21, { color: rateLimit.remaining < prevRateLimit ? theme.error : theme.success, children: ` (${rateLimit.remaining - prevRateLimit > 0 ? "+" : ""}${rateLimit.remaining - prevRateLimit})` }),
|
|
3278
3475
|
" | ",
|
|
3279
3476
|
"REST: ",
|
|
3280
3477
|
restRateLimit ? `${restRateLimit.core.remaining}/${restRateLimit.core.limit}` : "---/---",
|
|
3281
|
-
prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */
|
|
3478
|
+
prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */ jsx21(Text21, { color: restRateLimit.core.remaining < prevRestRateLimit ? theme.error : theme.success, children: ` (${restRateLimit.core.remaining - prevRestRateLimit > 0 ? "+" : ""}${restRateLimit.core.remaining - prevRestRateLimit})` }),
|
|
3282
3479
|
" "
|
|
3283
3480
|
] })
|
|
3284
|
-
] }), [visibleItems.length, totalCount, loading, loadingMore, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg, restRateLimit, prevRestRateLimit, starsMode, hasNextPage, items.length, theme]);
|
|
3481
|
+
] }), [visibleItems.length, totalCount, loading, loadingMore, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg, restRateLimit, prevRestRateLimit, enrichingForks, starsMode, hasNextPage, items.length, theme]);
|
|
3285
3482
|
if (error) {
|
|
3286
|
-
return /* @__PURE__ */
|
|
3287
|
-
/* @__PURE__ */
|
|
3288
|
-
/* @__PURE__ */
|
|
3289
|
-
/* @__PURE__ */
|
|
3483
|
+
return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", height: availableHeight, children: [
|
|
3484
|
+
/* @__PURE__ */ jsx21(Box20, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "row", gap: 1, children: [
|
|
3485
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, children: " Repositories" }),
|
|
3486
|
+
/* @__PURE__ */ jsx21(Text21, { color: "red", children: "(Error)" })
|
|
3290
3487
|
] }) }),
|
|
3291
|
-
/* @__PURE__ */
|
|
3292
|
-
/* @__PURE__ */
|
|
3293
|
-
/* @__PURE__ */
|
|
3488
|
+
/* @__PURE__ */ jsx21(Box20, { borderStyle: "single", borderColor: "red", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx21(Box20, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", alignItems: "center", children: [
|
|
3489
|
+
/* @__PURE__ */ jsx21(Text21, { color: "red", children: error }),
|
|
3490
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "gray", dimColor: true, children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
3294
3491
|
] }) }) }),
|
|
3295
|
-
/* @__PURE__ */
|
|
3492
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "gray", children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
3296
3493
|
] });
|
|
3297
3494
|
}
|
|
3298
3495
|
if (loading && items.length === 0 || sortingLoading) {
|
|
3299
|
-
return /* @__PURE__ */
|
|
3300
|
-
/* @__PURE__ */
|
|
3301
|
-
/* @__PURE__ */
|
|
3302
|
-
/* @__PURE__ */
|
|
3496
|
+
return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", height: availableHeight, children: [
|
|
3497
|
+
/* @__PURE__ */ jsx21(Box20, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "row", gap: 1, children: [
|
|
3498
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, children: " Repositories" }),
|
|
3499
|
+
/* @__PURE__ */ jsx21(Text21, { color: "gray", children: "(Loading...)" })
|
|
3303
3500
|
] }) }),
|
|
3304
|
-
/* @__PURE__ */
|
|
3305
|
-
/* @__PURE__ */
|
|
3306
|
-
/* @__PURE__ */
|
|
3307
|
-
/* @__PURE__ */
|
|
3501
|
+
/* @__PURE__ */ jsx21(Box20, { borderStyle: "single", borderColor: "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx21(Box20, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx21(Box20, { flexDirection: "column", alignItems: "center", children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", alignItems: "center", children: [
|
|
3502
|
+
/* @__PURE__ */ jsxs20(Box20, { height: 1, flexDirection: "row", children: [
|
|
3503
|
+
/* @__PURE__ */ jsx21(Box20, { width: 2, flexShrink: 0, flexGrow: 0, children: /* @__PURE__ */ jsx21(Text21, { color: "cyan", children: /* @__PURE__ */ jsx21(SlowSpinner, {}) }) }),
|
|
3504
|
+
/* @__PURE__ */ jsx21(Text21, { color: "cyan", children: refreshing ? "Refreshing..." : sortingLoading ? "Applying sort..." : "Loading repositories..." })
|
|
3308
3505
|
] }),
|
|
3309
|
-
/* @__PURE__ */
|
|
3506
|
+
/* @__PURE__ */ jsx21(Box20, { height: 1, marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "gray", children: refreshing ? "Fetching latest repository data" : sortingLoading ? `Sorting by ${sortKey} (${sortDir === "asc" ? "ascending" : "descending"})` : "Fetching your GitHub repositories" }) })
|
|
3310
3507
|
] }) }) }) }),
|
|
3311
|
-
/* @__PURE__ */
|
|
3508
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "gray", children: "Please wait..." }) })
|
|
3312
3509
|
] });
|
|
3313
3510
|
}
|
|
3314
|
-
return /* @__PURE__ */
|
|
3511
|
+
return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", height: availableHeight, children: [
|
|
3315
3512
|
headerBar,
|
|
3316
|
-
showSponsorReminder && /* @__PURE__ */
|
|
3317
|
-
/* @__PURE__ */
|
|
3318
|
-
/* @__PURE__ */
|
|
3319
|
-
/* @__PURE__ */
|
|
3513
|
+
showSponsorReminder && /* @__PURE__ */ jsx21(Box20, { marginX: 1, marginBottom: 1, children: /* @__PURE__ */ jsx21(Box20, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", alignItems: "center", children: [
|
|
3514
|
+
/* @__PURE__ */ jsx21(Text21, { color: "yellow", children: "\u{1F49A} Thanks for using gh-manager-cli!" }),
|
|
3515
|
+
/* @__PURE__ */ jsx21(Text21, { color: "gray", children: "Your support helps craft more open-source tools" }),
|
|
3516
|
+
/* @__PURE__ */ jsx21(Text21, { color: "cyan", children: "\u{1F496} github.com/sponsors/wiiiimm" })
|
|
3320
3517
|
] }) }) }),
|
|
3321
|
-
/* @__PURE__ */
|
|
3518
|
+
/* @__PURE__ */ jsx21(Box20, { borderStyle: "single", borderColor: modalOpen ? theme.muted : theme.warning, paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: deleteMode && deleteTarget ? (
|
|
3322
3519
|
// Centered modal; hide list content while modal is open
|
|
3323
|
-
/* @__PURE__ */
|
|
3324
|
-
/* @__PURE__ */
|
|
3325
|
-
/* @__PURE__ */
|
|
3326
|
-
/* @__PURE__ */
|
|
3520
|
+
/* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
3521
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, children: "Delete Confirmation" }),
|
|
3522
|
+
/* @__PURE__ */ jsx21(Text21, { color: "red", children: "\u26A0\uFE0F Delete repository?" }),
|
|
3523
|
+
/* @__PURE__ */ jsx21(Box20, { height: 2, children: /* @__PURE__ */ jsx21(Text21, { children: " " }) }),
|
|
3327
3524
|
(() => {
|
|
3328
3525
|
const langName = deleteTarget.primaryLanguage?.name || "";
|
|
3329
3526
|
const langColor = deleteTarget.primaryLanguage?.color || "#666666";
|
|
@@ -3335,19 +3532,19 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3335
3532
|
let line2 = "";
|
|
3336
3533
|
if (langName) line2 += chalk15.hex(langColor)("\u25CF ") + tc.muted(`${langName} `);
|
|
3337
3534
|
line2 += tc.muted(`\u2605 ${deleteTarget.stargazerCount} \u2442 ${deleteTarget.forkCount} Updated ${formatDate(deleteTarget.updatedAt)}`);
|
|
3338
|
-
return /* @__PURE__ */
|
|
3339
|
-
/* @__PURE__ */
|
|
3340
|
-
/* @__PURE__ */
|
|
3535
|
+
return /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
3536
|
+
/* @__PURE__ */ jsx21(Text21, { children: line1 }),
|
|
3537
|
+
/* @__PURE__ */ jsx21(Text21, { children: line2 })
|
|
3341
3538
|
] });
|
|
3342
3539
|
})(),
|
|
3343
|
-
/* @__PURE__ */
|
|
3540
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsxs20(Text21, { children: [
|
|
3344
3541
|
"Type ",
|
|
3345
|
-
/* @__PURE__ */
|
|
3542
|
+
/* @__PURE__ */ jsx21(Text21, { color: "yellow", bold: true, children: deleteCode }),
|
|
3346
3543
|
" to confirm."
|
|
3347
3544
|
] }) }),
|
|
3348
|
-
!deleteConfirmStage && /* @__PURE__ */
|
|
3349
|
-
/* @__PURE__ */
|
|
3350
|
-
/* @__PURE__ */
|
|
3545
|
+
!deleteConfirmStage && /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, children: [
|
|
3546
|
+
/* @__PURE__ */ jsx21(Text21, { children: "Confirm code: " }),
|
|
3547
|
+
/* @__PURE__ */ jsx21(
|
|
3351
3548
|
TextInput5,
|
|
3352
3549
|
{
|
|
3353
3550
|
value: typedCode,
|
|
@@ -3374,11 +3571,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3374
3571
|
}
|
|
3375
3572
|
)
|
|
3376
3573
|
] }),
|
|
3377
|
-
deleteConfirmStage && /* @__PURE__ */
|
|
3378
|
-
/* @__PURE__ */
|
|
3379
|
-
/* @__PURE__ */
|
|
3380
|
-
/* @__PURE__ */
|
|
3381
|
-
|
|
3574
|
+
deleteConfirmStage && /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "column", children: [
|
|
3575
|
+
/* @__PURE__ */ jsx21(Text21, { color: "red", children: "This action will permanently delete the repository. This cannot be undone." }),
|
|
3576
|
+
/* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3577
|
+
/* @__PURE__ */ jsx21(
|
|
3578
|
+
Box20,
|
|
3382
3579
|
{
|
|
3383
3580
|
borderStyle: "round",
|
|
3384
3581
|
borderColor: "red",
|
|
@@ -3387,11 +3584,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3387
3584
|
alignItems: "center",
|
|
3388
3585
|
justifyContent: "center",
|
|
3389
3586
|
flexDirection: "column",
|
|
3390
|
-
children: /* @__PURE__ */
|
|
3587
|
+
children: /* @__PURE__ */ jsx21(Text21, { children: confirmFocus === "delete" ? chalk15.bgRed.white.bold(" Delete ") : tc.error.bold("Delete") })
|
|
3391
3588
|
}
|
|
3392
3589
|
),
|
|
3393
|
-
/* @__PURE__ */
|
|
3394
|
-
|
|
3590
|
+
/* @__PURE__ */ jsx21(
|
|
3591
|
+
Box20,
|
|
3395
3592
|
{
|
|
3396
3593
|
borderStyle: "round",
|
|
3397
3594
|
borderColor: confirmFocus === "cancel" ? "white" : "gray",
|
|
@@ -3400,16 +3597,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3400
3597
|
alignItems: "center",
|
|
3401
3598
|
justifyContent: "center",
|
|
3402
3599
|
flexDirection: "column",
|
|
3403
|
-
children: /* @__PURE__ */
|
|
3600
|
+
children: /* @__PURE__ */ jsx21(Text21, { children: confirmFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
|
|
3404
3601
|
}
|
|
3405
3602
|
)
|
|
3406
3603
|
] }),
|
|
3407
|
-
/* @__PURE__ */
|
|
3604
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Text21, { color: "gray", children: [
|
|
3408
3605
|
"Press Enter to ",
|
|
3409
3606
|
confirmFocus === "delete" ? "Delete" : "Cancel",
|
|
3410
3607
|
" | Y to Delete | C to Cancel"
|
|
3411
3608
|
] }) }),
|
|
3412
|
-
/* @__PURE__ */
|
|
3609
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(
|
|
3413
3610
|
TextInput5,
|
|
3414
3611
|
{
|
|
3415
3612
|
value: "",
|
|
@@ -3423,18 +3620,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3423
3620
|
}
|
|
3424
3621
|
) })
|
|
3425
3622
|
] }),
|
|
3426
|
-
deleteError && /* @__PURE__ */
|
|
3427
|
-
deleting && /* @__PURE__ */
|
|
3623
|
+
deleteError && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "magenta", children: deleteError }) }),
|
|
3624
|
+
deleting && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "yellow", children: "Deleting..." }) })
|
|
3428
3625
|
] }) })
|
|
3429
|
-
) : archiveMode && archiveTarget ? /* @__PURE__ */
|
|
3430
|
-
/* @__PURE__ */
|
|
3431
|
-
/* @__PURE__ */
|
|
3432
|
-
/* @__PURE__ */
|
|
3433
|
-
/* @__PURE__ */
|
|
3434
|
-
/* @__PURE__ */
|
|
3435
|
-
/* @__PURE__ */
|
|
3436
|
-
/* @__PURE__ */
|
|
3437
|
-
|
|
3626
|
+
) : archiveMode && archiveTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "round", borderColor: archiveTarget.isArchived ? "green" : "yellow", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
3627
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, children: archiveTarget.isArchived ? "Unarchive Confirmation" : "Archive Confirmation" }),
|
|
3628
|
+
/* @__PURE__ */ jsx21(Text21, { color: archiveTarget.isArchived ? "green" : "yellow", children: archiveTarget.isArchived ? "\u21BA Unarchive repository?" : "\u26A0\uFE0F Archive repository?" }),
|
|
3629
|
+
/* @__PURE__ */ jsx21(Box20, { height: 1, children: /* @__PURE__ */ jsx21(Text21, { children: " " }) }),
|
|
3630
|
+
/* @__PURE__ */ jsx21(Text21, { children: archiveTarget.nameWithOwner }),
|
|
3631
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { children: archiveTarget.isArchived ? "This will make the repository active again." : "This will make the repository read-only." }) }),
|
|
3632
|
+
/* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3633
|
+
/* @__PURE__ */ jsx21(
|
|
3634
|
+
Box20,
|
|
3438
3635
|
{
|
|
3439
3636
|
borderStyle: "round",
|
|
3440
3637
|
borderColor: archiveTarget.isArchived ? "green" : "yellow",
|
|
@@ -3443,11 +3640,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3443
3640
|
alignItems: "center",
|
|
3444
3641
|
justifyContent: "center",
|
|
3445
3642
|
flexDirection: "column",
|
|
3446
|
-
children: /* @__PURE__ */
|
|
3643
|
+
children: /* @__PURE__ */ jsx21(Text21, { children: archiveFocus === "confirm" ? chalk15.bgGreen.white.bold(` ${archiveTarget.isArchived ? "Unarchive" : "Archive"} `) : (archiveTarget.isArchived ? tc.success : tc.warning).bold(archiveTarget.isArchived ? "Unarchive" : "Archive") })
|
|
3447
3644
|
}
|
|
3448
3645
|
),
|
|
3449
|
-
/* @__PURE__ */
|
|
3450
|
-
|
|
3646
|
+
/* @__PURE__ */ jsx21(
|
|
3647
|
+
Box20,
|
|
3451
3648
|
{
|
|
3452
3649
|
borderStyle: "round",
|
|
3453
3650
|
borderColor: archiveFocus === "cancel" ? "white" : "gray",
|
|
@@ -3456,18 +3653,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3456
3653
|
alignItems: "center",
|
|
3457
3654
|
justifyContent: "center",
|
|
3458
3655
|
flexDirection: "column",
|
|
3459
|
-
children: /* @__PURE__ */
|
|
3656
|
+
children: /* @__PURE__ */ jsx21(Text21, { children: archiveFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
|
|
3460
3657
|
}
|
|
3461
3658
|
)
|
|
3462
3659
|
] }),
|
|
3463
|
-
/* @__PURE__ */
|
|
3660
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Text21, { color: theme.muted, children: [
|
|
3464
3661
|
"Press Enter to ",
|
|
3465
3662
|
archiveFocus === "confirm" ? archiveTarget.isArchived ? "Unarchive" : "Archive" : "Cancel",
|
|
3466
3663
|
" | Y to ",
|
|
3467
3664
|
archiveTarget.isArchived ? "Unarchive" : "Archive",
|
|
3468
3665
|
" | C to Cancel"
|
|
3469
3666
|
] }) }),
|
|
3470
|
-
/* @__PURE__ */
|
|
3667
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(
|
|
3471
3668
|
TextInput5,
|
|
3472
3669
|
{
|
|
3473
3670
|
value: "",
|
|
@@ -3482,21 +3679,34 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3482
3679
|
}
|
|
3483
3680
|
}
|
|
3484
3681
|
) }),
|
|
3485
|
-
archiveError && /* @__PURE__ */
|
|
3486
|
-
archiving && /* @__PURE__ */
|
|
3487
|
-
] }) }) : syncMode && syncTarget ? /* @__PURE__ */
|
|
3488
|
-
/* @__PURE__ */
|
|
3489
|
-
/* @__PURE__ */
|
|
3490
|
-
/* @__PURE__ */
|
|
3491
|
-
/* @__PURE__ */
|
|
3492
|
-
syncTarget.parent && /* @__PURE__ */
|
|
3682
|
+
archiveError && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "magenta", children: archiveError }) }),
|
|
3683
|
+
archiving && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "yellow", children: archiveTarget.isArchived ? "Unarchiving..." : "Archiving..." }) })
|
|
3684
|
+
] }) }) : syncMode && syncTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
3685
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, children: "Sync Fork Confirmation" }),
|
|
3686
|
+
/* @__PURE__ */ jsx21(Text21, { color: "blue", children: "\u27F2 Sync fork with upstream?" }),
|
|
3687
|
+
/* @__PURE__ */ jsx21(Box20, { height: 1, children: /* @__PURE__ */ jsx21(Text21, { children: " " }) }),
|
|
3688
|
+
/* @__PURE__ */ jsx21(Text21, { children: syncTarget.nameWithOwner }),
|
|
3689
|
+
syncTarget.parent && /* @__PURE__ */ jsxs20(Text21, { color: "gray", children: [
|
|
3493
3690
|
"Upstream: ",
|
|
3494
3691
|
syncTarget.parent.nameWithOwner
|
|
3495
3692
|
] }),
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3693
|
+
(() => {
|
|
3694
|
+
const hasData = syncTarget.isFork && syncTarget.parent && syncTarget.defaultBranchRef?.target?.history && syncTarget.parent.defaultBranchRef?.target?.history;
|
|
3695
|
+
if (!hasData) return null;
|
|
3696
|
+
const forkC = syncTarget.defaultBranchRef.target.history.totalCount;
|
|
3697
|
+
const parentC = syncTarget.parent.defaultBranchRef.target.history.totalCount;
|
|
3698
|
+
const behind = Math.max(0, parentC - forkC);
|
|
3699
|
+
const ahead = Math.max(0, forkC - parentC);
|
|
3700
|
+
const parts = [];
|
|
3701
|
+
if (ahead > 0) parts.push(chalk15.green(`${ahead} ahead`));
|
|
3702
|
+
if (behind > 0) parts.push(chalk15.yellow(`${behind} behind`));
|
|
3703
|
+
const statusText = parts.length === 0 ? chalk15.green("Your fork is up to date with upstream.") : `This fork is ${parts.join(", ")} of upstream.`;
|
|
3704
|
+
return /* @__PURE__ */ jsx21(Text21, { children: statusText });
|
|
3705
|
+
})(),
|
|
3706
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { children: "This will merge upstream changes into your fork." }) }),
|
|
3707
|
+
/* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3708
|
+
/* @__PURE__ */ jsx21(
|
|
3709
|
+
Box20,
|
|
3500
3710
|
{
|
|
3501
3711
|
borderStyle: "round",
|
|
3502
3712
|
borderColor: "blue",
|
|
@@ -3505,11 +3715,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3505
3715
|
alignItems: "center",
|
|
3506
3716
|
justifyContent: "center",
|
|
3507
3717
|
flexDirection: "column",
|
|
3508
|
-
children: /* @__PURE__ */
|
|
3718
|
+
children: /* @__PURE__ */ jsx21(Text21, { children: syncFocus === "confirm" ? tc.btnPrimary(" Sync ") : tc.primary.bold("Sync") })
|
|
3509
3719
|
}
|
|
3510
3720
|
),
|
|
3511
|
-
/* @__PURE__ */
|
|
3512
|
-
|
|
3721
|
+
/* @__PURE__ */ jsx21(
|
|
3722
|
+
Box20,
|
|
3513
3723
|
{
|
|
3514
3724
|
borderStyle: "round",
|
|
3515
3725
|
borderColor: syncFocus === "cancel" ? "white" : "gray",
|
|
@@ -3518,16 +3728,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3518
3728
|
alignItems: "center",
|
|
3519
3729
|
justifyContent: "center",
|
|
3520
3730
|
flexDirection: "column",
|
|
3521
|
-
children: /* @__PURE__ */
|
|
3731
|
+
children: /* @__PURE__ */ jsx21(Text21, { children: syncFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
|
|
3522
3732
|
}
|
|
3523
3733
|
)
|
|
3524
3734
|
] }),
|
|
3525
|
-
/* @__PURE__ */
|
|
3735
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Text21, { color: theme.muted, children: [
|
|
3526
3736
|
"Press Enter to ",
|
|
3527
3737
|
syncFocus === "confirm" ? "Sync" : "Cancel",
|
|
3528
3738
|
" | Y to Sync | C to Cancel"
|
|
3529
3739
|
] }) }),
|
|
3530
|
-
/* @__PURE__ */
|
|
3740
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(
|
|
3531
3741
|
TextInput5,
|
|
3532
3742
|
{
|
|
3533
3743
|
value: "",
|
|
@@ -3542,14 +3752,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3542
3752
|
}
|
|
3543
3753
|
}
|
|
3544
3754
|
) }),
|
|
3545
|
-
syncError && /* @__PURE__ */
|
|
3546
|
-
syncing && /* @__PURE__ */
|
|
3547
|
-
] }) }) : logoutMode ? /* @__PURE__ */
|
|
3548
|
-
/* @__PURE__ */
|
|
3549
|
-
/* @__PURE__ */
|
|
3550
|
-
/* @__PURE__ */
|
|
3551
|
-
/* @__PURE__ */
|
|
3552
|
-
|
|
3755
|
+
syncError && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: theme.error, children: syncError }) }),
|
|
3756
|
+
syncing && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: theme.warning, children: "Syncing..." }) })
|
|
3757
|
+
] }) }) : logoutMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "round", borderColor: theme.primary, paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
3758
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, children: "Logout Confirmation" }),
|
|
3759
|
+
/* @__PURE__ */ jsx21(Text21, { color: theme.primary, children: "Are you sure you want to log out?" }),
|
|
3760
|
+
/* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3761
|
+
/* @__PURE__ */ jsx21(
|
|
3762
|
+
Box20,
|
|
3553
3763
|
{
|
|
3554
3764
|
borderStyle: "round",
|
|
3555
3765
|
borderColor: theme.primary,
|
|
@@ -3558,11 +3768,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3558
3768
|
alignItems: "center",
|
|
3559
3769
|
justifyContent: "center",
|
|
3560
3770
|
flexDirection: "column",
|
|
3561
|
-
children: /* @__PURE__ */
|
|
3771
|
+
children: /* @__PURE__ */ jsx21(Text21, { children: logoutFocus === "confirm" ? tc.btnPrimary(" Logout ") : tc.primary.bold("Logout") })
|
|
3562
3772
|
}
|
|
3563
3773
|
),
|
|
3564
|
-
/* @__PURE__ */
|
|
3565
|
-
|
|
3774
|
+
/* @__PURE__ */ jsx21(
|
|
3775
|
+
Box20,
|
|
3566
3776
|
{
|
|
3567
3777
|
borderStyle: "round",
|
|
3568
3778
|
borderColor: logoutFocus === "cancel" ? "white" : theme.muted,
|
|
@@ -3571,16 +3781,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3571
3781
|
alignItems: "center",
|
|
3572
3782
|
justifyContent: "center",
|
|
3573
3783
|
flexDirection: "column",
|
|
3574
|
-
children: /* @__PURE__ */
|
|
3784
|
+
children: /* @__PURE__ */ jsx21(Text21, { children: logoutFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
|
|
3575
3785
|
}
|
|
3576
3786
|
)
|
|
3577
3787
|
] }),
|
|
3578
|
-
/* @__PURE__ */
|
|
3788
|
+
/* @__PURE__ */ jsx21(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Text21, { color: theme.muted, children: [
|
|
3579
3789
|
"Press Enter to ",
|
|
3580
3790
|
logoutFocus === "confirm" ? "Logout" : "Cancel",
|
|
3581
3791
|
" | Y to Logout | C to Cancel"
|
|
3582
3792
|
] }) })
|
|
3583
|
-
] }) }) : orgSwitcherOpen ? /* @__PURE__ */
|
|
3793
|
+
] }) }) : orgSwitcherOpen ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
|
|
3584
3794
|
OrgSwitcher,
|
|
3585
3795
|
{
|
|
3586
3796
|
token,
|
|
@@ -3588,45 +3798,45 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3588
3798
|
onSelect: handleOrgContextChange,
|
|
3589
3799
|
onClose: () => setOrgSwitcherOpen(false)
|
|
3590
3800
|
}
|
|
3591
|
-
) }) : infoMode ? /* @__PURE__ */
|
|
3801
|
+
) }) : infoMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: (() => {
|
|
3592
3802
|
const repo = infoRepo || visibleItems[cursor];
|
|
3593
|
-
if (!repo) return /* @__PURE__ */
|
|
3803
|
+
if (!repo) return /* @__PURE__ */ jsx21(Text21, { color: theme.error, children: "No repository selected." });
|
|
3594
3804
|
const langName = repo.primaryLanguage?.name || "N/A";
|
|
3595
3805
|
const langColor = repo.primaryLanguage?.color || "#666666";
|
|
3596
|
-
return /* @__PURE__ */
|
|
3597
|
-
/* @__PURE__ */
|
|
3806
|
+
return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "round", borderColor: theme.internal, paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 90), children: [
|
|
3807
|
+
/* @__PURE__ */ jsxs20(Text21, { bold: true, children: [
|
|
3598
3808
|
"Repository Info ",
|
|
3599
3809
|
infoRepo ? tc.muted("(cached)") : ""
|
|
3600
3810
|
] }),
|
|
3601
|
-
/* @__PURE__ */
|
|
3602
|
-
/* @__PURE__ */
|
|
3603
|
-
repo.description && /* @__PURE__ */
|
|
3604
|
-
/* @__PURE__ */
|
|
3605
|
-
/* @__PURE__ */
|
|
3811
|
+
/* @__PURE__ */ jsx21(Box20, { height: 1, children: /* @__PURE__ */ jsx21(Text21, { children: " " }) }),
|
|
3812
|
+
/* @__PURE__ */ jsx21(Text21, { children: tc.text.bold(repo.nameWithOwner) }),
|
|
3813
|
+
repo.description && /* @__PURE__ */ jsx21(Text21, { color: theme.muted, children: repo.description }),
|
|
3814
|
+
/* @__PURE__ */ jsx21(Box20, { height: 1, children: /* @__PURE__ */ jsx21(Text21, { children: " " }) }),
|
|
3815
|
+
/* @__PURE__ */ jsxs20(Text21, { children: [
|
|
3606
3816
|
repo.visibility === "PRIVATE" ? tc.private("Private") : repo.visibility === "INTERNAL" ? tc.internal("Internal") : tc.success("Public"),
|
|
3607
3817
|
repo.isArchived ? tc.archived(" Archived") : "",
|
|
3608
3818
|
repo.isFork ? tc.fork(" Fork") : ""
|
|
3609
3819
|
] }),
|
|
3610
|
-
/* @__PURE__ */
|
|
3611
|
-
/* @__PURE__ */
|
|
3820
|
+
/* @__PURE__ */ jsx21(Text21, { children: tc.muted(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount}`) }),
|
|
3821
|
+
/* @__PURE__ */ jsxs20(Text21, { children: [
|
|
3612
3822
|
chalk15.hex(langColor)(`\u25CF `),
|
|
3613
3823
|
tc.muted(`${langName}`)
|
|
3614
3824
|
] }),
|
|
3615
|
-
/* @__PURE__ */
|
|
3825
|
+
/* @__PURE__ */ jsxs20(Text21, { color: theme.muted, children: [
|
|
3616
3826
|
"Updated: ",
|
|
3617
3827
|
formatDate(repo.updatedAt),
|
|
3618
3828
|
" \u2022 Pushed: ",
|
|
3619
3829
|
formatDate(repo.pushedAt)
|
|
3620
3830
|
] }),
|
|
3621
|
-
/* @__PURE__ */
|
|
3831
|
+
/* @__PURE__ */ jsxs20(Text21, { color: theme.muted, children: [
|
|
3622
3832
|
"Size: ",
|
|
3623
3833
|
repo.diskUsage,
|
|
3624
3834
|
" KB"
|
|
3625
3835
|
] }),
|
|
3626
|
-
/* @__PURE__ */
|
|
3627
|
-
/* @__PURE__ */
|
|
3836
|
+
/* @__PURE__ */ jsx21(Box20, { height: 1, children: /* @__PURE__ */ jsx21(Text21, { children: " " }) }),
|
|
3837
|
+
/* @__PURE__ */ jsx21(Text21, { color: theme.muted, children: "Press Esc or I to close" })
|
|
3628
3838
|
] });
|
|
3629
|
-
})() }) : archiveFilterMode ? /* @__PURE__ */
|
|
3839
|
+
})() }) : archiveFilterMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
|
|
3630
3840
|
ArchiveFilterModal,
|
|
3631
3841
|
{
|
|
3632
3842
|
currentFilter: archiveFilter,
|
|
@@ -3639,7 +3849,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3639
3849
|
onCancel: () => setArchiveFilterMode(false),
|
|
3640
3850
|
theme
|
|
3641
3851
|
}
|
|
3642
|
-
) }) : visibilityMode ? /* @__PURE__ */
|
|
3852
|
+
) }) : visibilityMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
|
|
3643
3853
|
VisibilityModal,
|
|
3644
3854
|
{
|
|
3645
3855
|
currentFilter: visibilityFilter,
|
|
@@ -3653,7 +3863,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3653
3863
|
onCancel: () => setVisibilityMode(false),
|
|
3654
3864
|
theme
|
|
3655
3865
|
}
|
|
3656
|
-
) }) : sortMode ? /* @__PURE__ */
|
|
3866
|
+
) }) : sortMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
|
|
3657
3867
|
SortModal,
|
|
3658
3868
|
{
|
|
3659
3869
|
currentSort: sortKey,
|
|
@@ -3666,7 +3876,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3666
3876
|
onCancel: () => setSortMode(false),
|
|
3667
3877
|
theme
|
|
3668
3878
|
}
|
|
3669
|
-
) }) : sortDirectionMode ? /* @__PURE__ */
|
|
3879
|
+
) }) : sortDirectionMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
|
|
3670
3880
|
SortDirectionModal,
|
|
3671
3881
|
{
|
|
3672
3882
|
currentDirection: sortDir,
|
|
@@ -3680,7 +3890,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3680
3890
|
onCancel: () => setSortDirectionMode(false),
|
|
3681
3891
|
theme
|
|
3682
3892
|
}
|
|
3683
|
-
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */
|
|
3893
|
+
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
|
|
3684
3894
|
ChangeVisibilityModal,
|
|
3685
3895
|
{
|
|
3686
3896
|
isOpen: changeVisibilityMode,
|
|
@@ -3694,7 +3904,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3694
3904
|
error: changeVisibilityError,
|
|
3695
3905
|
theme
|
|
3696
3906
|
}
|
|
3697
|
-
) }) : renameMode && renameTarget ? /* @__PURE__ */
|
|
3907
|
+
) }) : renameMode && renameTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
|
|
3698
3908
|
RenameModal,
|
|
3699
3909
|
{
|
|
3700
3910
|
repo: renameTarget,
|
|
@@ -3702,7 +3912,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3702
3912
|
onCancel: closeRenameModal,
|
|
3703
3913
|
theme
|
|
3704
3914
|
}
|
|
3705
|
-
) }) : copyUrlMode ? /* @__PURE__ */
|
|
3915
|
+
) }) : copyUrlMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
|
|
3706
3916
|
CopyUrlModal,
|
|
3707
3917
|
{
|
|
3708
3918
|
repo: copyUrlTarget,
|
|
@@ -3711,7 +3921,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3711
3921
|
onCopy: handleCopyUrl,
|
|
3712
3922
|
theme
|
|
3713
3923
|
}
|
|
3714
|
-
) }) : unstarMode && unstarTarget ? /* @__PURE__ */
|
|
3924
|
+
) }) : unstarMode && unstarTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
|
|
3715
3925
|
UnstarModal,
|
|
3716
3926
|
{
|
|
3717
3927
|
visible: unstarMode,
|
|
@@ -3722,7 +3932,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3722
3932
|
error: unstarError,
|
|
3723
3933
|
theme
|
|
3724
3934
|
}
|
|
3725
|
-
) }) : starMode && starTarget ? /* @__PURE__ */
|
|
3935
|
+
) }) : starMode && starTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
|
|
3726
3936
|
StarModal,
|
|
3727
3937
|
{
|
|
3728
3938
|
visible: starMode,
|
|
@@ -3734,8 +3944,23 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3734
3944
|
error: starError,
|
|
3735
3945
|
theme
|
|
3736
3946
|
}
|
|
3737
|
-
) }) : /* @__PURE__ */
|
|
3738
|
-
|
|
3947
|
+
) }) : openInBrowserMode && openInBrowserTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
|
|
3948
|
+
OpenInBrowserModal,
|
|
3949
|
+
{
|
|
3950
|
+
repo: openInBrowserTarget,
|
|
3951
|
+
onOpen: (url) => {
|
|
3952
|
+
openInBrowser(url);
|
|
3953
|
+
setOpenInBrowserMode(false);
|
|
3954
|
+
setOpenInBrowserTarget(null);
|
|
3955
|
+
},
|
|
3956
|
+
onCancel: () => {
|
|
3957
|
+
setOpenInBrowserMode(false);
|
|
3958
|
+
setOpenInBrowserTarget(null);
|
|
3959
|
+
},
|
|
3960
|
+
theme
|
|
3961
|
+
}
|
|
3962
|
+
) }) : /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
3963
|
+
/* @__PURE__ */ jsx21(
|
|
3739
3964
|
RepoListHeader,
|
|
3740
3965
|
{
|
|
3741
3966
|
ownerContext,
|
|
@@ -3751,9 +3976,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3751
3976
|
theme
|
|
3752
3977
|
}
|
|
3753
3978
|
),
|
|
3754
|
-
filterMode && /* @__PURE__ */
|
|
3755
|
-
/* @__PURE__ */
|
|
3756
|
-
/* @__PURE__ */
|
|
3979
|
+
filterMode && /* @__PURE__ */ jsxs20(Box20, { marginBottom: 1, children: [
|
|
3980
|
+
/* @__PURE__ */ jsx21(Text21, { children: "Search: " }),
|
|
3981
|
+
/* @__PURE__ */ jsx21(
|
|
3757
3982
|
TextInput5,
|
|
3758
3983
|
{
|
|
3759
3984
|
value: filter,
|
|
@@ -3767,10 +3992,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3767
3992
|
}
|
|
3768
3993
|
)
|
|
3769
3994
|
] }),
|
|
3770
|
-
/* @__PURE__ */
|
|
3995
|
+
/* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", height: listHeight, children: [
|
|
3771
3996
|
visibleItems.slice(windowed.start, windowed.end).map((repo, i) => {
|
|
3772
3997
|
const idx = windowed.start + i;
|
|
3773
|
-
return /* @__PURE__ */
|
|
3998
|
+
return /* @__PURE__ */ jsx21(
|
|
3774
3999
|
RepoRow,
|
|
3775
4000
|
{
|
|
3776
4001
|
repo,
|
|
@@ -3785,55 +4010,55 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3785
4010
|
repo.nameWithOwner
|
|
3786
4011
|
);
|
|
3787
4012
|
}),
|
|
3788
|
-
loadingMore && hasNextPage && !starsMode && /* @__PURE__ */
|
|
3789
|
-
/* @__PURE__ */
|
|
3790
|
-
/* @__PURE__ */
|
|
4013
|
+
loadingMore && hasNextPage && !starsMode && /* @__PURE__ */ jsx21(Box20, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "row", children: [
|
|
4014
|
+
/* @__PURE__ */ jsx21(Box20, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "cyan", children: /* @__PURE__ */ jsx21(SlowSpinner, {}) }) }),
|
|
4015
|
+
/* @__PURE__ */ jsxs20(Text21, { color: "cyan", children: [
|
|
3791
4016
|
"Loading repositories\u2026 ",
|
|
3792
4017
|
totalCount > 0 ? `(${items.length}/${totalCount})` : `(${items.length})`
|
|
3793
4018
|
] })
|
|
3794
4019
|
] }) }),
|
|
3795
|
-
loadingMore && hasNextPage && starsMode && /* @__PURE__ */
|
|
3796
|
-
/* @__PURE__ */
|
|
3797
|
-
/* @__PURE__ */
|
|
4020
|
+
loadingMore && hasNextPage && starsMode && /* @__PURE__ */ jsx21(Box20, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "row", children: [
|
|
4021
|
+
/* @__PURE__ */ jsx21(Box20, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "cyan", children: /* @__PURE__ */ jsx21(SlowSpinner, {}) }) }),
|
|
4022
|
+
/* @__PURE__ */ jsx21(Text21, { color: "cyan", children: "Loading more repositories..." })
|
|
3798
4023
|
] }) }),
|
|
3799
|
-
filterActive && hasNextPage && !starsMode && /* @__PURE__ */
|
|
4024
|
+
filterActive && hasNextPage && !starsMode && /* @__PURE__ */ jsx21(Box20, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs20(Text21, { color: "yellow", dimColor: true, children: [
|
|
3800
4025
|
"Still loading repos (",
|
|
3801
4026
|
items.length,
|
|
3802
4027
|
"/",
|
|
3803
4028
|
totalCount > 0 ? totalCount : "?",
|
|
3804
4029
|
") \u2014 fuzzy results may be incomplete"
|
|
3805
4030
|
] }) }),
|
|
3806
|
-
!loading && visibleItems.length === 0 && !(filterActive && hasNextPage && !starsMode) && /* @__PURE__ */
|
|
4031
|
+
!loading && visibleItems.length === 0 && !(filterActive && hasNextPage && !starsMode) && /* @__PURE__ */ jsx21(Box20, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "gray", dimColor: true, children: filter ? "No repositories match your search" : "No repositories found" }) })
|
|
3807
4032
|
] })
|
|
3808
4033
|
] }) }),
|
|
3809
|
-
/* @__PURE__ */
|
|
3810
|
-
/* @__PURE__ */
|
|
3811
|
-
/* @__PURE__ */
|
|
4034
|
+
/* @__PURE__ */ jsxs20(Box20, { marginTop: 1, paddingX: 1, flexDirection: "column", children: [
|
|
4035
|
+
/* @__PURE__ */ jsx21(Box20, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx21(Text21, { 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" }) }),
|
|
4036
|
+
/* @__PURE__ */ jsx21(Box20, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsxs20(Text21, { color: theme.muted, dimColor: modalOpen ? true : void 0, children: [
|
|
3812
4037
|
"/ Search",
|
|
3813
4038
|
!filterActive && " \u2022 S Sort \u2022 D Direction",
|
|
3814
4039
|
" \u2022 T Density \u2022 Shift+T Theme \u2022 A Archive Filter",
|
|
3815
4040
|
!starsMode && " \u2022 V Visibility Filter"
|
|
3816
4041
|
] }) }),
|
|
3817
|
-
/* @__PURE__ */
|
|
3818
|
-
/* @__PURE__ */
|
|
3819
|
-
/* @__PURE__ */
|
|
4042
|
+
/* @__PURE__ */ jsx21(Box20, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx21(Text21, { 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 Ctrl+A Un/Archive \u2022 Ctrl+V Change Visibility \u2022 Ctrl+F Sync Fork \u2022 P Jump to upstream` }) }),
|
|
4043
|
+
/* @__PURE__ */ jsx21(Box20, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx21(Text21, { color: theme.muted, dimColor: modalOpen ? true : void 0, children: "K Cache Info \u2022 W Org Switch \u2022 Del/Backspace Delete \u2022 Ctrl+L Logout \u2022 Q Quit" }) }),
|
|
4044
|
+
/* @__PURE__ */ jsx21(Box20, { width: terminalWidth, justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: theme.warning, dimColor: modalOpen ? true : void 0, children: "\u{1F496} Sponsor on GitHub: github.com/sponsors/wiiiimm" }) })
|
|
3820
4045
|
] }),
|
|
3821
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
3822
|
-
/* @__PURE__ */
|
|
3823
|
-
debugMessages.length === 0 ? /* @__PURE__ */
|
|
4046
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, borderStyle: "single", borderColor: "yellow", paddingX: 1, flexDirection: "column", children: [
|
|
4047
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, color: "yellow", children: "Debug Messages:" }),
|
|
4048
|
+
debugMessages.length === 0 ? /* @__PURE__ */ jsx21(Text21, { color: "gray", children: "No debug messages yet..." }) : debugMessages.map((msg, i) => /* @__PURE__ */ jsx21(Text21, { color: "gray", children: msg }, i))
|
|
3824
4049
|
] }),
|
|
3825
|
-
themeToast && /* @__PURE__ */
|
|
3826
|
-
copyToast && /* @__PURE__ */
|
|
4050
|
+
themeToast && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx21(Box20, { borderStyle: "round", borderColor: theme.primary, paddingX: 2, paddingY: 0, children: /* @__PURE__ */ jsx21(Text21, { color: theme.primary, children: themeToast }) }) }),
|
|
4051
|
+
copyToast && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx21(Box20, { borderStyle: "round", borderColor: copyToast.includes("Failed") ? "red" : "green", paddingX: 2, paddingY: 0, children: /* @__PURE__ */ jsx21(Text21, { color: copyToast.includes("Failed") ? "red" : "green", children: copyToast }) }) })
|
|
3827
4052
|
] });
|
|
3828
4053
|
}
|
|
3829
4054
|
|
|
3830
4055
|
// src/ui/components/auth/AuthMethodSelector.tsx
|
|
3831
|
-
import { useState as
|
|
3832
|
-
import { Box as
|
|
4056
|
+
import { useState as useState18 } from "react";
|
|
4057
|
+
import { Box as Box21, Text as Text22, useInput as useInput18 } from "ink";
|
|
3833
4058
|
import chalk16 from "chalk";
|
|
3834
|
-
import { jsx as
|
|
4059
|
+
import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3835
4060
|
function AuthMethodSelector({ onSelect, onQuit }) {
|
|
3836
|
-
const [selectedIndex, setSelectedIndex] =
|
|
4061
|
+
const [selectedIndex, setSelectedIndex] = useState18(0);
|
|
3837
4062
|
const methods = [
|
|
3838
4063
|
{
|
|
3839
4064
|
key: "oauth",
|
|
@@ -3846,7 +4071,7 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3846
4071
|
description: "Manually enter a GitHub Personal Access Token"
|
|
3847
4072
|
}
|
|
3848
4073
|
];
|
|
3849
|
-
|
|
4074
|
+
useInput18((input, key) => {
|
|
3850
4075
|
if (key.escape || input?.toLowerCase() === "q") {
|
|
3851
4076
|
if (onQuit) {
|
|
3852
4077
|
onQuit();
|
|
@@ -3865,33 +4090,33 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3865
4090
|
onSelect("pat");
|
|
3866
4091
|
}
|
|
3867
4092
|
});
|
|
3868
|
-
return /* @__PURE__ */
|
|
3869
|
-
/* @__PURE__ */
|
|
3870
|
-
/* @__PURE__ */
|
|
4093
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, children: [
|
|
4094
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, marginBottom: 1, children: "Choose Authentication Method" }),
|
|
4095
|
+
/* @__PURE__ */ jsx22(Box21, { flexDirection: "column", marginY: 1, children: methods.map((method, index) => {
|
|
3871
4096
|
const isSelected = index === selectedIndex;
|
|
3872
4097
|
const prefix = isSelected ? chalk16.cyan("\u203A") : " ";
|
|
3873
4098
|
const numberPrefix = `${index + 1}.`;
|
|
3874
|
-
return /* @__PURE__ */
|
|
3875
|
-
/* @__PURE__ */
|
|
4099
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", marginBottom: 1, children: [
|
|
4100
|
+
/* @__PURE__ */ jsx22(Text22, { children: /* @__PURE__ */ jsxs21(Text22, { color: isSelected ? "cyan" : void 0, bold: isSelected, children: [
|
|
3876
4101
|
prefix,
|
|
3877
4102
|
" ",
|
|
3878
4103
|
numberPrefix,
|
|
3879
4104
|
" ",
|
|
3880
4105
|
method.label
|
|
3881
4106
|
] }) }),
|
|
3882
|
-
/* @__PURE__ */
|
|
4107
|
+
/* @__PURE__ */ jsxs21(Text22, { color: "gray", dimColor: true, children: [
|
|
3883
4108
|
" ",
|
|
3884
4109
|
method.description
|
|
3885
4110
|
] })
|
|
3886
4111
|
] }, method.key);
|
|
3887
4112
|
}) }),
|
|
3888
|
-
/* @__PURE__ */
|
|
4113
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", dimColor: true, marginTop: 1, children: "Use arrow keys to navigate, Enter to select, or press 1/2 \u2022 Q/Esc to quit" })
|
|
3889
4114
|
] });
|
|
3890
4115
|
}
|
|
3891
4116
|
|
|
3892
4117
|
// src/ui/components/auth/OAuthProgress.tsx
|
|
3893
|
-
import { Box as
|
|
3894
|
-
import { jsx as
|
|
4118
|
+
import { Box as Box22, Text as Text23 } from "ink";
|
|
4119
|
+
import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3895
4120
|
function OAuthProgress({ status, error, deviceCode }) {
|
|
3896
4121
|
const statusMessages = {
|
|
3897
4122
|
initializing: {
|
|
@@ -3928,64 +4153,64 @@ function OAuthProgress({ status, error, deviceCode }) {
|
|
|
3928
4153
|
}
|
|
3929
4154
|
};
|
|
3930
4155
|
const { message, showSpinner } = statusMessages[status];
|
|
3931
|
-
return /* @__PURE__ */
|
|
3932
|
-
/* @__PURE__ */
|
|
3933
|
-
/* @__PURE__ */
|
|
3934
|
-
/* @__PURE__ */
|
|
3935
|
-
/* @__PURE__ */
|
|
4156
|
+
return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", borderStyle: "single", borderColor: status === "error" ? "red" : "cyan", paddingX: 2, paddingY: 1, children: [
|
|
4157
|
+
/* @__PURE__ */ jsx23(Text23, { bold: true, marginBottom: 1, children: "GitHub OAuth Authentication" }),
|
|
4158
|
+
/* @__PURE__ */ jsx23(Box22, { marginY: 1, children: showSpinner ? /* @__PURE__ */ jsxs22(Box22, { children: [
|
|
4159
|
+
/* @__PURE__ */ jsx23(Text23, { color: "green", children: /* @__PURE__ */ jsx23(SlowSpinner, { interval: 2e3 }) }),
|
|
4160
|
+
/* @__PURE__ */ jsxs22(Text23, { children: [
|
|
3936
4161
|
" ",
|
|
3937
4162
|
message
|
|
3938
4163
|
] })
|
|
3939
|
-
] }) : /* @__PURE__ */
|
|
4164
|
+
] }) : /* @__PURE__ */ jsxs22(Text23, { color: status === "error" ? "red" : "green", children: [
|
|
3940
4165
|
status === "error" ? "\u2717" : "\u2713",
|
|
3941
4166
|
" ",
|
|
3942
4167
|
message
|
|
3943
4168
|
] }) }),
|
|
3944
|
-
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */
|
|
3945
|
-
/* @__PURE__ */
|
|
3946
|
-
/* @__PURE__ */
|
|
3947
|
-
/* @__PURE__ */
|
|
3948
|
-
/* @__PURE__ */
|
|
4169
|
+
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */ jsxs22(Box22, { marginY: 1, flexDirection: "column", children: [
|
|
4170
|
+
/* @__PURE__ */ jsx23(Text23, { bold: true, color: "cyan", marginBottom: 1, children: "\u{1F4CB} Please complete these steps:" }),
|
|
4171
|
+
/* @__PURE__ */ jsxs22(Box22, { marginBottom: 1, children: [
|
|
4172
|
+
/* @__PURE__ */ jsx23(Text23, { children: "1. Visit: " }),
|
|
4173
|
+
/* @__PURE__ */ jsx23(Text23, { bold: true, color: "blue", children: deviceCode.verification_uri })
|
|
3949
4174
|
] }),
|
|
3950
|
-
/* @__PURE__ */
|
|
3951
|
-
/* @__PURE__ */
|
|
3952
|
-
/* @__PURE__ */
|
|
4175
|
+
/* @__PURE__ */ jsxs22(Box22, { marginBottom: 1, flexDirection: "column", children: [
|
|
4176
|
+
/* @__PURE__ */ jsx23(Text23, { children: "2. Enter this code:" }),
|
|
4177
|
+
/* @__PURE__ */ jsx23(Box22, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, marginTop: 1, children: /* @__PURE__ */ jsx23(Text23, { bold: true, color: "yellow", children: deviceCode.user_code }) })
|
|
3953
4178
|
] }),
|
|
3954
|
-
status === "waiting_for_authorization" && /* @__PURE__ */
|
|
3955
|
-
status === "polling_for_token" && /* @__PURE__ */
|
|
3956
|
-
/* @__PURE__ */
|
|
3957
|
-
/* @__PURE__ */
|
|
4179
|
+
status === "waiting_for_authorization" && /* @__PURE__ */ jsx23(Text23, { color: "gray", marginTop: 1, children: "Your browser should open automatically." }),
|
|
4180
|
+
status === "polling_for_token" && /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", marginTop: 1, children: [
|
|
4181
|
+
/* @__PURE__ */ jsx23(Text23, { color: "gray", children: "Waiting for you to complete authorization in your browser..." }),
|
|
4182
|
+
/* @__PURE__ */ jsx23(Text23, { color: "gray", dimColor: true, marginTop: 1, children: "This will timeout in 15 minutes. Press Esc to cancel." })
|
|
3958
4183
|
] })
|
|
3959
4184
|
] }),
|
|
3960
|
-
status === "error" && error && /* @__PURE__ */
|
|
3961
|
-
/* @__PURE__ */
|
|
3962
|
-
/* @__PURE__ */
|
|
4185
|
+
status === "error" && error && /* @__PURE__ */ jsxs22(Box22, { marginY: 1, flexDirection: "column", children: [
|
|
4186
|
+
/* @__PURE__ */ jsx23(Text23, { color: "red", children: error }),
|
|
4187
|
+
/* @__PURE__ */ jsx23(Text23, { color: "gray", marginTop: 1, children: "Press Esc to go back and try again." })
|
|
3963
4188
|
] }),
|
|
3964
|
-
status === "success" && /* @__PURE__ */
|
|
4189
|
+
status === "success" && /* @__PURE__ */ jsx23(Text23, { color: "gray", marginTop: 1, children: "Returning to application..." })
|
|
3965
4190
|
] });
|
|
3966
4191
|
}
|
|
3967
4192
|
|
|
3968
4193
|
// src/ui/App.tsx
|
|
3969
|
-
import { jsx as
|
|
4194
|
+
import { jsx as jsx24, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3970
4195
|
var packageJson = require_package();
|
|
3971
4196
|
function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlineTokenEphemeral }) {
|
|
3972
4197
|
const { exit } = useApp2();
|
|
3973
4198
|
const { stdout } = useStdout2();
|
|
3974
|
-
const [mode, setMode] =
|
|
3975
|
-
const [token, setToken] =
|
|
3976
|
-
const [input, setInput] =
|
|
3977
|
-
const [error, setError] =
|
|
3978
|
-
const [viewer, setViewer] =
|
|
3979
|
-
const [rateLimitReset, setRateLimitReset] =
|
|
3980
|
-
const [wasRateLimited, setWasRateLimited] =
|
|
3981
|
-
const [orgContext, setOrgContext] =
|
|
3982
|
-
const [authMethod, setAuthMethod] =
|
|
3983
|
-
const [oauthStatus, setOAuthStatus] =
|
|
3984
|
-
const [tokenSource, setTokenSource] =
|
|
3985
|
-
const [sessionTokenOrigin, setSessionTokenOrigin] =
|
|
3986
|
-
const [deviceCodeResponse, setDeviceCodeResponse] =
|
|
3987
|
-
const [oauthDeviceCode, setOauthDeviceCode] =
|
|
3988
|
-
const [dims, setDims] =
|
|
4199
|
+
const [mode, setMode] = useState19("checking");
|
|
4200
|
+
const [token, setToken] = useState19(null);
|
|
4201
|
+
const [input, setInput] = useState19("");
|
|
4202
|
+
const [error, setError] = useState19(null);
|
|
4203
|
+
const [viewer, setViewer] = useState19(null);
|
|
4204
|
+
const [rateLimitReset, setRateLimitReset] = useState19(null);
|
|
4205
|
+
const [wasRateLimited, setWasRateLimited] = useState19(false);
|
|
4206
|
+
const [orgContext, setOrgContext] = useState19("personal");
|
|
4207
|
+
const [authMethod, setAuthMethod] = useState19("pat");
|
|
4208
|
+
const [oauthStatus, setOAuthStatus] = useState19("initializing");
|
|
4209
|
+
const [tokenSource, setTokenSource] = useState19("pat");
|
|
4210
|
+
const [sessionTokenOrigin, setSessionTokenOrigin] = useState19("stored");
|
|
4211
|
+
const [deviceCodeResponse, setDeviceCodeResponse] = useState19(null);
|
|
4212
|
+
const [oauthDeviceCode, setOauthDeviceCode] = useState19(null);
|
|
4213
|
+
const [dims, setDims] = useState19(() => {
|
|
3989
4214
|
const cols = stdout?.columns ?? 100;
|
|
3990
4215
|
const rows = stdout?.rows ?? 30;
|
|
3991
4216
|
return { cols, rows };
|
|
@@ -4190,7 +4415,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4190
4415
|
setTokenSource("pat");
|
|
4191
4416
|
setMode("auth_method_selection");
|
|
4192
4417
|
};
|
|
4193
|
-
|
|
4418
|
+
useInput19((input2, key) => {
|
|
4194
4419
|
if ((mode === "prompt" || mode === "auth_method_selection") && key.escape) {
|
|
4195
4420
|
exit();
|
|
4196
4421
|
}
|
|
@@ -4222,19 +4447,19 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4222
4447
|
}
|
|
4223
4448
|
});
|
|
4224
4449
|
const verticalPadding = Math.floor(dims.rows * 0.05);
|
|
4225
|
-
const header = useMemo3(() => /* @__PURE__ */
|
|
4226
|
-
/* @__PURE__ */
|
|
4227
|
-
/* @__PURE__ */
|
|
4450
|
+
const header = useMemo3(() => /* @__PURE__ */ jsxs23(Box23, { flexDirection: "row", justifyContent: "space-between", marginBottom: 1, children: [
|
|
4451
|
+
/* @__PURE__ */ jsxs23(Box23, { flexDirection: "row", gap: 1, children: [
|
|
4452
|
+
/* @__PURE__ */ jsxs23(Text24, { bold: true, color: "cyan", children: [
|
|
4228
4453
|
" ",
|
|
4229
4454
|
"GitHub Repository Manager"
|
|
4230
4455
|
] }),
|
|
4231
|
-
/* @__PURE__ */
|
|
4456
|
+
/* @__PURE__ */ jsxs23(Text24, { color: "gray", dimColor: true, children: [
|
|
4232
4457
|
"v",
|
|
4233
4458
|
packageJson.version
|
|
4234
4459
|
] }),
|
|
4235
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
4460
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsx24(Text24, { backgroundColor: "blue", color: "white", children: " debug mode " })
|
|
4236
4461
|
] }),
|
|
4237
|
-
viewer && /* @__PURE__ */
|
|
4462
|
+
viewer && /* @__PURE__ */ jsx24(Text24, { color: "gray", children: orgContext !== "personal" && orgContext.login ? `${orgContext.login}/@${viewer} ` : `@${viewer} ` })
|
|
4238
4463
|
] }), [viewer, orgContext]);
|
|
4239
4464
|
if (mode === "rate_limited") {
|
|
4240
4465
|
const formatResetTime = (resetTime) => {
|
|
@@ -4257,70 +4482,70 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4257
4482
|
return "Unknown";
|
|
4258
4483
|
}
|
|
4259
4484
|
};
|
|
4260
|
-
return /* @__PURE__ */
|
|
4485
|
+
return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4261
4486
|
header,
|
|
4262
|
-
/* @__PURE__ */
|
|
4263
|
-
/* @__PURE__ */
|
|
4264
|
-
/* @__PURE__ */
|
|
4265
|
-
/* @__PURE__ */
|
|
4266
|
-
rateLimitReset && /* @__PURE__ */
|
|
4267
|
-
/* @__PURE__ */
|
|
4268
|
-
/* @__PURE__ */
|
|
4487
|
+
/* @__PURE__ */ jsx24(Box23, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs23(Box23, { borderStyle: "single", borderColor: "yellow", paddingX: 3, paddingY: 2, flexDirection: "column", width: Math.min(dims.cols - 8, 80), children: [
|
|
4488
|
+
/* @__PURE__ */ jsx24(Text24, { bold: true, color: "yellow", marginBottom: 1, children: "\u26A0\uFE0F Rate Limit Exceeded" }),
|
|
4489
|
+
/* @__PURE__ */ jsx24(Text24, { color: "gray", marginBottom: 1, children: "You've hit GitHub's API rate limit for your token." }),
|
|
4490
|
+
/* @__PURE__ */ jsx24(Text24, { color: "gray", marginBottom: 1, children: "This happens when you make too many requests in a short time." }),
|
|
4491
|
+
rateLimitReset && /* @__PURE__ */ jsxs23(Box23, { marginTop: 1, marginBottom: 1, children: [
|
|
4492
|
+
/* @__PURE__ */ jsxs23(Text24, { children: [
|
|
4493
|
+
/* @__PURE__ */ jsx24(Text24, { color: "cyan", children: "Reset in:" }),
|
|
4269
4494
|
" ",
|
|
4270
|
-
/* @__PURE__ */
|
|
4495
|
+
/* @__PURE__ */ jsx24(Text24, { bold: true, children: formatResetTime(rateLimitReset) })
|
|
4271
4496
|
] }),
|
|
4272
|
-
/* @__PURE__ */
|
|
4497
|
+
/* @__PURE__ */ jsxs23(Text24, { color: "gray", dimColor: true, children: [
|
|
4273
4498
|
"(",
|
|
4274
4499
|
new Date(rateLimitReset).toLocaleTimeString(),
|
|
4275
4500
|
")"
|
|
4276
4501
|
] })
|
|
4277
4502
|
] }),
|
|
4278
|
-
/* @__PURE__ */
|
|
4279
|
-
/* @__PURE__ */
|
|
4280
|
-
/* @__PURE__ */
|
|
4281
|
-
/* @__PURE__ */
|
|
4282
|
-
/* @__PURE__ */
|
|
4503
|
+
/* @__PURE__ */ jsxs23(Box23, { marginTop: 2, flexDirection: "column", gap: 1, children: [
|
|
4504
|
+
/* @__PURE__ */ jsx24(Text24, { bold: true, children: "What would you like to do?" }),
|
|
4505
|
+
/* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", paddingLeft: 2, children: [
|
|
4506
|
+
/* @__PURE__ */ jsxs23(Text24, { children: [
|
|
4507
|
+
/* @__PURE__ */ jsx24(Text24, { color: "cyan", bold: true, children: "R" }),
|
|
4283
4508
|
" - Retry now ",
|
|
4284
4509
|
rateLimitReset && formatResetTime(rateLimitReset) !== "Now (should be reset)" ? "(likely to fail until reset)" : "(should work now)"
|
|
4285
4510
|
] }),
|
|
4286
|
-
/* @__PURE__ */
|
|
4287
|
-
/* @__PURE__ */
|
|
4511
|
+
/* @__PURE__ */ jsxs23(Text24, { children: [
|
|
4512
|
+
/* @__PURE__ */ jsx24(Text24, { color: "cyan", bold: true, children: "L" }),
|
|
4288
4513
|
" - Logout and choose authentication method"
|
|
4289
4514
|
] }),
|
|
4290
|
-
/* @__PURE__ */
|
|
4291
|
-
/* @__PURE__ */
|
|
4515
|
+
/* @__PURE__ */ jsxs23(Text24, { children: [
|
|
4516
|
+
/* @__PURE__ */ jsx24(Text24, { color: "gray", bold: true, children: "Q/Esc" }),
|
|
4292
4517
|
" - Quit application"
|
|
4293
4518
|
] })
|
|
4294
4519
|
] })
|
|
4295
4520
|
] }),
|
|
4296
|
-
/* @__PURE__ */
|
|
4521
|
+
/* @__PURE__ */ jsx24(Text24, { color: "gray", dimColor: true, marginTop: 2, children: "Tip: Using multiple tokens or waiting between requests can help avoid rate limits." })
|
|
4297
4522
|
] }) })
|
|
4298
4523
|
] });
|
|
4299
4524
|
}
|
|
4300
4525
|
if (mode === "auth_method_selection") {
|
|
4301
|
-
return /* @__PURE__ */
|
|
4526
|
+
return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4302
4527
|
header,
|
|
4303
|
-
/* @__PURE__ */
|
|
4304
|
-
/* @__PURE__ */
|
|
4305
|
-
error && /* @__PURE__ */
|
|
4528
|
+
/* @__PURE__ */ jsx24(Box23, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", alignItems: "center", children: [
|
|
4529
|
+
/* @__PURE__ */ jsx24(AuthMethodSelector, { onSelect: handleAuthMethodSelect }),
|
|
4530
|
+
error && /* @__PURE__ */ jsx24(Text24, { color: "red", marginTop: 1, children: error })
|
|
4306
4531
|
] }) })
|
|
4307
4532
|
] });
|
|
4308
4533
|
}
|
|
4309
4534
|
if (mode === "oauth_flow") {
|
|
4310
|
-
return /* @__PURE__ */
|
|
4535
|
+
return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4311
4536
|
header,
|
|
4312
|
-
/* @__PURE__ */
|
|
4537
|
+
/* @__PURE__ */ jsx24(Box23, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx24(OAuthProgress, { status: oauthStatus, error: error || void 0, deviceCode: oauthDeviceCode || void 0 }) })
|
|
4313
4538
|
] });
|
|
4314
4539
|
}
|
|
4315
4540
|
if (mode === "prompt") {
|
|
4316
|
-
return /* @__PURE__ */
|
|
4541
|
+
return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4317
4542
|
header,
|
|
4318
|
-
/* @__PURE__ */
|
|
4319
|
-
/* @__PURE__ */
|
|
4320
|
-
/* @__PURE__ */
|
|
4321
|
-
/* @__PURE__ */
|
|
4322
|
-
/* @__PURE__ */
|
|
4323
|
-
/* @__PURE__ */
|
|
4543
|
+
/* @__PURE__ */ jsx24(Box23, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs23(Box23, { borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, flexDirection: "column", children: [
|
|
4544
|
+
/* @__PURE__ */ jsx24(Text24, { bold: true, marginBottom: 1, children: "Authentication Required" }),
|
|
4545
|
+
/* @__PURE__ */ jsx24(Text24, { color: "gray", marginBottom: 1, children: "Enter your GitHub Personal Access Token" }),
|
|
4546
|
+
/* @__PURE__ */ jsxs23(Box23, { children: [
|
|
4547
|
+
/* @__PURE__ */ jsx24(Text24, { children: "Token: " }),
|
|
4548
|
+
/* @__PURE__ */ jsx24(
|
|
4324
4549
|
TextInput6,
|
|
4325
4550
|
{
|
|
4326
4551
|
value: input,
|
|
@@ -4330,30 +4555,30 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4330
4555
|
}
|
|
4331
4556
|
)
|
|
4332
4557
|
] }),
|
|
4333
|
-
error && /* @__PURE__ */
|
|
4334
|
-
/* @__PURE__ */
|
|
4335
|
-
/* @__PURE__ */
|
|
4558
|
+
error && /* @__PURE__ */ jsx24(Text24, { color: "red", marginTop: 1, children: error }),
|
|
4559
|
+
/* @__PURE__ */ jsx24(Text24, { color: "gray", dimColor: true, marginTop: 1, children: "The token will be stored securely in your local config" }),
|
|
4560
|
+
/* @__PURE__ */ jsx24(Text24, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to go back" })
|
|
4336
4561
|
] }) })
|
|
4337
4562
|
] });
|
|
4338
4563
|
}
|
|
4339
4564
|
if (mode === "validating" || mode === "checking") {
|
|
4340
|
-
return /* @__PURE__ */
|
|
4565
|
+
return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4341
4566
|
header,
|
|
4342
|
-
/* @__PURE__ */
|
|
4343
|
-
/* @__PURE__ */
|
|
4344
|
-
mode === "validating" && /* @__PURE__ */
|
|
4567
|
+
/* @__PURE__ */ jsx24(Box23, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", alignItems: "center", children: [
|
|
4568
|
+
/* @__PURE__ */ jsx24(Text24, { color: "yellow", children: "Validating token..." }),
|
|
4569
|
+
mode === "validating" && /* @__PURE__ */ jsx24(Text24, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to cancel" })
|
|
4345
4570
|
] }) })
|
|
4346
4571
|
] });
|
|
4347
4572
|
}
|
|
4348
4573
|
if (mode === "error") {
|
|
4349
|
-
return /* @__PURE__ */
|
|
4574
|
+
return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4350
4575
|
header,
|
|
4351
|
-
/* @__PURE__ */
|
|
4576
|
+
/* @__PURE__ */ jsx24(Box23, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx24(Text24, { color: "red", children: error ?? "Unexpected error" }) })
|
|
4352
4577
|
] });
|
|
4353
4578
|
}
|
|
4354
|
-
return /* @__PURE__ */
|
|
4579
|
+
return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4355
4580
|
header,
|
|
4356
|
-
/* @__PURE__ */
|
|
4581
|
+
/* @__PURE__ */ jsx24(
|
|
4357
4582
|
RepoList,
|
|
4358
4583
|
{
|
|
4359
4584
|
token,
|
|
@@ -4368,7 +4593,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4368
4593
|
}
|
|
4369
4594
|
|
|
4370
4595
|
// src/index.tsx
|
|
4371
|
-
import { jsx as
|
|
4596
|
+
import { jsx as jsx25, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4372
4597
|
var argv = process.argv.slice(2);
|
|
4373
4598
|
var getFlagValue = (name) => {
|
|
4374
4599
|
const idx = argv.findIndex((a) => a === `--${name}` || a.startsWith(`--${name}=`));
|
|
@@ -4481,8 +4706,8 @@ var inlineToken = (() => {
|
|
|
4481
4706
|
})();
|
|
4482
4707
|
logger.debug("Rendering UI");
|
|
4483
4708
|
var { unmount } = render(
|
|
4484
|
-
/* @__PURE__ */
|
|
4485
|
-
/* @__PURE__ */
|
|
4486
|
-
/* @__PURE__ */
|
|
4709
|
+
/* @__PURE__ */ jsxs24(Box24, { flexDirection: "column", children: [
|
|
4710
|
+
/* @__PURE__ */ jsx25(App, { initialOrgSlug, inlineToken, inlineTokenEphemeral: Boolean(inlineToken) }),
|
|
4711
|
+
/* @__PURE__ */ jsx25(Text25, { color: "gray" })
|
|
4487
4712
|
] })
|
|
4488
4713
|
);
|