gh-manager-cli 1.34.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 +19 -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 +851 -409
- 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,72 +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 [operationCount, setOperationCount] =
|
|
1701
|
-
const [showSponsorReminder, setShowSponsorReminder] =
|
|
1702
|
-
const [searchItems, setSearchItems] =
|
|
1703
|
-
const [searchEndCursor, setSearchEndCursor] =
|
|
1704
|
-
const [searchHasNextPage, setSearchHasNextPage] =
|
|
1705
|
-
const [searchTotalCount, setSearchTotalCount] =
|
|
1706
|
-
const [searchLoading, setSearchLoading] =
|
|
1707
|
-
const [deleteMode, setDeleteMode] =
|
|
1708
|
-
const [deleteTarget, setDeleteTarget] =
|
|
1709
|
-
const [deleteCode, setDeleteCode] =
|
|
1710
|
-
const [typedCode, setTypedCode] =
|
|
1711
|
-
const [deleting, setDeleting] =
|
|
1712
|
-
const [deleteError, setDeleteError] =
|
|
1713
|
-
const [deleteConfirmStage, setDeleteConfirmStage] =
|
|
1714
|
-
const [confirmFocus, setConfirmFocus] =
|
|
1715
|
-
const [archiveMode, setArchiveMode] =
|
|
1716
|
-
const [archiveTarget, setArchiveTarget] =
|
|
1717
|
-
const [archiving, setArchiving] =
|
|
1718
|
-
const [archiveError, setArchiveError] =
|
|
1719
|
-
const [archiveFocus, setArchiveFocus] =
|
|
1720
|
-
const [syncMode, setSyncMode] =
|
|
1721
|
-
const [syncTarget, setSyncTarget] =
|
|
1722
|
-
const [syncing, setSyncing] =
|
|
1723
|
-
const [syncError, setSyncError] =
|
|
1724
|
-
const [syncFocus, setSyncFocus] =
|
|
1725
|
-
const [renameMode, setRenameMode] =
|
|
1726
|
-
const [renameTarget, setRenameTarget] =
|
|
1727
|
-
const [copyUrlMode, setCopyUrlMode] =
|
|
1728
|
-
const [copyUrlTarget, setCopyUrlTarget] =
|
|
1729
|
-
const [copyToast, setCopyToast] =
|
|
1730
|
-
const [syncTrigger, setSyncTrigger] =
|
|
1731
|
-
const [infoMode, setInfoMode] =
|
|
1732
|
-
const [infoRepo, setInfoRepo] =
|
|
1733
|
-
const [logoutMode, setLogoutMode] =
|
|
1734
|
-
const [logoutFocus, setLogoutFocus] =
|
|
1735
|
-
const [logoutError, setLogoutError] =
|
|
1736
|
-
const [visibilityMode, setVisibilityMode] =
|
|
1737
|
-
const [isEnterpriseOrg, setIsEnterpriseOrg] =
|
|
1738
|
-
const [hasInternalRepos, setHasInternalRepos] =
|
|
1739
|
-
const [changeVisibilityMode, setChangeVisibilityMode] =
|
|
1740
|
-
const [changeVisibilityTarget, setChangeVisibilityTarget] =
|
|
1741
|
-
const [changingVisibility, setChangingVisibility] =
|
|
1742
|
-
const [changeVisibilityError, setChangeVisibilityError] =
|
|
1743
|
-
const [sortMode, setSortMode] =
|
|
1744
|
-
const [sortDirectionMode, setSortDirectionMode] =
|
|
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);
|
|
1745
2002
|
const appliedInitialOrg = useRef(false);
|
|
1746
|
-
|
|
2003
|
+
useEffect11(() => {
|
|
1747
2004
|
(async () => {
|
|
1748
2005
|
if (appliedInitialOrg.current) return;
|
|
1749
2006
|
if (!initialOrgSlug2) return;
|
|
@@ -1812,6 +2069,102 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1812
2069
|
setCopyUrlMode(true);
|
|
1813
2070
|
setCopyUrlTarget(repo);
|
|
1814
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
|
+
}
|
|
1815
2168
|
async function executeSync() {
|
|
1816
2169
|
if (!syncTarget || syncing) return;
|
|
1817
2170
|
try {
|
|
@@ -1916,7 +2269,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1916
2269
|
throw error2;
|
|
1917
2270
|
}
|
|
1918
2271
|
}
|
|
1919
|
-
|
|
2272
|
+
useEffect11(() => {
|
|
1920
2273
|
return () => {
|
|
1921
2274
|
if (copyToastTimerRef.current) {
|
|
1922
2275
|
clearTimeout(copyToastTimerRef.current);
|
|
@@ -1963,6 +2316,13 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1963
2316
|
setFilter("");
|
|
1964
2317
|
setFilterMode(false);
|
|
1965
2318
|
setVisibilityFilter("all");
|
|
2319
|
+
if (newContext !== "personal" && starsMode) {
|
|
2320
|
+
setStarsMode(false);
|
|
2321
|
+
setStarredItems([]);
|
|
2322
|
+
setStarredHasNextPage(false);
|
|
2323
|
+
setStarredEndCursor(null);
|
|
2324
|
+
setStarredTotalCount(0);
|
|
2325
|
+
}
|
|
1966
2326
|
const newAffiliations = newContext === "personal" ? ["OWNER"] : ["ORGANIZATION_MEMBER"];
|
|
1967
2327
|
setOwnerAffiliations(newAffiliations);
|
|
1968
2328
|
if (newContext !== "personal") {
|
|
@@ -2017,12 +2377,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2017
2377
|
setDeleteError("Failed to delete repository. Ensure delete_repo scope and admin permissions.");
|
|
2018
2378
|
}
|
|
2019
2379
|
}
|
|
2020
|
-
const [filter, setFilter] =
|
|
2021
|
-
const [filterMode, setFilterMode] =
|
|
2022
|
-
const [sortKey, setSortKey] =
|
|
2023
|
-
const [sortDir, setSortDir] =
|
|
2024
|
-
const [forkTracking, setForkTracking] =
|
|
2025
|
-
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");
|
|
2026
2386
|
const previousVisibilityFilter = useRef("all");
|
|
2027
2387
|
const sortFieldMap = {
|
|
2028
2388
|
"updated": "UPDATED_AT",
|
|
@@ -2183,7 +2543,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2183
2543
|
setSearchLoading(false);
|
|
2184
2544
|
}
|
|
2185
2545
|
};
|
|
2186
|
-
|
|
2546
|
+
useEffect11(() => {
|
|
2187
2547
|
const ui = getUIPrefs();
|
|
2188
2548
|
if (ui.density !== void 0) setDensity(ui.density);
|
|
2189
2549
|
if (ui.sortKey && ["updated", "pushed", "name", "stars"].includes(ui.sortKey)) {
|
|
@@ -2192,8 +2552,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2192
2552
|
if (ui.sortDir && (ui.sortDir === "asc" || ui.sortDir === "desc")) {
|
|
2193
2553
|
setSortDir(ui.sortDir);
|
|
2194
2554
|
}
|
|
2195
|
-
|
|
2196
|
-
else setForkTracking(true);
|
|
2555
|
+
setForkTracking(true);
|
|
2197
2556
|
if (ui.visibilityFilter && ["all", "public", "private", "internal"].includes(ui.visibilityFilter)) {
|
|
2198
2557
|
setVisibilityFilter(ui.visibilityFilter);
|
|
2199
2558
|
}
|
|
@@ -2214,7 +2573,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2214
2573
|
}
|
|
2215
2574
|
setPrefsLoaded(true);
|
|
2216
2575
|
}, [onOrgContextChange]);
|
|
2217
|
-
|
|
2576
|
+
useEffect11(() => {
|
|
2218
2577
|
if (!prefsLoaded) return;
|
|
2219
2578
|
let policy = "cache-first";
|
|
2220
2579
|
const orgLogin = ownerContext !== "personal" ? ownerContext.login : void 0;
|
|
@@ -2234,7 +2593,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2234
2593
|
setCursor(0);
|
|
2235
2594
|
fetchPage(null, true, false, void 0, policy);
|
|
2236
2595
|
}, [client, prefsLoaded, ownerContext, ownerAffiliations]);
|
|
2237
|
-
|
|
2596
|
+
useEffect11(() => {
|
|
2238
2597
|
if (!searchActive) {
|
|
2239
2598
|
if (items.length > 0) {
|
|
2240
2599
|
let policy = "cache-first";
|
|
@@ -2273,7 +2632,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2273
2632
|
}
|
|
2274
2633
|
}
|
|
2275
2634
|
}, [sortKey, sortDir]);
|
|
2276
|
-
|
|
2635
|
+
useEffect11(() => {
|
|
2277
2636
|
if (visibilityFilter !== "all" || previousVisibilityFilter.current && previousVisibilityFilter.current !== visibilityFilter) {
|
|
2278
2637
|
if (!searchActive) {
|
|
2279
2638
|
if (items.length > 0) {
|
|
@@ -2290,7 +2649,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2290
2649
|
}
|
|
2291
2650
|
previousVisibilityFilter.current = visibilityFilter;
|
|
2292
2651
|
}, [visibilityFilter]);
|
|
2293
|
-
|
|
2652
|
+
useEffect11(() => {
|
|
2294
2653
|
if (viewerLogin && searchActive && !searchLoading && searchItems.length === 0) {
|
|
2295
2654
|
let policy = "cache-first";
|
|
2296
2655
|
try {
|
|
@@ -2311,7 +2670,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2311
2670
|
fetchSearchPage(null, true, policy);
|
|
2312
2671
|
}
|
|
2313
2672
|
}, [viewerLogin]);
|
|
2314
|
-
|
|
2673
|
+
useInput15((input, key) => {
|
|
2315
2674
|
if (error) {
|
|
2316
2675
|
if (input && input.toUpperCase() === "Q") {
|
|
2317
2676
|
try {
|
|
@@ -2396,6 +2755,20 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2396
2755
|
}
|
|
2397
2756
|
return;
|
|
2398
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
|
+
}
|
|
2399
2772
|
if (syncMode) {
|
|
2400
2773
|
if (key.escape || input && input.toUpperCase() === "C") {
|
|
2401
2774
|
closeSyncModal();
|
|
@@ -2486,22 +2859,24 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2486
2859
|
addDebugMessage("[ESC] Cleared search and returned to normal listing");
|
|
2487
2860
|
return;
|
|
2488
2861
|
}
|
|
2489
|
-
if (key.downArrow && searchActive && visibleItems.length > 0) {
|
|
2862
|
+
if (key.downArrow && (searchActive || starsMode && filter.trim().length > 0) && visibleItems.length > 0) {
|
|
2490
2863
|
setFilterMode(false);
|
|
2491
2864
|
setCursor(0);
|
|
2492
|
-
addDebugMessage("[DOWN] Exited filter mode and selected first
|
|
2865
|
+
addDebugMessage("[DOWN] Exited filter mode and selected first result");
|
|
2493
2866
|
return;
|
|
2494
2867
|
}
|
|
2495
2868
|
return;
|
|
2496
2869
|
}
|
|
2497
|
-
if (key.escape && searchActive) {
|
|
2870
|
+
if (key.escape && (searchActive || starsMode && filter.trim().length > 0)) {
|
|
2498
2871
|
setFilter("");
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2872
|
+
if (!starsMode) {
|
|
2873
|
+
setSearchItems([]);
|
|
2874
|
+
setSearchEndCursor(null);
|
|
2875
|
+
setSearchHasNextPage(false);
|
|
2876
|
+
setSearchTotalCount(0);
|
|
2877
|
+
}
|
|
2503
2878
|
setCursor(0);
|
|
2504
|
-
addDebugMessage("[ESC] Cleared
|
|
2879
|
+
addDebugMessage("[ESC] Cleared filter and returned to normal listing");
|
|
2505
2880
|
return;
|
|
2506
2881
|
}
|
|
2507
2882
|
if (input && input.toUpperCase() === "Q") {
|
|
@@ -2581,7 +2956,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2581
2956
|
}
|
|
2582
2957
|
return;
|
|
2583
2958
|
}
|
|
2584
|
-
if (key.ctrl && (input === "
|
|
2959
|
+
if (key.ctrl && (input === "f" || input === "F")) {
|
|
2585
2960
|
const repo = visibleItems[cursor];
|
|
2586
2961
|
if (repo && repo.isFork && repo.parent) {
|
|
2587
2962
|
const hasCommitData = repo.defaultBranchRef && repo.parent.defaultBranchRef && repo.parent.defaultBranchRef.target?.history && repo.defaultBranchRef.target?.history;
|
|
@@ -2649,7 +3024,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2649
3024
|
setOrgSwitcherOpen(true);
|
|
2650
3025
|
return;
|
|
2651
3026
|
}
|
|
2652
|
-
if (input && input.toUpperCase() === "S") {
|
|
3027
|
+
if (input && input.toUpperCase() === "S" && !key.shift && !key.ctrl) {
|
|
2653
3028
|
setSortMode(true);
|
|
2654
3029
|
return;
|
|
2655
3030
|
}
|
|
@@ -2657,6 +3032,47 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2657
3032
|
setSortDirectionMode(true);
|
|
2658
3033
|
return;
|
|
2659
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
|
+
}
|
|
2660
3076
|
if (input && input.toUpperCase() === "O") {
|
|
2661
3077
|
const repo = visibleItems[cursor];
|
|
2662
3078
|
if (repo) openInBrowser(`https://github.com/${repo.nameWithOwner}`);
|
|
@@ -2670,23 +3086,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2670
3086
|
});
|
|
2671
3087
|
return;
|
|
2672
3088
|
}
|
|
2673
|
-
if (input && input.toUpperCase() === "F") {
|
|
2674
|
-
setForkTracking((prev) => {
|
|
2675
|
-
const next = !prev;
|
|
2676
|
-
storeUIPrefs({ forkTracking: next });
|
|
2677
|
-
const needsRefresh = next && items.some(
|
|
2678
|
-
(repo) => repo.isFork && repo.parent && (!repo.defaultBranchRef?.target?.history || !repo.parent.defaultBranchRef?.target?.history)
|
|
2679
|
-
);
|
|
2680
|
-
if (needsRefresh) {
|
|
2681
|
-
setSortingLoading(true);
|
|
2682
|
-
fetchPage(null, true, true, next);
|
|
2683
|
-
}
|
|
2684
|
-
return next;
|
|
2685
|
-
});
|
|
2686
|
-
return;
|
|
2687
|
-
}
|
|
2688
3089
|
if (input && input.toUpperCase() === "V") {
|
|
2689
|
-
|
|
3090
|
+
if (!starsMode) {
|
|
3091
|
+
setVisibilityMode(true);
|
|
3092
|
+
}
|
|
2690
3093
|
return;
|
|
2691
3094
|
}
|
|
2692
3095
|
});
|
|
@@ -2723,7 +3126,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2723
3126
|
});
|
|
2724
3127
|
return arr;
|
|
2725
3128
|
}, [filtered, sortKey, sortDir]);
|
|
2726
|
-
const searchActive = filter.trim().length >= 3;
|
|
3129
|
+
const searchActive = !starsMode && filter.trim().length >= 3;
|
|
2727
3130
|
const filteredSearchItems = useMemo(() => {
|
|
2728
3131
|
let result = searchItems;
|
|
2729
3132
|
if (visibilityFilter === "private") {
|
|
@@ -2733,13 +3136,20 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2733
3136
|
}
|
|
2734
3137
|
return result;
|
|
2735
3138
|
}, [searchItems, visibilityFilter]);
|
|
2736
|
-
const
|
|
2737
|
-
|
|
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(() => {
|
|
2738
3148
|
if (searchActive) {
|
|
2739
3149
|
addDebugMessage(`[State] searchActive=${searchActive}, searchItems=${searchItems.length}, visibleItems=${visibleItems.length}, filter="${filter}"`);
|
|
2740
3150
|
}
|
|
2741
3151
|
}, [searchActive, searchItems.length, visibleItems.length, filter]);
|
|
2742
|
-
|
|
3152
|
+
useEffect11(() => {
|
|
2743
3153
|
setCursor((c) => Math.min(c, Math.max(0, (searchActive ? searchItems.length : items.length) - 1)));
|
|
2744
3154
|
}, [searchActive, searchItems.length, items.length]);
|
|
2745
3155
|
const headerHeight = 2;
|
|
@@ -2760,10 +3170,15 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2760
3170
|
const end = Math.min(total, start + visibleRepos + buffer);
|
|
2761
3171
|
return { start, end };
|
|
2762
3172
|
}, [visibleItems.length, cursor, listHeight, spacingLines]);
|
|
2763
|
-
|
|
3173
|
+
useEffect11(() => {
|
|
2764
3174
|
const prefetchThreshold = Math.floor(visibleItems.length * 0.8);
|
|
2765
3175
|
const nearEnd = visibleItems.length > 0 && cursor >= prefetchThreshold;
|
|
2766
|
-
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) {
|
|
2767
3182
|
if (!searchLoading && searchHasNextPage && nearEnd) {
|
|
2768
3183
|
addDebugMessage(`[Infinite Scroll] Prefetching search results at ${cursor}/${visibleItems.length} (80% threshold: ${prefetchThreshold})`);
|
|
2769
3184
|
fetchSearchPage(searchEndCursor);
|
|
@@ -2774,7 +3189,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2774
3189
|
fetchPage(endCursor);
|
|
2775
3190
|
}
|
|
2776
3191
|
}
|
|
2777
|
-
}, [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]);
|
|
2778
3193
|
function openInBrowser(url) {
|
|
2779
3194
|
const platform = process.platform;
|
|
2780
3195
|
const cmd = platform === "darwin" ? `open "${url}"` : platform === "win32" ? `start "" "${url}"` : `xdg-open "${url}"`;
|
|
@@ -2782,76 +3197,76 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2782
3197
|
}
|
|
2783
3198
|
const lowRate = rateLimit && rateLimit.remaining <= Math.ceil(rateLimit.limit * 0.1) || restRateLimit && restRateLimit.core.remaining <= Math.ceil(restRateLimit.core.limit * 0.1);
|
|
2784
3199
|
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || sortMode || sortDirectionMode || changeVisibilityMode || copyUrlMode || renameMode;
|
|
2785
|
-
const headerBar = useMemo(() => /* @__PURE__ */
|
|
2786
|
-
/* @__PURE__ */
|
|
2787
|
-
/* @__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: [
|
|
2788
3203
|
" ",
|
|
2789
3204
|
ownerContext === "personal" ? "Personal" : ownerContext.name || ownerContext.login,
|
|
2790
3205
|
ownerContext !== "personal" && isEnterpriseOrg && " (ENT)"
|
|
2791
3206
|
] }),
|
|
2792
|
-
/* @__PURE__ */
|
|
2793
|
-
/* @__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: [
|
|
2794
3209
|
"(",
|
|
2795
3210
|
visibleItems.length,
|
|
2796
3211
|
"/",
|
|
2797
3212
|
searchActive ? searchTotalCount : totalCount,
|
|
2798
3213
|
")"
|
|
2799
3214
|
] }),
|
|
2800
|
-
(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, {}) }) })
|
|
2801
3216
|
] }),
|
|
2802
|
-
(rateLimit || restRateLimit) && /* @__PURE__ */
|
|
3217
|
+
(rateLimit || restRateLimit) && /* @__PURE__ */ jsxs18(Text19, { color: lowRate ? "yellow" : "gray", children: [
|
|
2803
3218
|
"GraphQL: ",
|
|
2804
3219
|
rateLimit ? `${rateLimit.remaining}/${rateLimit.limit}` : "---/---",
|
|
2805
|
-
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})` }),
|
|
2806
3221
|
" | ",
|
|
2807
3222
|
"REST: ",
|
|
2808
3223
|
restRateLimit ? `${restRateLimit.core.remaining}/${restRateLimit.core.limit}` : "---/---",
|
|
2809
|
-
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})` }),
|
|
2810
3225
|
" "
|
|
2811
3226
|
] })
|
|
2812
3227
|
] }), [visibleItems.length, searchActive, searchTotalCount, totalCount, loading, searchLoading, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg, restRateLimit, prevRestRateLimit]);
|
|
2813
3228
|
if (error) {
|
|
2814
|
-
return /* @__PURE__ */
|
|
2815
|
-
/* @__PURE__ */
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
/* @__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)" })
|
|
2818
3233
|
] }) }),
|
|
2819
|
-
/* @__PURE__ */
|
|
2820
|
-
/* @__PURE__ */
|
|
2821
|
-
/* @__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" }) })
|
|
2822
3237
|
] }) }) }),
|
|
2823
|
-
/* @__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" }) })
|
|
2824
3239
|
] });
|
|
2825
3240
|
}
|
|
2826
3241
|
if (loading && items.length === 0 || sortingLoading) {
|
|
2827
|
-
return /* @__PURE__ */
|
|
2828
|
-
/* @__PURE__ */
|
|
2829
|
-
/* @__PURE__ */
|
|
2830
|
-
/* @__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...)" })
|
|
2831
3246
|
] }) }),
|
|
2832
|
-
/* @__PURE__ */
|
|
2833
|
-
/* @__PURE__ */
|
|
2834
|
-
/* @__PURE__ */
|
|
2835
|
-
/* @__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..." })
|
|
2836
3251
|
] }),
|
|
2837
|
-
/* @__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" }) })
|
|
2838
3253
|
] }) }) }) }),
|
|
2839
|
-
/* @__PURE__ */
|
|
3254
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "gray", children: "Please wait..." }) })
|
|
2840
3255
|
] });
|
|
2841
3256
|
}
|
|
2842
|
-
return /* @__PURE__ */
|
|
3257
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", height: availableHeight, children: [
|
|
2843
3258
|
headerBar,
|
|
2844
|
-
showSponsorReminder && /* @__PURE__ */
|
|
2845
|
-
/* @__PURE__ */
|
|
2846
|
-
/* @__PURE__ */
|
|
2847
|
-
/* @__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" })
|
|
2848
3263
|
] }) }) }),
|
|
2849
|
-
/* @__PURE__ */
|
|
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 ? (
|
|
2850
3265
|
// Centered modal; hide list content while modal is open
|
|
2851
|
-
/* @__PURE__ */
|
|
2852
|
-
/* @__PURE__ */
|
|
2853
|
-
/* @__PURE__ */
|
|
2854
|
-
/* @__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: " " }) }),
|
|
2855
3270
|
(() => {
|
|
2856
3271
|
const langName = deleteTarget.primaryLanguage?.name || "";
|
|
2857
3272
|
const langColor = deleteTarget.primaryLanguage?.color || "#666666";
|
|
@@ -2863,19 +3278,19 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2863
3278
|
let line2 = "";
|
|
2864
3279
|
if (langName) line2 += chalk13.hex(langColor)("\u25CF ") + chalk13.gray(`${langName} `);
|
|
2865
3280
|
line2 += chalk13.gray(`\u2605 ${deleteTarget.stargazerCount} \u2442 ${deleteTarget.forkCount} Updated ${formatDate(deleteTarget.updatedAt)}`);
|
|
2866
|
-
return /* @__PURE__ */
|
|
2867
|
-
/* @__PURE__ */
|
|
2868
|
-
/* @__PURE__ */
|
|
3281
|
+
return /* @__PURE__ */ jsxs18(Fragment10, { children: [
|
|
3282
|
+
/* @__PURE__ */ jsx19(Text19, { children: line1 }),
|
|
3283
|
+
/* @__PURE__ */ jsx19(Text19, { children: line2 })
|
|
2869
3284
|
] });
|
|
2870
3285
|
})(),
|
|
2871
|
-
/* @__PURE__ */
|
|
3286
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsxs18(Text19, { children: [
|
|
2872
3287
|
"Type ",
|
|
2873
|
-
/* @__PURE__ */
|
|
3288
|
+
/* @__PURE__ */ jsx19(Text19, { color: "yellow", bold: true, children: deleteCode }),
|
|
2874
3289
|
" to confirm."
|
|
2875
3290
|
] }) }),
|
|
2876
|
-
!deleteConfirmStage && /* @__PURE__ */
|
|
2877
|
-
/* @__PURE__ */
|
|
2878
|
-
/* @__PURE__ */
|
|
3291
|
+
!deleteConfirmStage && /* @__PURE__ */ jsxs18(Box18, { marginTop: 1, children: [
|
|
3292
|
+
/* @__PURE__ */ jsx19(Text19, { children: "Confirm code: " }),
|
|
3293
|
+
/* @__PURE__ */ jsx19(
|
|
2879
3294
|
TextInput5,
|
|
2880
3295
|
{
|
|
2881
3296
|
value: typedCode,
|
|
@@ -2902,11 +3317,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2902
3317
|
}
|
|
2903
3318
|
)
|
|
2904
3319
|
] }),
|
|
2905
|
-
deleteConfirmStage && /* @__PURE__ */
|
|
2906
|
-
/* @__PURE__ */
|
|
2907
|
-
/* @__PURE__ */
|
|
2908
|
-
/* @__PURE__ */
|
|
2909
|
-
|
|
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,
|
|
2910
3325
|
{
|
|
2911
3326
|
borderStyle: "round",
|
|
2912
3327
|
borderColor: "red",
|
|
@@ -2915,11 +3330,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2915
3330
|
alignItems: "center",
|
|
2916
3331
|
justifyContent: "center",
|
|
2917
3332
|
flexDirection: "column",
|
|
2918
|
-
children: /* @__PURE__ */
|
|
3333
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: confirmFocus === "delete" ? chalk13.bgRed.white.bold(" Delete ") : chalk13.red.bold("Delete") })
|
|
2919
3334
|
}
|
|
2920
3335
|
),
|
|
2921
|
-
/* @__PURE__ */
|
|
2922
|
-
|
|
3336
|
+
/* @__PURE__ */ jsx19(
|
|
3337
|
+
Box18,
|
|
2923
3338
|
{
|
|
2924
3339
|
borderStyle: "round",
|
|
2925
3340
|
borderColor: confirmFocus === "cancel" ? "white" : "gray",
|
|
@@ -2928,16 +3343,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2928
3343
|
alignItems: "center",
|
|
2929
3344
|
justifyContent: "center",
|
|
2930
3345
|
flexDirection: "column",
|
|
2931
|
-
children: /* @__PURE__ */
|
|
3346
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: confirmFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
2932
3347
|
}
|
|
2933
3348
|
)
|
|
2934
3349
|
] }),
|
|
2935
|
-
/* @__PURE__ */
|
|
3350
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
2936
3351
|
"Press Enter to ",
|
|
2937
3352
|
confirmFocus === "delete" ? "Delete" : "Cancel",
|
|
2938
3353
|
" | Y to Delete | C to Cancel"
|
|
2939
3354
|
] }) }),
|
|
2940
|
-
/* @__PURE__ */
|
|
3355
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(
|
|
2941
3356
|
TextInput5,
|
|
2942
3357
|
{
|
|
2943
3358
|
value: "",
|
|
@@ -2951,18 +3366,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2951
3366
|
}
|
|
2952
3367
|
) })
|
|
2953
3368
|
] }),
|
|
2954
|
-
deleteError && /* @__PURE__ */
|
|
2955
|
-
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..." }) })
|
|
2956
3371
|
] }) })
|
|
2957
|
-
) : archiveMode && archiveTarget ? /* @__PURE__ */
|
|
2958
|
-
/* @__PURE__ */
|
|
2959
|
-
/* @__PURE__ */
|
|
2960
|
-
/* @__PURE__ */
|
|
2961
|
-
/* @__PURE__ */
|
|
2962
|
-
/* @__PURE__ */
|
|
2963
|
-
/* @__PURE__ */
|
|
2964
|
-
/* @__PURE__ */
|
|
2965
|
-
|
|
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,
|
|
2966
3381
|
{
|
|
2967
3382
|
borderStyle: "round",
|
|
2968
3383
|
borderColor: archiveTarget.isArchived ? "green" : "yellow",
|
|
@@ -2971,11 +3386,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2971
3386
|
alignItems: "center",
|
|
2972
3387
|
justifyContent: "center",
|
|
2973
3388
|
flexDirection: "column",
|
|
2974
|
-
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") })
|
|
2975
3390
|
}
|
|
2976
3391
|
),
|
|
2977
|
-
/* @__PURE__ */
|
|
2978
|
-
|
|
3392
|
+
/* @__PURE__ */ jsx19(
|
|
3393
|
+
Box18,
|
|
2979
3394
|
{
|
|
2980
3395
|
borderStyle: "round",
|
|
2981
3396
|
borderColor: archiveFocus === "cancel" ? "white" : "gray",
|
|
@@ -2984,18 +3399,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2984
3399
|
alignItems: "center",
|
|
2985
3400
|
justifyContent: "center",
|
|
2986
3401
|
flexDirection: "column",
|
|
2987
|
-
children: /* @__PURE__ */
|
|
3402
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: archiveFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
2988
3403
|
}
|
|
2989
3404
|
)
|
|
2990
3405
|
] }),
|
|
2991
|
-
/* @__PURE__ */
|
|
3406
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
2992
3407
|
"Press Enter to ",
|
|
2993
3408
|
archiveFocus === "confirm" ? archiveTarget.isArchived ? "Unarchive" : "Archive" : "Cancel",
|
|
2994
3409
|
" | Y to ",
|
|
2995
3410
|
archiveTarget.isArchived ? "Unarchive" : "Archive",
|
|
2996
3411
|
" | C to Cancel"
|
|
2997
3412
|
] }) }),
|
|
2998
|
-
/* @__PURE__ */
|
|
3413
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(
|
|
2999
3414
|
TextInput5,
|
|
3000
3415
|
{
|
|
3001
3416
|
value: "",
|
|
@@ -3010,21 +3425,21 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3010
3425
|
}
|
|
3011
3426
|
}
|
|
3012
3427
|
) }),
|
|
3013
|
-
archiveError && /* @__PURE__ */
|
|
3014
|
-
archiving && /* @__PURE__ */
|
|
3015
|
-
] }) }) : syncMode && syncTarget ? /* @__PURE__ */
|
|
3016
|
-
/* @__PURE__ */
|
|
3017
|
-
/* @__PURE__ */
|
|
3018
|
-
/* @__PURE__ */
|
|
3019
|
-
/* @__PURE__ */
|
|
3020
|
-
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: [
|
|
3021
3436
|
"Upstream: ",
|
|
3022
3437
|
syncTarget.parent.nameWithOwner
|
|
3023
3438
|
] }),
|
|
3024
|
-
/* @__PURE__ */
|
|
3025
|
-
/* @__PURE__ */
|
|
3026
|
-
/* @__PURE__ */
|
|
3027
|
-
|
|
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,
|
|
3028
3443
|
{
|
|
3029
3444
|
borderStyle: "round",
|
|
3030
3445
|
borderColor: "blue",
|
|
@@ -3033,11 +3448,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3033
3448
|
alignItems: "center",
|
|
3034
3449
|
justifyContent: "center",
|
|
3035
3450
|
flexDirection: "column",
|
|
3036
|
-
children: /* @__PURE__ */
|
|
3451
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: syncFocus === "confirm" ? chalk13.bgBlue.white.bold(" Sync ") : chalk13.blue.bold("Sync") })
|
|
3037
3452
|
}
|
|
3038
3453
|
),
|
|
3039
|
-
/* @__PURE__ */
|
|
3040
|
-
|
|
3454
|
+
/* @__PURE__ */ jsx19(
|
|
3455
|
+
Box18,
|
|
3041
3456
|
{
|
|
3042
3457
|
borderStyle: "round",
|
|
3043
3458
|
borderColor: syncFocus === "cancel" ? "white" : "gray",
|
|
@@ -3046,16 +3461,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3046
3461
|
alignItems: "center",
|
|
3047
3462
|
justifyContent: "center",
|
|
3048
3463
|
flexDirection: "column",
|
|
3049
|
-
children: /* @__PURE__ */
|
|
3464
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: syncFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
3050
3465
|
}
|
|
3051
3466
|
)
|
|
3052
3467
|
] }),
|
|
3053
|
-
/* @__PURE__ */
|
|
3468
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3054
3469
|
"Press Enter to ",
|
|
3055
3470
|
syncFocus === "confirm" ? "Sync" : "Cancel",
|
|
3056
3471
|
" | Y to Sync | C to Cancel"
|
|
3057
3472
|
] }) }),
|
|
3058
|
-
/* @__PURE__ */
|
|
3473
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(
|
|
3059
3474
|
TextInput5,
|
|
3060
3475
|
{
|
|
3061
3476
|
value: "",
|
|
@@ -3070,14 +3485,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3070
3485
|
}
|
|
3071
3486
|
}
|
|
3072
3487
|
) }),
|
|
3073
|
-
syncError && /* @__PURE__ */
|
|
3074
|
-
syncing && /* @__PURE__ */
|
|
3075
|
-
] }) }) : logoutMode ? /* @__PURE__ */
|
|
3076
|
-
/* @__PURE__ */
|
|
3077
|
-
/* @__PURE__ */
|
|
3078
|
-
/* @__PURE__ */
|
|
3079
|
-
/* @__PURE__ */
|
|
3080
|
-
|
|
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,
|
|
3081
3496
|
{
|
|
3082
3497
|
borderStyle: "round",
|
|
3083
3498
|
borderColor: "cyan",
|
|
@@ -3086,11 +3501,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3086
3501
|
alignItems: "center",
|
|
3087
3502
|
justifyContent: "center",
|
|
3088
3503
|
flexDirection: "column",
|
|
3089
|
-
children: /* @__PURE__ */
|
|
3504
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: logoutFocus === "confirm" ? chalk13.bgCyan.white.bold(" Logout ") : chalk13.cyan.bold("Logout") })
|
|
3090
3505
|
}
|
|
3091
3506
|
),
|
|
3092
|
-
/* @__PURE__ */
|
|
3093
|
-
|
|
3507
|
+
/* @__PURE__ */ jsx19(
|
|
3508
|
+
Box18,
|
|
3094
3509
|
{
|
|
3095
3510
|
borderStyle: "round",
|
|
3096
3511
|
borderColor: logoutFocus === "cancel" ? "white" : "gray",
|
|
@@ -3099,16 +3514,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3099
3514
|
alignItems: "center",
|
|
3100
3515
|
justifyContent: "center",
|
|
3101
3516
|
flexDirection: "column",
|
|
3102
|
-
children: /* @__PURE__ */
|
|
3517
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: logoutFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
3103
3518
|
}
|
|
3104
3519
|
)
|
|
3105
3520
|
] }),
|
|
3106
|
-
/* @__PURE__ */
|
|
3521
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3107
3522
|
"Press Enter to ",
|
|
3108
3523
|
logoutFocus === "confirm" ? "Logout" : "Cancel",
|
|
3109
3524
|
" | Y to Logout | C to Cancel"
|
|
3110
3525
|
] }) })
|
|
3111
|
-
] }) }) : orgSwitcherOpen ? /* @__PURE__ */
|
|
3526
|
+
] }) }) : orgSwitcherOpen ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3112
3527
|
OrgSwitcher,
|
|
3113
3528
|
{
|
|
3114
3529
|
token,
|
|
@@ -3116,45 +3531,45 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3116
3531
|
onSelect: handleOrgContextChange,
|
|
3117
3532
|
onClose: () => setOrgSwitcherOpen(false)
|
|
3118
3533
|
}
|
|
3119
|
-
) }) : infoMode ? /* @__PURE__ */
|
|
3534
|
+
) }) : infoMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: (() => {
|
|
3120
3535
|
const repo = infoRepo || visibleItems[cursor];
|
|
3121
|
-
if (!repo) return /* @__PURE__ */
|
|
3536
|
+
if (!repo) return /* @__PURE__ */ jsx19(Text19, { color: "red", children: "No repository selected." });
|
|
3122
3537
|
const langName = repo.primaryLanguage?.name || "N/A";
|
|
3123
3538
|
const langColor = repo.primaryLanguage?.color || "#666666";
|
|
3124
|
-
return /* @__PURE__ */
|
|
3125
|
-
/* @__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: [
|
|
3126
3541
|
"Repository Info ",
|
|
3127
3542
|
infoRepo ? chalk13.dim("(cached)") : ""
|
|
3128
3543
|
] }),
|
|
3129
|
-
/* @__PURE__ */
|
|
3130
|
-
/* @__PURE__ */
|
|
3131
|
-
repo.description && /* @__PURE__ */
|
|
3132
|
-
/* @__PURE__ */
|
|
3133
|
-
/* @__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: [
|
|
3134
3549
|
repo.visibility === "PRIVATE" ? chalk13.yellow("Private") : repo.visibility === "INTERNAL" ? chalk13.magenta("Internal") : chalk13.green("Public"),
|
|
3135
3550
|
repo.isArchived ? chalk13.gray(" Archived") : "",
|
|
3136
3551
|
repo.isFork ? chalk13.blue(" Fork") : ""
|
|
3137
3552
|
] }),
|
|
3138
|
-
/* @__PURE__ */
|
|
3139
|
-
/* @__PURE__ */
|
|
3553
|
+
/* @__PURE__ */ jsx19(Text19, { children: chalk13.gray(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount}`) }),
|
|
3554
|
+
/* @__PURE__ */ jsxs18(Text19, { children: [
|
|
3140
3555
|
chalk13.hex(langColor)(`\u25CF `),
|
|
3141
3556
|
chalk13.gray(`${langName}`)
|
|
3142
3557
|
] }),
|
|
3143
|
-
/* @__PURE__ */
|
|
3558
|
+
/* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3144
3559
|
"Updated: ",
|
|
3145
3560
|
formatDate(repo.updatedAt),
|
|
3146
3561
|
" \u2022 Pushed: ",
|
|
3147
3562
|
formatDate(repo.pushedAt)
|
|
3148
3563
|
] }),
|
|
3149
|
-
/* @__PURE__ */
|
|
3564
|
+
/* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3150
3565
|
"Size: ",
|
|
3151
3566
|
repo.diskUsage,
|
|
3152
3567
|
" KB"
|
|
3153
3568
|
] }),
|
|
3154
|
-
/* @__PURE__ */
|
|
3155
|
-
/* @__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" })
|
|
3156
3571
|
] });
|
|
3157
|
-
})() }) : visibilityMode ? /* @__PURE__ */
|
|
3572
|
+
})() }) : visibilityMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3158
3573
|
VisibilityModal,
|
|
3159
3574
|
{
|
|
3160
3575
|
currentFilter: visibilityFilter,
|
|
@@ -3167,7 +3582,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3167
3582
|
},
|
|
3168
3583
|
onCancel: () => setVisibilityMode(false)
|
|
3169
3584
|
}
|
|
3170
|
-
) }) : sortMode ? /* @__PURE__ */
|
|
3585
|
+
) }) : sortMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3171
3586
|
SortModal,
|
|
3172
3587
|
{
|
|
3173
3588
|
currentSort: sortKey,
|
|
@@ -3179,7 +3594,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3179
3594
|
},
|
|
3180
3595
|
onCancel: () => setSortMode(false)
|
|
3181
3596
|
}
|
|
3182
|
-
) }) : sortDirectionMode ? /* @__PURE__ */
|
|
3597
|
+
) }) : sortDirectionMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3183
3598
|
SortDirectionModal,
|
|
3184
3599
|
{
|
|
3185
3600
|
currentDirection: sortDir,
|
|
@@ -3192,7 +3607,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3192
3607
|
},
|
|
3193
3608
|
onCancel: () => setSortDirectionMode(false)
|
|
3194
3609
|
}
|
|
3195
|
-
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */
|
|
3610
|
+
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3196
3611
|
ChangeVisibilityModal,
|
|
3197
3612
|
{
|
|
3198
3613
|
isOpen: changeVisibilityMode,
|
|
@@ -3205,14 +3620,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3205
3620
|
changing: changingVisibility,
|
|
3206
3621
|
error: changeVisibilityError
|
|
3207
3622
|
}
|
|
3208
|
-
) }) : renameMode && renameTarget ? /* @__PURE__ */
|
|
3623
|
+
) }) : renameMode && renameTarget ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3209
3624
|
RenameModal,
|
|
3210
3625
|
{
|
|
3211
3626
|
repo: renameTarget,
|
|
3212
3627
|
onRename: executeRename,
|
|
3213
3628
|
onCancel: closeRenameModal
|
|
3214
3629
|
}
|
|
3215
|
-
) }) : copyUrlMode ? /* @__PURE__ */
|
|
3630
|
+
) }) : copyUrlMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3216
3631
|
CopyUrlModal,
|
|
3217
3632
|
{
|
|
3218
3633
|
repo: copyUrlTarget,
|
|
@@ -3220,8 +3635,29 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3220
3635
|
onClose: closeCopyUrlModal,
|
|
3221
3636
|
onCopy: handleCopyUrl
|
|
3222
3637
|
}
|
|
3223
|
-
) }) : /* @__PURE__ */
|
|
3224
|
-
|
|
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(
|
|
3225
3661
|
RepoListHeader,
|
|
3226
3662
|
{
|
|
3227
3663
|
ownerContext,
|
|
@@ -3232,12 +3668,13 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3232
3668
|
searchActive,
|
|
3233
3669
|
searchLoading,
|
|
3234
3670
|
visibilityFilter,
|
|
3235
|
-
isEnterprise: isEnterpriseOrg
|
|
3671
|
+
isEnterprise: isEnterpriseOrg,
|
|
3672
|
+
starsMode
|
|
3236
3673
|
}
|
|
3237
3674
|
),
|
|
3238
|
-
filterMode && /* @__PURE__ */
|
|
3239
|
-
/* @__PURE__ */
|
|
3240
|
-
/* @__PURE__ */
|
|
3675
|
+
filterMode && /* @__PURE__ */ jsxs18(Box18, { marginBottom: 1, children: [
|
|
3676
|
+
/* @__PURE__ */ jsx19(Text19, { children: "Search: " }),
|
|
3677
|
+
/* @__PURE__ */ jsx19(
|
|
3241
3678
|
TextInput5,
|
|
3242
3679
|
{
|
|
3243
3680
|
value: filter,
|
|
@@ -3273,14 +3710,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3273
3710
|
onSubmit: () => {
|
|
3274
3711
|
setFilterMode(false);
|
|
3275
3712
|
},
|
|
3276
|
-
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)..."
|
|
3277
3714
|
}
|
|
3278
3715
|
)
|
|
3279
3716
|
] }),
|
|
3280
|
-
/* @__PURE__ */
|
|
3281
|
-
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) => {
|
|
3282
3719
|
const idx = windowed.start + i;
|
|
3283
|
-
return /* @__PURE__ */
|
|
3720
|
+
return /* @__PURE__ */ jsx19(
|
|
3284
3721
|
RepoRow,
|
|
3285
3722
|
{
|
|
3286
3723
|
repo,
|
|
@@ -3288,40 +3725,45 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3288
3725
|
index: idx + 1,
|
|
3289
3726
|
maxWidth: terminalWidth - 6,
|
|
3290
3727
|
spacingLines,
|
|
3291
|
-
forkTracking
|
|
3728
|
+
forkTracking,
|
|
3729
|
+
starsMode
|
|
3292
3730
|
},
|
|
3293
3731
|
repo.nameWithOwner
|
|
3294
3732
|
);
|
|
3295
3733
|
}),
|
|
3296
|
-
loadingMore && hasNextPage && /* @__PURE__ */
|
|
3297
|
-
/* @__PURE__ */
|
|
3298
|
-
/* @__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..." })
|
|
3299
3737
|
] }) }),
|
|
3300
|
-
!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" }) })
|
|
3301
3739
|
] })
|
|
3302
3740
|
] }) }),
|
|
3303
|
-
/* @__PURE__ */
|
|
3304
|
-
/* @__PURE__ */
|
|
3305
|
-
/* @__PURE__ */
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
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" }) })
|
|
3309
3751
|
] }),
|
|
3310
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
3311
|
-
/* @__PURE__ */
|
|
3312
|
-
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))
|
|
3313
3755
|
] }),
|
|
3314
|
-
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 }) }) })
|
|
3315
3757
|
] });
|
|
3316
3758
|
}
|
|
3317
3759
|
|
|
3318
3760
|
// src/ui/components/auth/AuthMethodSelector.tsx
|
|
3319
|
-
import { useState as
|
|
3320
|
-
import { Box as
|
|
3761
|
+
import { useState as useState16 } from "react";
|
|
3762
|
+
import { Box as Box19, Text as Text20, useInput as useInput16 } from "ink";
|
|
3321
3763
|
import chalk14 from "chalk";
|
|
3322
|
-
import { jsx as
|
|
3764
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3323
3765
|
function AuthMethodSelector({ onSelect, onQuit }) {
|
|
3324
|
-
const [selectedIndex, setSelectedIndex] =
|
|
3766
|
+
const [selectedIndex, setSelectedIndex] = useState16(0);
|
|
3325
3767
|
const methods = [
|
|
3326
3768
|
{
|
|
3327
3769
|
key: "oauth",
|
|
@@ -3334,7 +3776,7 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3334
3776
|
description: "Manually enter a GitHub Personal Access Token"
|
|
3335
3777
|
}
|
|
3336
3778
|
];
|
|
3337
|
-
|
|
3779
|
+
useInput16((input, key) => {
|
|
3338
3780
|
if (key.escape || input?.toLowerCase() === "q") {
|
|
3339
3781
|
if (onQuit) {
|
|
3340
3782
|
onQuit();
|
|
@@ -3353,33 +3795,33 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3353
3795
|
onSelect("pat");
|
|
3354
3796
|
}
|
|
3355
3797
|
});
|
|
3356
|
-
return /* @__PURE__ */
|
|
3357
|
-
/* @__PURE__ */
|
|
3358
|
-
/* @__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) => {
|
|
3359
3801
|
const isSelected = index === selectedIndex;
|
|
3360
3802
|
const prefix = isSelected ? chalk14.cyan("\u203A") : " ";
|
|
3361
3803
|
const numberPrefix = `${index + 1}.`;
|
|
3362
|
-
return /* @__PURE__ */
|
|
3363
|
-
/* @__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: [
|
|
3364
3806
|
prefix,
|
|
3365
3807
|
" ",
|
|
3366
3808
|
numberPrefix,
|
|
3367
3809
|
" ",
|
|
3368
3810
|
method.label
|
|
3369
3811
|
] }) }),
|
|
3370
|
-
/* @__PURE__ */
|
|
3812
|
+
/* @__PURE__ */ jsxs19(Text20, { color: "gray", dimColor: true, children: [
|
|
3371
3813
|
" ",
|
|
3372
3814
|
method.description
|
|
3373
3815
|
] })
|
|
3374
3816
|
] }, method.key);
|
|
3375
3817
|
}) }),
|
|
3376
|
-
/* @__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" })
|
|
3377
3819
|
] });
|
|
3378
3820
|
}
|
|
3379
3821
|
|
|
3380
3822
|
// src/ui/components/auth/OAuthProgress.tsx
|
|
3381
|
-
import { Box as
|
|
3382
|
-
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";
|
|
3383
3825
|
function OAuthProgress({ status, error, deviceCode }) {
|
|
3384
3826
|
const statusMessages = {
|
|
3385
3827
|
initializing: {
|
|
@@ -3416,69 +3858,69 @@ function OAuthProgress({ status, error, deviceCode }) {
|
|
|
3416
3858
|
}
|
|
3417
3859
|
};
|
|
3418
3860
|
const { message, showSpinner } = statusMessages[status];
|
|
3419
|
-
return /* @__PURE__ */
|
|
3420
|
-
/* @__PURE__ */
|
|
3421
|
-
/* @__PURE__ */
|
|
3422
|
-
/* @__PURE__ */
|
|
3423
|
-
/* @__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: [
|
|
3424
3866
|
" ",
|
|
3425
3867
|
message
|
|
3426
3868
|
] })
|
|
3427
|
-
] }) : /* @__PURE__ */
|
|
3869
|
+
] }) : /* @__PURE__ */ jsxs20(Text21, { color: status === "error" ? "red" : "green", children: [
|
|
3428
3870
|
status === "error" ? "\u2717" : "\u2713",
|
|
3429
3871
|
" ",
|
|
3430
3872
|
message
|
|
3431
3873
|
] }) }),
|
|
3432
|
-
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */
|
|
3433
|
-
/* @__PURE__ */
|
|
3434
|
-
/* @__PURE__ */
|
|
3435
|
-
/* @__PURE__ */
|
|
3436
|
-
/* @__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 })
|
|
3437
3879
|
] }),
|
|
3438
|
-
/* @__PURE__ */
|
|
3439
|
-
/* @__PURE__ */
|
|
3440
|
-
/* @__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 }) })
|
|
3441
3883
|
] }),
|
|
3442
|
-
status === "waiting_for_authorization" && /* @__PURE__ */
|
|
3443
|
-
status === "polling_for_token" && /* @__PURE__ */
|
|
3444
|
-
/* @__PURE__ */
|
|
3445
|
-
/* @__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." })
|
|
3446
3888
|
] })
|
|
3447
3889
|
] }),
|
|
3448
|
-
status === "error" && error && /* @__PURE__ */
|
|
3449
|
-
/* @__PURE__ */
|
|
3450
|
-
/* @__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." })
|
|
3451
3893
|
] }),
|
|
3452
|
-
status === "success" && /* @__PURE__ */
|
|
3894
|
+
status === "success" && /* @__PURE__ */ jsx21(Text21, { color: "gray", marginTop: 1, children: "Returning to application..." })
|
|
3453
3895
|
] });
|
|
3454
3896
|
}
|
|
3455
3897
|
|
|
3456
3898
|
// src/ui/App.tsx
|
|
3457
|
-
import { jsx as
|
|
3899
|
+
import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3458
3900
|
var packageJson = require_package();
|
|
3459
3901
|
function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlineTokenEphemeral }) {
|
|
3460
3902
|
const { exit } = useApp2();
|
|
3461
3903
|
const { stdout } = useStdout2();
|
|
3462
|
-
const [mode, setMode] =
|
|
3463
|
-
const [token, setToken] =
|
|
3464
|
-
const [input, setInput] =
|
|
3465
|
-
const [error, setError] =
|
|
3466
|
-
const [viewer, setViewer] =
|
|
3467
|
-
const [rateLimitReset, setRateLimitReset] =
|
|
3468
|
-
const [wasRateLimited, setWasRateLimited] =
|
|
3469
|
-
const [orgContext, setOrgContext] =
|
|
3470
|
-
const [authMethod, setAuthMethod] =
|
|
3471
|
-
const [oauthStatus, setOAuthStatus] =
|
|
3472
|
-
const [tokenSource, setTokenSource] =
|
|
3473
|
-
const [sessionTokenOrigin, setSessionTokenOrigin] =
|
|
3474
|
-
const [deviceCodeResponse, setDeviceCodeResponse] =
|
|
3475
|
-
const [oauthDeviceCode, setOauthDeviceCode] =
|
|
3476
|
-
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(() => {
|
|
3477
3919
|
const cols = stdout?.columns ?? 100;
|
|
3478
3920
|
const rows = stdout?.rows ?? 30;
|
|
3479
3921
|
return { cols, rows };
|
|
3480
3922
|
});
|
|
3481
|
-
|
|
3923
|
+
useEffect12(() => {
|
|
3482
3924
|
if (!stdout) return;
|
|
3483
3925
|
const onResize = () => {
|
|
3484
3926
|
const cols = stdout.columns ?? 100;
|
|
@@ -3490,7 +3932,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3490
3932
|
stdout.off?.("resize", onResize);
|
|
3491
3933
|
};
|
|
3492
3934
|
}, [stdout]);
|
|
3493
|
-
|
|
3935
|
+
useEffect12(() => {
|
|
3494
3936
|
const env = getTokenFromEnv();
|
|
3495
3937
|
const stored = getStoredToken();
|
|
3496
3938
|
const source = getTokenSource();
|
|
@@ -3514,7 +3956,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3514
3956
|
setMode("auth_method_selection");
|
|
3515
3957
|
}
|
|
3516
3958
|
}, [inlineToken2]);
|
|
3517
|
-
|
|
3959
|
+
useEffect12(() => {
|
|
3518
3960
|
if (mode !== "oauth_flow") return;
|
|
3519
3961
|
(async () => {
|
|
3520
3962
|
try {
|
|
@@ -3566,7 +4008,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3566
4008
|
setMode("oauth_flow");
|
|
3567
4009
|
}
|
|
3568
4010
|
};
|
|
3569
|
-
|
|
4011
|
+
useEffect12(() => {
|
|
3570
4012
|
(async () => {
|
|
3571
4013
|
if (mode !== "validating" || !token) return;
|
|
3572
4014
|
const timeoutId = setTimeout(() => {
|
|
@@ -3678,7 +4120,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3678
4120
|
setTokenSource("pat");
|
|
3679
4121
|
setMode("auth_method_selection");
|
|
3680
4122
|
};
|
|
3681
|
-
|
|
4123
|
+
useInput17((input2, key) => {
|
|
3682
4124
|
if ((mode === "prompt" || mode === "auth_method_selection") && key.escape) {
|
|
3683
4125
|
exit();
|
|
3684
4126
|
}
|
|
@@ -3710,19 +4152,19 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3710
4152
|
}
|
|
3711
4153
|
});
|
|
3712
4154
|
const verticalPadding = Math.floor(dims.rows * 0.05);
|
|
3713
|
-
const header = useMemo2(() => /* @__PURE__ */
|
|
3714
|
-
/* @__PURE__ */
|
|
3715
|
-
/* @__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: [
|
|
3716
4158
|
" ",
|
|
3717
4159
|
"GitHub Repository Manager"
|
|
3718
4160
|
] }),
|
|
3719
|
-
/* @__PURE__ */
|
|
4161
|
+
/* @__PURE__ */ jsxs21(Text22, { color: "gray", dimColor: true, children: [
|
|
3720
4162
|
"v",
|
|
3721
4163
|
packageJson.version
|
|
3722
4164
|
] }),
|
|
3723
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
4165
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsx22(Text22, { backgroundColor: "blue", color: "white", children: " debug mode " })
|
|
3724
4166
|
] }),
|
|
3725
|
-
viewer && /* @__PURE__ */
|
|
4167
|
+
viewer && /* @__PURE__ */ jsx22(Text22, { color: "gray", children: orgContext !== "personal" && orgContext.login ? `${orgContext.login}/@${viewer} ` : `@${viewer} ` })
|
|
3726
4168
|
] }), [viewer, orgContext]);
|
|
3727
4169
|
if (mode === "rate_limited") {
|
|
3728
4170
|
const formatResetTime = (resetTime) => {
|
|
@@ -3745,70 +4187,70 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3745
4187
|
return "Unknown";
|
|
3746
4188
|
}
|
|
3747
4189
|
};
|
|
3748
|
-
return /* @__PURE__ */
|
|
4190
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3749
4191
|
header,
|
|
3750
|
-
/* @__PURE__ */
|
|
3751
|
-
/* @__PURE__ */
|
|
3752
|
-
/* @__PURE__ */
|
|
3753
|
-
/* @__PURE__ */
|
|
3754
|
-
rateLimitReset && /* @__PURE__ */
|
|
3755
|
-
/* @__PURE__ */
|
|
3756
|
-
/* @__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:" }),
|
|
3757
4199
|
" ",
|
|
3758
|
-
/* @__PURE__ */
|
|
4200
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, children: formatResetTime(rateLimitReset) })
|
|
3759
4201
|
] }),
|
|
3760
|
-
/* @__PURE__ */
|
|
4202
|
+
/* @__PURE__ */ jsxs21(Text22, { color: "gray", dimColor: true, children: [
|
|
3761
4203
|
"(",
|
|
3762
4204
|
new Date(rateLimitReset).toLocaleTimeString(),
|
|
3763
4205
|
")"
|
|
3764
4206
|
] })
|
|
3765
4207
|
] }),
|
|
3766
|
-
/* @__PURE__ */
|
|
3767
|
-
/* @__PURE__ */
|
|
3768
|
-
/* @__PURE__ */
|
|
3769
|
-
/* @__PURE__ */
|
|
3770
|
-
/* @__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" }),
|
|
3771
4213
|
" - Retry now ",
|
|
3772
4214
|
rateLimitReset && formatResetTime(rateLimitReset) !== "Now (should be reset)" ? "(likely to fail until reset)" : "(should work now)"
|
|
3773
4215
|
] }),
|
|
3774
|
-
/* @__PURE__ */
|
|
3775
|
-
/* @__PURE__ */
|
|
4216
|
+
/* @__PURE__ */ jsxs21(Text22, { children: [
|
|
4217
|
+
/* @__PURE__ */ jsx22(Text22, { color: "cyan", bold: true, children: "L" }),
|
|
3776
4218
|
" - Logout and choose authentication method"
|
|
3777
4219
|
] }),
|
|
3778
|
-
/* @__PURE__ */
|
|
3779
|
-
/* @__PURE__ */
|
|
4220
|
+
/* @__PURE__ */ jsxs21(Text22, { children: [
|
|
4221
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", bold: true, children: "Q/Esc" }),
|
|
3780
4222
|
" - Quit application"
|
|
3781
4223
|
] })
|
|
3782
4224
|
] })
|
|
3783
4225
|
] }),
|
|
3784
|
-
/* @__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." })
|
|
3785
4227
|
] }) })
|
|
3786
4228
|
] });
|
|
3787
4229
|
}
|
|
3788
4230
|
if (mode === "auth_method_selection") {
|
|
3789
|
-
return /* @__PURE__ */
|
|
4231
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3790
4232
|
header,
|
|
3791
|
-
/* @__PURE__ */
|
|
3792
|
-
/* @__PURE__ */
|
|
3793
|
-
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 })
|
|
3794
4236
|
] }) })
|
|
3795
4237
|
] });
|
|
3796
4238
|
}
|
|
3797
4239
|
if (mode === "oauth_flow") {
|
|
3798
|
-
return /* @__PURE__ */
|
|
4240
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3799
4241
|
header,
|
|
3800
|
-
/* @__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 }) })
|
|
3801
4243
|
] });
|
|
3802
4244
|
}
|
|
3803
4245
|
if (mode === "prompt") {
|
|
3804
|
-
return /* @__PURE__ */
|
|
4246
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3805
4247
|
header,
|
|
3806
|
-
/* @__PURE__ */
|
|
3807
|
-
/* @__PURE__ */
|
|
3808
|
-
/* @__PURE__ */
|
|
3809
|
-
/* @__PURE__ */
|
|
3810
|
-
/* @__PURE__ */
|
|
3811
|
-
/* @__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(
|
|
3812
4254
|
TextInput6,
|
|
3813
4255
|
{
|
|
3814
4256
|
value: input,
|
|
@@ -3818,30 +4260,30 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3818
4260
|
}
|
|
3819
4261
|
)
|
|
3820
4262
|
] }),
|
|
3821
|
-
error && /* @__PURE__ */
|
|
3822
|
-
/* @__PURE__ */
|
|
3823
|
-
/* @__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" })
|
|
3824
4266
|
] }) })
|
|
3825
4267
|
] });
|
|
3826
4268
|
}
|
|
3827
4269
|
if (mode === "validating" || mode === "checking") {
|
|
3828
|
-
return /* @__PURE__ */
|
|
4270
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3829
4271
|
header,
|
|
3830
|
-
/* @__PURE__ */
|
|
3831
|
-
/* @__PURE__ */
|
|
3832
|
-
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" })
|
|
3833
4275
|
] }) })
|
|
3834
4276
|
] });
|
|
3835
4277
|
}
|
|
3836
4278
|
if (mode === "error") {
|
|
3837
|
-
return /* @__PURE__ */
|
|
4279
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3838
4280
|
header,
|
|
3839
|
-
/* @__PURE__ */
|
|
4281
|
+
/* @__PURE__ */ jsx22(Box21, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx22(Text22, { color: "red", children: error ?? "Unexpected error" }) })
|
|
3840
4282
|
] });
|
|
3841
4283
|
}
|
|
3842
|
-
return /* @__PURE__ */
|
|
4284
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3843
4285
|
header,
|
|
3844
|
-
/* @__PURE__ */
|
|
4286
|
+
/* @__PURE__ */ jsx22(
|
|
3845
4287
|
RepoList,
|
|
3846
4288
|
{
|
|
3847
4289
|
token,
|
|
@@ -3856,7 +4298,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3856
4298
|
}
|
|
3857
4299
|
|
|
3858
4300
|
// src/index.tsx
|
|
3859
|
-
import { jsx as
|
|
4301
|
+
import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3860
4302
|
var argv = process.argv.slice(2);
|
|
3861
4303
|
var getFlagValue = (name) => {
|
|
3862
4304
|
const idx = argv.findIndex((a) => a === `--${name}` || a.startsWith(`--${name}=`));
|
|
@@ -3969,8 +4411,8 @@ var inlineToken = (() => {
|
|
|
3969
4411
|
})();
|
|
3970
4412
|
logger.debug("Rendering UI");
|
|
3971
4413
|
var { unmount } = render(
|
|
3972
|
-
/* @__PURE__ */
|
|
3973
|
-
/* @__PURE__ */
|
|
3974
|
-
/* @__PURE__ */
|
|
4414
|
+
/* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", children: [
|
|
4415
|
+
/* @__PURE__ */ jsx23(App, { initialOrgSlug, inlineToken, inlineTokenEphemeral: Boolean(inlineToken) }),
|
|
4416
|
+
/* @__PURE__ */ jsx23(Text23, { color: "gray" })
|
|
3975
4417
|
] })
|
|
3976
4418
|
);
|