gh-manager-cli 1.33.0 → 1.35.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 +26 -0
- package/README.md +11 -5
- package/dist/{chunk-4A3TGHG7.js → chunk-EZP4YBHA.js} +153 -0
- package/dist/{github-64JCWV7P.js → github-HIF7MTPO.js} +7 -1
- package/dist/index.js +878 -402
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
fetchViewerOrganizations,
|
|
11
11
|
fetchViewerReposPageUnified,
|
|
12
12
|
getRepositoryFromCache,
|
|
13
|
+
getStarredRepositories,
|
|
13
14
|
getViewerLogin,
|
|
14
15
|
inspectCacheStatus,
|
|
15
16
|
logger,
|
|
@@ -17,21 +18,23 @@ import {
|
|
|
17
18
|
purgeApolloCacheFiles,
|
|
18
19
|
renameRepositoryById,
|
|
19
20
|
searchRepositoriesUnified,
|
|
21
|
+
starRepository,
|
|
20
22
|
syncForkWithUpstream,
|
|
21
23
|
unarchiveRepositoryById,
|
|
24
|
+
unstarRepository,
|
|
22
25
|
updateCacheAfterArchive,
|
|
23
26
|
updateCacheAfterDelete,
|
|
24
27
|
updateCacheAfterRename,
|
|
25
28
|
updateCacheAfterVisibilityChange,
|
|
26
29
|
updateCacheWithRepository
|
|
27
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-EZP4YBHA.js";
|
|
28
31
|
|
|
29
32
|
// package.json
|
|
30
33
|
var require_package = __commonJS({
|
|
31
34
|
"package.json"(exports, module) {
|
|
32
35
|
module.exports = {
|
|
33
36
|
name: "gh-manager-cli",
|
|
34
|
-
version: "1.
|
|
37
|
+
version: "1.35.0",
|
|
35
38
|
private: false,
|
|
36
39
|
description: "TUI terminal app to manage GitHub repos. Clean up your account in 5 minutes. Archive, delete, rename repos with keyboard shortcuts. Alternative to clicking through github.com",
|
|
37
40
|
license: "MIT",
|
|
@@ -171,12 +174,12 @@ var require_package = __commonJS({
|
|
|
171
174
|
|
|
172
175
|
// src/index.tsx
|
|
173
176
|
var import_package = __toESM(require_package(), 1);
|
|
174
|
-
import { render, Box as
|
|
177
|
+
import { render, Box as Box22, Text as Text23 } from "ink";
|
|
175
178
|
import "dotenv/config";
|
|
176
179
|
|
|
177
180
|
// src/ui/App.tsx
|
|
178
|
-
import { useEffect as
|
|
179
|
-
import { Box as
|
|
181
|
+
import { useEffect as useEffect12, useMemo as useMemo2, useState as useState17 } from "react";
|
|
182
|
+
import { Box as Box21, Text as Text22, useApp as useApp2, useStdout as useStdout2, useInput as useInput17 } from "ink";
|
|
180
183
|
import TextInput6 from "ink-text-input";
|
|
181
184
|
|
|
182
185
|
// src/config/config.ts
|
|
@@ -425,8 +428,8 @@ async function openGitHubAuthorizationPage() {
|
|
|
425
428
|
}
|
|
426
429
|
|
|
427
430
|
// src/ui/views/RepoList.tsx
|
|
428
|
-
import
|
|
429
|
-
import { Box as
|
|
431
|
+
import React15, { useEffect as useEffect11, useMemo, useState as useState15, useRef, useCallback } from "react";
|
|
432
|
+
import { Box as Box18, Text as Text19, useApp, useInput as useInput15, useStdout } from "ink";
|
|
430
433
|
import TextInput5 from "ink-text-input";
|
|
431
434
|
import chalk13 from "chalk";
|
|
432
435
|
|
|
@@ -506,7 +509,7 @@ function OrgSwitcher({ token, currentContext, onSelect, onClose }) {
|
|
|
506
509
|
try {
|
|
507
510
|
setLoading(true);
|
|
508
511
|
setError(null);
|
|
509
|
-
const client = await import("./github-
|
|
512
|
+
const client = await import("./github-HIF7MTPO.js").then((m) => m.makeClient(token));
|
|
510
513
|
const orgs = await fetchViewerOrganizations(client);
|
|
511
514
|
setOrganizations(orgs);
|
|
512
515
|
const entOrgs = /* @__PURE__ */ new Set();
|
|
@@ -1528,10 +1531,241 @@ function RenameModal({ repo, onRename, onCancel }) {
|
|
|
1528
1531
|
);
|
|
1529
1532
|
}
|
|
1530
1533
|
|
|
1531
|
-
// src/ui/components/
|
|
1534
|
+
// src/ui/components/modals/StarModal.tsx
|
|
1535
|
+
import { useEffect as useEffect9, useState as useState13 } from "react";
|
|
1532
1536
|
import { Box as Box13, Text as Text14 } from "ink";
|
|
1537
|
+
import { useInput as useInput13 } from "ink";
|
|
1538
|
+
import { Fragment as Fragment7, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1539
|
+
function StarModal({
|
|
1540
|
+
visible,
|
|
1541
|
+
repo,
|
|
1542
|
+
isStarred,
|
|
1543
|
+
onConfirm,
|
|
1544
|
+
onCancel,
|
|
1545
|
+
isStarring = false,
|
|
1546
|
+
error = null
|
|
1547
|
+
}) {
|
|
1548
|
+
const [focusedButton, setFocusedButton] = useState13("cancel");
|
|
1549
|
+
useInput13((input, key) => {
|
|
1550
|
+
if (!visible) return;
|
|
1551
|
+
if (key.escape || input === "c" || input === "C") {
|
|
1552
|
+
onCancel();
|
|
1553
|
+
return;
|
|
1554
|
+
}
|
|
1555
|
+
if (key.leftArrow) {
|
|
1556
|
+
setFocusedButton("cancel");
|
|
1557
|
+
} else if (key.rightArrow) {
|
|
1558
|
+
setFocusedButton("star");
|
|
1559
|
+
}
|
|
1560
|
+
if (key.return || input === "y" || input === "Y") {
|
|
1561
|
+
if (focusedButton === "star") {
|
|
1562
|
+
onConfirm();
|
|
1563
|
+
} else {
|
|
1564
|
+
onCancel();
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
if (input === "n" || input === "N") {
|
|
1568
|
+
onCancel();
|
|
1569
|
+
}
|
|
1570
|
+
if (input === "s" || input === "S") {
|
|
1571
|
+
onConfirm();
|
|
1572
|
+
}
|
|
1573
|
+
});
|
|
1574
|
+
useEffect9(() => {
|
|
1575
|
+
if (visible) {
|
|
1576
|
+
setFocusedButton("cancel");
|
|
1577
|
+
}
|
|
1578
|
+
}, [visible]);
|
|
1579
|
+
if (!visible || !repo) return null;
|
|
1580
|
+
const action = isStarred ? "Unstar" : "Star";
|
|
1581
|
+
const actionLower = isStarred ? "unstar" : "star";
|
|
1582
|
+
const actionGerund = isStarred ? "Unstarring" : "Starring";
|
|
1583
|
+
return /* @__PURE__ */ jsxs13(
|
|
1584
|
+
Box13,
|
|
1585
|
+
{
|
|
1586
|
+
flexDirection: "column",
|
|
1587
|
+
borderStyle: "round",
|
|
1588
|
+
borderColor: "yellow",
|
|
1589
|
+
paddingX: 2,
|
|
1590
|
+
paddingY: 1,
|
|
1591
|
+
marginTop: 1,
|
|
1592
|
+
children: [
|
|
1593
|
+
/* @__PURE__ */ jsx14(Box13, { marginBottom: 1, children: /* @__PURE__ */ jsxs13(Text14, { bold: true, color: "yellow", children: [
|
|
1594
|
+
"\u2B50 ",
|
|
1595
|
+
action,
|
|
1596
|
+
" Repository"
|
|
1597
|
+
] }) }),
|
|
1598
|
+
/* @__PURE__ */ jsx14(Box13, { marginBottom: 1, children: /* @__PURE__ */ jsxs13(Text14, { children: [
|
|
1599
|
+
"Are you sure you want to ",
|
|
1600
|
+
actionLower,
|
|
1601
|
+
" ",
|
|
1602
|
+
/* @__PURE__ */ jsx14(Text14, { bold: true, color: "cyan", children: repo.nameWithOwner }),
|
|
1603
|
+
"?"
|
|
1604
|
+
] }) }),
|
|
1605
|
+
repo.description && /* @__PURE__ */ jsx14(Box13, { marginBottom: 1, children: /* @__PURE__ */ jsx14(Text14, { dimColor: true, wrap: "wrap", children: repo.description }) }),
|
|
1606
|
+
/* @__PURE__ */ jsx14(Box13, { marginBottom: 1, children: /* @__PURE__ */ jsxs13(Text14, { dimColor: true, children: [
|
|
1607
|
+
"Current Stars: ",
|
|
1608
|
+
repo.stargazerCount,
|
|
1609
|
+
" \u2022 Forks: ",
|
|
1610
|
+
repo.forkCount
|
|
1611
|
+
] }) }),
|
|
1612
|
+
error && /* @__PURE__ */ jsx14(Box13, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs13(Text14, { color: "red", wrap: "wrap", children: [
|
|
1613
|
+
error.includes("OAuth access restrictions") ? "\u26A0\uFE0F " : "Error: ",
|
|
1614
|
+
error
|
|
1615
|
+
] }) }),
|
|
1616
|
+
isStarring ? /* @__PURE__ */ jsx14(Box13, { children: /* @__PURE__ */ jsxs13(Text14, { color: "yellow", children: [
|
|
1617
|
+
actionGerund,
|
|
1618
|
+
"..."
|
|
1619
|
+
] }) }) : /* @__PURE__ */ jsxs13(Fragment7, { children: [
|
|
1620
|
+
/* @__PURE__ */ jsxs13(Box13, { gap: 2, children: [
|
|
1621
|
+
/* @__PURE__ */ jsx14(Box13, { children: /* @__PURE__ */ jsxs13(
|
|
1622
|
+
Text14,
|
|
1623
|
+
{
|
|
1624
|
+
backgroundColor: focusedButton === "cancel" ? "white" : void 0,
|
|
1625
|
+
color: focusedButton === "cancel" ? "black" : "white",
|
|
1626
|
+
bold: focusedButton === "cancel",
|
|
1627
|
+
children: [
|
|
1628
|
+
" ",
|
|
1629
|
+
"Cancel (C/Esc)",
|
|
1630
|
+
" "
|
|
1631
|
+
]
|
|
1632
|
+
}
|
|
1633
|
+
) }),
|
|
1634
|
+
/* @__PURE__ */ jsx14(Box13, { children: /* @__PURE__ */ jsxs13(
|
|
1635
|
+
Text14,
|
|
1636
|
+
{
|
|
1637
|
+
backgroundColor: focusedButton === "star" ? "yellow" : void 0,
|
|
1638
|
+
color: focusedButton === "star" ? "black" : "yellow",
|
|
1639
|
+
bold: focusedButton === "star",
|
|
1640
|
+
children: [
|
|
1641
|
+
" ",
|
|
1642
|
+
action,
|
|
1643
|
+
" (S/Y)",
|
|
1644
|
+
" "
|
|
1645
|
+
]
|
|
1646
|
+
}
|
|
1647
|
+
) })
|
|
1648
|
+
] }),
|
|
1649
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { dimColor: true, children: "Use \u2190 \u2192 to navigate, Enter to select" }) })
|
|
1650
|
+
] })
|
|
1651
|
+
]
|
|
1652
|
+
}
|
|
1653
|
+
);
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
// src/ui/components/modals/UnstarModal.tsx
|
|
1657
|
+
import { useEffect as useEffect10, useState as useState14 } from "react";
|
|
1658
|
+
import { Box as Box14, Text as Text15 } from "ink";
|
|
1659
|
+
import { useInput as useInput14 } from "ink";
|
|
1660
|
+
import { Fragment as Fragment8, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1661
|
+
function UnstarModal({
|
|
1662
|
+
visible,
|
|
1663
|
+
repo,
|
|
1664
|
+
onConfirm,
|
|
1665
|
+
onCancel,
|
|
1666
|
+
isUnstarring = false,
|
|
1667
|
+
error = null
|
|
1668
|
+
}) {
|
|
1669
|
+
const [focusedButton, setFocusedButton] = useState14("cancel");
|
|
1670
|
+
useInput14((input, key) => {
|
|
1671
|
+
if (!visible) return;
|
|
1672
|
+
if (key.escape || input === "c" || input === "C") {
|
|
1673
|
+
onCancel();
|
|
1674
|
+
return;
|
|
1675
|
+
}
|
|
1676
|
+
if (key.leftArrow) {
|
|
1677
|
+
setFocusedButton("cancel");
|
|
1678
|
+
} else if (key.rightArrow) {
|
|
1679
|
+
setFocusedButton("unstar");
|
|
1680
|
+
}
|
|
1681
|
+
if (key.return || input === "y" || input === "Y") {
|
|
1682
|
+
if (focusedButton === "unstar") {
|
|
1683
|
+
onConfirm();
|
|
1684
|
+
} else {
|
|
1685
|
+
onCancel();
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
if (input === "n" || input === "N") {
|
|
1689
|
+
onCancel();
|
|
1690
|
+
}
|
|
1691
|
+
if (input === "u" || input === "U") {
|
|
1692
|
+
onConfirm();
|
|
1693
|
+
}
|
|
1694
|
+
});
|
|
1695
|
+
useEffect10(() => {
|
|
1696
|
+
if (visible) {
|
|
1697
|
+
setFocusedButton("cancel");
|
|
1698
|
+
}
|
|
1699
|
+
}, [visible]);
|
|
1700
|
+
if (!visible || !repo) return null;
|
|
1701
|
+
return /* @__PURE__ */ jsxs14(
|
|
1702
|
+
Box14,
|
|
1703
|
+
{
|
|
1704
|
+
flexDirection: "column",
|
|
1705
|
+
borderStyle: "round",
|
|
1706
|
+
borderColor: "yellow",
|
|
1707
|
+
paddingX: 2,
|
|
1708
|
+
paddingY: 1,
|
|
1709
|
+
marginTop: 1,
|
|
1710
|
+
children: [
|
|
1711
|
+
/* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx15(Text15, { bold: true, color: "yellow", children: "\u2B50 Unstar Repository" }) }),
|
|
1712
|
+
/* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsxs14(Text15, { children: [
|
|
1713
|
+
"Are you sure you want to unstar",
|
|
1714
|
+
" ",
|
|
1715
|
+
/* @__PURE__ */ jsx15(Text15, { bold: true, color: "cyan", children: repo.nameWithOwner }),
|
|
1716
|
+
"?"
|
|
1717
|
+
] }) }),
|
|
1718
|
+
repo.description && /* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx15(Text15, { dimColor: true, wrap: "wrap", children: repo.description }) }),
|
|
1719
|
+
/* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsxs14(Text15, { dimColor: true, children: [
|
|
1720
|
+
"Stars: ",
|
|
1721
|
+
repo.stargazerCount,
|
|
1722
|
+
" \u2022 Forks: ",
|
|
1723
|
+
repo.forkCount
|
|
1724
|
+
] }) }),
|
|
1725
|
+
error && /* @__PURE__ */ jsx15(Box14, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs14(Text15, { color: "red", wrap: "wrap", children: [
|
|
1726
|
+
error.includes("OAuth access restrictions") ? "\u26A0\uFE0F " : "Error: ",
|
|
1727
|
+
error
|
|
1728
|
+
] }) }),
|
|
1729
|
+
isUnstarring ? /* @__PURE__ */ jsx15(Box14, { children: /* @__PURE__ */ jsx15(Text15, { color: "yellow", children: "Unstarring..." }) }) : /* @__PURE__ */ jsxs14(Fragment8, { children: [
|
|
1730
|
+
/* @__PURE__ */ jsxs14(Box14, { gap: 2, children: [
|
|
1731
|
+
/* @__PURE__ */ jsx15(Box14, { children: /* @__PURE__ */ jsxs14(
|
|
1732
|
+
Text15,
|
|
1733
|
+
{
|
|
1734
|
+
backgroundColor: focusedButton === "cancel" ? "white" : void 0,
|
|
1735
|
+
color: focusedButton === "cancel" ? "black" : "white",
|
|
1736
|
+
bold: focusedButton === "cancel",
|
|
1737
|
+
children: [
|
|
1738
|
+
" ",
|
|
1739
|
+
"Cancel (C/Esc)",
|
|
1740
|
+
" "
|
|
1741
|
+
]
|
|
1742
|
+
}
|
|
1743
|
+
) }),
|
|
1744
|
+
/* @__PURE__ */ jsx15(Box14, { children: /* @__PURE__ */ jsxs14(
|
|
1745
|
+
Text15,
|
|
1746
|
+
{
|
|
1747
|
+
backgroundColor: focusedButton === "unstar" ? "yellow" : void 0,
|
|
1748
|
+
color: focusedButton === "unstar" ? "black" : "yellow",
|
|
1749
|
+
bold: focusedButton === "unstar",
|
|
1750
|
+
children: [
|
|
1751
|
+
" ",
|
|
1752
|
+
"Unstar (U/Y)",
|
|
1753
|
+
" "
|
|
1754
|
+
]
|
|
1755
|
+
}
|
|
1756
|
+
) })
|
|
1757
|
+
] }),
|
|
1758
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(Text15, { dimColor: true, children: "Use \u2190 \u2192 to navigate, Enter to select" }) })
|
|
1759
|
+
] })
|
|
1760
|
+
]
|
|
1761
|
+
}
|
|
1762
|
+
);
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
// src/ui/components/repo/RepoRow.tsx
|
|
1766
|
+
import { Box as Box15, Text as Text16 } from "ink";
|
|
1533
1767
|
import chalk12 from "chalk";
|
|
1534
|
-
import { jsx as
|
|
1768
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1535
1769
|
function RepoRow({
|
|
1536
1770
|
repo,
|
|
1537
1771
|
selected,
|
|
@@ -1539,7 +1773,8 @@ function RepoRow({
|
|
|
1539
1773
|
maxWidth,
|
|
1540
1774
|
spacingLines,
|
|
1541
1775
|
dim,
|
|
1542
|
-
forkTracking
|
|
1776
|
+
forkTracking,
|
|
1777
|
+
starsMode = false
|
|
1543
1778
|
}) {
|
|
1544
1779
|
const langName = repo.primaryLanguage?.name || "";
|
|
1545
1780
|
const langColor = repo.primaryLanguage?.color || "#666666";
|
|
@@ -1550,12 +1785,18 @@ function RepoRow({
|
|
|
1550
1785
|
const numColor = selected ? chalk12.cyan : chalk12.gray;
|
|
1551
1786
|
const nameColor = selected ? chalk12.cyan.bold : chalk12.white;
|
|
1552
1787
|
line1 += numColor(`${String(index).padStart(3, " ")}.`);
|
|
1788
|
+
if (repo.viewerHasStarred) {
|
|
1789
|
+
line1 += chalk12.yellow(" \u2B50");
|
|
1790
|
+
}
|
|
1553
1791
|
line1 += nameColor(` ${repo.nameWithOwner}`);
|
|
1554
1792
|
if (repo.visibility === "INTERNAL") {
|
|
1555
1793
|
line1 += chalk12.magenta(" Internal");
|
|
1556
1794
|
} else if (repo.visibility === "PRIVATE" || repo.isPrivate && !repo.visibility) {
|
|
1557
1795
|
line1 += chalk12.yellow(" Private");
|
|
1558
1796
|
}
|
|
1797
|
+
if (starsMode && repo.owner && repo.owner.__typename === "Organization") {
|
|
1798
|
+
line1 += chalk12.gray(" [org]");
|
|
1799
|
+
}
|
|
1559
1800
|
if (repo.isArchived) line1 += " " + chalk12.bgGray.whiteBright(" Archived ") + " ";
|
|
1560
1801
|
if (repo.isFork && repo.parent) {
|
|
1561
1802
|
line1 += chalk12.blue(` Fork of ${repo.parent.nameWithOwner}`);
|
|
@@ -1576,21 +1817,21 @@ function RepoRow({
|
|
|
1576
1817
|
if (line3) fullText += "\n" + metaColor(line3);
|
|
1577
1818
|
const spacingAbove = Math.floor(spacingLines / 2);
|
|
1578
1819
|
const spacingBelow = spacingLines - spacingAbove;
|
|
1579
|
-
return /* @__PURE__ */
|
|
1580
|
-
spacingAbove > 0 && /* @__PURE__ */
|
|
1581
|
-
/* @__PURE__ */
|
|
1582
|
-
spacingBelow > 0 && /* @__PURE__ */
|
|
1820
|
+
return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", backgroundColor: selected ? "gray" : void 0, children: [
|
|
1821
|
+
spacingAbove > 0 && /* @__PURE__ */ jsx16(Box15, { height: spacingAbove, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) }),
|
|
1822
|
+
/* @__PURE__ */ jsx16(Text16, { children: dim ? chalk12.dim(fullText) : fullText }),
|
|
1823
|
+
spacingBelow > 0 && /* @__PURE__ */ jsx16(Box15, { height: spacingBelow, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) })
|
|
1583
1824
|
] });
|
|
1584
1825
|
}
|
|
1585
1826
|
|
|
1586
1827
|
// src/ui/components/repo/FilterInput.tsx
|
|
1587
|
-
import { Box as
|
|
1828
|
+
import { Box as Box16, Text as Text17 } from "ink";
|
|
1588
1829
|
import TextInput4 from "ink-text-input";
|
|
1589
|
-
import { jsx as
|
|
1830
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1590
1831
|
|
|
1591
1832
|
// src/ui/components/repo/RepoListHeader.tsx
|
|
1592
|
-
import { Box as
|
|
1593
|
-
import { Fragment as
|
|
1833
|
+
import { Box as Box17, Text as Text18 } from "ink";
|
|
1834
|
+
import { Fragment as Fragment9, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1594
1835
|
function RepoListHeader({
|
|
1595
1836
|
ownerContext,
|
|
1596
1837
|
sortKey,
|
|
@@ -1600,39 +1841,41 @@ function RepoListHeader({
|
|
|
1600
1841
|
searchActive,
|
|
1601
1842
|
searchLoading,
|
|
1602
1843
|
visibilityFilter = "all",
|
|
1603
|
-
isEnterprise = false
|
|
1844
|
+
isEnterprise = false,
|
|
1845
|
+
starsMode = false
|
|
1604
1846
|
}) {
|
|
1605
1847
|
const contextLabel = ownerContext === "personal" ? "Personal Account" : ownerContext?.type === "organization" ? `Organization: ${ownerContext.name ?? ownerContext.login}` : "";
|
|
1606
1848
|
const visibilityLabel = visibilityFilter === "public" ? "Public" : visibilityFilter === "private" ? isEnterprise ? "Private/Internal" : "Private" : visibilityFilter === "internal" ? "Internal" : "";
|
|
1607
|
-
return /* @__PURE__ */
|
|
1608
|
-
contextLabel && /* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1849
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "row", gap: 2, marginBottom: 1, children: [
|
|
1850
|
+
contextLabel && /* @__PURE__ */ jsx18(Text18, { children: contextLabel }),
|
|
1851
|
+
starsMode && /* @__PURE__ */ jsx18(Text18, { color: "yellow", bold: true, children: "\u2B50 Stars Mode" }),
|
|
1852
|
+
/* @__PURE__ */ jsxs17(Text18, { color: "gray", dimColor: true, children: [
|
|
1610
1853
|
"Sort: ",
|
|
1611
1854
|
sortKey,
|
|
1612
1855
|
" ",
|
|
1613
1856
|
sortDir === "asc" ? "\u2191" : "\u2193"
|
|
1614
1857
|
] }),
|
|
1615
|
-
/* @__PURE__ */
|
|
1858
|
+
/* @__PURE__ */ jsxs17(Text18, { color: "gray", dimColor: true, children: [
|
|
1616
1859
|
"Fork Status - Commits Behind: ",
|
|
1617
1860
|
forkTracking ? "ON" : "OFF"
|
|
1618
1861
|
] }),
|
|
1619
|
-
!!visibilityLabel && /* @__PURE__ */
|
|
1862
|
+
!!visibilityLabel && !starsMode && /* @__PURE__ */ jsxs17(Text18, { color: "yellow", children: [
|
|
1620
1863
|
"Visibility: ",
|
|
1621
1864
|
visibilityLabel
|
|
1622
1865
|
] }),
|
|
1623
|
-
filter && !searchActive && /* @__PURE__ */
|
|
1866
|
+
filter && !searchActive && /* @__PURE__ */ jsxs17(Text18, { color: "cyan", children: [
|
|
1624
1867
|
'Filter: "',
|
|
1625
1868
|
filter,
|
|
1626
1869
|
'"'
|
|
1627
1870
|
] }),
|
|
1628
|
-
searchActive && /* @__PURE__ */
|
|
1629
|
-
/* @__PURE__ */
|
|
1871
|
+
searchActive && /* @__PURE__ */ jsxs17(Fragment9, { children: [
|
|
1872
|
+
/* @__PURE__ */ jsxs17(Text18, { color: "cyan", children: [
|
|
1630
1873
|
'Search: "',
|
|
1631
1874
|
filter.trim(),
|
|
1632
1875
|
'"'
|
|
1633
1876
|
] }),
|
|
1634
|
-
searchLoading && /* @__PURE__ */
|
|
1635
|
-
/* @__PURE__ */
|
|
1877
|
+
searchLoading && /* @__PURE__ */ jsx18(Box17, { marginLeft: 1, children: /* @__PURE__ */ jsxs17(Text18, { color: "cyan", children: [
|
|
1878
|
+
/* @__PURE__ */ jsx18(SlowSpinner, {}),
|
|
1636
1879
|
" Searching\u2026"
|
|
1637
1880
|
] }) })
|
|
1638
1881
|
] })
|
|
@@ -1640,7 +1883,7 @@ function RepoListHeader({
|
|
|
1640
1883
|
}
|
|
1641
1884
|
|
|
1642
1885
|
// src/ui/views/RepoList.tsx
|
|
1643
|
-
import { Fragment as
|
|
1886
|
+
import { Fragment as Fragment10, jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1644
1887
|
var getPageSize = () => {
|
|
1645
1888
|
const envValue = process.env.REPOS_PER_FETCH;
|
|
1646
1889
|
if (envValue) {
|
|
@@ -1656,17 +1899,17 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1656
1899
|
const { exit } = useApp();
|
|
1657
1900
|
const { stdout } = useStdout();
|
|
1658
1901
|
const client = useMemo(() => makeClient(token), [token]);
|
|
1659
|
-
const [debugMessages, setDebugMessages] =
|
|
1902
|
+
const [debugMessages, setDebugMessages] = useState15([]);
|
|
1660
1903
|
const addDebugMessage = useCallback((msg) => {
|
|
1661
1904
|
if (process.env.GH_MANAGER_DEBUG === "1") {
|
|
1662
1905
|
setDebugMessages((prev) => [...prev.slice(-9), msg]);
|
|
1663
1906
|
}
|
|
1664
1907
|
}, []);
|
|
1665
1908
|
const handleOrgContextChangeRef = useRef(onOrgContextChange);
|
|
1666
|
-
|
|
1909
|
+
useEffect11(() => {
|
|
1667
1910
|
handleOrgContextChangeRef.current = onOrgContextChange;
|
|
1668
1911
|
}, [onOrgContextChange]);
|
|
1669
|
-
|
|
1912
|
+
React15.useEffect(() => {
|
|
1670
1913
|
addDebugMessage(`[RepoList] Component mounted`);
|
|
1671
1914
|
logger.info("RepoList component mounted", {
|
|
1672
1915
|
token: token ? "present" : "missing",
|
|
@@ -1678,70 +1921,86 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1678
1921
|
}, []);
|
|
1679
1922
|
const terminalWidth = stdout?.columns ?? 80;
|
|
1680
1923
|
const availableHeight = maxVisibleRows ?? 20;
|
|
1681
|
-
const [items, setItems] =
|
|
1682
|
-
const [cursor, setCursor] =
|
|
1683
|
-
const [endCursor, setEndCursor] =
|
|
1684
|
-
const [hasNextPage, setHasNextPage] =
|
|
1685
|
-
const [totalCount, setTotalCount] =
|
|
1686
|
-
const [loading, setLoading] =
|
|
1687
|
-
const [sortingLoading, setSortingLoading] =
|
|
1688
|
-
const [refreshing, setRefreshing] =
|
|
1689
|
-
const [loadingMore, setLoadingMore] =
|
|
1690
|
-
const [error, setError] =
|
|
1691
|
-
const [rateLimit, setRateLimit] =
|
|
1692
|
-
const [prevRateLimit, setPrevRateLimit] =
|
|
1693
|
-
const [restRateLimit, setRestRateLimit] =
|
|
1694
|
-
const [prevRestRateLimit, setPrevRestRateLimit] =
|
|
1695
|
-
const [density, setDensity] =
|
|
1696
|
-
const [prefsLoaded, setPrefsLoaded] =
|
|
1697
|
-
const [ownerContext, setOwnerContext] =
|
|
1698
|
-
const [ownerAffiliations, setOwnerAffiliations] =
|
|
1699
|
-
const [orgSwitcherOpen, setOrgSwitcherOpen] =
|
|
1700
|
-
const [
|
|
1701
|
-
const [
|
|
1702
|
-
const [
|
|
1703
|
-
const [
|
|
1704
|
-
const [
|
|
1705
|
-
const [
|
|
1706
|
-
const [
|
|
1707
|
-
const [
|
|
1708
|
-
const [
|
|
1709
|
-
const [
|
|
1710
|
-
const [
|
|
1711
|
-
const [
|
|
1712
|
-
const [
|
|
1713
|
-
const [
|
|
1714
|
-
const [
|
|
1715
|
-
const [
|
|
1716
|
-
const [
|
|
1717
|
-
const [
|
|
1718
|
-
const [
|
|
1719
|
-
const [
|
|
1720
|
-
const [
|
|
1721
|
-
const [
|
|
1722
|
-
const [
|
|
1723
|
-
const [
|
|
1724
|
-
const [
|
|
1725
|
-
const [
|
|
1726
|
-
const [
|
|
1727
|
-
const [
|
|
1728
|
-
const [
|
|
1729
|
-
const [
|
|
1730
|
-
const [
|
|
1731
|
-
const [
|
|
1732
|
-
const [
|
|
1733
|
-
const [
|
|
1734
|
-
const [
|
|
1735
|
-
const [
|
|
1736
|
-
const [
|
|
1737
|
-
const [
|
|
1738
|
-
const [
|
|
1739
|
-
const [
|
|
1740
|
-
const [
|
|
1741
|
-
const [
|
|
1742
|
-
const [
|
|
1924
|
+
const [items, setItems] = useState15([]);
|
|
1925
|
+
const [cursor, setCursor] = useState15(0);
|
|
1926
|
+
const [endCursor, setEndCursor] = useState15(null);
|
|
1927
|
+
const [hasNextPage, setHasNextPage] = useState15(false);
|
|
1928
|
+
const [totalCount, setTotalCount] = useState15(0);
|
|
1929
|
+
const [loading, setLoading] = useState15(true);
|
|
1930
|
+
const [sortingLoading, setSortingLoading] = useState15(false);
|
|
1931
|
+
const [refreshing, setRefreshing] = useState15(false);
|
|
1932
|
+
const [loadingMore, setLoadingMore] = useState15(false);
|
|
1933
|
+
const [error, setError] = useState15(null);
|
|
1934
|
+
const [rateLimit, setRateLimit] = useState15(void 0);
|
|
1935
|
+
const [prevRateLimit, setPrevRateLimit] = useState15(void 0);
|
|
1936
|
+
const [restRateLimit, setRestRateLimit] = useState15(void 0);
|
|
1937
|
+
const [prevRestRateLimit, setPrevRestRateLimit] = useState15(void 0);
|
|
1938
|
+
const [density, setDensity] = useState15(2);
|
|
1939
|
+
const [prefsLoaded, setPrefsLoaded] = useState15(false);
|
|
1940
|
+
const [ownerContext, setOwnerContext] = useState15("personal");
|
|
1941
|
+
const [ownerAffiliations, setOwnerAffiliations] = useState15(["OWNER"]);
|
|
1942
|
+
const [orgSwitcherOpen, setOrgSwitcherOpen] = useState15(false);
|
|
1943
|
+
const [operationCount, setOperationCount] = useState15(0);
|
|
1944
|
+
const [showSponsorReminder, setShowSponsorReminder] = useState15(false);
|
|
1945
|
+
const [searchItems, setSearchItems] = useState15([]);
|
|
1946
|
+
const [searchEndCursor, setSearchEndCursor] = useState15(null);
|
|
1947
|
+
const [searchHasNextPage, setSearchHasNextPage] = useState15(false);
|
|
1948
|
+
const [searchTotalCount, setSearchTotalCount] = useState15(0);
|
|
1949
|
+
const [searchLoading, setSearchLoading] = useState15(false);
|
|
1950
|
+
const [deleteMode, setDeleteMode] = useState15(false);
|
|
1951
|
+
const [deleteTarget, setDeleteTarget] = useState15(null);
|
|
1952
|
+
const [deleteCode, setDeleteCode] = useState15("");
|
|
1953
|
+
const [typedCode, setTypedCode] = useState15("");
|
|
1954
|
+
const [deleting, setDeleting] = useState15(false);
|
|
1955
|
+
const [deleteError, setDeleteError] = useState15(null);
|
|
1956
|
+
const [deleteConfirmStage, setDeleteConfirmStage] = useState15(false);
|
|
1957
|
+
const [confirmFocus, setConfirmFocus] = useState15("delete");
|
|
1958
|
+
const [archiveMode, setArchiveMode] = useState15(false);
|
|
1959
|
+
const [archiveTarget, setArchiveTarget] = useState15(null);
|
|
1960
|
+
const [archiving, setArchiving] = useState15(false);
|
|
1961
|
+
const [archiveError, setArchiveError] = useState15(null);
|
|
1962
|
+
const [archiveFocus, setArchiveFocus] = useState15("confirm");
|
|
1963
|
+
const [syncMode, setSyncMode] = useState15(false);
|
|
1964
|
+
const [syncTarget, setSyncTarget] = useState15(null);
|
|
1965
|
+
const [syncing, setSyncing] = useState15(false);
|
|
1966
|
+
const [syncError, setSyncError] = useState15(null);
|
|
1967
|
+
const [syncFocus, setSyncFocus] = useState15("confirm");
|
|
1968
|
+
const [renameMode, setRenameMode] = useState15(false);
|
|
1969
|
+
const [renameTarget, setRenameTarget] = useState15(null);
|
|
1970
|
+
const [copyUrlMode, setCopyUrlMode] = useState15(false);
|
|
1971
|
+
const [copyUrlTarget, setCopyUrlTarget] = useState15(null);
|
|
1972
|
+
const [copyToast, setCopyToast] = useState15(null);
|
|
1973
|
+
const [syncTrigger, setSyncTrigger] = useState15(false);
|
|
1974
|
+
const [infoMode, setInfoMode] = useState15(false);
|
|
1975
|
+
const [infoRepo, setInfoRepo] = useState15(null);
|
|
1976
|
+
const [logoutMode, setLogoutMode] = useState15(false);
|
|
1977
|
+
const [logoutFocus, setLogoutFocus] = useState15("confirm");
|
|
1978
|
+
const [logoutError, setLogoutError] = useState15(null);
|
|
1979
|
+
const [visibilityMode, setVisibilityMode] = useState15(false);
|
|
1980
|
+
const [isEnterpriseOrg, setIsEnterpriseOrg] = useState15(false);
|
|
1981
|
+
const [hasInternalRepos, setHasInternalRepos] = useState15(false);
|
|
1982
|
+
const [changeVisibilityMode, setChangeVisibilityMode] = useState15(false);
|
|
1983
|
+
const [changeVisibilityTarget, setChangeVisibilityTarget] = useState15(null);
|
|
1984
|
+
const [changingVisibility, setChangingVisibility] = useState15(false);
|
|
1985
|
+
const [changeVisibilityError, setChangeVisibilityError] = useState15(null);
|
|
1986
|
+
const [sortMode, setSortMode] = useState15(false);
|
|
1987
|
+
const [sortDirectionMode, setSortDirectionMode] = useState15(false);
|
|
1988
|
+
const [starsMode, setStarsMode] = useState15(false);
|
|
1989
|
+
const [starredItems, setStarredItems] = useState15([]);
|
|
1990
|
+
const [starredEndCursor, setStarredEndCursor] = useState15(null);
|
|
1991
|
+
const [starredHasNextPage, setStarredHasNextPage] = useState15(false);
|
|
1992
|
+
const [starredTotalCount, setStarredTotalCount] = useState15(0);
|
|
1993
|
+
const [starredLoading, setStarredLoading] = useState15(false);
|
|
1994
|
+
const [unstarMode, setUnstarMode] = useState15(false);
|
|
1995
|
+
const [unstarTarget, setUnstarTarget] = useState15(null);
|
|
1996
|
+
const [unstarring, setUnstarring] = useState15(false);
|
|
1997
|
+
const [unstarError, setUnstarError] = useState15(null);
|
|
1998
|
+
const [starMode, setStarMode] = useState15(false);
|
|
1999
|
+
const [starTarget, setStarTarget] = useState15(null);
|
|
2000
|
+
const [starring, setStarring] = useState15(false);
|
|
2001
|
+
const [starError, setStarError] = useState15(null);
|
|
1743
2002
|
const appliedInitialOrg = useRef(false);
|
|
1744
|
-
|
|
2003
|
+
useEffect11(() => {
|
|
1745
2004
|
(async () => {
|
|
1746
2005
|
if (appliedInitialOrg.current) return;
|
|
1747
2006
|
if (!initialOrgSlug2) return;
|
|
@@ -1769,6 +2028,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1769
2028
|
}
|
|
1770
2029
|
})();
|
|
1771
2030
|
}, [initialOrgSlug2, token, prefsLoaded, client, addDebugMessage]);
|
|
2031
|
+
function trackSuccessfulOperation() {
|
|
2032
|
+
const newCount = operationCount + 1;
|
|
2033
|
+
setOperationCount(newCount);
|
|
2034
|
+
if (newCount % 5 === 0) {
|
|
2035
|
+
setShowSponsorReminder(true);
|
|
2036
|
+
setTimeout(() => setShowSponsorReminder(false), 5e3);
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
1772
2039
|
function closeArchiveModal() {
|
|
1773
2040
|
setArchiveMode(false);
|
|
1774
2041
|
setArchiveTarget(null);
|
|
@@ -1802,6 +2069,102 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1802
2069
|
setCopyUrlMode(true);
|
|
1803
2070
|
setCopyUrlTarget(repo);
|
|
1804
2071
|
}
|
|
2072
|
+
async function fetchStarredRepositories(after, reset = false) {
|
|
2073
|
+
setStarredLoading(true);
|
|
2074
|
+
try {
|
|
2075
|
+
const page = await getStarredRepositories(client, PAGE_SIZE, after ?? void 0);
|
|
2076
|
+
setStarredItems((prev) => reset || !after ? page.nodes : [...prev, ...page.nodes]);
|
|
2077
|
+
setStarredEndCursor(page.endCursor ?? null);
|
|
2078
|
+
setStarredHasNextPage(page.hasNextPage);
|
|
2079
|
+
setStarredTotalCount(page.totalCount);
|
|
2080
|
+
if (page.rateLimit) {
|
|
2081
|
+
setRateLimit(page.rateLimit);
|
|
2082
|
+
setPrevRateLimit(page.rateLimit.remaining);
|
|
2083
|
+
}
|
|
2084
|
+
setStarredLoading(false);
|
|
2085
|
+
} catch (e) {
|
|
2086
|
+
setStarredLoading(false);
|
|
2087
|
+
setError(e.message || "Failed to fetch starred repositories");
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
async function handleUnstar() {
|
|
2091
|
+
if (!unstarTarget || unstarring) return;
|
|
2092
|
+
try {
|
|
2093
|
+
setUnstarring(true);
|
|
2094
|
+
const targetId = unstarTarget.id;
|
|
2095
|
+
await unstarRepository(client, targetId);
|
|
2096
|
+
setStarredItems((prev) => prev.filter((r) => r.id !== targetId));
|
|
2097
|
+
setStarredTotalCount((c) => Math.max(0, c - 1));
|
|
2098
|
+
setCursor((c) => Math.max(0, Math.min(c, starredItems.length - 2)));
|
|
2099
|
+
trackSuccessfulOperation();
|
|
2100
|
+
setUnstarMode(false);
|
|
2101
|
+
setUnstarTarget(null);
|
|
2102
|
+
setUnstarError(null);
|
|
2103
|
+
setUnstarring(false);
|
|
2104
|
+
} catch (e) {
|
|
2105
|
+
setUnstarring(false);
|
|
2106
|
+
const errorMsg = e.message || "Failed to unstar repository";
|
|
2107
|
+
if (errorMsg.includes("OAuth App access restrictions")) {
|
|
2108
|
+
const orgMatch = errorMsg.match(/`([^`]+)` organization/);
|
|
2109
|
+
const orgName = orgMatch ? orgMatch[1] : unstarTarget?.nameWithOwner.split("/")[0];
|
|
2110
|
+
setUnstarError(
|
|
2111
|
+
`Cannot unstar: The ${orgName} organization has OAuth access restrictions. You'll need to unstar this repository directly on GitHub.`
|
|
2112
|
+
);
|
|
2113
|
+
} else {
|
|
2114
|
+
setUnstarError(errorMsg);
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
function closeUnstarModal() {
|
|
2119
|
+
setUnstarMode(false);
|
|
2120
|
+
setUnstarTarget(null);
|
|
2121
|
+
setUnstarError(null);
|
|
2122
|
+
setUnstarring(false);
|
|
2123
|
+
}
|
|
2124
|
+
async function handleStar() {
|
|
2125
|
+
if (!starTarget || starring) return;
|
|
2126
|
+
const isStarred = starTarget.viewerHasStarred;
|
|
2127
|
+
try {
|
|
2128
|
+
setStarring(true);
|
|
2129
|
+
const targetId = starTarget.id;
|
|
2130
|
+
if (isStarred) {
|
|
2131
|
+
await unstarRepository(client, targetId);
|
|
2132
|
+
} else {
|
|
2133
|
+
await starRepository(client, targetId);
|
|
2134
|
+
}
|
|
2135
|
+
const updateRepo = (r) => {
|
|
2136
|
+
if (r.id === targetId) {
|
|
2137
|
+
return { ...r, viewerHasStarred: !isStarred, stargazerCount: r.stargazerCount + (isStarred ? -1 : 1) };
|
|
2138
|
+
}
|
|
2139
|
+
return r;
|
|
2140
|
+
};
|
|
2141
|
+
setItems((prev) => prev.map(updateRepo));
|
|
2142
|
+
setSearchItems((prev) => prev.map(updateRepo));
|
|
2143
|
+
trackSuccessfulOperation();
|
|
2144
|
+
setStarMode(false);
|
|
2145
|
+
setStarTarget(null);
|
|
2146
|
+
setStarError(null);
|
|
2147
|
+
setStarring(false);
|
|
2148
|
+
} catch (e) {
|
|
2149
|
+
setStarring(false);
|
|
2150
|
+
const errorMsg = e.message || `Failed to ${isStarred ? "unstar" : "star"} repository`;
|
|
2151
|
+
if (errorMsg.includes("OAuth access restrictions")) {
|
|
2152
|
+
const orgMatch = errorMsg.match(/`([^`]+)` organization/);
|
|
2153
|
+
const orgName = orgMatch ? orgMatch[1] : starTarget?.nameWithOwner.split("/")[0];
|
|
2154
|
+
setStarError(
|
|
2155
|
+
`Cannot ${isStarred ? "unstar" : "star"}: The ${orgName} organization has OAuth access restrictions. You'll need to ${isStarred ? "unstar" : "star"} this repository directly on GitHub.`
|
|
2156
|
+
);
|
|
2157
|
+
} else {
|
|
2158
|
+
setStarError(errorMsg);
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
function closeStarModal() {
|
|
2163
|
+
setStarMode(false);
|
|
2164
|
+
setStarTarget(null);
|
|
2165
|
+
setStarError(null);
|
|
2166
|
+
setStarring(false);
|
|
2167
|
+
}
|
|
1805
2168
|
async function executeSync() {
|
|
1806
2169
|
if (!syncTarget || syncing) return;
|
|
1807
2170
|
try {
|
|
@@ -1856,6 +2219,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1856
2219
|
const updateRepo = (r) => r.id === id ? { ...r, isArchived: !isArchived } : r;
|
|
1857
2220
|
setItems((prev) => prev.map(updateRepo));
|
|
1858
2221
|
setSearchItems((prev) => prev.map(updateRepo));
|
|
2222
|
+
trackSuccessfulOperation();
|
|
1859
2223
|
closeArchiveModal();
|
|
1860
2224
|
} catch (e) {
|
|
1861
2225
|
setArchiving(false);
|
|
@@ -1905,7 +2269,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1905
2269
|
throw error2;
|
|
1906
2270
|
}
|
|
1907
2271
|
}
|
|
1908
|
-
|
|
2272
|
+
useEffect11(() => {
|
|
1909
2273
|
return () => {
|
|
1910
2274
|
if (copyToastTimerRef.current) {
|
|
1911
2275
|
clearTimeout(copyToastTimerRef.current);
|
|
@@ -1952,6 +2316,13 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1952
2316
|
setFilter("");
|
|
1953
2317
|
setFilterMode(false);
|
|
1954
2318
|
setVisibilityFilter("all");
|
|
2319
|
+
if (newContext !== "personal" && starsMode) {
|
|
2320
|
+
setStarsMode(false);
|
|
2321
|
+
setStarredItems([]);
|
|
2322
|
+
setStarredHasNextPage(false);
|
|
2323
|
+
setStarredEndCursor(null);
|
|
2324
|
+
setStarredTotalCount(0);
|
|
2325
|
+
}
|
|
1955
2326
|
const newAffiliations = newContext === "personal" ? ["OWNER"] : ["ORGANIZATION_MEMBER"];
|
|
1956
2327
|
setOwnerAffiliations(newAffiliations);
|
|
1957
2328
|
if (newContext !== "personal") {
|
|
@@ -1993,6 +2364,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1993
2364
|
if (searchActive) {
|
|
1994
2365
|
setSearchTotalCount((c) => Math.max(0, c - 1));
|
|
1995
2366
|
}
|
|
2367
|
+
trackSuccessfulOperation();
|
|
1996
2368
|
setDeleteMode(false);
|
|
1997
2369
|
setDeleteTarget(null);
|
|
1998
2370
|
setTypedCode("");
|
|
@@ -2005,12 +2377,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2005
2377
|
setDeleteError("Failed to delete repository. Ensure delete_repo scope and admin permissions.");
|
|
2006
2378
|
}
|
|
2007
2379
|
}
|
|
2008
|
-
const [filter, setFilter] =
|
|
2009
|
-
const [filterMode, setFilterMode] =
|
|
2010
|
-
const [sortKey, setSortKey] =
|
|
2011
|
-
const [sortDir, setSortDir] =
|
|
2012
|
-
const [forkTracking, setForkTracking] =
|
|
2013
|
-
const [visibilityFilter, setVisibilityFilter] =
|
|
2380
|
+
const [filter, setFilter] = useState15("");
|
|
2381
|
+
const [filterMode, setFilterMode] = useState15(false);
|
|
2382
|
+
const [sortKey, setSortKey] = useState15("updated");
|
|
2383
|
+
const [sortDir, setSortDir] = useState15("desc");
|
|
2384
|
+
const [forkTracking, setForkTracking] = useState15(true);
|
|
2385
|
+
const [visibilityFilter, setVisibilityFilter] = useState15("all");
|
|
2014
2386
|
const previousVisibilityFilter = useRef("all");
|
|
2015
2387
|
const sortFieldMap = {
|
|
2016
2388
|
"updated": "UPDATED_AT",
|
|
@@ -2171,7 +2543,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2171
2543
|
setSearchLoading(false);
|
|
2172
2544
|
}
|
|
2173
2545
|
};
|
|
2174
|
-
|
|
2546
|
+
useEffect11(() => {
|
|
2175
2547
|
const ui = getUIPrefs();
|
|
2176
2548
|
if (ui.density !== void 0) setDensity(ui.density);
|
|
2177
2549
|
if (ui.sortKey && ["updated", "pushed", "name", "stars"].includes(ui.sortKey)) {
|
|
@@ -2180,8 +2552,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2180
2552
|
if (ui.sortDir && (ui.sortDir === "asc" || ui.sortDir === "desc")) {
|
|
2181
2553
|
setSortDir(ui.sortDir);
|
|
2182
2554
|
}
|
|
2183
|
-
|
|
2184
|
-
else setForkTracking(true);
|
|
2555
|
+
setForkTracking(true);
|
|
2185
2556
|
if (ui.visibilityFilter && ["all", "public", "private", "internal"].includes(ui.visibilityFilter)) {
|
|
2186
2557
|
setVisibilityFilter(ui.visibilityFilter);
|
|
2187
2558
|
}
|
|
@@ -2202,7 +2573,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2202
2573
|
}
|
|
2203
2574
|
setPrefsLoaded(true);
|
|
2204
2575
|
}, [onOrgContextChange]);
|
|
2205
|
-
|
|
2576
|
+
useEffect11(() => {
|
|
2206
2577
|
if (!prefsLoaded) return;
|
|
2207
2578
|
let policy = "cache-first";
|
|
2208
2579
|
const orgLogin = ownerContext !== "personal" ? ownerContext.login : void 0;
|
|
@@ -2222,7 +2593,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2222
2593
|
setCursor(0);
|
|
2223
2594
|
fetchPage(null, true, false, void 0, policy);
|
|
2224
2595
|
}, [client, prefsLoaded, ownerContext, ownerAffiliations]);
|
|
2225
|
-
|
|
2596
|
+
useEffect11(() => {
|
|
2226
2597
|
if (!searchActive) {
|
|
2227
2598
|
if (items.length > 0) {
|
|
2228
2599
|
let policy = "cache-first";
|
|
@@ -2261,7 +2632,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2261
2632
|
}
|
|
2262
2633
|
}
|
|
2263
2634
|
}, [sortKey, sortDir]);
|
|
2264
|
-
|
|
2635
|
+
useEffect11(() => {
|
|
2265
2636
|
if (visibilityFilter !== "all" || previousVisibilityFilter.current && previousVisibilityFilter.current !== visibilityFilter) {
|
|
2266
2637
|
if (!searchActive) {
|
|
2267
2638
|
if (items.length > 0) {
|
|
@@ -2278,7 +2649,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2278
2649
|
}
|
|
2279
2650
|
previousVisibilityFilter.current = visibilityFilter;
|
|
2280
2651
|
}, [visibilityFilter]);
|
|
2281
|
-
|
|
2652
|
+
useEffect11(() => {
|
|
2282
2653
|
if (viewerLogin && searchActive && !searchLoading && searchItems.length === 0) {
|
|
2283
2654
|
let policy = "cache-first";
|
|
2284
2655
|
try {
|
|
@@ -2299,7 +2670,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2299
2670
|
fetchSearchPage(null, true, policy);
|
|
2300
2671
|
}
|
|
2301
2672
|
}, [viewerLogin]);
|
|
2302
|
-
|
|
2673
|
+
useInput15((input, key) => {
|
|
2303
2674
|
if (error) {
|
|
2304
2675
|
if (input && input.toUpperCase() === "Q") {
|
|
2305
2676
|
try {
|
|
@@ -2384,6 +2755,20 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2384
2755
|
}
|
|
2385
2756
|
return;
|
|
2386
2757
|
}
|
|
2758
|
+
if (unstarMode) {
|
|
2759
|
+
if (key.escape || input && input.toUpperCase() === "C") {
|
|
2760
|
+
closeUnstarModal();
|
|
2761
|
+
return;
|
|
2762
|
+
}
|
|
2763
|
+
return;
|
|
2764
|
+
}
|
|
2765
|
+
if (starMode) {
|
|
2766
|
+
if (key.escape || input && input.toUpperCase() === "C") {
|
|
2767
|
+
closeStarModal();
|
|
2768
|
+
return;
|
|
2769
|
+
}
|
|
2770
|
+
return;
|
|
2771
|
+
}
|
|
2387
2772
|
if (syncMode) {
|
|
2388
2773
|
if (key.escape || input && input.toUpperCase() === "C") {
|
|
2389
2774
|
closeSyncModal();
|
|
@@ -2474,22 +2859,24 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2474
2859
|
addDebugMessage("[ESC] Cleared search and returned to normal listing");
|
|
2475
2860
|
return;
|
|
2476
2861
|
}
|
|
2477
|
-
if (key.downArrow && searchActive && visibleItems.length > 0) {
|
|
2862
|
+
if (key.downArrow && (searchActive || starsMode && filter.trim().length > 0) && visibleItems.length > 0) {
|
|
2478
2863
|
setFilterMode(false);
|
|
2479
2864
|
setCursor(0);
|
|
2480
|
-
addDebugMessage("[DOWN] Exited filter mode and selected first
|
|
2865
|
+
addDebugMessage("[DOWN] Exited filter mode and selected first result");
|
|
2481
2866
|
return;
|
|
2482
2867
|
}
|
|
2483
2868
|
return;
|
|
2484
2869
|
}
|
|
2485
|
-
if (key.escape && searchActive) {
|
|
2870
|
+
if (key.escape && (searchActive || starsMode && filter.trim().length > 0)) {
|
|
2486
2871
|
setFilter("");
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2872
|
+
if (!starsMode) {
|
|
2873
|
+
setSearchItems([]);
|
|
2874
|
+
setSearchEndCursor(null);
|
|
2875
|
+
setSearchHasNextPage(false);
|
|
2876
|
+
setSearchTotalCount(0);
|
|
2877
|
+
}
|
|
2491
2878
|
setCursor(0);
|
|
2492
|
-
addDebugMessage("[ESC] Cleared
|
|
2879
|
+
addDebugMessage("[ESC] Cleared filter and returned to normal listing");
|
|
2493
2880
|
return;
|
|
2494
2881
|
}
|
|
2495
2882
|
if (input && input.toUpperCase() === "Q") {
|
|
@@ -2569,7 +2956,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2569
2956
|
}
|
|
2570
2957
|
return;
|
|
2571
2958
|
}
|
|
2572
|
-
if (key.ctrl && (input === "
|
|
2959
|
+
if (key.ctrl && (input === "f" || input === "F")) {
|
|
2573
2960
|
const repo = visibleItems[cursor];
|
|
2574
2961
|
if (repo && repo.isFork && repo.parent) {
|
|
2575
2962
|
const hasCommitData = repo.defaultBranchRef && repo.parent.defaultBranchRef && repo.parent.defaultBranchRef.target?.history && repo.defaultBranchRef.target?.history;
|
|
@@ -2637,7 +3024,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2637
3024
|
setOrgSwitcherOpen(true);
|
|
2638
3025
|
return;
|
|
2639
3026
|
}
|
|
2640
|
-
if (input && input.toUpperCase() === "S") {
|
|
3027
|
+
if (input && input.toUpperCase() === "S" && !key.shift && !key.ctrl) {
|
|
2641
3028
|
setSortMode(true);
|
|
2642
3029
|
return;
|
|
2643
3030
|
}
|
|
@@ -2645,6 +3032,47 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2645
3032
|
setSortDirectionMode(true);
|
|
2646
3033
|
return;
|
|
2647
3034
|
}
|
|
3035
|
+
if (key.shift && input === "S" && ownerContext === "personal") {
|
|
3036
|
+
const newStarsMode = !starsMode;
|
|
3037
|
+
setStarsMode(newStarsMode);
|
|
3038
|
+
setCursor(0);
|
|
3039
|
+
setFilter("");
|
|
3040
|
+
setFilterMode(false);
|
|
3041
|
+
if (newStarsMode) {
|
|
3042
|
+
setVisibilityFilter("all");
|
|
3043
|
+
setSearchItems([]);
|
|
3044
|
+
setSearchEndCursor(null);
|
|
3045
|
+
setSearchHasNextPage(false);
|
|
3046
|
+
setSearchTotalCount(0);
|
|
3047
|
+
fetchStarredRepositories(null, true);
|
|
3048
|
+
} else {
|
|
3049
|
+
setSearchItems([]);
|
|
3050
|
+
setSearchEndCursor(null);
|
|
3051
|
+
setSearchHasNextPage(false);
|
|
3052
|
+
setSearchTotalCount(0);
|
|
3053
|
+
}
|
|
3054
|
+
return;
|
|
3055
|
+
}
|
|
3056
|
+
if (input && input.toUpperCase() === "U" && starsMode) {
|
|
3057
|
+
const repo = visibleItems[cursor];
|
|
3058
|
+
if (repo) {
|
|
3059
|
+
setUnstarTarget(repo);
|
|
3060
|
+
setUnstarMode(true);
|
|
3061
|
+
setUnstarError(null);
|
|
3062
|
+
setUnstarring(false);
|
|
3063
|
+
}
|
|
3064
|
+
return;
|
|
3065
|
+
}
|
|
3066
|
+
if (key.ctrl && (input === "s" || input === "S") && !starsMode) {
|
|
3067
|
+
const repo = visibleItems[cursor];
|
|
3068
|
+
if (repo) {
|
|
3069
|
+
setStarTarget(repo);
|
|
3070
|
+
setStarMode(true);
|
|
3071
|
+
setStarError(null);
|
|
3072
|
+
setStarring(false);
|
|
3073
|
+
}
|
|
3074
|
+
return;
|
|
3075
|
+
}
|
|
2648
3076
|
if (input && input.toUpperCase() === "O") {
|
|
2649
3077
|
const repo = visibleItems[cursor];
|
|
2650
3078
|
if (repo) openInBrowser(`https://github.com/${repo.nameWithOwner}`);
|
|
@@ -2658,23 +3086,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2658
3086
|
});
|
|
2659
3087
|
return;
|
|
2660
3088
|
}
|
|
2661
|
-
if (input && input.toUpperCase() === "F") {
|
|
2662
|
-
setForkTracking((prev) => {
|
|
2663
|
-
const next = !prev;
|
|
2664
|
-
storeUIPrefs({ forkTracking: next });
|
|
2665
|
-
const needsRefresh = next && items.some(
|
|
2666
|
-
(repo) => repo.isFork && repo.parent && (!repo.defaultBranchRef?.target?.history || !repo.parent.defaultBranchRef?.target?.history)
|
|
2667
|
-
);
|
|
2668
|
-
if (needsRefresh) {
|
|
2669
|
-
setSortingLoading(true);
|
|
2670
|
-
fetchPage(null, true, true, next);
|
|
2671
|
-
}
|
|
2672
|
-
return next;
|
|
2673
|
-
});
|
|
2674
|
-
return;
|
|
2675
|
-
}
|
|
2676
3089
|
if (input && input.toUpperCase() === "V") {
|
|
2677
|
-
|
|
3090
|
+
if (!starsMode) {
|
|
3091
|
+
setVisibilityMode(true);
|
|
3092
|
+
}
|
|
2678
3093
|
return;
|
|
2679
3094
|
}
|
|
2680
3095
|
});
|
|
@@ -2711,7 +3126,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2711
3126
|
});
|
|
2712
3127
|
return arr;
|
|
2713
3128
|
}, [filtered, sortKey, sortDir]);
|
|
2714
|
-
const searchActive = filter.trim().length >= 3;
|
|
3129
|
+
const searchActive = !starsMode && filter.trim().length >= 3;
|
|
2715
3130
|
const filteredSearchItems = useMemo(() => {
|
|
2716
3131
|
let result = searchItems;
|
|
2717
3132
|
if (visibilityFilter === "private") {
|
|
@@ -2721,13 +3136,20 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2721
3136
|
}
|
|
2722
3137
|
return result;
|
|
2723
3138
|
}, [searchItems, visibilityFilter]);
|
|
2724
|
-
const
|
|
2725
|
-
|
|
3139
|
+
const filteredStarredItems = useMemo(() => {
|
|
3140
|
+
if (!filter || filter.trim().length === 0) return starredItems;
|
|
3141
|
+
const lowerFilter = filter.toLowerCase();
|
|
3142
|
+
return starredItems.filter(
|
|
3143
|
+
(repo) => repo.nameWithOwner.toLowerCase().includes(lowerFilter) || repo.description && repo.description.toLowerCase().includes(lowerFilter)
|
|
3144
|
+
);
|
|
3145
|
+
}, [starredItems, filter]);
|
|
3146
|
+
const visibleItems = starsMode ? filteredStarredItems : searchActive ? filteredSearchItems : filteredAndSorted;
|
|
3147
|
+
useEffect11(() => {
|
|
2726
3148
|
if (searchActive) {
|
|
2727
3149
|
addDebugMessage(`[State] searchActive=${searchActive}, searchItems=${searchItems.length}, visibleItems=${visibleItems.length}, filter="${filter}"`);
|
|
2728
3150
|
}
|
|
2729
3151
|
}, [searchActive, searchItems.length, visibleItems.length, filter]);
|
|
2730
|
-
|
|
3152
|
+
useEffect11(() => {
|
|
2731
3153
|
setCursor((c) => Math.min(c, Math.max(0, (searchActive ? searchItems.length : items.length) - 1)));
|
|
2732
3154
|
}, [searchActive, searchItems.length, items.length]);
|
|
2733
3155
|
const headerHeight = 2;
|
|
@@ -2748,10 +3170,15 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2748
3170
|
const end = Math.min(total, start + visibleRepos + buffer);
|
|
2749
3171
|
return { start, end };
|
|
2750
3172
|
}, [visibleItems.length, cursor, listHeight, spacingLines]);
|
|
2751
|
-
|
|
3173
|
+
useEffect11(() => {
|
|
2752
3174
|
const prefetchThreshold = Math.floor(visibleItems.length * 0.8);
|
|
2753
3175
|
const nearEnd = visibleItems.length > 0 && cursor >= prefetchThreshold;
|
|
2754
|
-
if (
|
|
3176
|
+
if (starsMode) {
|
|
3177
|
+
if (!starredLoading && starredHasNextPage && nearEnd) {
|
|
3178
|
+
addDebugMessage(`[Infinite Scroll] Prefetching starred repos at ${cursor}/${visibleItems.length} (80% threshold: ${prefetchThreshold})`);
|
|
3179
|
+
fetchStarredRepositories(starredEndCursor);
|
|
3180
|
+
}
|
|
3181
|
+
} else if (searchActive) {
|
|
2755
3182
|
if (!searchLoading && searchHasNextPage && nearEnd) {
|
|
2756
3183
|
addDebugMessage(`[Infinite Scroll] Prefetching search results at ${cursor}/${visibleItems.length} (80% threshold: ${prefetchThreshold})`);
|
|
2757
3184
|
fetchSearchPage(searchEndCursor);
|
|
@@ -2762,7 +3189,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2762
3189
|
fetchPage(endCursor);
|
|
2763
3190
|
}
|
|
2764
3191
|
}
|
|
2765
|
-
}, [cursor, visibleItems.length, searchActive, searchLoading, searchHasNextPage, searchEndCursor, loading, loadingMore, hasNextPage, endCursor]);
|
|
3192
|
+
}, [cursor, visibleItems.length, starsMode, starredLoading, starredHasNextPage, starredEndCursor, searchActive, searchLoading, searchHasNextPage, searchEndCursor, loading, loadingMore, hasNextPage, endCursor]);
|
|
2766
3193
|
function openInBrowser(url) {
|
|
2767
3194
|
const platform = process.platform;
|
|
2768
3195
|
const cmd = platform === "darwin" ? `open "${url}"` : platform === "win32" ? `start "" "${url}"` : `xdg-open "${url}"`;
|
|
@@ -2770,71 +3197,76 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2770
3197
|
}
|
|
2771
3198
|
const lowRate = rateLimit && rateLimit.remaining <= Math.ceil(rateLimit.limit * 0.1) || restRateLimit && restRateLimit.core.remaining <= Math.ceil(restRateLimit.core.limit * 0.1);
|
|
2772
3199
|
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || sortMode || sortDirectionMode || changeVisibilityMode || copyUrlMode || renameMode;
|
|
2773
|
-
const headerBar = useMemo(() => /* @__PURE__ */
|
|
2774
|
-
/* @__PURE__ */
|
|
2775
|
-
/* @__PURE__ */
|
|
3200
|
+
const headerBar = useMemo(() => /* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: [
|
|
3201
|
+
/* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", gap: 1, children: [
|
|
3202
|
+
/* @__PURE__ */ jsxs18(Text19, { color: "cyan", bold: !modalOpen, dimColor: modalOpen, children: [
|
|
2776
3203
|
" ",
|
|
2777
3204
|
ownerContext === "personal" ? "Personal" : ownerContext.name || ownerContext.login,
|
|
2778
3205
|
ownerContext !== "personal" && isEnterpriseOrg && " (ENT)"
|
|
2779
3206
|
] }),
|
|
2780
|
-
/* @__PURE__ */
|
|
2781
|
-
/* @__PURE__ */
|
|
3207
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, color: modalOpen ? "gray" : void 0, dimColor: modalOpen ? true : void 0, children: "Repositories" }),
|
|
3208
|
+
/* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
2782
3209
|
"(",
|
|
2783
3210
|
visibleItems.length,
|
|
2784
3211
|
"/",
|
|
2785
3212
|
searchActive ? searchTotalCount : totalCount,
|
|
2786
3213
|
")"
|
|
2787
3214
|
] }),
|
|
2788
|
-
(loading || searchLoading) && /* @__PURE__ */
|
|
3215
|
+
(loading || searchLoading) && /* @__PURE__ */ jsx19(Box18, { width: 2, flexShrink: 0, flexGrow: 0, marginLeft: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "yellow", children: /* @__PURE__ */ jsx19(SlowSpinner, {}) }) })
|
|
2789
3216
|
] }),
|
|
2790
|
-
(rateLimit || restRateLimit) && /* @__PURE__ */
|
|
3217
|
+
(rateLimit || restRateLimit) && /* @__PURE__ */ jsxs18(Text19, { color: lowRate ? "yellow" : "gray", children: [
|
|
2791
3218
|
"GraphQL: ",
|
|
2792
3219
|
rateLimit ? `${rateLimit.remaining}/${rateLimit.limit}` : "---/---",
|
|
2793
|
-
prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */
|
|
3220
|
+
prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */ jsx19(Text19, { color: rateLimit.remaining < prevRateLimit ? "red" : "green", children: ` (${rateLimit.remaining - prevRateLimit > 0 ? "+" : ""}${rateLimit.remaining - prevRateLimit})` }),
|
|
2794
3221
|
" | ",
|
|
2795
3222
|
"REST: ",
|
|
2796
3223
|
restRateLimit ? `${restRateLimit.core.remaining}/${restRateLimit.core.limit}` : "---/---",
|
|
2797
|
-
prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */
|
|
3224
|
+
prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */ jsx19(Text19, { color: restRateLimit.core.remaining < prevRestRateLimit ? "red" : "green", children: ` (${restRateLimit.core.remaining - prevRestRateLimit > 0 ? "+" : ""}${restRateLimit.core.remaining - prevRestRateLimit})` }),
|
|
2798
3225
|
" "
|
|
2799
3226
|
] })
|
|
2800
3227
|
] }), [visibleItems.length, searchActive, searchTotalCount, totalCount, loading, searchLoading, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg, restRateLimit, prevRestRateLimit]);
|
|
2801
3228
|
if (error) {
|
|
2802
|
-
return /* @__PURE__ */
|
|
2803
|
-
/* @__PURE__ */
|
|
2804
|
-
/* @__PURE__ */
|
|
2805
|
-
/* @__PURE__ */
|
|
3229
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", height: availableHeight, children: [
|
|
3230
|
+
/* @__PURE__ */ jsx19(Box18, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", gap: 1, children: [
|
|
3231
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, children: " Repositories" }),
|
|
3232
|
+
/* @__PURE__ */ jsx19(Text19, { color: "red", children: "(Error)" })
|
|
2806
3233
|
] }) }),
|
|
2807
|
-
/* @__PURE__ */
|
|
2808
|
-
/* @__PURE__ */
|
|
2809
|
-
/* @__PURE__ */
|
|
3234
|
+
/* @__PURE__ */ jsx19(Box18, { borderStyle: "single", borderColor: "red", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx19(Box18, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", alignItems: "center", children: [
|
|
3235
|
+
/* @__PURE__ */ jsx19(Text19, { color: "red", children: error }),
|
|
3236
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "gray", dimColor: true, children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
2810
3237
|
] }) }) }),
|
|
2811
|
-
/* @__PURE__ */
|
|
3238
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "gray", children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
2812
3239
|
] });
|
|
2813
3240
|
}
|
|
2814
3241
|
if (loading && items.length === 0 || sortingLoading) {
|
|
2815
|
-
return /* @__PURE__ */
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
/* @__PURE__ */
|
|
2818
|
-
/* @__PURE__ */
|
|
3242
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", height: availableHeight, children: [
|
|
3243
|
+
/* @__PURE__ */ jsx19(Box18, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", gap: 1, children: [
|
|
3244
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, children: " Repositories" }),
|
|
3245
|
+
/* @__PURE__ */ jsx19(Text19, { color: "gray", children: "(Loading...)" })
|
|
2819
3246
|
] }) }),
|
|
2820
|
-
/* @__PURE__ */
|
|
2821
|
-
/* @__PURE__ */
|
|
2822
|
-
/* @__PURE__ */
|
|
2823
|
-
/* @__PURE__ */
|
|
3247
|
+
/* @__PURE__ */ jsx19(Box18, { borderStyle: "single", borderColor: "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx19(Box18, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx19(Box18, { flexDirection: "column", alignItems: "center", children: /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", alignItems: "center", children: [
|
|
3248
|
+
/* @__PURE__ */ jsxs18(Box18, { height: 1, flexDirection: "row", children: [
|
|
3249
|
+
/* @__PURE__ */ jsx19(Box18, { width: 2, flexShrink: 0, flexGrow: 0, children: /* @__PURE__ */ jsx19(Text19, { color: "cyan", children: /* @__PURE__ */ jsx19(SlowSpinner, {}) }) }),
|
|
3250
|
+
/* @__PURE__ */ jsx19(Text19, { color: "cyan", children: refreshing ? "Refreshing..." : sortingLoading ? "Applying sort..." : "Loading repositories..." })
|
|
2824
3251
|
] }),
|
|
2825
|
-
/* @__PURE__ */
|
|
3252
|
+
/* @__PURE__ */ jsx19(Box18, { height: 1, marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "gray", children: refreshing ? "Fetching latest repository data" : sortingLoading ? `Sorting by ${sortKey} (${sortDir === "asc" ? "ascending" : "descending"})` : "Fetching your GitHub repositories" }) })
|
|
2826
3253
|
] }) }) }) }),
|
|
2827
|
-
/* @__PURE__ */
|
|
3254
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "gray", children: "Please wait..." }) })
|
|
2828
3255
|
] });
|
|
2829
3256
|
}
|
|
2830
|
-
return /* @__PURE__ */
|
|
3257
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", height: availableHeight, children: [
|
|
2831
3258
|
headerBar,
|
|
2832
|
-
/* @__PURE__ */
|
|
3259
|
+
showSponsorReminder && /* @__PURE__ */ jsx19(Box18, { marginX: 1, marginBottom: 1, children: /* @__PURE__ */ jsx19(Box18, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", alignItems: "center", children: [
|
|
3260
|
+
/* @__PURE__ */ jsx19(Text19, { color: "yellow", children: "\u{1F49A} Thanks for using gh-manager-cli!" }),
|
|
3261
|
+
/* @__PURE__ */ jsx19(Text19, { color: "gray", children: "Your support helps craft more open-source tools" }),
|
|
3262
|
+
/* @__PURE__ */ jsx19(Text19, { color: "cyan", children: "\u2615 buymeacoffee.com/wiiiimm" })
|
|
3263
|
+
] }) }) }),
|
|
3264
|
+
/* @__PURE__ */ jsx19(Box18, { borderStyle: "single", borderColor: modalOpen ? "gray" : "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: deleteMode && deleteTarget ? (
|
|
2833
3265
|
// Centered modal; hide list content while modal is open
|
|
2834
|
-
/* @__PURE__ */
|
|
2835
|
-
/* @__PURE__ */
|
|
2836
|
-
/* @__PURE__ */
|
|
2837
|
-
/* @__PURE__ */
|
|
3266
|
+
/* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
3267
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, children: "Delete Confirmation" }),
|
|
3268
|
+
/* @__PURE__ */ jsx19(Text19, { color: "red", children: "\u26A0\uFE0F Delete repository?" }),
|
|
3269
|
+
/* @__PURE__ */ jsx19(Box18, { height: 2, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
2838
3270
|
(() => {
|
|
2839
3271
|
const langName = deleteTarget.primaryLanguage?.name || "";
|
|
2840
3272
|
const langColor = deleteTarget.primaryLanguage?.color || "#666666";
|
|
@@ -2846,19 +3278,19 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2846
3278
|
let line2 = "";
|
|
2847
3279
|
if (langName) line2 += chalk13.hex(langColor)("\u25CF ") + chalk13.gray(`${langName} `);
|
|
2848
3280
|
line2 += chalk13.gray(`\u2605 ${deleteTarget.stargazerCount} \u2442 ${deleteTarget.forkCount} Updated ${formatDate(deleteTarget.updatedAt)}`);
|
|
2849
|
-
return /* @__PURE__ */
|
|
2850
|
-
/* @__PURE__ */
|
|
2851
|
-
/* @__PURE__ */
|
|
3281
|
+
return /* @__PURE__ */ jsxs18(Fragment10, { children: [
|
|
3282
|
+
/* @__PURE__ */ jsx19(Text19, { children: line1 }),
|
|
3283
|
+
/* @__PURE__ */ jsx19(Text19, { children: line2 })
|
|
2852
3284
|
] });
|
|
2853
3285
|
})(),
|
|
2854
|
-
/* @__PURE__ */
|
|
3286
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsxs18(Text19, { children: [
|
|
2855
3287
|
"Type ",
|
|
2856
|
-
/* @__PURE__ */
|
|
3288
|
+
/* @__PURE__ */ jsx19(Text19, { color: "yellow", bold: true, children: deleteCode }),
|
|
2857
3289
|
" to confirm."
|
|
2858
3290
|
] }) }),
|
|
2859
|
-
!deleteConfirmStage && /* @__PURE__ */
|
|
2860
|
-
/* @__PURE__ */
|
|
2861
|
-
/* @__PURE__ */
|
|
3291
|
+
!deleteConfirmStage && /* @__PURE__ */ jsxs18(Box18, { marginTop: 1, children: [
|
|
3292
|
+
/* @__PURE__ */ jsx19(Text19, { children: "Confirm code: " }),
|
|
3293
|
+
/* @__PURE__ */ jsx19(
|
|
2862
3294
|
TextInput5,
|
|
2863
3295
|
{
|
|
2864
3296
|
value: typedCode,
|
|
@@ -2885,11 +3317,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2885
3317
|
}
|
|
2886
3318
|
)
|
|
2887
3319
|
] }),
|
|
2888
|
-
deleteConfirmStage && /* @__PURE__ */
|
|
2889
|
-
/* @__PURE__ */
|
|
2890
|
-
/* @__PURE__ */
|
|
2891
|
-
/* @__PURE__ */
|
|
2892
|
-
|
|
3320
|
+
deleteConfirmStage && /* @__PURE__ */ jsxs18(Box18, { marginTop: 1, flexDirection: "column", children: [
|
|
3321
|
+
/* @__PURE__ */ jsx19(Text19, { color: "red", children: "This action will permanently delete the repository. This cannot be undone." }),
|
|
3322
|
+
/* @__PURE__ */ jsxs18(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3323
|
+
/* @__PURE__ */ jsx19(
|
|
3324
|
+
Box18,
|
|
2893
3325
|
{
|
|
2894
3326
|
borderStyle: "round",
|
|
2895
3327
|
borderColor: "red",
|
|
@@ -2898,11 +3330,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2898
3330
|
alignItems: "center",
|
|
2899
3331
|
justifyContent: "center",
|
|
2900
3332
|
flexDirection: "column",
|
|
2901
|
-
children: /* @__PURE__ */
|
|
3333
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: confirmFocus === "delete" ? chalk13.bgRed.white.bold(" Delete ") : chalk13.red.bold("Delete") })
|
|
2902
3334
|
}
|
|
2903
3335
|
),
|
|
2904
|
-
/* @__PURE__ */
|
|
2905
|
-
|
|
3336
|
+
/* @__PURE__ */ jsx19(
|
|
3337
|
+
Box18,
|
|
2906
3338
|
{
|
|
2907
3339
|
borderStyle: "round",
|
|
2908
3340
|
borderColor: confirmFocus === "cancel" ? "white" : "gray",
|
|
@@ -2911,16 +3343,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2911
3343
|
alignItems: "center",
|
|
2912
3344
|
justifyContent: "center",
|
|
2913
3345
|
flexDirection: "column",
|
|
2914
|
-
children: /* @__PURE__ */
|
|
3346
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: confirmFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
2915
3347
|
}
|
|
2916
3348
|
)
|
|
2917
3349
|
] }),
|
|
2918
|
-
/* @__PURE__ */
|
|
3350
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
2919
3351
|
"Press Enter to ",
|
|
2920
3352
|
confirmFocus === "delete" ? "Delete" : "Cancel",
|
|
2921
3353
|
" | Y to Delete | C to Cancel"
|
|
2922
3354
|
] }) }),
|
|
2923
|
-
/* @__PURE__ */
|
|
3355
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(
|
|
2924
3356
|
TextInput5,
|
|
2925
3357
|
{
|
|
2926
3358
|
value: "",
|
|
@@ -2934,18 +3366,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2934
3366
|
}
|
|
2935
3367
|
) })
|
|
2936
3368
|
] }),
|
|
2937
|
-
deleteError && /* @__PURE__ */
|
|
2938
|
-
deleting && /* @__PURE__ */
|
|
3369
|
+
deleteError && /* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "magenta", children: deleteError }) }),
|
|
3370
|
+
deleting && /* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "yellow", children: "Deleting..." }) })
|
|
2939
3371
|
] }) })
|
|
2940
|
-
) : archiveMode && archiveTarget ? /* @__PURE__ */
|
|
2941
|
-
/* @__PURE__ */
|
|
2942
|
-
/* @__PURE__ */
|
|
2943
|
-
/* @__PURE__ */
|
|
2944
|
-
/* @__PURE__ */
|
|
2945
|
-
/* @__PURE__ */
|
|
2946
|
-
/* @__PURE__ */
|
|
2947
|
-
/* @__PURE__ */
|
|
2948
|
-
|
|
3372
|
+
) : archiveMode && archiveTarget ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: archiveTarget.isArchived ? "green" : "yellow", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
3373
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, children: archiveTarget.isArchived ? "Unarchive Confirmation" : "Archive Confirmation" }),
|
|
3374
|
+
/* @__PURE__ */ jsx19(Text19, { color: archiveTarget.isArchived ? "green" : "yellow", children: archiveTarget.isArchived ? "\u21BA Unarchive repository?" : "\u26A0\uFE0F Archive repository?" }),
|
|
3375
|
+
/* @__PURE__ */ jsx19(Box18, { height: 1, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
3376
|
+
/* @__PURE__ */ jsx19(Text19, { children: archiveTarget.nameWithOwner }),
|
|
3377
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { children: archiveTarget.isArchived ? "This will make the repository active again." : "This will make the repository read-only." }) }),
|
|
3378
|
+
/* @__PURE__ */ jsxs18(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3379
|
+
/* @__PURE__ */ jsx19(
|
|
3380
|
+
Box18,
|
|
2949
3381
|
{
|
|
2950
3382
|
borderStyle: "round",
|
|
2951
3383
|
borderColor: archiveTarget.isArchived ? "green" : "yellow",
|
|
@@ -2954,11 +3386,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2954
3386
|
alignItems: "center",
|
|
2955
3387
|
justifyContent: "center",
|
|
2956
3388
|
flexDirection: "column",
|
|
2957
|
-
children: /* @__PURE__ */
|
|
3389
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: archiveFocus === "confirm" ? chalk13.bgGreen.white.bold(` ${archiveTarget.isArchived ? "Unarchive" : "Archive"} `) : chalk13.bold[archiveTarget.isArchived ? "green" : "yellow"](archiveTarget.isArchived ? "Unarchive" : "Archive") })
|
|
2958
3390
|
}
|
|
2959
3391
|
),
|
|
2960
|
-
/* @__PURE__ */
|
|
2961
|
-
|
|
3392
|
+
/* @__PURE__ */ jsx19(
|
|
3393
|
+
Box18,
|
|
2962
3394
|
{
|
|
2963
3395
|
borderStyle: "round",
|
|
2964
3396
|
borderColor: archiveFocus === "cancel" ? "white" : "gray",
|
|
@@ -2967,18 +3399,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2967
3399
|
alignItems: "center",
|
|
2968
3400
|
justifyContent: "center",
|
|
2969
3401
|
flexDirection: "column",
|
|
2970
|
-
children: /* @__PURE__ */
|
|
3402
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: archiveFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
2971
3403
|
}
|
|
2972
3404
|
)
|
|
2973
3405
|
] }),
|
|
2974
|
-
/* @__PURE__ */
|
|
3406
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
2975
3407
|
"Press Enter to ",
|
|
2976
3408
|
archiveFocus === "confirm" ? archiveTarget.isArchived ? "Unarchive" : "Archive" : "Cancel",
|
|
2977
3409
|
" | Y to ",
|
|
2978
3410
|
archiveTarget.isArchived ? "Unarchive" : "Archive",
|
|
2979
3411
|
" | C to Cancel"
|
|
2980
3412
|
] }) }),
|
|
2981
|
-
/* @__PURE__ */
|
|
3413
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(
|
|
2982
3414
|
TextInput5,
|
|
2983
3415
|
{
|
|
2984
3416
|
value: "",
|
|
@@ -2993,21 +3425,21 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2993
3425
|
}
|
|
2994
3426
|
}
|
|
2995
3427
|
) }),
|
|
2996
|
-
archiveError && /* @__PURE__ */
|
|
2997
|
-
archiving && /* @__PURE__ */
|
|
2998
|
-
] }) }) : syncMode && syncTarget ? /* @__PURE__ */
|
|
2999
|
-
/* @__PURE__ */
|
|
3000
|
-
/* @__PURE__ */
|
|
3001
|
-
/* @__PURE__ */
|
|
3002
|
-
/* @__PURE__ */
|
|
3003
|
-
syncTarget.parent && /* @__PURE__ */
|
|
3428
|
+
archiveError && /* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "magenta", children: archiveError }) }),
|
|
3429
|
+
archiving && /* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "yellow", children: archiveTarget.isArchived ? "Unarchiving..." : "Archiving..." }) })
|
|
3430
|
+
] }) }) : syncMode && syncTarget ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
3431
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, children: "Sync Fork Confirmation" }),
|
|
3432
|
+
/* @__PURE__ */ jsx19(Text19, { color: "blue", children: "\u27F2 Sync fork with upstream?" }),
|
|
3433
|
+
/* @__PURE__ */ jsx19(Box18, { height: 1, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
3434
|
+
/* @__PURE__ */ jsx19(Text19, { children: syncTarget.nameWithOwner }),
|
|
3435
|
+
syncTarget.parent && /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3004
3436
|
"Upstream: ",
|
|
3005
3437
|
syncTarget.parent.nameWithOwner
|
|
3006
3438
|
] }),
|
|
3007
|
-
/* @__PURE__ */
|
|
3008
|
-
/* @__PURE__ */
|
|
3009
|
-
/* @__PURE__ */
|
|
3010
|
-
|
|
3439
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { children: "This will merge upstream changes into your fork." }) }),
|
|
3440
|
+
/* @__PURE__ */ jsxs18(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3441
|
+
/* @__PURE__ */ jsx19(
|
|
3442
|
+
Box18,
|
|
3011
3443
|
{
|
|
3012
3444
|
borderStyle: "round",
|
|
3013
3445
|
borderColor: "blue",
|
|
@@ -3016,11 +3448,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3016
3448
|
alignItems: "center",
|
|
3017
3449
|
justifyContent: "center",
|
|
3018
3450
|
flexDirection: "column",
|
|
3019
|
-
children: /* @__PURE__ */
|
|
3451
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: syncFocus === "confirm" ? chalk13.bgBlue.white.bold(" Sync ") : chalk13.blue.bold("Sync") })
|
|
3020
3452
|
}
|
|
3021
3453
|
),
|
|
3022
|
-
/* @__PURE__ */
|
|
3023
|
-
|
|
3454
|
+
/* @__PURE__ */ jsx19(
|
|
3455
|
+
Box18,
|
|
3024
3456
|
{
|
|
3025
3457
|
borderStyle: "round",
|
|
3026
3458
|
borderColor: syncFocus === "cancel" ? "white" : "gray",
|
|
@@ -3029,16 +3461,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3029
3461
|
alignItems: "center",
|
|
3030
3462
|
justifyContent: "center",
|
|
3031
3463
|
flexDirection: "column",
|
|
3032
|
-
children: /* @__PURE__ */
|
|
3464
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: syncFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
3033
3465
|
}
|
|
3034
3466
|
)
|
|
3035
3467
|
] }),
|
|
3036
|
-
/* @__PURE__ */
|
|
3468
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3037
3469
|
"Press Enter to ",
|
|
3038
3470
|
syncFocus === "confirm" ? "Sync" : "Cancel",
|
|
3039
3471
|
" | Y to Sync | C to Cancel"
|
|
3040
3472
|
] }) }),
|
|
3041
|
-
/* @__PURE__ */
|
|
3473
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(
|
|
3042
3474
|
TextInput5,
|
|
3043
3475
|
{
|
|
3044
3476
|
value: "",
|
|
@@ -3053,14 +3485,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3053
3485
|
}
|
|
3054
3486
|
}
|
|
3055
3487
|
) }),
|
|
3056
|
-
syncError && /* @__PURE__ */
|
|
3057
|
-
syncing && /* @__PURE__ */
|
|
3058
|
-
] }) }) : logoutMode ? /* @__PURE__ */
|
|
3059
|
-
/* @__PURE__ */
|
|
3060
|
-
/* @__PURE__ */
|
|
3061
|
-
/* @__PURE__ */
|
|
3062
|
-
/* @__PURE__ */
|
|
3063
|
-
|
|
3488
|
+
syncError && /* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "magenta", children: syncError }) }),
|
|
3489
|
+
syncing && /* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "yellow", children: "Syncing..." }) })
|
|
3490
|
+
] }) }) : logoutMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
3491
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, children: "Logout Confirmation" }),
|
|
3492
|
+
/* @__PURE__ */ jsx19(Text19, { color: "cyan", children: "Are you sure you want to log out?" }),
|
|
3493
|
+
/* @__PURE__ */ jsxs18(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3494
|
+
/* @__PURE__ */ jsx19(
|
|
3495
|
+
Box18,
|
|
3064
3496
|
{
|
|
3065
3497
|
borderStyle: "round",
|
|
3066
3498
|
borderColor: "cyan",
|
|
@@ -3069,11 +3501,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3069
3501
|
alignItems: "center",
|
|
3070
3502
|
justifyContent: "center",
|
|
3071
3503
|
flexDirection: "column",
|
|
3072
|
-
children: /* @__PURE__ */
|
|
3504
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: logoutFocus === "confirm" ? chalk13.bgCyan.white.bold(" Logout ") : chalk13.cyan.bold("Logout") })
|
|
3073
3505
|
}
|
|
3074
3506
|
),
|
|
3075
|
-
/* @__PURE__ */
|
|
3076
|
-
|
|
3507
|
+
/* @__PURE__ */ jsx19(
|
|
3508
|
+
Box18,
|
|
3077
3509
|
{
|
|
3078
3510
|
borderStyle: "round",
|
|
3079
3511
|
borderColor: logoutFocus === "cancel" ? "white" : "gray",
|
|
@@ -3082,16 +3514,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3082
3514
|
alignItems: "center",
|
|
3083
3515
|
justifyContent: "center",
|
|
3084
3516
|
flexDirection: "column",
|
|
3085
|
-
children: /* @__PURE__ */
|
|
3517
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: logoutFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
3086
3518
|
}
|
|
3087
3519
|
)
|
|
3088
3520
|
] }),
|
|
3089
|
-
/* @__PURE__ */
|
|
3521
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3090
3522
|
"Press Enter to ",
|
|
3091
3523
|
logoutFocus === "confirm" ? "Logout" : "Cancel",
|
|
3092
3524
|
" | Y to Logout | C to Cancel"
|
|
3093
3525
|
] }) })
|
|
3094
|
-
] }) }) : orgSwitcherOpen ? /* @__PURE__ */
|
|
3526
|
+
] }) }) : orgSwitcherOpen ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3095
3527
|
OrgSwitcher,
|
|
3096
3528
|
{
|
|
3097
3529
|
token,
|
|
@@ -3099,45 +3531,45 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3099
3531
|
onSelect: handleOrgContextChange,
|
|
3100
3532
|
onClose: () => setOrgSwitcherOpen(false)
|
|
3101
3533
|
}
|
|
3102
|
-
) }) : infoMode ? /* @__PURE__ */
|
|
3534
|
+
) }) : infoMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: (() => {
|
|
3103
3535
|
const repo = infoRepo || visibleItems[cursor];
|
|
3104
|
-
if (!repo) return /* @__PURE__ */
|
|
3536
|
+
if (!repo) return /* @__PURE__ */ jsx19(Text19, { color: "red", children: "No repository selected." });
|
|
3105
3537
|
const langName = repo.primaryLanguage?.name || "N/A";
|
|
3106
3538
|
const langColor = repo.primaryLanguage?.color || "#666666";
|
|
3107
|
-
return /* @__PURE__ */
|
|
3108
|
-
/* @__PURE__ */
|
|
3539
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 90), children: [
|
|
3540
|
+
/* @__PURE__ */ jsxs18(Text19, { bold: true, children: [
|
|
3109
3541
|
"Repository Info ",
|
|
3110
3542
|
infoRepo ? chalk13.dim("(cached)") : ""
|
|
3111
3543
|
] }),
|
|
3112
|
-
/* @__PURE__ */
|
|
3113
|
-
/* @__PURE__ */
|
|
3114
|
-
repo.description && /* @__PURE__ */
|
|
3115
|
-
/* @__PURE__ */
|
|
3116
|
-
/* @__PURE__ */
|
|
3544
|
+
/* @__PURE__ */ jsx19(Box18, { height: 1, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
3545
|
+
/* @__PURE__ */ jsx19(Text19, { children: chalk13.bold(repo.nameWithOwner) }),
|
|
3546
|
+
repo.description && /* @__PURE__ */ jsx19(Text19, { color: "gray", children: repo.description }),
|
|
3547
|
+
/* @__PURE__ */ jsx19(Box18, { height: 1, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
3548
|
+
/* @__PURE__ */ jsxs18(Text19, { children: [
|
|
3117
3549
|
repo.visibility === "PRIVATE" ? chalk13.yellow("Private") : repo.visibility === "INTERNAL" ? chalk13.magenta("Internal") : chalk13.green("Public"),
|
|
3118
3550
|
repo.isArchived ? chalk13.gray(" Archived") : "",
|
|
3119
3551
|
repo.isFork ? chalk13.blue(" Fork") : ""
|
|
3120
3552
|
] }),
|
|
3121
|
-
/* @__PURE__ */
|
|
3122
|
-
/* @__PURE__ */
|
|
3553
|
+
/* @__PURE__ */ jsx19(Text19, { children: chalk13.gray(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount}`) }),
|
|
3554
|
+
/* @__PURE__ */ jsxs18(Text19, { children: [
|
|
3123
3555
|
chalk13.hex(langColor)(`\u25CF `),
|
|
3124
3556
|
chalk13.gray(`${langName}`)
|
|
3125
3557
|
] }),
|
|
3126
|
-
/* @__PURE__ */
|
|
3558
|
+
/* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3127
3559
|
"Updated: ",
|
|
3128
3560
|
formatDate(repo.updatedAt),
|
|
3129
3561
|
" \u2022 Pushed: ",
|
|
3130
3562
|
formatDate(repo.pushedAt)
|
|
3131
3563
|
] }),
|
|
3132
|
-
/* @__PURE__ */
|
|
3564
|
+
/* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3133
3565
|
"Size: ",
|
|
3134
3566
|
repo.diskUsage,
|
|
3135
3567
|
" KB"
|
|
3136
3568
|
] }),
|
|
3137
|
-
/* @__PURE__ */
|
|
3138
|
-
/* @__PURE__ */
|
|
3569
|
+
/* @__PURE__ */ jsx19(Box18, { height: 1, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
3570
|
+
/* @__PURE__ */ jsx19(Text19, { color: "gray", children: "Press Esc or I to close" })
|
|
3139
3571
|
] });
|
|
3140
|
-
})() }) : visibilityMode ? /* @__PURE__ */
|
|
3572
|
+
})() }) : visibilityMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3141
3573
|
VisibilityModal,
|
|
3142
3574
|
{
|
|
3143
3575
|
currentFilter: visibilityFilter,
|
|
@@ -3150,7 +3582,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3150
3582
|
},
|
|
3151
3583
|
onCancel: () => setVisibilityMode(false)
|
|
3152
3584
|
}
|
|
3153
|
-
) }) : sortMode ? /* @__PURE__ */
|
|
3585
|
+
) }) : sortMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3154
3586
|
SortModal,
|
|
3155
3587
|
{
|
|
3156
3588
|
currentSort: sortKey,
|
|
@@ -3162,7 +3594,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3162
3594
|
},
|
|
3163
3595
|
onCancel: () => setSortMode(false)
|
|
3164
3596
|
}
|
|
3165
|
-
) }) : sortDirectionMode ? /* @__PURE__ */
|
|
3597
|
+
) }) : sortDirectionMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3166
3598
|
SortDirectionModal,
|
|
3167
3599
|
{
|
|
3168
3600
|
currentDirection: sortDir,
|
|
@@ -3175,7 +3607,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3175
3607
|
},
|
|
3176
3608
|
onCancel: () => setSortDirectionMode(false)
|
|
3177
3609
|
}
|
|
3178
|
-
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */
|
|
3610
|
+
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3179
3611
|
ChangeVisibilityModal,
|
|
3180
3612
|
{
|
|
3181
3613
|
isOpen: changeVisibilityMode,
|
|
@@ -3188,14 +3620,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3188
3620
|
changing: changingVisibility,
|
|
3189
3621
|
error: changeVisibilityError
|
|
3190
3622
|
}
|
|
3191
|
-
) }) : renameMode && renameTarget ? /* @__PURE__ */
|
|
3623
|
+
) }) : renameMode && renameTarget ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3192
3624
|
RenameModal,
|
|
3193
3625
|
{
|
|
3194
3626
|
repo: renameTarget,
|
|
3195
3627
|
onRename: executeRename,
|
|
3196
3628
|
onCancel: closeRenameModal
|
|
3197
3629
|
}
|
|
3198
|
-
) }) : copyUrlMode ? /* @__PURE__ */
|
|
3630
|
+
) }) : copyUrlMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3199
3631
|
CopyUrlModal,
|
|
3200
3632
|
{
|
|
3201
3633
|
repo: copyUrlTarget,
|
|
@@ -3203,8 +3635,29 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3203
3635
|
onClose: closeCopyUrlModal,
|
|
3204
3636
|
onCopy: handleCopyUrl
|
|
3205
3637
|
}
|
|
3206
|
-
) }) : /* @__PURE__ */
|
|
3207
|
-
|
|
3638
|
+
) }) : unstarMode && unstarTarget ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3639
|
+
UnstarModal,
|
|
3640
|
+
{
|
|
3641
|
+
visible: unstarMode,
|
|
3642
|
+
repo: unstarTarget,
|
|
3643
|
+
onConfirm: handleUnstar,
|
|
3644
|
+
onCancel: closeUnstarModal,
|
|
3645
|
+
isUnstarring: unstarring,
|
|
3646
|
+
error: unstarError
|
|
3647
|
+
}
|
|
3648
|
+
) }) : starMode && starTarget ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3649
|
+
StarModal,
|
|
3650
|
+
{
|
|
3651
|
+
visible: starMode,
|
|
3652
|
+
repo: starTarget,
|
|
3653
|
+
isStarred: starTarget.viewerHasStarred || false,
|
|
3654
|
+
onConfirm: handleStar,
|
|
3655
|
+
onCancel: closeStarModal,
|
|
3656
|
+
isStarring: starring,
|
|
3657
|
+
error: starError
|
|
3658
|
+
}
|
|
3659
|
+
) }) : /* @__PURE__ */ jsxs18(Fragment10, { children: [
|
|
3660
|
+
/* @__PURE__ */ jsx19(
|
|
3208
3661
|
RepoListHeader,
|
|
3209
3662
|
{
|
|
3210
3663
|
ownerContext,
|
|
@@ -3215,12 +3668,13 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3215
3668
|
searchActive,
|
|
3216
3669
|
searchLoading,
|
|
3217
3670
|
visibilityFilter,
|
|
3218
|
-
isEnterprise: isEnterpriseOrg
|
|
3671
|
+
isEnterprise: isEnterpriseOrg,
|
|
3672
|
+
starsMode
|
|
3219
3673
|
}
|
|
3220
3674
|
),
|
|
3221
|
-
filterMode && /* @__PURE__ */
|
|
3222
|
-
/* @__PURE__ */
|
|
3223
|
-
/* @__PURE__ */
|
|
3675
|
+
filterMode && /* @__PURE__ */ jsxs18(Box18, { marginBottom: 1, children: [
|
|
3676
|
+
/* @__PURE__ */ jsx19(Text19, { children: "Search: " }),
|
|
3677
|
+
/* @__PURE__ */ jsx19(
|
|
3224
3678
|
TextInput5,
|
|
3225
3679
|
{
|
|
3226
3680
|
value: filter,
|
|
@@ -3256,14 +3710,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3256
3710
|
onSubmit: () => {
|
|
3257
3711
|
setFilterMode(false);
|
|
3258
3712
|
},
|
|
3259
|
-
placeholder: "Type to search (3+ chars for server search)..."
|
|
3713
|
+
placeholder: starsMode ? "Type to filter starred repositories..." : "Type to search (3+ chars for server search)..."
|
|
3260
3714
|
}
|
|
3261
3715
|
)
|
|
3262
3716
|
] }),
|
|
3263
|
-
/* @__PURE__ */
|
|
3264
|
-
filterMode && filter.trim().length > 0 && filter.trim().length < 3 ? /* @__PURE__ */
|
|
3717
|
+
/* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", height: listHeight, children: [
|
|
3718
|
+
filterMode && filter.trim().length > 0 && filter.trim().length < 3 ? /* @__PURE__ */ jsx19(Box18, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "gray", dimColor: true, children: "Type at least 3 characters to search" }) }) : visibleItems.slice(windowed.start, windowed.end).map((repo, i) => {
|
|
3265
3719
|
const idx = windowed.start + i;
|
|
3266
|
-
return /* @__PURE__ */
|
|
3720
|
+
return /* @__PURE__ */ jsx19(
|
|
3267
3721
|
RepoRow,
|
|
3268
3722
|
{
|
|
3269
3723
|
repo,
|
|
@@ -3271,39 +3725,45 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3271
3725
|
index: idx + 1,
|
|
3272
3726
|
maxWidth: terminalWidth - 6,
|
|
3273
3727
|
spacingLines,
|
|
3274
|
-
forkTracking
|
|
3728
|
+
forkTracking,
|
|
3729
|
+
starsMode
|
|
3275
3730
|
},
|
|
3276
3731
|
repo.nameWithOwner
|
|
3277
3732
|
);
|
|
3278
3733
|
}),
|
|
3279
|
-
loadingMore && hasNextPage && /* @__PURE__ */
|
|
3280
|
-
/* @__PURE__ */
|
|
3281
|
-
/* @__PURE__ */
|
|
3734
|
+
loadingMore && hasNextPage && /* @__PURE__ */ jsx19(Box18, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", children: [
|
|
3735
|
+
/* @__PURE__ */ jsx19(Box18, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "cyan", children: /* @__PURE__ */ jsx19(SlowSpinner, {}) }) }),
|
|
3736
|
+
/* @__PURE__ */ jsx19(Text19, { color: "cyan", children: "Loading more repositories..." })
|
|
3282
3737
|
] }) }),
|
|
3283
|
-
!loading && !searchLoading && visibleItems.length === 0 && /* @__PURE__ */
|
|
3738
|
+
!loading && !searchLoading && visibleItems.length === 0 && /* @__PURE__ */ jsx19(Box18, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "gray", dimColor: true, children: searchActive ? "No repositories match your search" : filter ? "No repositories match your filter" : "No repositories found" }) })
|
|
3284
3739
|
] })
|
|
3285
3740
|
] }) }),
|
|
3286
|
-
/* @__PURE__ */
|
|
3287
|
-
/* @__PURE__ */
|
|
3288
|
-
/* @__PURE__ */
|
|
3289
|
-
|
|
3290
|
-
|
|
3741
|
+
/* @__PURE__ */ jsxs18(Box18, { marginTop: 1, paddingX: 1, flexDirection: "column", children: [
|
|
3742
|
+
/* @__PURE__ */ jsx19(Box18, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx19(Text19, { color: "gray", dimColor: modalOpen ? true : void 0, children: "\u2191\u2193 Navigate \u2022 Ctrl+G Top \u2022 G Bottom \u2022 \u23CE/O Open \u2022 R Refresh" }) }),
|
|
3743
|
+
/* @__PURE__ */ jsx19(Box18, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", dimColor: modalOpen ? true : void 0, children: [
|
|
3744
|
+
"/ Search \u2022 S Sort \u2022 D Direction \u2022 T Density",
|
|
3745
|
+
!starsMode && " \u2022 V Visibility",
|
|
3746
|
+
ownerContext === "personal" && " \u2022 Shift+S Stars"
|
|
3747
|
+
] }) }),
|
|
3748
|
+
/* @__PURE__ */ jsx19(Box18, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx19(Text19, { color: "gray", dimColor: modalOpen ? true : void 0, children: starsMode ? "I Info \u2022 C Copy URL \u2022 U Unstar Repository" : "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" }) }),
|
|
3749
|
+
/* @__PURE__ */ jsx19(Box18, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx19(Text19, { color: "gray", dimColor: modalOpen ? true : void 0, children: "K Cache Info \u2022 W Org Switch \u2022 Del/Backspace Delete \u2022 Ctrl+L Logout \u2022 Q Quit" }) }),
|
|
3750
|
+
/* @__PURE__ */ jsx19(Box18, { width: terminalWidth, justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "yellow", dimColor: modalOpen ? true : void 0, children: "\u{1F49A} Support the project: buymeacoffee.com/wiiiimm" }) })
|
|
3291
3751
|
] }),
|
|
3292
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
3293
|
-
/* @__PURE__ */
|
|
3294
|
-
debugMessages.length === 0 ? /* @__PURE__ */
|
|
3752
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsxs18(Box18, { marginTop: 1, borderStyle: "single", borderColor: "yellow", paddingX: 1, flexDirection: "column", children: [
|
|
3753
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, color: "yellow", children: "Debug Messages:" }),
|
|
3754
|
+
debugMessages.length === 0 ? /* @__PURE__ */ jsx19(Text19, { color: "gray", children: "No debug messages yet..." }) : debugMessages.map((msg, i) => /* @__PURE__ */ jsx19(Text19, { color: "gray", children: msg }, i))
|
|
3295
3755
|
] }),
|
|
3296
|
-
copyToast && /* @__PURE__ */
|
|
3756
|
+
copyToast && /* @__PURE__ */ jsx19(Box18, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx19(Box18, { borderStyle: "round", borderColor: copyToast.includes("Failed") ? "red" : "green", paddingX: 2, paddingY: 0, children: /* @__PURE__ */ jsx19(Text19, { color: copyToast.includes("Failed") ? "red" : "green", children: copyToast }) }) })
|
|
3297
3757
|
] });
|
|
3298
3758
|
}
|
|
3299
3759
|
|
|
3300
3760
|
// src/ui/components/auth/AuthMethodSelector.tsx
|
|
3301
|
-
import { useState as
|
|
3302
|
-
import { Box as
|
|
3761
|
+
import { useState as useState16 } from "react";
|
|
3762
|
+
import { Box as Box19, Text as Text20, useInput as useInput16 } from "ink";
|
|
3303
3763
|
import chalk14 from "chalk";
|
|
3304
|
-
import { jsx as
|
|
3764
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3305
3765
|
function AuthMethodSelector({ onSelect, onQuit }) {
|
|
3306
|
-
const [selectedIndex, setSelectedIndex] =
|
|
3766
|
+
const [selectedIndex, setSelectedIndex] = useState16(0);
|
|
3307
3767
|
const methods = [
|
|
3308
3768
|
{
|
|
3309
3769
|
key: "oauth",
|
|
@@ -3316,7 +3776,7 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3316
3776
|
description: "Manually enter a GitHub Personal Access Token"
|
|
3317
3777
|
}
|
|
3318
3778
|
];
|
|
3319
|
-
|
|
3779
|
+
useInput16((input, key) => {
|
|
3320
3780
|
if (key.escape || input?.toLowerCase() === "q") {
|
|
3321
3781
|
if (onQuit) {
|
|
3322
3782
|
onQuit();
|
|
@@ -3335,33 +3795,33 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3335
3795
|
onSelect("pat");
|
|
3336
3796
|
}
|
|
3337
3797
|
});
|
|
3338
|
-
return /* @__PURE__ */
|
|
3339
|
-
/* @__PURE__ */
|
|
3340
|
-
/* @__PURE__ */
|
|
3798
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, children: [
|
|
3799
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, marginBottom: 1, children: "Choose Authentication Method" }),
|
|
3800
|
+
/* @__PURE__ */ jsx20(Box19, { flexDirection: "column", marginY: 1, children: methods.map((method, index) => {
|
|
3341
3801
|
const isSelected = index === selectedIndex;
|
|
3342
3802
|
const prefix = isSelected ? chalk14.cyan("\u203A") : " ";
|
|
3343
3803
|
const numberPrefix = `${index + 1}.`;
|
|
3344
|
-
return /* @__PURE__ */
|
|
3345
|
-
/* @__PURE__ */
|
|
3804
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", marginBottom: 1, children: [
|
|
3805
|
+
/* @__PURE__ */ jsx20(Text20, { children: /* @__PURE__ */ jsxs19(Text20, { color: isSelected ? "cyan" : void 0, bold: isSelected, children: [
|
|
3346
3806
|
prefix,
|
|
3347
3807
|
" ",
|
|
3348
3808
|
numberPrefix,
|
|
3349
3809
|
" ",
|
|
3350
3810
|
method.label
|
|
3351
3811
|
] }) }),
|
|
3352
|
-
/* @__PURE__ */
|
|
3812
|
+
/* @__PURE__ */ jsxs19(Text20, { color: "gray", dimColor: true, children: [
|
|
3353
3813
|
" ",
|
|
3354
3814
|
method.description
|
|
3355
3815
|
] })
|
|
3356
3816
|
] }, method.key);
|
|
3357
3817
|
}) }),
|
|
3358
|
-
/* @__PURE__ */
|
|
3818
|
+
/* @__PURE__ */ jsx20(Text20, { color: "gray", dimColor: true, marginTop: 1, children: "Use arrow keys to navigate, Enter to select, or press 1/2 \u2022 Q/Esc to quit" })
|
|
3359
3819
|
] });
|
|
3360
3820
|
}
|
|
3361
3821
|
|
|
3362
3822
|
// src/ui/components/auth/OAuthProgress.tsx
|
|
3363
|
-
import { Box as
|
|
3364
|
-
import { jsx as
|
|
3823
|
+
import { Box as Box20, Text as Text21 } from "ink";
|
|
3824
|
+
import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3365
3825
|
function OAuthProgress({ status, error, deviceCode }) {
|
|
3366
3826
|
const statusMessages = {
|
|
3367
3827
|
initializing: {
|
|
@@ -3398,69 +3858,69 @@ function OAuthProgress({ status, error, deviceCode }) {
|
|
|
3398
3858
|
}
|
|
3399
3859
|
};
|
|
3400
3860
|
const { message, showSpinner } = statusMessages[status];
|
|
3401
|
-
return /* @__PURE__ */
|
|
3402
|
-
/* @__PURE__ */
|
|
3403
|
-
/* @__PURE__ */
|
|
3404
|
-
/* @__PURE__ */
|
|
3405
|
-
/* @__PURE__ */
|
|
3861
|
+
return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "single", borderColor: status === "error" ? "red" : "cyan", paddingX: 2, paddingY: 1, children: [
|
|
3862
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, marginBottom: 1, children: "GitHub OAuth Authentication" }),
|
|
3863
|
+
/* @__PURE__ */ jsx21(Box20, { marginY: 1, children: showSpinner ? /* @__PURE__ */ jsxs20(Box20, { children: [
|
|
3864
|
+
/* @__PURE__ */ jsx21(Text21, { color: "green", children: /* @__PURE__ */ jsx21(SlowSpinner, { interval: 2e3 }) }),
|
|
3865
|
+
/* @__PURE__ */ jsxs20(Text21, { children: [
|
|
3406
3866
|
" ",
|
|
3407
3867
|
message
|
|
3408
3868
|
] })
|
|
3409
|
-
] }) : /* @__PURE__ */
|
|
3869
|
+
] }) : /* @__PURE__ */ jsxs20(Text21, { color: status === "error" ? "red" : "green", children: [
|
|
3410
3870
|
status === "error" ? "\u2717" : "\u2713",
|
|
3411
3871
|
" ",
|
|
3412
3872
|
message
|
|
3413
3873
|
] }) }),
|
|
3414
|
-
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */
|
|
3415
|
-
/* @__PURE__ */
|
|
3416
|
-
/* @__PURE__ */
|
|
3417
|
-
/* @__PURE__ */
|
|
3418
|
-
/* @__PURE__ */
|
|
3874
|
+
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */ jsxs20(Box20, { marginY: 1, flexDirection: "column", children: [
|
|
3875
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, color: "cyan", marginBottom: 1, children: "\u{1F4CB} Please complete these steps:" }),
|
|
3876
|
+
/* @__PURE__ */ jsxs20(Box20, { marginBottom: 1, children: [
|
|
3877
|
+
/* @__PURE__ */ jsx21(Text21, { children: "1. Visit: " }),
|
|
3878
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, color: "blue", children: deviceCode.verification_uri })
|
|
3419
3879
|
] }),
|
|
3420
|
-
/* @__PURE__ */
|
|
3421
|
-
/* @__PURE__ */
|
|
3422
|
-
/* @__PURE__ */
|
|
3880
|
+
/* @__PURE__ */ jsxs20(Box20, { marginBottom: 1, flexDirection: "column", children: [
|
|
3881
|
+
/* @__PURE__ */ jsx21(Text21, { children: "2. Enter this code:" }),
|
|
3882
|
+
/* @__PURE__ */ jsx21(Box20, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { bold: true, color: "yellow", children: deviceCode.user_code }) })
|
|
3423
3883
|
] }),
|
|
3424
|
-
status === "waiting_for_authorization" && /* @__PURE__ */
|
|
3425
|
-
status === "polling_for_token" && /* @__PURE__ */
|
|
3426
|
-
/* @__PURE__ */
|
|
3427
|
-
/* @__PURE__ */
|
|
3884
|
+
status === "waiting_for_authorization" && /* @__PURE__ */ jsx21(Text21, { color: "gray", marginTop: 1, children: "Your browser should open automatically." }),
|
|
3885
|
+
status === "polling_for_token" && /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", marginTop: 1, children: [
|
|
3886
|
+
/* @__PURE__ */ jsx21(Text21, { color: "gray", children: "Waiting for you to complete authorization in your browser..." }),
|
|
3887
|
+
/* @__PURE__ */ jsx21(Text21, { color: "gray", dimColor: true, marginTop: 1, children: "This will timeout in 15 minutes. Press Esc to cancel." })
|
|
3428
3888
|
] })
|
|
3429
3889
|
] }),
|
|
3430
|
-
status === "error" && error && /* @__PURE__ */
|
|
3431
|
-
/* @__PURE__ */
|
|
3432
|
-
/* @__PURE__ */
|
|
3890
|
+
status === "error" && error && /* @__PURE__ */ jsxs20(Box20, { marginY: 1, flexDirection: "column", children: [
|
|
3891
|
+
/* @__PURE__ */ jsx21(Text21, { color: "red", children: error }),
|
|
3892
|
+
/* @__PURE__ */ jsx21(Text21, { color: "gray", marginTop: 1, children: "Press Esc to go back and try again." })
|
|
3433
3893
|
] }),
|
|
3434
|
-
status === "success" && /* @__PURE__ */
|
|
3894
|
+
status === "success" && /* @__PURE__ */ jsx21(Text21, { color: "gray", marginTop: 1, children: "Returning to application..." })
|
|
3435
3895
|
] });
|
|
3436
3896
|
}
|
|
3437
3897
|
|
|
3438
3898
|
// src/ui/App.tsx
|
|
3439
|
-
import { jsx as
|
|
3899
|
+
import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3440
3900
|
var packageJson = require_package();
|
|
3441
3901
|
function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlineTokenEphemeral }) {
|
|
3442
3902
|
const { exit } = useApp2();
|
|
3443
3903
|
const { stdout } = useStdout2();
|
|
3444
|
-
const [mode, setMode] =
|
|
3445
|
-
const [token, setToken] =
|
|
3446
|
-
const [input, setInput] =
|
|
3447
|
-
const [error, setError] =
|
|
3448
|
-
const [viewer, setViewer] =
|
|
3449
|
-
const [rateLimitReset, setRateLimitReset] =
|
|
3450
|
-
const [wasRateLimited, setWasRateLimited] =
|
|
3451
|
-
const [orgContext, setOrgContext] =
|
|
3452
|
-
const [authMethod, setAuthMethod] =
|
|
3453
|
-
const [oauthStatus, setOAuthStatus] =
|
|
3454
|
-
const [tokenSource, setTokenSource] =
|
|
3455
|
-
const [sessionTokenOrigin, setSessionTokenOrigin] =
|
|
3456
|
-
const [deviceCodeResponse, setDeviceCodeResponse] =
|
|
3457
|
-
const [oauthDeviceCode, setOauthDeviceCode] =
|
|
3458
|
-
const [dims, setDims] =
|
|
3904
|
+
const [mode, setMode] = useState17("checking");
|
|
3905
|
+
const [token, setToken] = useState17(null);
|
|
3906
|
+
const [input, setInput] = useState17("");
|
|
3907
|
+
const [error, setError] = useState17(null);
|
|
3908
|
+
const [viewer, setViewer] = useState17(null);
|
|
3909
|
+
const [rateLimitReset, setRateLimitReset] = useState17(null);
|
|
3910
|
+
const [wasRateLimited, setWasRateLimited] = useState17(false);
|
|
3911
|
+
const [orgContext, setOrgContext] = useState17("personal");
|
|
3912
|
+
const [authMethod, setAuthMethod] = useState17("pat");
|
|
3913
|
+
const [oauthStatus, setOAuthStatus] = useState17("initializing");
|
|
3914
|
+
const [tokenSource, setTokenSource] = useState17("pat");
|
|
3915
|
+
const [sessionTokenOrigin, setSessionTokenOrigin] = useState17("stored");
|
|
3916
|
+
const [deviceCodeResponse, setDeviceCodeResponse] = useState17(null);
|
|
3917
|
+
const [oauthDeviceCode, setOauthDeviceCode] = useState17(null);
|
|
3918
|
+
const [dims, setDims] = useState17(() => {
|
|
3459
3919
|
const cols = stdout?.columns ?? 100;
|
|
3460
3920
|
const rows = stdout?.rows ?? 30;
|
|
3461
3921
|
return { cols, rows };
|
|
3462
3922
|
});
|
|
3463
|
-
|
|
3923
|
+
useEffect12(() => {
|
|
3464
3924
|
if (!stdout) return;
|
|
3465
3925
|
const onResize = () => {
|
|
3466
3926
|
const cols = stdout.columns ?? 100;
|
|
@@ -3472,7 +3932,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3472
3932
|
stdout.off?.("resize", onResize);
|
|
3473
3933
|
};
|
|
3474
3934
|
}, [stdout]);
|
|
3475
|
-
|
|
3935
|
+
useEffect12(() => {
|
|
3476
3936
|
const env = getTokenFromEnv();
|
|
3477
3937
|
const stored = getStoredToken();
|
|
3478
3938
|
const source = getTokenSource();
|
|
@@ -3496,7 +3956,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3496
3956
|
setMode("auth_method_selection");
|
|
3497
3957
|
}
|
|
3498
3958
|
}, [inlineToken2]);
|
|
3499
|
-
|
|
3959
|
+
useEffect12(() => {
|
|
3500
3960
|
if (mode !== "oauth_flow") return;
|
|
3501
3961
|
(async () => {
|
|
3502
3962
|
try {
|
|
@@ -3548,7 +4008,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3548
4008
|
setMode("oauth_flow");
|
|
3549
4009
|
}
|
|
3550
4010
|
};
|
|
3551
|
-
|
|
4011
|
+
useEffect12(() => {
|
|
3552
4012
|
(async () => {
|
|
3553
4013
|
if (mode !== "validating" || !token) return;
|
|
3554
4014
|
const timeoutId = setTimeout(() => {
|
|
@@ -3660,7 +4120,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3660
4120
|
setTokenSource("pat");
|
|
3661
4121
|
setMode("auth_method_selection");
|
|
3662
4122
|
};
|
|
3663
|
-
|
|
4123
|
+
useInput17((input2, key) => {
|
|
3664
4124
|
if ((mode === "prompt" || mode === "auth_method_selection") && key.escape) {
|
|
3665
4125
|
exit();
|
|
3666
4126
|
}
|
|
@@ -3692,19 +4152,19 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3692
4152
|
}
|
|
3693
4153
|
});
|
|
3694
4154
|
const verticalPadding = Math.floor(dims.rows * 0.05);
|
|
3695
|
-
const header = useMemo2(() => /* @__PURE__ */
|
|
3696
|
-
/* @__PURE__ */
|
|
3697
|
-
/* @__PURE__ */
|
|
4155
|
+
const header = useMemo2(() => /* @__PURE__ */ jsxs21(Box21, { flexDirection: "row", justifyContent: "space-between", marginBottom: 1, children: [
|
|
4156
|
+
/* @__PURE__ */ jsxs21(Box21, { flexDirection: "row", gap: 1, children: [
|
|
4157
|
+
/* @__PURE__ */ jsxs21(Text22, { bold: true, color: "cyan", children: [
|
|
3698
4158
|
" ",
|
|
3699
4159
|
"GitHub Repository Manager"
|
|
3700
4160
|
] }),
|
|
3701
|
-
/* @__PURE__ */
|
|
4161
|
+
/* @__PURE__ */ jsxs21(Text22, { color: "gray", dimColor: true, children: [
|
|
3702
4162
|
"v",
|
|
3703
4163
|
packageJson.version
|
|
3704
4164
|
] }),
|
|
3705
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
4165
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsx22(Text22, { backgroundColor: "blue", color: "white", children: " debug mode " })
|
|
3706
4166
|
] }),
|
|
3707
|
-
viewer && /* @__PURE__ */
|
|
4167
|
+
viewer && /* @__PURE__ */ jsx22(Text22, { color: "gray", children: orgContext !== "personal" && orgContext.login ? `${orgContext.login}/@${viewer} ` : `@${viewer} ` })
|
|
3708
4168
|
] }), [viewer, orgContext]);
|
|
3709
4169
|
if (mode === "rate_limited") {
|
|
3710
4170
|
const formatResetTime = (resetTime) => {
|
|
@@ -3727,70 +4187,70 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3727
4187
|
return "Unknown";
|
|
3728
4188
|
}
|
|
3729
4189
|
};
|
|
3730
|
-
return /* @__PURE__ */
|
|
4190
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3731
4191
|
header,
|
|
3732
|
-
/* @__PURE__ */
|
|
3733
|
-
/* @__PURE__ */
|
|
3734
|
-
/* @__PURE__ */
|
|
3735
|
-
/* @__PURE__ */
|
|
3736
|
-
rateLimitReset && /* @__PURE__ */
|
|
3737
|
-
/* @__PURE__ */
|
|
3738
|
-
/* @__PURE__ */
|
|
4192
|
+
/* @__PURE__ */ jsx22(Box21, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs21(Box21, { borderStyle: "single", borderColor: "yellow", paddingX: 3, paddingY: 2, flexDirection: "column", width: Math.min(dims.cols - 8, 80), children: [
|
|
4193
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, color: "yellow", marginBottom: 1, children: "\u26A0\uFE0F Rate Limit Exceeded" }),
|
|
4194
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", marginBottom: 1, children: "You've hit GitHub's API rate limit for your token." }),
|
|
4195
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", marginBottom: 1, children: "This happens when you make too many requests in a short time." }),
|
|
4196
|
+
rateLimitReset && /* @__PURE__ */ jsxs21(Box21, { marginTop: 1, marginBottom: 1, children: [
|
|
4197
|
+
/* @__PURE__ */ jsxs21(Text22, { children: [
|
|
4198
|
+
/* @__PURE__ */ jsx22(Text22, { color: "cyan", children: "Reset in:" }),
|
|
3739
4199
|
" ",
|
|
3740
|
-
/* @__PURE__ */
|
|
4200
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, children: formatResetTime(rateLimitReset) })
|
|
3741
4201
|
] }),
|
|
3742
|
-
/* @__PURE__ */
|
|
4202
|
+
/* @__PURE__ */ jsxs21(Text22, { color: "gray", dimColor: true, children: [
|
|
3743
4203
|
"(",
|
|
3744
4204
|
new Date(rateLimitReset).toLocaleTimeString(),
|
|
3745
4205
|
")"
|
|
3746
4206
|
] })
|
|
3747
4207
|
] }),
|
|
3748
|
-
/* @__PURE__ */
|
|
3749
|
-
/* @__PURE__ */
|
|
3750
|
-
/* @__PURE__ */
|
|
3751
|
-
/* @__PURE__ */
|
|
3752
|
-
/* @__PURE__ */
|
|
4208
|
+
/* @__PURE__ */ jsxs21(Box21, { marginTop: 2, flexDirection: "column", gap: 1, children: [
|
|
4209
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, children: "What would you like to do?" }),
|
|
4210
|
+
/* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", paddingLeft: 2, children: [
|
|
4211
|
+
/* @__PURE__ */ jsxs21(Text22, { children: [
|
|
4212
|
+
/* @__PURE__ */ jsx22(Text22, { color: "cyan", bold: true, children: "R" }),
|
|
3753
4213
|
" - Retry now ",
|
|
3754
4214
|
rateLimitReset && formatResetTime(rateLimitReset) !== "Now (should be reset)" ? "(likely to fail until reset)" : "(should work now)"
|
|
3755
4215
|
] }),
|
|
3756
|
-
/* @__PURE__ */
|
|
3757
|
-
/* @__PURE__ */
|
|
4216
|
+
/* @__PURE__ */ jsxs21(Text22, { children: [
|
|
4217
|
+
/* @__PURE__ */ jsx22(Text22, { color: "cyan", bold: true, children: "L" }),
|
|
3758
4218
|
" - Logout and choose authentication method"
|
|
3759
4219
|
] }),
|
|
3760
|
-
/* @__PURE__ */
|
|
3761
|
-
/* @__PURE__ */
|
|
4220
|
+
/* @__PURE__ */ jsxs21(Text22, { children: [
|
|
4221
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", bold: true, children: "Q/Esc" }),
|
|
3762
4222
|
" - Quit application"
|
|
3763
4223
|
] })
|
|
3764
4224
|
] })
|
|
3765
4225
|
] }),
|
|
3766
|
-
/* @__PURE__ */
|
|
4226
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", dimColor: true, marginTop: 2, children: "Tip: Using multiple tokens or waiting between requests can help avoid rate limits." })
|
|
3767
4227
|
] }) })
|
|
3768
4228
|
] });
|
|
3769
4229
|
}
|
|
3770
4230
|
if (mode === "auth_method_selection") {
|
|
3771
|
-
return /* @__PURE__ */
|
|
4231
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3772
4232
|
header,
|
|
3773
|
-
/* @__PURE__ */
|
|
3774
|
-
/* @__PURE__ */
|
|
3775
|
-
error && /* @__PURE__ */
|
|
4233
|
+
/* @__PURE__ */ jsx22(Box21, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", alignItems: "center", children: [
|
|
4234
|
+
/* @__PURE__ */ jsx22(AuthMethodSelector, { onSelect: handleAuthMethodSelect }),
|
|
4235
|
+
error && /* @__PURE__ */ jsx22(Text22, { color: "red", marginTop: 1, children: error })
|
|
3776
4236
|
] }) })
|
|
3777
4237
|
] });
|
|
3778
4238
|
}
|
|
3779
4239
|
if (mode === "oauth_flow") {
|
|
3780
|
-
return /* @__PURE__ */
|
|
4240
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3781
4241
|
header,
|
|
3782
|
-
/* @__PURE__ */
|
|
4242
|
+
/* @__PURE__ */ jsx22(Box21, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx22(OAuthProgress, { status: oauthStatus, error: error || void 0, deviceCode: oauthDeviceCode || void 0 }) })
|
|
3783
4243
|
] });
|
|
3784
4244
|
}
|
|
3785
4245
|
if (mode === "prompt") {
|
|
3786
|
-
return /* @__PURE__ */
|
|
4246
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3787
4247
|
header,
|
|
3788
|
-
/* @__PURE__ */
|
|
3789
|
-
/* @__PURE__ */
|
|
3790
|
-
/* @__PURE__ */
|
|
3791
|
-
/* @__PURE__ */
|
|
3792
|
-
/* @__PURE__ */
|
|
3793
|
-
/* @__PURE__ */
|
|
4248
|
+
/* @__PURE__ */ jsx22(Box21, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs21(Box21, { borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, flexDirection: "column", children: [
|
|
4249
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, marginBottom: 1, children: "Authentication Required" }),
|
|
4250
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", marginBottom: 1, children: "Enter your GitHub Personal Access Token" }),
|
|
4251
|
+
/* @__PURE__ */ jsxs21(Box21, { children: [
|
|
4252
|
+
/* @__PURE__ */ jsx22(Text22, { children: "Token: " }),
|
|
4253
|
+
/* @__PURE__ */ jsx22(
|
|
3794
4254
|
TextInput6,
|
|
3795
4255
|
{
|
|
3796
4256
|
value: input,
|
|
@@ -3800,30 +4260,30 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3800
4260
|
}
|
|
3801
4261
|
)
|
|
3802
4262
|
] }),
|
|
3803
|
-
error && /* @__PURE__ */
|
|
3804
|
-
/* @__PURE__ */
|
|
3805
|
-
/* @__PURE__ */
|
|
4263
|
+
error && /* @__PURE__ */ jsx22(Text22, { color: "red", marginTop: 1, children: error }),
|
|
4264
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", dimColor: true, marginTop: 1, children: "The token will be stored securely in your local config" }),
|
|
4265
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to go back" })
|
|
3806
4266
|
] }) })
|
|
3807
4267
|
] });
|
|
3808
4268
|
}
|
|
3809
4269
|
if (mode === "validating" || mode === "checking") {
|
|
3810
|
-
return /* @__PURE__ */
|
|
4270
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3811
4271
|
header,
|
|
3812
|
-
/* @__PURE__ */
|
|
3813
|
-
/* @__PURE__ */
|
|
3814
|
-
mode === "validating" && /* @__PURE__ */
|
|
4272
|
+
/* @__PURE__ */ jsx22(Box21, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", alignItems: "center", children: [
|
|
4273
|
+
/* @__PURE__ */ jsx22(Text22, { color: "yellow", children: "Validating token..." }),
|
|
4274
|
+
mode === "validating" && /* @__PURE__ */ jsx22(Text22, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to cancel" })
|
|
3815
4275
|
] }) })
|
|
3816
4276
|
] });
|
|
3817
4277
|
}
|
|
3818
4278
|
if (mode === "error") {
|
|
3819
|
-
return /* @__PURE__ */
|
|
4279
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3820
4280
|
header,
|
|
3821
|
-
/* @__PURE__ */
|
|
4281
|
+
/* @__PURE__ */ jsx22(Box21, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx22(Text22, { color: "red", children: error ?? "Unexpected error" }) })
|
|
3822
4282
|
] });
|
|
3823
4283
|
}
|
|
3824
|
-
return /* @__PURE__ */
|
|
4284
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3825
4285
|
header,
|
|
3826
|
-
/* @__PURE__ */
|
|
4286
|
+
/* @__PURE__ */ jsx22(
|
|
3827
4287
|
RepoList,
|
|
3828
4288
|
{
|
|
3829
4289
|
token,
|
|
@@ -3838,7 +4298,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3838
4298
|
}
|
|
3839
4299
|
|
|
3840
4300
|
// src/index.tsx
|
|
3841
|
-
import { jsx as
|
|
4301
|
+
import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3842
4302
|
var argv = process.argv.slice(2);
|
|
3843
4303
|
var getFlagValue = (name) => {
|
|
3844
4304
|
const idx = argv.findIndex((a) => a === `--${name}` || a.startsWith(`--${name}=`));
|
|
@@ -3905,9 +4365,25 @@ var handleShutdown = (signal) => {
|
|
|
3905
4365
|
});
|
|
3906
4366
|
process.exit(0);
|
|
3907
4367
|
};
|
|
4368
|
+
var showSponsorshipMessage = () => {
|
|
4369
|
+
console.log("\n" + "\u2500".repeat(60));
|
|
4370
|
+
console.log("\n\u{1F49A} Thank you for using gh-manager-cli!\n");
|
|
4371
|
+
console.log("If this app saved you time, please consider supporting");
|
|
4372
|
+
console.log("the development of more open-source projects like this:\n");
|
|
4373
|
+
console.log(" \u2615 Buy Me a Coffee: https://buymeacoffee.com/wiiiimm");
|
|
4374
|
+
console.log(" \u{1F680} Visit my site: https://wiiiimm.codes");
|
|
4375
|
+
console.log(" \u{1F4AC} Leave feedback: https://github.com/wiiiimm/gh-manager-cli");
|
|
4376
|
+
console.log("\nYour support and contributions make a difference! \u{1F64F}\n");
|
|
4377
|
+
console.log("\u2500".repeat(60) + "\n");
|
|
4378
|
+
};
|
|
3908
4379
|
process.on("SIGINT", () => handleShutdown("SIGINT"));
|
|
3909
4380
|
process.on("SIGTERM", () => handleShutdown("SIGTERM"));
|
|
3910
4381
|
process.on("exit", (code) => {
|
|
4382
|
+
const isNormalExit = code === 0;
|
|
4383
|
+
const isInteractiveSession = !argv.includes("--version") && !argv.includes("-v") && !argv.includes("--help") && !argv.includes("-h");
|
|
4384
|
+
if (isNormalExit && isInteractiveSession) {
|
|
4385
|
+
showSponsorshipMessage();
|
|
4386
|
+
}
|
|
3911
4387
|
logger.info("gh-manager-cli exited", {
|
|
3912
4388
|
exitCode: code,
|
|
3913
4389
|
uptime: process.uptime()
|
|
@@ -3935,8 +4411,8 @@ var inlineToken = (() => {
|
|
|
3935
4411
|
})();
|
|
3936
4412
|
logger.debug("Rendering UI");
|
|
3937
4413
|
var { unmount } = render(
|
|
3938
|
-
/* @__PURE__ */
|
|
3939
|
-
/* @__PURE__ */
|
|
3940
|
-
/* @__PURE__ */
|
|
4414
|
+
/* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", children: [
|
|
4415
|
+
/* @__PURE__ */ jsx23(App, { initialOrgSlug, inlineToken, inlineTokenEphemeral: Boolean(inlineToken) }),
|
|
4416
|
+
/* @__PURE__ */ jsx23(Text23, { color: "gray" })
|
|
3941
4417
|
] })
|
|
3942
4418
|
);
|