gh-manager-cli 1.34.0 → 1.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +11 -5
- package/dist/{chunk-4A3TGHG7.js → chunk-EZP4YBHA.js} +153 -0
- package/dist/{github-64JCWV7P.js → github-HIF7MTPO.js} +7 -1
- package/dist/index.js +851 -431
- package/package.json +1 -23
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.1",
|
|
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",
|
|
@@ -140,28 +143,6 @@ var require_package = __commonJS({
|
|
|
140
143
|
],
|
|
141
144
|
message: "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
|
|
142
145
|
}
|
|
143
|
-
],
|
|
144
|
-
[
|
|
145
|
-
"@semantic-release/github",
|
|
146
|
-
{
|
|
147
|
-
assets: [
|
|
148
|
-
{
|
|
149
|
-
path: "binaries/gh-manager-cli-linux-x64/gh-manager-cli-linux-x64",
|
|
150
|
-
name: "gh-manager-cli-linux-x64",
|
|
151
|
-
label: "Linux x64 Binary"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
path: "binaries/gh-manager-cli-macos-x64/gh-manager-cli-macos-x64",
|
|
155
|
-
name: "gh-manager-cli-macos-x64",
|
|
156
|
-
label: "macOS x64 Binary"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
path: "binaries/gh-manager-cli-windows-x64/gh-manager-cli-windows-x64.exe",
|
|
160
|
-
name: "gh-manager-cli-windows-x64.exe",
|
|
161
|
-
label: "Windows x64 Binary"
|
|
162
|
-
}
|
|
163
|
-
]
|
|
164
|
-
}
|
|
165
146
|
]
|
|
166
147
|
]
|
|
167
148
|
}
|
|
@@ -171,12 +152,12 @@ var require_package = __commonJS({
|
|
|
171
152
|
|
|
172
153
|
// src/index.tsx
|
|
173
154
|
var import_package = __toESM(require_package(), 1);
|
|
174
|
-
import { render, Box as
|
|
155
|
+
import { render, Box as Box22, Text as Text23 } from "ink";
|
|
175
156
|
import "dotenv/config";
|
|
176
157
|
|
|
177
158
|
// src/ui/App.tsx
|
|
178
|
-
import { useEffect as
|
|
179
|
-
import { Box as
|
|
159
|
+
import { useEffect as useEffect12, useMemo as useMemo2, useState as useState17 } from "react";
|
|
160
|
+
import { Box as Box21, Text as Text22, useApp as useApp2, useStdout as useStdout2, useInput as useInput17 } from "ink";
|
|
180
161
|
import TextInput6 from "ink-text-input";
|
|
181
162
|
|
|
182
163
|
// src/config/config.ts
|
|
@@ -425,8 +406,8 @@ async function openGitHubAuthorizationPage() {
|
|
|
425
406
|
}
|
|
426
407
|
|
|
427
408
|
// src/ui/views/RepoList.tsx
|
|
428
|
-
import
|
|
429
|
-
import { Box as
|
|
409
|
+
import React15, { useEffect as useEffect11, useMemo, useState as useState15, useRef, useCallback } from "react";
|
|
410
|
+
import { Box as Box18, Text as Text19, useApp, useInput as useInput15, useStdout } from "ink";
|
|
430
411
|
import TextInput5 from "ink-text-input";
|
|
431
412
|
import chalk13 from "chalk";
|
|
432
413
|
|
|
@@ -506,7 +487,7 @@ function OrgSwitcher({ token, currentContext, onSelect, onClose }) {
|
|
|
506
487
|
try {
|
|
507
488
|
setLoading(true);
|
|
508
489
|
setError(null);
|
|
509
|
-
const client = await import("./github-
|
|
490
|
+
const client = await import("./github-HIF7MTPO.js").then((m) => m.makeClient(token));
|
|
510
491
|
const orgs = await fetchViewerOrganizations(client);
|
|
511
492
|
setOrganizations(orgs);
|
|
512
493
|
const entOrgs = /* @__PURE__ */ new Set();
|
|
@@ -1528,10 +1509,241 @@ function RenameModal({ repo, onRename, onCancel }) {
|
|
|
1528
1509
|
);
|
|
1529
1510
|
}
|
|
1530
1511
|
|
|
1531
|
-
// src/ui/components/
|
|
1512
|
+
// src/ui/components/modals/StarModal.tsx
|
|
1513
|
+
import { useEffect as useEffect9, useState as useState13 } from "react";
|
|
1532
1514
|
import { Box as Box13, Text as Text14 } from "ink";
|
|
1515
|
+
import { useInput as useInput13 } from "ink";
|
|
1516
|
+
import { Fragment as Fragment7, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1517
|
+
function StarModal({
|
|
1518
|
+
visible,
|
|
1519
|
+
repo,
|
|
1520
|
+
isStarred,
|
|
1521
|
+
onConfirm,
|
|
1522
|
+
onCancel,
|
|
1523
|
+
isStarring = false,
|
|
1524
|
+
error = null
|
|
1525
|
+
}) {
|
|
1526
|
+
const [focusedButton, setFocusedButton] = useState13("cancel");
|
|
1527
|
+
useInput13((input, key) => {
|
|
1528
|
+
if (!visible) return;
|
|
1529
|
+
if (key.escape || input === "c" || input === "C") {
|
|
1530
|
+
onCancel();
|
|
1531
|
+
return;
|
|
1532
|
+
}
|
|
1533
|
+
if (key.leftArrow) {
|
|
1534
|
+
setFocusedButton("cancel");
|
|
1535
|
+
} else if (key.rightArrow) {
|
|
1536
|
+
setFocusedButton("star");
|
|
1537
|
+
}
|
|
1538
|
+
if (key.return || input === "y" || input === "Y") {
|
|
1539
|
+
if (focusedButton === "star") {
|
|
1540
|
+
onConfirm();
|
|
1541
|
+
} else {
|
|
1542
|
+
onCancel();
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
if (input === "n" || input === "N") {
|
|
1546
|
+
onCancel();
|
|
1547
|
+
}
|
|
1548
|
+
if (input === "s" || input === "S") {
|
|
1549
|
+
onConfirm();
|
|
1550
|
+
}
|
|
1551
|
+
});
|
|
1552
|
+
useEffect9(() => {
|
|
1553
|
+
if (visible) {
|
|
1554
|
+
setFocusedButton("cancel");
|
|
1555
|
+
}
|
|
1556
|
+
}, [visible]);
|
|
1557
|
+
if (!visible || !repo) return null;
|
|
1558
|
+
const action = isStarred ? "Unstar" : "Star";
|
|
1559
|
+
const actionLower = isStarred ? "unstar" : "star";
|
|
1560
|
+
const actionGerund = isStarred ? "Unstarring" : "Starring";
|
|
1561
|
+
return /* @__PURE__ */ jsxs13(
|
|
1562
|
+
Box13,
|
|
1563
|
+
{
|
|
1564
|
+
flexDirection: "column",
|
|
1565
|
+
borderStyle: "round",
|
|
1566
|
+
borderColor: "yellow",
|
|
1567
|
+
paddingX: 2,
|
|
1568
|
+
paddingY: 1,
|
|
1569
|
+
marginTop: 1,
|
|
1570
|
+
children: [
|
|
1571
|
+
/* @__PURE__ */ jsx14(Box13, { marginBottom: 1, children: /* @__PURE__ */ jsxs13(Text14, { bold: true, color: "yellow", children: [
|
|
1572
|
+
"\u2B50 ",
|
|
1573
|
+
action,
|
|
1574
|
+
" Repository"
|
|
1575
|
+
] }) }),
|
|
1576
|
+
/* @__PURE__ */ jsx14(Box13, { marginBottom: 1, children: /* @__PURE__ */ jsxs13(Text14, { children: [
|
|
1577
|
+
"Are you sure you want to ",
|
|
1578
|
+
actionLower,
|
|
1579
|
+
" ",
|
|
1580
|
+
/* @__PURE__ */ jsx14(Text14, { bold: true, color: "cyan", children: repo.nameWithOwner }),
|
|
1581
|
+
"?"
|
|
1582
|
+
] }) }),
|
|
1583
|
+
repo.description && /* @__PURE__ */ jsx14(Box13, { marginBottom: 1, children: /* @__PURE__ */ jsx14(Text14, { dimColor: true, wrap: "wrap", children: repo.description }) }),
|
|
1584
|
+
/* @__PURE__ */ jsx14(Box13, { marginBottom: 1, children: /* @__PURE__ */ jsxs13(Text14, { dimColor: true, children: [
|
|
1585
|
+
"Current Stars: ",
|
|
1586
|
+
repo.stargazerCount,
|
|
1587
|
+
" \u2022 Forks: ",
|
|
1588
|
+
repo.forkCount
|
|
1589
|
+
] }) }),
|
|
1590
|
+
error && /* @__PURE__ */ jsx14(Box13, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs13(Text14, { color: "red", wrap: "wrap", children: [
|
|
1591
|
+
error.includes("OAuth access restrictions") ? "\u26A0\uFE0F " : "Error: ",
|
|
1592
|
+
error
|
|
1593
|
+
] }) }),
|
|
1594
|
+
isStarring ? /* @__PURE__ */ jsx14(Box13, { children: /* @__PURE__ */ jsxs13(Text14, { color: "yellow", children: [
|
|
1595
|
+
actionGerund,
|
|
1596
|
+
"..."
|
|
1597
|
+
] }) }) : /* @__PURE__ */ jsxs13(Fragment7, { children: [
|
|
1598
|
+
/* @__PURE__ */ jsxs13(Box13, { gap: 2, children: [
|
|
1599
|
+
/* @__PURE__ */ jsx14(Box13, { children: /* @__PURE__ */ jsxs13(
|
|
1600
|
+
Text14,
|
|
1601
|
+
{
|
|
1602
|
+
backgroundColor: focusedButton === "cancel" ? "white" : void 0,
|
|
1603
|
+
color: focusedButton === "cancel" ? "black" : "white",
|
|
1604
|
+
bold: focusedButton === "cancel",
|
|
1605
|
+
children: [
|
|
1606
|
+
" ",
|
|
1607
|
+
"Cancel (C/Esc)",
|
|
1608
|
+
" "
|
|
1609
|
+
]
|
|
1610
|
+
}
|
|
1611
|
+
) }),
|
|
1612
|
+
/* @__PURE__ */ jsx14(Box13, { children: /* @__PURE__ */ jsxs13(
|
|
1613
|
+
Text14,
|
|
1614
|
+
{
|
|
1615
|
+
backgroundColor: focusedButton === "star" ? "yellow" : void 0,
|
|
1616
|
+
color: focusedButton === "star" ? "black" : "yellow",
|
|
1617
|
+
bold: focusedButton === "star",
|
|
1618
|
+
children: [
|
|
1619
|
+
" ",
|
|
1620
|
+
action,
|
|
1621
|
+
" (S/Y)",
|
|
1622
|
+
" "
|
|
1623
|
+
]
|
|
1624
|
+
}
|
|
1625
|
+
) })
|
|
1626
|
+
] }),
|
|
1627
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { dimColor: true, children: "Use \u2190 \u2192 to navigate, Enter to select" }) })
|
|
1628
|
+
] })
|
|
1629
|
+
]
|
|
1630
|
+
}
|
|
1631
|
+
);
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
// src/ui/components/modals/UnstarModal.tsx
|
|
1635
|
+
import { useEffect as useEffect10, useState as useState14 } from "react";
|
|
1636
|
+
import { Box as Box14, Text as Text15 } from "ink";
|
|
1637
|
+
import { useInput as useInput14 } from "ink";
|
|
1638
|
+
import { Fragment as Fragment8, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1639
|
+
function UnstarModal({
|
|
1640
|
+
visible,
|
|
1641
|
+
repo,
|
|
1642
|
+
onConfirm,
|
|
1643
|
+
onCancel,
|
|
1644
|
+
isUnstarring = false,
|
|
1645
|
+
error = null
|
|
1646
|
+
}) {
|
|
1647
|
+
const [focusedButton, setFocusedButton] = useState14("cancel");
|
|
1648
|
+
useInput14((input, key) => {
|
|
1649
|
+
if (!visible) return;
|
|
1650
|
+
if (key.escape || input === "c" || input === "C") {
|
|
1651
|
+
onCancel();
|
|
1652
|
+
return;
|
|
1653
|
+
}
|
|
1654
|
+
if (key.leftArrow) {
|
|
1655
|
+
setFocusedButton("cancel");
|
|
1656
|
+
} else if (key.rightArrow) {
|
|
1657
|
+
setFocusedButton("unstar");
|
|
1658
|
+
}
|
|
1659
|
+
if (key.return || input === "y" || input === "Y") {
|
|
1660
|
+
if (focusedButton === "unstar") {
|
|
1661
|
+
onConfirm();
|
|
1662
|
+
} else {
|
|
1663
|
+
onCancel();
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
if (input === "n" || input === "N") {
|
|
1667
|
+
onCancel();
|
|
1668
|
+
}
|
|
1669
|
+
if (input === "u" || input === "U") {
|
|
1670
|
+
onConfirm();
|
|
1671
|
+
}
|
|
1672
|
+
});
|
|
1673
|
+
useEffect10(() => {
|
|
1674
|
+
if (visible) {
|
|
1675
|
+
setFocusedButton("cancel");
|
|
1676
|
+
}
|
|
1677
|
+
}, [visible]);
|
|
1678
|
+
if (!visible || !repo) return null;
|
|
1679
|
+
return /* @__PURE__ */ jsxs14(
|
|
1680
|
+
Box14,
|
|
1681
|
+
{
|
|
1682
|
+
flexDirection: "column",
|
|
1683
|
+
borderStyle: "round",
|
|
1684
|
+
borderColor: "yellow",
|
|
1685
|
+
paddingX: 2,
|
|
1686
|
+
paddingY: 1,
|
|
1687
|
+
marginTop: 1,
|
|
1688
|
+
children: [
|
|
1689
|
+
/* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx15(Text15, { bold: true, color: "yellow", children: "\u2B50 Unstar Repository" }) }),
|
|
1690
|
+
/* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsxs14(Text15, { children: [
|
|
1691
|
+
"Are you sure you want to unstar",
|
|
1692
|
+
" ",
|
|
1693
|
+
/* @__PURE__ */ jsx15(Text15, { bold: true, color: "cyan", children: repo.nameWithOwner }),
|
|
1694
|
+
"?"
|
|
1695
|
+
] }) }),
|
|
1696
|
+
repo.description && /* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx15(Text15, { dimColor: true, wrap: "wrap", children: repo.description }) }),
|
|
1697
|
+
/* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsxs14(Text15, { dimColor: true, children: [
|
|
1698
|
+
"Stars: ",
|
|
1699
|
+
repo.stargazerCount,
|
|
1700
|
+
" \u2022 Forks: ",
|
|
1701
|
+
repo.forkCount
|
|
1702
|
+
] }) }),
|
|
1703
|
+
error && /* @__PURE__ */ jsx15(Box14, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs14(Text15, { color: "red", wrap: "wrap", children: [
|
|
1704
|
+
error.includes("OAuth access restrictions") ? "\u26A0\uFE0F " : "Error: ",
|
|
1705
|
+
error
|
|
1706
|
+
] }) }),
|
|
1707
|
+
isUnstarring ? /* @__PURE__ */ jsx15(Box14, { children: /* @__PURE__ */ jsx15(Text15, { color: "yellow", children: "Unstarring..." }) }) : /* @__PURE__ */ jsxs14(Fragment8, { children: [
|
|
1708
|
+
/* @__PURE__ */ jsxs14(Box14, { gap: 2, children: [
|
|
1709
|
+
/* @__PURE__ */ jsx15(Box14, { children: /* @__PURE__ */ jsxs14(
|
|
1710
|
+
Text15,
|
|
1711
|
+
{
|
|
1712
|
+
backgroundColor: focusedButton === "cancel" ? "white" : void 0,
|
|
1713
|
+
color: focusedButton === "cancel" ? "black" : "white",
|
|
1714
|
+
bold: focusedButton === "cancel",
|
|
1715
|
+
children: [
|
|
1716
|
+
" ",
|
|
1717
|
+
"Cancel (C/Esc)",
|
|
1718
|
+
" "
|
|
1719
|
+
]
|
|
1720
|
+
}
|
|
1721
|
+
) }),
|
|
1722
|
+
/* @__PURE__ */ jsx15(Box14, { children: /* @__PURE__ */ jsxs14(
|
|
1723
|
+
Text15,
|
|
1724
|
+
{
|
|
1725
|
+
backgroundColor: focusedButton === "unstar" ? "yellow" : void 0,
|
|
1726
|
+
color: focusedButton === "unstar" ? "black" : "yellow",
|
|
1727
|
+
bold: focusedButton === "unstar",
|
|
1728
|
+
children: [
|
|
1729
|
+
" ",
|
|
1730
|
+
"Unstar (U/Y)",
|
|
1731
|
+
" "
|
|
1732
|
+
]
|
|
1733
|
+
}
|
|
1734
|
+
) })
|
|
1735
|
+
] }),
|
|
1736
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(Text15, { dimColor: true, children: "Use \u2190 \u2192 to navigate, Enter to select" }) })
|
|
1737
|
+
] })
|
|
1738
|
+
]
|
|
1739
|
+
}
|
|
1740
|
+
);
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
// src/ui/components/repo/RepoRow.tsx
|
|
1744
|
+
import { Box as Box15, Text as Text16 } from "ink";
|
|
1533
1745
|
import chalk12 from "chalk";
|
|
1534
|
-
import { jsx as
|
|
1746
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1535
1747
|
function RepoRow({
|
|
1536
1748
|
repo,
|
|
1537
1749
|
selected,
|
|
@@ -1539,7 +1751,8 @@ function RepoRow({
|
|
|
1539
1751
|
maxWidth,
|
|
1540
1752
|
spacingLines,
|
|
1541
1753
|
dim,
|
|
1542
|
-
forkTracking
|
|
1754
|
+
forkTracking,
|
|
1755
|
+
starsMode = false
|
|
1543
1756
|
}) {
|
|
1544
1757
|
const langName = repo.primaryLanguage?.name || "";
|
|
1545
1758
|
const langColor = repo.primaryLanguage?.color || "#666666";
|
|
@@ -1550,12 +1763,18 @@ function RepoRow({
|
|
|
1550
1763
|
const numColor = selected ? chalk12.cyan : chalk12.gray;
|
|
1551
1764
|
const nameColor = selected ? chalk12.cyan.bold : chalk12.white;
|
|
1552
1765
|
line1 += numColor(`${String(index).padStart(3, " ")}.`);
|
|
1766
|
+
if (repo.viewerHasStarred) {
|
|
1767
|
+
line1 += chalk12.yellow(" \u2B50");
|
|
1768
|
+
}
|
|
1553
1769
|
line1 += nameColor(` ${repo.nameWithOwner}`);
|
|
1554
1770
|
if (repo.visibility === "INTERNAL") {
|
|
1555
1771
|
line1 += chalk12.magenta(" Internal");
|
|
1556
1772
|
} else if (repo.visibility === "PRIVATE" || repo.isPrivate && !repo.visibility) {
|
|
1557
1773
|
line1 += chalk12.yellow(" Private");
|
|
1558
1774
|
}
|
|
1775
|
+
if (starsMode && repo.owner && repo.owner.__typename === "Organization") {
|
|
1776
|
+
line1 += chalk12.gray(" [org]");
|
|
1777
|
+
}
|
|
1559
1778
|
if (repo.isArchived) line1 += " " + chalk12.bgGray.whiteBright(" Archived ") + " ";
|
|
1560
1779
|
if (repo.isFork && repo.parent) {
|
|
1561
1780
|
line1 += chalk12.blue(` Fork of ${repo.parent.nameWithOwner}`);
|
|
@@ -1576,21 +1795,21 @@ function RepoRow({
|
|
|
1576
1795
|
if (line3) fullText += "\n" + metaColor(line3);
|
|
1577
1796
|
const spacingAbove = Math.floor(spacingLines / 2);
|
|
1578
1797
|
const spacingBelow = spacingLines - spacingAbove;
|
|
1579
|
-
return /* @__PURE__ */
|
|
1580
|
-
spacingAbove > 0 && /* @__PURE__ */
|
|
1581
|
-
/* @__PURE__ */
|
|
1582
|
-
spacingBelow > 0 && /* @__PURE__ */
|
|
1798
|
+
return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", backgroundColor: selected ? "gray" : void 0, children: [
|
|
1799
|
+
spacingAbove > 0 && /* @__PURE__ */ jsx16(Box15, { height: spacingAbove, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) }),
|
|
1800
|
+
/* @__PURE__ */ jsx16(Text16, { children: dim ? chalk12.dim(fullText) : fullText }),
|
|
1801
|
+
spacingBelow > 0 && /* @__PURE__ */ jsx16(Box15, { height: spacingBelow, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) })
|
|
1583
1802
|
] });
|
|
1584
1803
|
}
|
|
1585
1804
|
|
|
1586
1805
|
// src/ui/components/repo/FilterInput.tsx
|
|
1587
|
-
import { Box as
|
|
1806
|
+
import { Box as Box16, Text as Text17 } from "ink";
|
|
1588
1807
|
import TextInput4 from "ink-text-input";
|
|
1589
|
-
import { jsx as
|
|
1808
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1590
1809
|
|
|
1591
1810
|
// src/ui/components/repo/RepoListHeader.tsx
|
|
1592
|
-
import { Box as
|
|
1593
|
-
import { Fragment as
|
|
1811
|
+
import { Box as Box17, Text as Text18 } from "ink";
|
|
1812
|
+
import { Fragment as Fragment9, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1594
1813
|
function RepoListHeader({
|
|
1595
1814
|
ownerContext,
|
|
1596
1815
|
sortKey,
|
|
@@ -1600,39 +1819,41 @@ function RepoListHeader({
|
|
|
1600
1819
|
searchActive,
|
|
1601
1820
|
searchLoading,
|
|
1602
1821
|
visibilityFilter = "all",
|
|
1603
|
-
isEnterprise = false
|
|
1822
|
+
isEnterprise = false,
|
|
1823
|
+
starsMode = false
|
|
1604
1824
|
}) {
|
|
1605
1825
|
const contextLabel = ownerContext === "personal" ? "Personal Account" : ownerContext?.type === "organization" ? `Organization: ${ownerContext.name ?? ownerContext.login}` : "";
|
|
1606
1826
|
const visibilityLabel = visibilityFilter === "public" ? "Public" : visibilityFilter === "private" ? isEnterprise ? "Private/Internal" : "Private" : visibilityFilter === "internal" ? "Internal" : "";
|
|
1607
|
-
return /* @__PURE__ */
|
|
1608
|
-
contextLabel && /* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1827
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "row", gap: 2, marginBottom: 1, children: [
|
|
1828
|
+
contextLabel && /* @__PURE__ */ jsx18(Text18, { children: contextLabel }),
|
|
1829
|
+
starsMode && /* @__PURE__ */ jsx18(Text18, { color: "yellow", bold: true, children: "\u2B50 Stars Mode" }),
|
|
1830
|
+
/* @__PURE__ */ jsxs17(Text18, { color: "gray", dimColor: true, children: [
|
|
1610
1831
|
"Sort: ",
|
|
1611
1832
|
sortKey,
|
|
1612
1833
|
" ",
|
|
1613
1834
|
sortDir === "asc" ? "\u2191" : "\u2193"
|
|
1614
1835
|
] }),
|
|
1615
|
-
/* @__PURE__ */
|
|
1836
|
+
/* @__PURE__ */ jsxs17(Text18, { color: "gray", dimColor: true, children: [
|
|
1616
1837
|
"Fork Status - Commits Behind: ",
|
|
1617
1838
|
forkTracking ? "ON" : "OFF"
|
|
1618
1839
|
] }),
|
|
1619
|
-
!!visibilityLabel && /* @__PURE__ */
|
|
1840
|
+
!!visibilityLabel && !starsMode && /* @__PURE__ */ jsxs17(Text18, { color: "yellow", children: [
|
|
1620
1841
|
"Visibility: ",
|
|
1621
1842
|
visibilityLabel
|
|
1622
1843
|
] }),
|
|
1623
|
-
filter && !searchActive && /* @__PURE__ */
|
|
1844
|
+
filter && !searchActive && /* @__PURE__ */ jsxs17(Text18, { color: "cyan", children: [
|
|
1624
1845
|
'Filter: "',
|
|
1625
1846
|
filter,
|
|
1626
1847
|
'"'
|
|
1627
1848
|
] }),
|
|
1628
|
-
searchActive && /* @__PURE__ */
|
|
1629
|
-
/* @__PURE__ */
|
|
1849
|
+
searchActive && /* @__PURE__ */ jsxs17(Fragment9, { children: [
|
|
1850
|
+
/* @__PURE__ */ jsxs17(Text18, { color: "cyan", children: [
|
|
1630
1851
|
'Search: "',
|
|
1631
1852
|
filter.trim(),
|
|
1632
1853
|
'"'
|
|
1633
1854
|
] }),
|
|
1634
|
-
searchLoading && /* @__PURE__ */
|
|
1635
|
-
/* @__PURE__ */
|
|
1855
|
+
searchLoading && /* @__PURE__ */ jsx18(Box17, { marginLeft: 1, children: /* @__PURE__ */ jsxs17(Text18, { color: "cyan", children: [
|
|
1856
|
+
/* @__PURE__ */ jsx18(SlowSpinner, {}),
|
|
1636
1857
|
" Searching\u2026"
|
|
1637
1858
|
] }) })
|
|
1638
1859
|
] })
|
|
@@ -1640,7 +1861,7 @@ function RepoListHeader({
|
|
|
1640
1861
|
}
|
|
1641
1862
|
|
|
1642
1863
|
// src/ui/views/RepoList.tsx
|
|
1643
|
-
import { Fragment as
|
|
1864
|
+
import { Fragment as Fragment10, jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1644
1865
|
var getPageSize = () => {
|
|
1645
1866
|
const envValue = process.env.REPOS_PER_FETCH;
|
|
1646
1867
|
if (envValue) {
|
|
@@ -1656,17 +1877,17 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1656
1877
|
const { exit } = useApp();
|
|
1657
1878
|
const { stdout } = useStdout();
|
|
1658
1879
|
const client = useMemo(() => makeClient(token), [token]);
|
|
1659
|
-
const [debugMessages, setDebugMessages] =
|
|
1880
|
+
const [debugMessages, setDebugMessages] = useState15([]);
|
|
1660
1881
|
const addDebugMessage = useCallback((msg) => {
|
|
1661
1882
|
if (process.env.GH_MANAGER_DEBUG === "1") {
|
|
1662
1883
|
setDebugMessages((prev) => [...prev.slice(-9), msg]);
|
|
1663
1884
|
}
|
|
1664
1885
|
}, []);
|
|
1665
1886
|
const handleOrgContextChangeRef = useRef(onOrgContextChange);
|
|
1666
|
-
|
|
1887
|
+
useEffect11(() => {
|
|
1667
1888
|
handleOrgContextChangeRef.current = onOrgContextChange;
|
|
1668
1889
|
}, [onOrgContextChange]);
|
|
1669
|
-
|
|
1890
|
+
React15.useEffect(() => {
|
|
1670
1891
|
addDebugMessage(`[RepoList] Component mounted`);
|
|
1671
1892
|
logger.info("RepoList component mounted", {
|
|
1672
1893
|
token: token ? "present" : "missing",
|
|
@@ -1678,72 +1899,86 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1678
1899
|
}, []);
|
|
1679
1900
|
const terminalWidth = stdout?.columns ?? 80;
|
|
1680
1901
|
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] =
|
|
1902
|
+
const [items, setItems] = useState15([]);
|
|
1903
|
+
const [cursor, setCursor] = useState15(0);
|
|
1904
|
+
const [endCursor, setEndCursor] = useState15(null);
|
|
1905
|
+
const [hasNextPage, setHasNextPage] = useState15(false);
|
|
1906
|
+
const [totalCount, setTotalCount] = useState15(0);
|
|
1907
|
+
const [loading, setLoading] = useState15(true);
|
|
1908
|
+
const [sortingLoading, setSortingLoading] = useState15(false);
|
|
1909
|
+
const [refreshing, setRefreshing] = useState15(false);
|
|
1910
|
+
const [loadingMore, setLoadingMore] = useState15(false);
|
|
1911
|
+
const [error, setError] = useState15(null);
|
|
1912
|
+
const [rateLimit, setRateLimit] = useState15(void 0);
|
|
1913
|
+
const [prevRateLimit, setPrevRateLimit] = useState15(void 0);
|
|
1914
|
+
const [restRateLimit, setRestRateLimit] = useState15(void 0);
|
|
1915
|
+
const [prevRestRateLimit, setPrevRestRateLimit] = useState15(void 0);
|
|
1916
|
+
const [density, setDensity] = useState15(2);
|
|
1917
|
+
const [prefsLoaded, setPrefsLoaded] = useState15(false);
|
|
1918
|
+
const [ownerContext, setOwnerContext] = useState15("personal");
|
|
1919
|
+
const [ownerAffiliations, setOwnerAffiliations] = useState15(["OWNER"]);
|
|
1920
|
+
const [orgSwitcherOpen, setOrgSwitcherOpen] = useState15(false);
|
|
1921
|
+
const [operationCount, setOperationCount] = useState15(0);
|
|
1922
|
+
const [showSponsorReminder, setShowSponsorReminder] = useState15(false);
|
|
1923
|
+
const [searchItems, setSearchItems] = useState15([]);
|
|
1924
|
+
const [searchEndCursor, setSearchEndCursor] = useState15(null);
|
|
1925
|
+
const [searchHasNextPage, setSearchHasNextPage] = useState15(false);
|
|
1926
|
+
const [searchTotalCount, setSearchTotalCount] = useState15(0);
|
|
1927
|
+
const [searchLoading, setSearchLoading] = useState15(false);
|
|
1928
|
+
const [deleteMode, setDeleteMode] = useState15(false);
|
|
1929
|
+
const [deleteTarget, setDeleteTarget] = useState15(null);
|
|
1930
|
+
const [deleteCode, setDeleteCode] = useState15("");
|
|
1931
|
+
const [typedCode, setTypedCode] = useState15("");
|
|
1932
|
+
const [deleting, setDeleting] = useState15(false);
|
|
1933
|
+
const [deleteError, setDeleteError] = useState15(null);
|
|
1934
|
+
const [deleteConfirmStage, setDeleteConfirmStage] = useState15(false);
|
|
1935
|
+
const [confirmFocus, setConfirmFocus] = useState15("delete");
|
|
1936
|
+
const [archiveMode, setArchiveMode] = useState15(false);
|
|
1937
|
+
const [archiveTarget, setArchiveTarget] = useState15(null);
|
|
1938
|
+
const [archiving, setArchiving] = useState15(false);
|
|
1939
|
+
const [archiveError, setArchiveError] = useState15(null);
|
|
1940
|
+
const [archiveFocus, setArchiveFocus] = useState15("confirm");
|
|
1941
|
+
const [syncMode, setSyncMode] = useState15(false);
|
|
1942
|
+
const [syncTarget, setSyncTarget] = useState15(null);
|
|
1943
|
+
const [syncing, setSyncing] = useState15(false);
|
|
1944
|
+
const [syncError, setSyncError] = useState15(null);
|
|
1945
|
+
const [syncFocus, setSyncFocus] = useState15("confirm");
|
|
1946
|
+
const [renameMode, setRenameMode] = useState15(false);
|
|
1947
|
+
const [renameTarget, setRenameTarget] = useState15(null);
|
|
1948
|
+
const [copyUrlMode, setCopyUrlMode] = useState15(false);
|
|
1949
|
+
const [copyUrlTarget, setCopyUrlTarget] = useState15(null);
|
|
1950
|
+
const [copyToast, setCopyToast] = useState15(null);
|
|
1951
|
+
const [syncTrigger, setSyncTrigger] = useState15(false);
|
|
1952
|
+
const [infoMode, setInfoMode] = useState15(false);
|
|
1953
|
+
const [infoRepo, setInfoRepo] = useState15(null);
|
|
1954
|
+
const [logoutMode, setLogoutMode] = useState15(false);
|
|
1955
|
+
const [logoutFocus, setLogoutFocus] = useState15("confirm");
|
|
1956
|
+
const [logoutError, setLogoutError] = useState15(null);
|
|
1957
|
+
const [visibilityMode, setVisibilityMode] = useState15(false);
|
|
1958
|
+
const [isEnterpriseOrg, setIsEnterpriseOrg] = useState15(false);
|
|
1959
|
+
const [hasInternalRepos, setHasInternalRepos] = useState15(false);
|
|
1960
|
+
const [changeVisibilityMode, setChangeVisibilityMode] = useState15(false);
|
|
1961
|
+
const [changeVisibilityTarget, setChangeVisibilityTarget] = useState15(null);
|
|
1962
|
+
const [changingVisibility, setChangingVisibility] = useState15(false);
|
|
1963
|
+
const [changeVisibilityError, setChangeVisibilityError] = useState15(null);
|
|
1964
|
+
const [sortMode, setSortMode] = useState15(false);
|
|
1965
|
+
const [sortDirectionMode, setSortDirectionMode] = useState15(false);
|
|
1966
|
+
const [starsMode, setStarsMode] = useState15(false);
|
|
1967
|
+
const [starredItems, setStarredItems] = useState15([]);
|
|
1968
|
+
const [starredEndCursor, setStarredEndCursor] = useState15(null);
|
|
1969
|
+
const [starredHasNextPage, setStarredHasNextPage] = useState15(false);
|
|
1970
|
+
const [starredTotalCount, setStarredTotalCount] = useState15(0);
|
|
1971
|
+
const [starredLoading, setStarredLoading] = useState15(false);
|
|
1972
|
+
const [unstarMode, setUnstarMode] = useState15(false);
|
|
1973
|
+
const [unstarTarget, setUnstarTarget] = useState15(null);
|
|
1974
|
+
const [unstarring, setUnstarring] = useState15(false);
|
|
1975
|
+
const [unstarError, setUnstarError] = useState15(null);
|
|
1976
|
+
const [starMode, setStarMode] = useState15(false);
|
|
1977
|
+
const [starTarget, setStarTarget] = useState15(null);
|
|
1978
|
+
const [starring, setStarring] = useState15(false);
|
|
1979
|
+
const [starError, setStarError] = useState15(null);
|
|
1745
1980
|
const appliedInitialOrg = useRef(false);
|
|
1746
|
-
|
|
1981
|
+
useEffect11(() => {
|
|
1747
1982
|
(async () => {
|
|
1748
1983
|
if (appliedInitialOrg.current) return;
|
|
1749
1984
|
if (!initialOrgSlug2) return;
|
|
@@ -1812,6 +2047,102 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1812
2047
|
setCopyUrlMode(true);
|
|
1813
2048
|
setCopyUrlTarget(repo);
|
|
1814
2049
|
}
|
|
2050
|
+
async function fetchStarredRepositories(after, reset = false) {
|
|
2051
|
+
setStarredLoading(true);
|
|
2052
|
+
try {
|
|
2053
|
+
const page = await getStarredRepositories(client, PAGE_SIZE, after ?? void 0);
|
|
2054
|
+
setStarredItems((prev) => reset || !after ? page.nodes : [...prev, ...page.nodes]);
|
|
2055
|
+
setStarredEndCursor(page.endCursor ?? null);
|
|
2056
|
+
setStarredHasNextPage(page.hasNextPage);
|
|
2057
|
+
setStarredTotalCount(page.totalCount);
|
|
2058
|
+
if (page.rateLimit) {
|
|
2059
|
+
setRateLimit(page.rateLimit);
|
|
2060
|
+
setPrevRateLimit(page.rateLimit.remaining);
|
|
2061
|
+
}
|
|
2062
|
+
setStarredLoading(false);
|
|
2063
|
+
} catch (e) {
|
|
2064
|
+
setStarredLoading(false);
|
|
2065
|
+
setError(e.message || "Failed to fetch starred repositories");
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
async function handleUnstar() {
|
|
2069
|
+
if (!unstarTarget || unstarring) return;
|
|
2070
|
+
try {
|
|
2071
|
+
setUnstarring(true);
|
|
2072
|
+
const targetId = unstarTarget.id;
|
|
2073
|
+
await unstarRepository(client, targetId);
|
|
2074
|
+
setStarredItems((prev) => prev.filter((r) => r.id !== targetId));
|
|
2075
|
+
setStarredTotalCount((c) => Math.max(0, c - 1));
|
|
2076
|
+
setCursor((c) => Math.max(0, Math.min(c, starredItems.length - 2)));
|
|
2077
|
+
trackSuccessfulOperation();
|
|
2078
|
+
setUnstarMode(false);
|
|
2079
|
+
setUnstarTarget(null);
|
|
2080
|
+
setUnstarError(null);
|
|
2081
|
+
setUnstarring(false);
|
|
2082
|
+
} catch (e) {
|
|
2083
|
+
setUnstarring(false);
|
|
2084
|
+
const errorMsg = e.message || "Failed to unstar repository";
|
|
2085
|
+
if (errorMsg.includes("OAuth App access restrictions")) {
|
|
2086
|
+
const orgMatch = errorMsg.match(/`([^`]+)` organization/);
|
|
2087
|
+
const orgName = orgMatch ? orgMatch[1] : unstarTarget?.nameWithOwner.split("/")[0];
|
|
2088
|
+
setUnstarError(
|
|
2089
|
+
`Cannot unstar: The ${orgName} organization has OAuth access restrictions. You'll need to unstar this repository directly on GitHub.`
|
|
2090
|
+
);
|
|
2091
|
+
} else {
|
|
2092
|
+
setUnstarError(errorMsg);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
function closeUnstarModal() {
|
|
2097
|
+
setUnstarMode(false);
|
|
2098
|
+
setUnstarTarget(null);
|
|
2099
|
+
setUnstarError(null);
|
|
2100
|
+
setUnstarring(false);
|
|
2101
|
+
}
|
|
2102
|
+
async function handleStar() {
|
|
2103
|
+
if (!starTarget || starring) return;
|
|
2104
|
+
const isStarred = starTarget.viewerHasStarred;
|
|
2105
|
+
try {
|
|
2106
|
+
setStarring(true);
|
|
2107
|
+
const targetId = starTarget.id;
|
|
2108
|
+
if (isStarred) {
|
|
2109
|
+
await unstarRepository(client, targetId);
|
|
2110
|
+
} else {
|
|
2111
|
+
await starRepository(client, targetId);
|
|
2112
|
+
}
|
|
2113
|
+
const updateRepo = (r) => {
|
|
2114
|
+
if (r.id === targetId) {
|
|
2115
|
+
return { ...r, viewerHasStarred: !isStarred, stargazerCount: r.stargazerCount + (isStarred ? -1 : 1) };
|
|
2116
|
+
}
|
|
2117
|
+
return r;
|
|
2118
|
+
};
|
|
2119
|
+
setItems((prev) => prev.map(updateRepo));
|
|
2120
|
+
setSearchItems((prev) => prev.map(updateRepo));
|
|
2121
|
+
trackSuccessfulOperation();
|
|
2122
|
+
setStarMode(false);
|
|
2123
|
+
setStarTarget(null);
|
|
2124
|
+
setStarError(null);
|
|
2125
|
+
setStarring(false);
|
|
2126
|
+
} catch (e) {
|
|
2127
|
+
setStarring(false);
|
|
2128
|
+
const errorMsg = e.message || `Failed to ${isStarred ? "unstar" : "star"} repository`;
|
|
2129
|
+
if (errorMsg.includes("OAuth access restrictions")) {
|
|
2130
|
+
const orgMatch = errorMsg.match(/`([^`]+)` organization/);
|
|
2131
|
+
const orgName = orgMatch ? orgMatch[1] : starTarget?.nameWithOwner.split("/")[0];
|
|
2132
|
+
setStarError(
|
|
2133
|
+
`Cannot ${isStarred ? "unstar" : "star"}: The ${orgName} organization has OAuth access restrictions. You'll need to ${isStarred ? "unstar" : "star"} this repository directly on GitHub.`
|
|
2134
|
+
);
|
|
2135
|
+
} else {
|
|
2136
|
+
setStarError(errorMsg);
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
function closeStarModal() {
|
|
2141
|
+
setStarMode(false);
|
|
2142
|
+
setStarTarget(null);
|
|
2143
|
+
setStarError(null);
|
|
2144
|
+
setStarring(false);
|
|
2145
|
+
}
|
|
1815
2146
|
async function executeSync() {
|
|
1816
2147
|
if (!syncTarget || syncing) return;
|
|
1817
2148
|
try {
|
|
@@ -1916,7 +2247,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1916
2247
|
throw error2;
|
|
1917
2248
|
}
|
|
1918
2249
|
}
|
|
1919
|
-
|
|
2250
|
+
useEffect11(() => {
|
|
1920
2251
|
return () => {
|
|
1921
2252
|
if (copyToastTimerRef.current) {
|
|
1922
2253
|
clearTimeout(copyToastTimerRef.current);
|
|
@@ -1963,6 +2294,13 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1963
2294
|
setFilter("");
|
|
1964
2295
|
setFilterMode(false);
|
|
1965
2296
|
setVisibilityFilter("all");
|
|
2297
|
+
if (newContext !== "personal" && starsMode) {
|
|
2298
|
+
setStarsMode(false);
|
|
2299
|
+
setStarredItems([]);
|
|
2300
|
+
setStarredHasNextPage(false);
|
|
2301
|
+
setStarredEndCursor(null);
|
|
2302
|
+
setStarredTotalCount(0);
|
|
2303
|
+
}
|
|
1966
2304
|
const newAffiliations = newContext === "personal" ? ["OWNER"] : ["ORGANIZATION_MEMBER"];
|
|
1967
2305
|
setOwnerAffiliations(newAffiliations);
|
|
1968
2306
|
if (newContext !== "personal") {
|
|
@@ -2017,12 +2355,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2017
2355
|
setDeleteError("Failed to delete repository. Ensure delete_repo scope and admin permissions.");
|
|
2018
2356
|
}
|
|
2019
2357
|
}
|
|
2020
|
-
const [filter, setFilter] =
|
|
2021
|
-
const [filterMode, setFilterMode] =
|
|
2022
|
-
const [sortKey, setSortKey] =
|
|
2023
|
-
const [sortDir, setSortDir] =
|
|
2024
|
-
const [forkTracking, setForkTracking] =
|
|
2025
|
-
const [visibilityFilter, setVisibilityFilter] =
|
|
2358
|
+
const [filter, setFilter] = useState15("");
|
|
2359
|
+
const [filterMode, setFilterMode] = useState15(false);
|
|
2360
|
+
const [sortKey, setSortKey] = useState15("updated");
|
|
2361
|
+
const [sortDir, setSortDir] = useState15("desc");
|
|
2362
|
+
const [forkTracking, setForkTracking] = useState15(true);
|
|
2363
|
+
const [visibilityFilter, setVisibilityFilter] = useState15("all");
|
|
2026
2364
|
const previousVisibilityFilter = useRef("all");
|
|
2027
2365
|
const sortFieldMap = {
|
|
2028
2366
|
"updated": "UPDATED_AT",
|
|
@@ -2183,7 +2521,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2183
2521
|
setSearchLoading(false);
|
|
2184
2522
|
}
|
|
2185
2523
|
};
|
|
2186
|
-
|
|
2524
|
+
useEffect11(() => {
|
|
2187
2525
|
const ui = getUIPrefs();
|
|
2188
2526
|
if (ui.density !== void 0) setDensity(ui.density);
|
|
2189
2527
|
if (ui.sortKey && ["updated", "pushed", "name", "stars"].includes(ui.sortKey)) {
|
|
@@ -2192,8 +2530,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2192
2530
|
if (ui.sortDir && (ui.sortDir === "asc" || ui.sortDir === "desc")) {
|
|
2193
2531
|
setSortDir(ui.sortDir);
|
|
2194
2532
|
}
|
|
2195
|
-
|
|
2196
|
-
else setForkTracking(true);
|
|
2533
|
+
setForkTracking(true);
|
|
2197
2534
|
if (ui.visibilityFilter && ["all", "public", "private", "internal"].includes(ui.visibilityFilter)) {
|
|
2198
2535
|
setVisibilityFilter(ui.visibilityFilter);
|
|
2199
2536
|
}
|
|
@@ -2214,7 +2551,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2214
2551
|
}
|
|
2215
2552
|
setPrefsLoaded(true);
|
|
2216
2553
|
}, [onOrgContextChange]);
|
|
2217
|
-
|
|
2554
|
+
useEffect11(() => {
|
|
2218
2555
|
if (!prefsLoaded) return;
|
|
2219
2556
|
let policy = "cache-first";
|
|
2220
2557
|
const orgLogin = ownerContext !== "personal" ? ownerContext.login : void 0;
|
|
@@ -2234,7 +2571,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2234
2571
|
setCursor(0);
|
|
2235
2572
|
fetchPage(null, true, false, void 0, policy);
|
|
2236
2573
|
}, [client, prefsLoaded, ownerContext, ownerAffiliations]);
|
|
2237
|
-
|
|
2574
|
+
useEffect11(() => {
|
|
2238
2575
|
if (!searchActive) {
|
|
2239
2576
|
if (items.length > 0) {
|
|
2240
2577
|
let policy = "cache-first";
|
|
@@ -2273,7 +2610,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2273
2610
|
}
|
|
2274
2611
|
}
|
|
2275
2612
|
}, [sortKey, sortDir]);
|
|
2276
|
-
|
|
2613
|
+
useEffect11(() => {
|
|
2277
2614
|
if (visibilityFilter !== "all" || previousVisibilityFilter.current && previousVisibilityFilter.current !== visibilityFilter) {
|
|
2278
2615
|
if (!searchActive) {
|
|
2279
2616
|
if (items.length > 0) {
|
|
@@ -2290,7 +2627,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2290
2627
|
}
|
|
2291
2628
|
previousVisibilityFilter.current = visibilityFilter;
|
|
2292
2629
|
}, [visibilityFilter]);
|
|
2293
|
-
|
|
2630
|
+
useEffect11(() => {
|
|
2294
2631
|
if (viewerLogin && searchActive && !searchLoading && searchItems.length === 0) {
|
|
2295
2632
|
let policy = "cache-first";
|
|
2296
2633
|
try {
|
|
@@ -2311,7 +2648,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2311
2648
|
fetchSearchPage(null, true, policy);
|
|
2312
2649
|
}
|
|
2313
2650
|
}, [viewerLogin]);
|
|
2314
|
-
|
|
2651
|
+
useInput15((input, key) => {
|
|
2315
2652
|
if (error) {
|
|
2316
2653
|
if (input && input.toUpperCase() === "Q") {
|
|
2317
2654
|
try {
|
|
@@ -2396,6 +2733,20 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2396
2733
|
}
|
|
2397
2734
|
return;
|
|
2398
2735
|
}
|
|
2736
|
+
if (unstarMode) {
|
|
2737
|
+
if (key.escape || input && input.toUpperCase() === "C") {
|
|
2738
|
+
closeUnstarModal();
|
|
2739
|
+
return;
|
|
2740
|
+
}
|
|
2741
|
+
return;
|
|
2742
|
+
}
|
|
2743
|
+
if (starMode) {
|
|
2744
|
+
if (key.escape || input && input.toUpperCase() === "C") {
|
|
2745
|
+
closeStarModal();
|
|
2746
|
+
return;
|
|
2747
|
+
}
|
|
2748
|
+
return;
|
|
2749
|
+
}
|
|
2399
2750
|
if (syncMode) {
|
|
2400
2751
|
if (key.escape || input && input.toUpperCase() === "C") {
|
|
2401
2752
|
closeSyncModal();
|
|
@@ -2486,22 +2837,24 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2486
2837
|
addDebugMessage("[ESC] Cleared search and returned to normal listing");
|
|
2487
2838
|
return;
|
|
2488
2839
|
}
|
|
2489
|
-
if (key.downArrow && searchActive && visibleItems.length > 0) {
|
|
2840
|
+
if (key.downArrow && (searchActive || starsMode && filter.trim().length > 0) && visibleItems.length > 0) {
|
|
2490
2841
|
setFilterMode(false);
|
|
2491
2842
|
setCursor(0);
|
|
2492
|
-
addDebugMessage("[DOWN] Exited filter mode and selected first
|
|
2843
|
+
addDebugMessage("[DOWN] Exited filter mode and selected first result");
|
|
2493
2844
|
return;
|
|
2494
2845
|
}
|
|
2495
2846
|
return;
|
|
2496
2847
|
}
|
|
2497
|
-
if (key.escape && searchActive) {
|
|
2848
|
+
if (key.escape && (searchActive || starsMode && filter.trim().length > 0)) {
|
|
2498
2849
|
setFilter("");
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2850
|
+
if (!starsMode) {
|
|
2851
|
+
setSearchItems([]);
|
|
2852
|
+
setSearchEndCursor(null);
|
|
2853
|
+
setSearchHasNextPage(false);
|
|
2854
|
+
setSearchTotalCount(0);
|
|
2855
|
+
}
|
|
2503
2856
|
setCursor(0);
|
|
2504
|
-
addDebugMessage("[ESC] Cleared
|
|
2857
|
+
addDebugMessage("[ESC] Cleared filter and returned to normal listing");
|
|
2505
2858
|
return;
|
|
2506
2859
|
}
|
|
2507
2860
|
if (input && input.toUpperCase() === "Q") {
|
|
@@ -2581,7 +2934,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2581
2934
|
}
|
|
2582
2935
|
return;
|
|
2583
2936
|
}
|
|
2584
|
-
if (key.ctrl && (input === "
|
|
2937
|
+
if (key.ctrl && (input === "f" || input === "F")) {
|
|
2585
2938
|
const repo = visibleItems[cursor];
|
|
2586
2939
|
if (repo && repo.isFork && repo.parent) {
|
|
2587
2940
|
const hasCommitData = repo.defaultBranchRef && repo.parent.defaultBranchRef && repo.parent.defaultBranchRef.target?.history && repo.defaultBranchRef.target?.history;
|
|
@@ -2649,7 +3002,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2649
3002
|
setOrgSwitcherOpen(true);
|
|
2650
3003
|
return;
|
|
2651
3004
|
}
|
|
2652
|
-
if (input && input.toUpperCase() === "S") {
|
|
3005
|
+
if (input && input.toUpperCase() === "S" && !key.shift && !key.ctrl) {
|
|
2653
3006
|
setSortMode(true);
|
|
2654
3007
|
return;
|
|
2655
3008
|
}
|
|
@@ -2657,6 +3010,47 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2657
3010
|
setSortDirectionMode(true);
|
|
2658
3011
|
return;
|
|
2659
3012
|
}
|
|
3013
|
+
if (key.shift && input === "S" && ownerContext === "personal") {
|
|
3014
|
+
const newStarsMode = !starsMode;
|
|
3015
|
+
setStarsMode(newStarsMode);
|
|
3016
|
+
setCursor(0);
|
|
3017
|
+
setFilter("");
|
|
3018
|
+
setFilterMode(false);
|
|
3019
|
+
if (newStarsMode) {
|
|
3020
|
+
setVisibilityFilter("all");
|
|
3021
|
+
setSearchItems([]);
|
|
3022
|
+
setSearchEndCursor(null);
|
|
3023
|
+
setSearchHasNextPage(false);
|
|
3024
|
+
setSearchTotalCount(0);
|
|
3025
|
+
fetchStarredRepositories(null, true);
|
|
3026
|
+
} else {
|
|
3027
|
+
setSearchItems([]);
|
|
3028
|
+
setSearchEndCursor(null);
|
|
3029
|
+
setSearchHasNextPage(false);
|
|
3030
|
+
setSearchTotalCount(0);
|
|
3031
|
+
}
|
|
3032
|
+
return;
|
|
3033
|
+
}
|
|
3034
|
+
if (input && input.toUpperCase() === "U" && starsMode) {
|
|
3035
|
+
const repo = visibleItems[cursor];
|
|
3036
|
+
if (repo) {
|
|
3037
|
+
setUnstarTarget(repo);
|
|
3038
|
+
setUnstarMode(true);
|
|
3039
|
+
setUnstarError(null);
|
|
3040
|
+
setUnstarring(false);
|
|
3041
|
+
}
|
|
3042
|
+
return;
|
|
3043
|
+
}
|
|
3044
|
+
if (key.ctrl && (input === "s" || input === "S") && !starsMode) {
|
|
3045
|
+
const repo = visibleItems[cursor];
|
|
3046
|
+
if (repo) {
|
|
3047
|
+
setStarTarget(repo);
|
|
3048
|
+
setStarMode(true);
|
|
3049
|
+
setStarError(null);
|
|
3050
|
+
setStarring(false);
|
|
3051
|
+
}
|
|
3052
|
+
return;
|
|
3053
|
+
}
|
|
2660
3054
|
if (input && input.toUpperCase() === "O") {
|
|
2661
3055
|
const repo = visibleItems[cursor];
|
|
2662
3056
|
if (repo) openInBrowser(`https://github.com/${repo.nameWithOwner}`);
|
|
@@ -2670,23 +3064,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2670
3064
|
});
|
|
2671
3065
|
return;
|
|
2672
3066
|
}
|
|
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
3067
|
if (input && input.toUpperCase() === "V") {
|
|
2689
|
-
|
|
3068
|
+
if (!starsMode) {
|
|
3069
|
+
setVisibilityMode(true);
|
|
3070
|
+
}
|
|
2690
3071
|
return;
|
|
2691
3072
|
}
|
|
2692
3073
|
});
|
|
@@ -2723,7 +3104,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2723
3104
|
});
|
|
2724
3105
|
return arr;
|
|
2725
3106
|
}, [filtered, sortKey, sortDir]);
|
|
2726
|
-
const searchActive = filter.trim().length >= 3;
|
|
3107
|
+
const searchActive = !starsMode && filter.trim().length >= 3;
|
|
2727
3108
|
const filteredSearchItems = useMemo(() => {
|
|
2728
3109
|
let result = searchItems;
|
|
2729
3110
|
if (visibilityFilter === "private") {
|
|
@@ -2733,13 +3114,20 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2733
3114
|
}
|
|
2734
3115
|
return result;
|
|
2735
3116
|
}, [searchItems, visibilityFilter]);
|
|
2736
|
-
const
|
|
2737
|
-
|
|
3117
|
+
const filteredStarredItems = useMemo(() => {
|
|
3118
|
+
if (!filter || filter.trim().length === 0) return starredItems;
|
|
3119
|
+
const lowerFilter = filter.toLowerCase();
|
|
3120
|
+
return starredItems.filter(
|
|
3121
|
+
(repo) => repo.nameWithOwner.toLowerCase().includes(lowerFilter) || repo.description && repo.description.toLowerCase().includes(lowerFilter)
|
|
3122
|
+
);
|
|
3123
|
+
}, [starredItems, filter]);
|
|
3124
|
+
const visibleItems = starsMode ? filteredStarredItems : searchActive ? filteredSearchItems : filteredAndSorted;
|
|
3125
|
+
useEffect11(() => {
|
|
2738
3126
|
if (searchActive) {
|
|
2739
3127
|
addDebugMessage(`[State] searchActive=${searchActive}, searchItems=${searchItems.length}, visibleItems=${visibleItems.length}, filter="${filter}"`);
|
|
2740
3128
|
}
|
|
2741
3129
|
}, [searchActive, searchItems.length, visibleItems.length, filter]);
|
|
2742
|
-
|
|
3130
|
+
useEffect11(() => {
|
|
2743
3131
|
setCursor((c) => Math.min(c, Math.max(0, (searchActive ? searchItems.length : items.length) - 1)));
|
|
2744
3132
|
}, [searchActive, searchItems.length, items.length]);
|
|
2745
3133
|
const headerHeight = 2;
|
|
@@ -2760,10 +3148,15 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2760
3148
|
const end = Math.min(total, start + visibleRepos + buffer);
|
|
2761
3149
|
return { start, end };
|
|
2762
3150
|
}, [visibleItems.length, cursor, listHeight, spacingLines]);
|
|
2763
|
-
|
|
3151
|
+
useEffect11(() => {
|
|
2764
3152
|
const prefetchThreshold = Math.floor(visibleItems.length * 0.8);
|
|
2765
3153
|
const nearEnd = visibleItems.length > 0 && cursor >= prefetchThreshold;
|
|
2766
|
-
if (
|
|
3154
|
+
if (starsMode) {
|
|
3155
|
+
if (!starredLoading && starredHasNextPage && nearEnd) {
|
|
3156
|
+
addDebugMessage(`[Infinite Scroll] Prefetching starred repos at ${cursor}/${visibleItems.length} (80% threshold: ${prefetchThreshold})`);
|
|
3157
|
+
fetchStarredRepositories(starredEndCursor);
|
|
3158
|
+
}
|
|
3159
|
+
} else if (searchActive) {
|
|
2767
3160
|
if (!searchLoading && searchHasNextPage && nearEnd) {
|
|
2768
3161
|
addDebugMessage(`[Infinite Scroll] Prefetching search results at ${cursor}/${visibleItems.length} (80% threshold: ${prefetchThreshold})`);
|
|
2769
3162
|
fetchSearchPage(searchEndCursor);
|
|
@@ -2774,7 +3167,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2774
3167
|
fetchPage(endCursor);
|
|
2775
3168
|
}
|
|
2776
3169
|
}
|
|
2777
|
-
}, [cursor, visibleItems.length, searchActive, searchLoading, searchHasNextPage, searchEndCursor, loading, loadingMore, hasNextPage, endCursor]);
|
|
3170
|
+
}, [cursor, visibleItems.length, starsMode, starredLoading, starredHasNextPage, starredEndCursor, searchActive, searchLoading, searchHasNextPage, searchEndCursor, loading, loadingMore, hasNextPage, endCursor]);
|
|
2778
3171
|
function openInBrowser(url) {
|
|
2779
3172
|
const platform = process.platform;
|
|
2780
3173
|
const cmd = platform === "darwin" ? `open "${url}"` : platform === "win32" ? `start "" "${url}"` : `xdg-open "${url}"`;
|
|
@@ -2782,76 +3175,76 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2782
3175
|
}
|
|
2783
3176
|
const lowRate = rateLimit && rateLimit.remaining <= Math.ceil(rateLimit.limit * 0.1) || restRateLimit && restRateLimit.core.remaining <= Math.ceil(restRateLimit.core.limit * 0.1);
|
|
2784
3177
|
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || sortMode || sortDirectionMode || changeVisibilityMode || copyUrlMode || renameMode;
|
|
2785
|
-
const headerBar = useMemo(() => /* @__PURE__ */
|
|
2786
|
-
/* @__PURE__ */
|
|
2787
|
-
/* @__PURE__ */
|
|
3178
|
+
const headerBar = useMemo(() => /* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: [
|
|
3179
|
+
/* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", gap: 1, children: [
|
|
3180
|
+
/* @__PURE__ */ jsxs18(Text19, { color: "cyan", bold: !modalOpen, dimColor: modalOpen, children: [
|
|
2788
3181
|
" ",
|
|
2789
3182
|
ownerContext === "personal" ? "Personal" : ownerContext.name || ownerContext.login,
|
|
2790
3183
|
ownerContext !== "personal" && isEnterpriseOrg && " (ENT)"
|
|
2791
3184
|
] }),
|
|
2792
|
-
/* @__PURE__ */
|
|
2793
|
-
/* @__PURE__ */
|
|
3185
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, color: modalOpen ? "gray" : void 0, dimColor: modalOpen ? true : void 0, children: "Repositories" }),
|
|
3186
|
+
/* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
2794
3187
|
"(",
|
|
2795
3188
|
visibleItems.length,
|
|
2796
3189
|
"/",
|
|
2797
3190
|
searchActive ? searchTotalCount : totalCount,
|
|
2798
3191
|
")"
|
|
2799
3192
|
] }),
|
|
2800
|
-
(loading || searchLoading) && /* @__PURE__ */
|
|
3193
|
+
(loading || searchLoading) && /* @__PURE__ */ jsx19(Box18, { width: 2, flexShrink: 0, flexGrow: 0, marginLeft: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "yellow", children: /* @__PURE__ */ jsx19(SlowSpinner, {}) }) })
|
|
2801
3194
|
] }),
|
|
2802
|
-
(rateLimit || restRateLimit) && /* @__PURE__ */
|
|
3195
|
+
(rateLimit || restRateLimit) && /* @__PURE__ */ jsxs18(Text19, { color: lowRate ? "yellow" : "gray", children: [
|
|
2803
3196
|
"GraphQL: ",
|
|
2804
3197
|
rateLimit ? `${rateLimit.remaining}/${rateLimit.limit}` : "---/---",
|
|
2805
|
-
prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */
|
|
3198
|
+
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
3199
|
" | ",
|
|
2807
3200
|
"REST: ",
|
|
2808
3201
|
restRateLimit ? `${restRateLimit.core.remaining}/${restRateLimit.core.limit}` : "---/---",
|
|
2809
|
-
prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */
|
|
3202
|
+
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
3203
|
" "
|
|
2811
3204
|
] })
|
|
2812
3205
|
] }), [visibleItems.length, searchActive, searchTotalCount, totalCount, loading, searchLoading, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg, restRateLimit, prevRestRateLimit]);
|
|
2813
3206
|
if (error) {
|
|
2814
|
-
return /* @__PURE__ */
|
|
2815
|
-
/* @__PURE__ */
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
/* @__PURE__ */
|
|
3207
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", height: availableHeight, children: [
|
|
3208
|
+
/* @__PURE__ */ jsx19(Box18, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", gap: 1, children: [
|
|
3209
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, children: " Repositories" }),
|
|
3210
|
+
/* @__PURE__ */ jsx19(Text19, { color: "red", children: "(Error)" })
|
|
2818
3211
|
] }) }),
|
|
2819
|
-
/* @__PURE__ */
|
|
2820
|
-
/* @__PURE__ */
|
|
2821
|
-
/* @__PURE__ */
|
|
3212
|
+
/* @__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: [
|
|
3213
|
+
/* @__PURE__ */ jsx19(Text19, { color: "red", children: error }),
|
|
3214
|
+
/* @__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
3215
|
] }) }) }),
|
|
2823
|
-
/* @__PURE__ */
|
|
3216
|
+
/* @__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
3217
|
] });
|
|
2825
3218
|
}
|
|
2826
3219
|
if (loading && items.length === 0 || sortingLoading) {
|
|
2827
|
-
return /* @__PURE__ */
|
|
2828
|
-
/* @__PURE__ */
|
|
2829
|
-
/* @__PURE__ */
|
|
2830
|
-
/* @__PURE__ */
|
|
3220
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", height: availableHeight, children: [
|
|
3221
|
+
/* @__PURE__ */ jsx19(Box18, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", gap: 1, children: [
|
|
3222
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, children: " Repositories" }),
|
|
3223
|
+
/* @__PURE__ */ jsx19(Text19, { color: "gray", children: "(Loading...)" })
|
|
2831
3224
|
] }) }),
|
|
2832
|
-
/* @__PURE__ */
|
|
2833
|
-
/* @__PURE__ */
|
|
2834
|
-
/* @__PURE__ */
|
|
2835
|
-
/* @__PURE__ */
|
|
3225
|
+
/* @__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: [
|
|
3226
|
+
/* @__PURE__ */ jsxs18(Box18, { height: 1, flexDirection: "row", children: [
|
|
3227
|
+
/* @__PURE__ */ jsx19(Box18, { width: 2, flexShrink: 0, flexGrow: 0, children: /* @__PURE__ */ jsx19(Text19, { color: "cyan", children: /* @__PURE__ */ jsx19(SlowSpinner, {}) }) }),
|
|
3228
|
+
/* @__PURE__ */ jsx19(Text19, { color: "cyan", children: refreshing ? "Refreshing..." : sortingLoading ? "Applying sort..." : "Loading repositories..." })
|
|
2836
3229
|
] }),
|
|
2837
|
-
/* @__PURE__ */
|
|
3230
|
+
/* @__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
3231
|
] }) }) }) }),
|
|
2839
|
-
/* @__PURE__ */
|
|
3232
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "gray", children: "Please wait..." }) })
|
|
2840
3233
|
] });
|
|
2841
3234
|
}
|
|
2842
|
-
return /* @__PURE__ */
|
|
3235
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", height: availableHeight, children: [
|
|
2843
3236
|
headerBar,
|
|
2844
|
-
showSponsorReminder && /* @__PURE__ */
|
|
2845
|
-
/* @__PURE__ */
|
|
2846
|
-
/* @__PURE__ */
|
|
2847
|
-
/* @__PURE__ */
|
|
3237
|
+
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: [
|
|
3238
|
+
/* @__PURE__ */ jsx19(Text19, { color: "yellow", children: "\u{1F49A} Thanks for using gh-manager-cli!" }),
|
|
3239
|
+
/* @__PURE__ */ jsx19(Text19, { color: "gray", children: "Your support helps craft more open-source tools" }),
|
|
3240
|
+
/* @__PURE__ */ jsx19(Text19, { color: "cyan", children: "\u2615 buymeacoffee.com/wiiiimm" })
|
|
2848
3241
|
] }) }) }),
|
|
2849
|
-
/* @__PURE__ */
|
|
3242
|
+
/* @__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
3243
|
// Centered modal; hide list content while modal is open
|
|
2851
|
-
/* @__PURE__ */
|
|
2852
|
-
/* @__PURE__ */
|
|
2853
|
-
/* @__PURE__ */
|
|
2854
|
-
/* @__PURE__ */
|
|
3244
|
+
/* @__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: [
|
|
3245
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, children: "Delete Confirmation" }),
|
|
3246
|
+
/* @__PURE__ */ jsx19(Text19, { color: "red", children: "\u26A0\uFE0F Delete repository?" }),
|
|
3247
|
+
/* @__PURE__ */ jsx19(Box18, { height: 2, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
2855
3248
|
(() => {
|
|
2856
3249
|
const langName = deleteTarget.primaryLanguage?.name || "";
|
|
2857
3250
|
const langColor = deleteTarget.primaryLanguage?.color || "#666666";
|
|
@@ -2863,19 +3256,19 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2863
3256
|
let line2 = "";
|
|
2864
3257
|
if (langName) line2 += chalk13.hex(langColor)("\u25CF ") + chalk13.gray(`${langName} `);
|
|
2865
3258
|
line2 += chalk13.gray(`\u2605 ${deleteTarget.stargazerCount} \u2442 ${deleteTarget.forkCount} Updated ${formatDate(deleteTarget.updatedAt)}`);
|
|
2866
|
-
return /* @__PURE__ */
|
|
2867
|
-
/* @__PURE__ */
|
|
2868
|
-
/* @__PURE__ */
|
|
3259
|
+
return /* @__PURE__ */ jsxs18(Fragment10, { children: [
|
|
3260
|
+
/* @__PURE__ */ jsx19(Text19, { children: line1 }),
|
|
3261
|
+
/* @__PURE__ */ jsx19(Text19, { children: line2 })
|
|
2869
3262
|
] });
|
|
2870
3263
|
})(),
|
|
2871
|
-
/* @__PURE__ */
|
|
3264
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsxs18(Text19, { children: [
|
|
2872
3265
|
"Type ",
|
|
2873
|
-
/* @__PURE__ */
|
|
3266
|
+
/* @__PURE__ */ jsx19(Text19, { color: "yellow", bold: true, children: deleteCode }),
|
|
2874
3267
|
" to confirm."
|
|
2875
3268
|
] }) }),
|
|
2876
|
-
!deleteConfirmStage && /* @__PURE__ */
|
|
2877
|
-
/* @__PURE__ */
|
|
2878
|
-
/* @__PURE__ */
|
|
3269
|
+
!deleteConfirmStage && /* @__PURE__ */ jsxs18(Box18, { marginTop: 1, children: [
|
|
3270
|
+
/* @__PURE__ */ jsx19(Text19, { children: "Confirm code: " }),
|
|
3271
|
+
/* @__PURE__ */ jsx19(
|
|
2879
3272
|
TextInput5,
|
|
2880
3273
|
{
|
|
2881
3274
|
value: typedCode,
|
|
@@ -2902,11 +3295,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2902
3295
|
}
|
|
2903
3296
|
)
|
|
2904
3297
|
] }),
|
|
2905
|
-
deleteConfirmStage && /* @__PURE__ */
|
|
2906
|
-
/* @__PURE__ */
|
|
2907
|
-
/* @__PURE__ */
|
|
2908
|
-
/* @__PURE__ */
|
|
2909
|
-
|
|
3298
|
+
deleteConfirmStage && /* @__PURE__ */ jsxs18(Box18, { marginTop: 1, flexDirection: "column", children: [
|
|
3299
|
+
/* @__PURE__ */ jsx19(Text19, { color: "red", children: "This action will permanently delete the repository. This cannot be undone." }),
|
|
3300
|
+
/* @__PURE__ */ jsxs18(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3301
|
+
/* @__PURE__ */ jsx19(
|
|
3302
|
+
Box18,
|
|
2910
3303
|
{
|
|
2911
3304
|
borderStyle: "round",
|
|
2912
3305
|
borderColor: "red",
|
|
@@ -2915,11 +3308,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2915
3308
|
alignItems: "center",
|
|
2916
3309
|
justifyContent: "center",
|
|
2917
3310
|
flexDirection: "column",
|
|
2918
|
-
children: /* @__PURE__ */
|
|
3311
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: confirmFocus === "delete" ? chalk13.bgRed.white.bold(" Delete ") : chalk13.red.bold("Delete") })
|
|
2919
3312
|
}
|
|
2920
3313
|
),
|
|
2921
|
-
/* @__PURE__ */
|
|
2922
|
-
|
|
3314
|
+
/* @__PURE__ */ jsx19(
|
|
3315
|
+
Box18,
|
|
2923
3316
|
{
|
|
2924
3317
|
borderStyle: "round",
|
|
2925
3318
|
borderColor: confirmFocus === "cancel" ? "white" : "gray",
|
|
@@ -2928,16 +3321,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2928
3321
|
alignItems: "center",
|
|
2929
3322
|
justifyContent: "center",
|
|
2930
3323
|
flexDirection: "column",
|
|
2931
|
-
children: /* @__PURE__ */
|
|
3324
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: confirmFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
2932
3325
|
}
|
|
2933
3326
|
)
|
|
2934
3327
|
] }),
|
|
2935
|
-
/* @__PURE__ */
|
|
3328
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
2936
3329
|
"Press Enter to ",
|
|
2937
3330
|
confirmFocus === "delete" ? "Delete" : "Cancel",
|
|
2938
3331
|
" | Y to Delete | C to Cancel"
|
|
2939
3332
|
] }) }),
|
|
2940
|
-
/* @__PURE__ */
|
|
3333
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(
|
|
2941
3334
|
TextInput5,
|
|
2942
3335
|
{
|
|
2943
3336
|
value: "",
|
|
@@ -2951,18 +3344,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2951
3344
|
}
|
|
2952
3345
|
) })
|
|
2953
3346
|
] }),
|
|
2954
|
-
deleteError && /* @__PURE__ */
|
|
2955
|
-
deleting && /* @__PURE__ */
|
|
3347
|
+
deleteError && /* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "magenta", children: deleteError }) }),
|
|
3348
|
+
deleting && /* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "yellow", children: "Deleting..." }) })
|
|
2956
3349
|
] }) })
|
|
2957
|
-
) : archiveMode && archiveTarget ? /* @__PURE__ */
|
|
2958
|
-
/* @__PURE__ */
|
|
2959
|
-
/* @__PURE__ */
|
|
2960
|
-
/* @__PURE__ */
|
|
2961
|
-
/* @__PURE__ */
|
|
2962
|
-
/* @__PURE__ */
|
|
2963
|
-
/* @__PURE__ */
|
|
2964
|
-
/* @__PURE__ */
|
|
2965
|
-
|
|
3350
|
+
) : 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: [
|
|
3351
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, children: archiveTarget.isArchived ? "Unarchive Confirmation" : "Archive Confirmation" }),
|
|
3352
|
+
/* @__PURE__ */ jsx19(Text19, { color: archiveTarget.isArchived ? "green" : "yellow", children: archiveTarget.isArchived ? "\u21BA Unarchive repository?" : "\u26A0\uFE0F Archive repository?" }),
|
|
3353
|
+
/* @__PURE__ */ jsx19(Box18, { height: 1, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
3354
|
+
/* @__PURE__ */ jsx19(Text19, { children: archiveTarget.nameWithOwner }),
|
|
3355
|
+
/* @__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." }) }),
|
|
3356
|
+
/* @__PURE__ */ jsxs18(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3357
|
+
/* @__PURE__ */ jsx19(
|
|
3358
|
+
Box18,
|
|
2966
3359
|
{
|
|
2967
3360
|
borderStyle: "round",
|
|
2968
3361
|
borderColor: archiveTarget.isArchived ? "green" : "yellow",
|
|
@@ -2971,11 +3364,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2971
3364
|
alignItems: "center",
|
|
2972
3365
|
justifyContent: "center",
|
|
2973
3366
|
flexDirection: "column",
|
|
2974
|
-
children: /* @__PURE__ */
|
|
3367
|
+
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
3368
|
}
|
|
2976
3369
|
),
|
|
2977
|
-
/* @__PURE__ */
|
|
2978
|
-
|
|
3370
|
+
/* @__PURE__ */ jsx19(
|
|
3371
|
+
Box18,
|
|
2979
3372
|
{
|
|
2980
3373
|
borderStyle: "round",
|
|
2981
3374
|
borderColor: archiveFocus === "cancel" ? "white" : "gray",
|
|
@@ -2984,18 +3377,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2984
3377
|
alignItems: "center",
|
|
2985
3378
|
justifyContent: "center",
|
|
2986
3379
|
flexDirection: "column",
|
|
2987
|
-
children: /* @__PURE__ */
|
|
3380
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: archiveFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
2988
3381
|
}
|
|
2989
3382
|
)
|
|
2990
3383
|
] }),
|
|
2991
|
-
/* @__PURE__ */
|
|
3384
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
2992
3385
|
"Press Enter to ",
|
|
2993
3386
|
archiveFocus === "confirm" ? archiveTarget.isArchived ? "Unarchive" : "Archive" : "Cancel",
|
|
2994
3387
|
" | Y to ",
|
|
2995
3388
|
archiveTarget.isArchived ? "Unarchive" : "Archive",
|
|
2996
3389
|
" | C to Cancel"
|
|
2997
3390
|
] }) }),
|
|
2998
|
-
/* @__PURE__ */
|
|
3391
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(
|
|
2999
3392
|
TextInput5,
|
|
3000
3393
|
{
|
|
3001
3394
|
value: "",
|
|
@@ -3010,21 +3403,21 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3010
3403
|
}
|
|
3011
3404
|
}
|
|
3012
3405
|
) }),
|
|
3013
|
-
archiveError && /* @__PURE__ */
|
|
3014
|
-
archiving && /* @__PURE__ */
|
|
3015
|
-
] }) }) : syncMode && syncTarget ? /* @__PURE__ */
|
|
3016
|
-
/* @__PURE__ */
|
|
3017
|
-
/* @__PURE__ */
|
|
3018
|
-
/* @__PURE__ */
|
|
3019
|
-
/* @__PURE__ */
|
|
3020
|
-
syncTarget.parent && /* @__PURE__ */
|
|
3406
|
+
archiveError && /* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "magenta", children: archiveError }) }),
|
|
3407
|
+
archiving && /* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "yellow", children: archiveTarget.isArchived ? "Unarchiving..." : "Archiving..." }) })
|
|
3408
|
+
] }) }) : 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: [
|
|
3409
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, children: "Sync Fork Confirmation" }),
|
|
3410
|
+
/* @__PURE__ */ jsx19(Text19, { color: "blue", children: "\u27F2 Sync fork with upstream?" }),
|
|
3411
|
+
/* @__PURE__ */ jsx19(Box18, { height: 1, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
3412
|
+
/* @__PURE__ */ jsx19(Text19, { children: syncTarget.nameWithOwner }),
|
|
3413
|
+
syncTarget.parent && /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3021
3414
|
"Upstream: ",
|
|
3022
3415
|
syncTarget.parent.nameWithOwner
|
|
3023
3416
|
] }),
|
|
3024
|
-
/* @__PURE__ */
|
|
3025
|
-
/* @__PURE__ */
|
|
3026
|
-
/* @__PURE__ */
|
|
3027
|
-
|
|
3417
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { children: "This will merge upstream changes into your fork." }) }),
|
|
3418
|
+
/* @__PURE__ */ jsxs18(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3419
|
+
/* @__PURE__ */ jsx19(
|
|
3420
|
+
Box18,
|
|
3028
3421
|
{
|
|
3029
3422
|
borderStyle: "round",
|
|
3030
3423
|
borderColor: "blue",
|
|
@@ -3033,11 +3426,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3033
3426
|
alignItems: "center",
|
|
3034
3427
|
justifyContent: "center",
|
|
3035
3428
|
flexDirection: "column",
|
|
3036
|
-
children: /* @__PURE__ */
|
|
3429
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: syncFocus === "confirm" ? chalk13.bgBlue.white.bold(" Sync ") : chalk13.blue.bold("Sync") })
|
|
3037
3430
|
}
|
|
3038
3431
|
),
|
|
3039
|
-
/* @__PURE__ */
|
|
3040
|
-
|
|
3432
|
+
/* @__PURE__ */ jsx19(
|
|
3433
|
+
Box18,
|
|
3041
3434
|
{
|
|
3042
3435
|
borderStyle: "round",
|
|
3043
3436
|
borderColor: syncFocus === "cancel" ? "white" : "gray",
|
|
@@ -3046,16 +3439,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3046
3439
|
alignItems: "center",
|
|
3047
3440
|
justifyContent: "center",
|
|
3048
3441
|
flexDirection: "column",
|
|
3049
|
-
children: /* @__PURE__ */
|
|
3442
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: syncFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
3050
3443
|
}
|
|
3051
3444
|
)
|
|
3052
3445
|
] }),
|
|
3053
|
-
/* @__PURE__ */
|
|
3446
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3054
3447
|
"Press Enter to ",
|
|
3055
3448
|
syncFocus === "confirm" ? "Sync" : "Cancel",
|
|
3056
3449
|
" | Y to Sync | C to Cancel"
|
|
3057
3450
|
] }) }),
|
|
3058
|
-
/* @__PURE__ */
|
|
3451
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(
|
|
3059
3452
|
TextInput5,
|
|
3060
3453
|
{
|
|
3061
3454
|
value: "",
|
|
@@ -3070,14 +3463,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3070
3463
|
}
|
|
3071
3464
|
}
|
|
3072
3465
|
) }),
|
|
3073
|
-
syncError && /* @__PURE__ */
|
|
3074
|
-
syncing && /* @__PURE__ */
|
|
3075
|
-
] }) }) : logoutMode ? /* @__PURE__ */
|
|
3076
|
-
/* @__PURE__ */
|
|
3077
|
-
/* @__PURE__ */
|
|
3078
|
-
/* @__PURE__ */
|
|
3079
|
-
/* @__PURE__ */
|
|
3080
|
-
|
|
3466
|
+
syncError && /* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "magenta", children: syncError }) }),
|
|
3467
|
+
syncing && /* @__PURE__ */ jsx19(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "yellow", children: "Syncing..." }) })
|
|
3468
|
+
] }) }) : 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: [
|
|
3469
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, children: "Logout Confirmation" }),
|
|
3470
|
+
/* @__PURE__ */ jsx19(Text19, { color: "cyan", children: "Are you sure you want to log out?" }),
|
|
3471
|
+
/* @__PURE__ */ jsxs18(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3472
|
+
/* @__PURE__ */ jsx19(
|
|
3473
|
+
Box18,
|
|
3081
3474
|
{
|
|
3082
3475
|
borderStyle: "round",
|
|
3083
3476
|
borderColor: "cyan",
|
|
@@ -3086,11 +3479,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3086
3479
|
alignItems: "center",
|
|
3087
3480
|
justifyContent: "center",
|
|
3088
3481
|
flexDirection: "column",
|
|
3089
|
-
children: /* @__PURE__ */
|
|
3482
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: logoutFocus === "confirm" ? chalk13.bgCyan.white.bold(" Logout ") : chalk13.cyan.bold("Logout") })
|
|
3090
3483
|
}
|
|
3091
3484
|
),
|
|
3092
|
-
/* @__PURE__ */
|
|
3093
|
-
|
|
3485
|
+
/* @__PURE__ */ jsx19(
|
|
3486
|
+
Box18,
|
|
3094
3487
|
{
|
|
3095
3488
|
borderStyle: "round",
|
|
3096
3489
|
borderColor: logoutFocus === "cancel" ? "white" : "gray",
|
|
@@ -3099,16 +3492,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3099
3492
|
alignItems: "center",
|
|
3100
3493
|
justifyContent: "center",
|
|
3101
3494
|
flexDirection: "column",
|
|
3102
|
-
children: /* @__PURE__ */
|
|
3495
|
+
children: /* @__PURE__ */ jsx19(Text19, { children: logoutFocus === "cancel" ? chalk13.bgGray.white.bold(" Cancel ") : chalk13.gray.bold("Cancel") })
|
|
3103
3496
|
}
|
|
3104
3497
|
)
|
|
3105
3498
|
] }),
|
|
3106
|
-
/* @__PURE__ */
|
|
3499
|
+
/* @__PURE__ */ jsx19(Box18, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3107
3500
|
"Press Enter to ",
|
|
3108
3501
|
logoutFocus === "confirm" ? "Logout" : "Cancel",
|
|
3109
3502
|
" | Y to Logout | C to Cancel"
|
|
3110
3503
|
] }) })
|
|
3111
|
-
] }) }) : orgSwitcherOpen ? /* @__PURE__ */
|
|
3504
|
+
] }) }) : orgSwitcherOpen ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3112
3505
|
OrgSwitcher,
|
|
3113
3506
|
{
|
|
3114
3507
|
token,
|
|
@@ -3116,45 +3509,45 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3116
3509
|
onSelect: handleOrgContextChange,
|
|
3117
3510
|
onClose: () => setOrgSwitcherOpen(false)
|
|
3118
3511
|
}
|
|
3119
|
-
) }) : infoMode ? /* @__PURE__ */
|
|
3512
|
+
) }) : infoMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: (() => {
|
|
3120
3513
|
const repo = infoRepo || visibleItems[cursor];
|
|
3121
|
-
if (!repo) return /* @__PURE__ */
|
|
3514
|
+
if (!repo) return /* @__PURE__ */ jsx19(Text19, { color: "red", children: "No repository selected." });
|
|
3122
3515
|
const langName = repo.primaryLanguage?.name || "N/A";
|
|
3123
3516
|
const langColor = repo.primaryLanguage?.color || "#666666";
|
|
3124
|
-
return /* @__PURE__ */
|
|
3125
|
-
/* @__PURE__ */
|
|
3517
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 90), children: [
|
|
3518
|
+
/* @__PURE__ */ jsxs18(Text19, { bold: true, children: [
|
|
3126
3519
|
"Repository Info ",
|
|
3127
3520
|
infoRepo ? chalk13.dim("(cached)") : ""
|
|
3128
3521
|
] }),
|
|
3129
|
-
/* @__PURE__ */
|
|
3130
|
-
/* @__PURE__ */
|
|
3131
|
-
repo.description && /* @__PURE__ */
|
|
3132
|
-
/* @__PURE__ */
|
|
3133
|
-
/* @__PURE__ */
|
|
3522
|
+
/* @__PURE__ */ jsx19(Box18, { height: 1, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
3523
|
+
/* @__PURE__ */ jsx19(Text19, { children: chalk13.bold(repo.nameWithOwner) }),
|
|
3524
|
+
repo.description && /* @__PURE__ */ jsx19(Text19, { color: "gray", children: repo.description }),
|
|
3525
|
+
/* @__PURE__ */ jsx19(Box18, { height: 1, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
3526
|
+
/* @__PURE__ */ jsxs18(Text19, { children: [
|
|
3134
3527
|
repo.visibility === "PRIVATE" ? chalk13.yellow("Private") : repo.visibility === "INTERNAL" ? chalk13.magenta("Internal") : chalk13.green("Public"),
|
|
3135
3528
|
repo.isArchived ? chalk13.gray(" Archived") : "",
|
|
3136
3529
|
repo.isFork ? chalk13.blue(" Fork") : ""
|
|
3137
3530
|
] }),
|
|
3138
|
-
/* @__PURE__ */
|
|
3139
|
-
/* @__PURE__ */
|
|
3531
|
+
/* @__PURE__ */ jsx19(Text19, { children: chalk13.gray(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount}`) }),
|
|
3532
|
+
/* @__PURE__ */ jsxs18(Text19, { children: [
|
|
3140
3533
|
chalk13.hex(langColor)(`\u25CF `),
|
|
3141
3534
|
chalk13.gray(`${langName}`)
|
|
3142
3535
|
] }),
|
|
3143
|
-
/* @__PURE__ */
|
|
3536
|
+
/* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3144
3537
|
"Updated: ",
|
|
3145
3538
|
formatDate(repo.updatedAt),
|
|
3146
3539
|
" \u2022 Pushed: ",
|
|
3147
3540
|
formatDate(repo.pushedAt)
|
|
3148
3541
|
] }),
|
|
3149
|
-
/* @__PURE__ */
|
|
3542
|
+
/* @__PURE__ */ jsxs18(Text19, { color: "gray", children: [
|
|
3150
3543
|
"Size: ",
|
|
3151
3544
|
repo.diskUsage,
|
|
3152
3545
|
" KB"
|
|
3153
3546
|
] }),
|
|
3154
|
-
/* @__PURE__ */
|
|
3155
|
-
/* @__PURE__ */
|
|
3547
|
+
/* @__PURE__ */ jsx19(Box18, { height: 1, children: /* @__PURE__ */ jsx19(Text19, { children: " " }) }),
|
|
3548
|
+
/* @__PURE__ */ jsx19(Text19, { color: "gray", children: "Press Esc or I to close" })
|
|
3156
3549
|
] });
|
|
3157
|
-
})() }) : visibilityMode ? /* @__PURE__ */
|
|
3550
|
+
})() }) : visibilityMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3158
3551
|
VisibilityModal,
|
|
3159
3552
|
{
|
|
3160
3553
|
currentFilter: visibilityFilter,
|
|
@@ -3167,7 +3560,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3167
3560
|
},
|
|
3168
3561
|
onCancel: () => setVisibilityMode(false)
|
|
3169
3562
|
}
|
|
3170
|
-
) }) : sortMode ? /* @__PURE__ */
|
|
3563
|
+
) }) : sortMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3171
3564
|
SortModal,
|
|
3172
3565
|
{
|
|
3173
3566
|
currentSort: sortKey,
|
|
@@ -3179,7 +3572,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3179
3572
|
},
|
|
3180
3573
|
onCancel: () => setSortMode(false)
|
|
3181
3574
|
}
|
|
3182
|
-
) }) : sortDirectionMode ? /* @__PURE__ */
|
|
3575
|
+
) }) : sortDirectionMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3183
3576
|
SortDirectionModal,
|
|
3184
3577
|
{
|
|
3185
3578
|
currentDirection: sortDir,
|
|
@@ -3192,7 +3585,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3192
3585
|
},
|
|
3193
3586
|
onCancel: () => setSortDirectionMode(false)
|
|
3194
3587
|
}
|
|
3195
|
-
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */
|
|
3588
|
+
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3196
3589
|
ChangeVisibilityModal,
|
|
3197
3590
|
{
|
|
3198
3591
|
isOpen: changeVisibilityMode,
|
|
@@ -3205,14 +3598,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3205
3598
|
changing: changingVisibility,
|
|
3206
3599
|
error: changeVisibilityError
|
|
3207
3600
|
}
|
|
3208
|
-
) }) : renameMode && renameTarget ? /* @__PURE__ */
|
|
3601
|
+
) }) : renameMode && renameTarget ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3209
3602
|
RenameModal,
|
|
3210
3603
|
{
|
|
3211
3604
|
repo: renameTarget,
|
|
3212
3605
|
onRename: executeRename,
|
|
3213
3606
|
onCancel: closeRenameModal
|
|
3214
3607
|
}
|
|
3215
|
-
) }) : copyUrlMode ? /* @__PURE__ */
|
|
3608
|
+
) }) : copyUrlMode ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3216
3609
|
CopyUrlModal,
|
|
3217
3610
|
{
|
|
3218
3611
|
repo: copyUrlTarget,
|
|
@@ -3220,8 +3613,29 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3220
3613
|
onClose: closeCopyUrlModal,
|
|
3221
3614
|
onCopy: handleCopyUrl
|
|
3222
3615
|
}
|
|
3223
|
-
) }) : /* @__PURE__ */
|
|
3224
|
-
|
|
3616
|
+
) }) : unstarMode && unstarTarget ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3617
|
+
UnstarModal,
|
|
3618
|
+
{
|
|
3619
|
+
visible: unstarMode,
|
|
3620
|
+
repo: unstarTarget,
|
|
3621
|
+
onConfirm: handleUnstar,
|
|
3622
|
+
onCancel: closeUnstarModal,
|
|
3623
|
+
isUnstarring: unstarring,
|
|
3624
|
+
error: unstarError
|
|
3625
|
+
}
|
|
3626
|
+
) }) : starMode && starTarget ? /* @__PURE__ */ jsx19(Box18, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx19(
|
|
3627
|
+
StarModal,
|
|
3628
|
+
{
|
|
3629
|
+
visible: starMode,
|
|
3630
|
+
repo: starTarget,
|
|
3631
|
+
isStarred: starTarget.viewerHasStarred || false,
|
|
3632
|
+
onConfirm: handleStar,
|
|
3633
|
+
onCancel: closeStarModal,
|
|
3634
|
+
isStarring: starring,
|
|
3635
|
+
error: starError
|
|
3636
|
+
}
|
|
3637
|
+
) }) : /* @__PURE__ */ jsxs18(Fragment10, { children: [
|
|
3638
|
+
/* @__PURE__ */ jsx19(
|
|
3225
3639
|
RepoListHeader,
|
|
3226
3640
|
{
|
|
3227
3641
|
ownerContext,
|
|
@@ -3232,12 +3646,13 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3232
3646
|
searchActive,
|
|
3233
3647
|
searchLoading,
|
|
3234
3648
|
visibilityFilter,
|
|
3235
|
-
isEnterprise: isEnterpriseOrg
|
|
3649
|
+
isEnterprise: isEnterpriseOrg,
|
|
3650
|
+
starsMode
|
|
3236
3651
|
}
|
|
3237
3652
|
),
|
|
3238
|
-
filterMode && /* @__PURE__ */
|
|
3239
|
-
/* @__PURE__ */
|
|
3240
|
-
/* @__PURE__ */
|
|
3653
|
+
filterMode && /* @__PURE__ */ jsxs18(Box18, { marginBottom: 1, children: [
|
|
3654
|
+
/* @__PURE__ */ jsx19(Text19, { children: "Search: " }),
|
|
3655
|
+
/* @__PURE__ */ jsx19(
|
|
3241
3656
|
TextInput5,
|
|
3242
3657
|
{
|
|
3243
3658
|
value: filter,
|
|
@@ -3273,14 +3688,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3273
3688
|
onSubmit: () => {
|
|
3274
3689
|
setFilterMode(false);
|
|
3275
3690
|
},
|
|
3276
|
-
placeholder: "Type to search (3+ chars for server search)..."
|
|
3691
|
+
placeholder: starsMode ? "Type to filter starred repositories..." : "Type to search (3+ chars for server search)..."
|
|
3277
3692
|
}
|
|
3278
3693
|
)
|
|
3279
3694
|
] }),
|
|
3280
|
-
/* @__PURE__ */
|
|
3281
|
-
filterMode && filter.trim().length > 0 && filter.trim().length < 3 ? /* @__PURE__ */
|
|
3695
|
+
/* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", height: listHeight, children: [
|
|
3696
|
+
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
3697
|
const idx = windowed.start + i;
|
|
3283
|
-
return /* @__PURE__ */
|
|
3698
|
+
return /* @__PURE__ */ jsx19(
|
|
3284
3699
|
RepoRow,
|
|
3285
3700
|
{
|
|
3286
3701
|
repo,
|
|
@@ -3288,40 +3703,45 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3288
3703
|
index: idx + 1,
|
|
3289
3704
|
maxWidth: terminalWidth - 6,
|
|
3290
3705
|
spacingLines,
|
|
3291
|
-
forkTracking
|
|
3706
|
+
forkTracking,
|
|
3707
|
+
starsMode
|
|
3292
3708
|
},
|
|
3293
3709
|
repo.nameWithOwner
|
|
3294
3710
|
);
|
|
3295
3711
|
}),
|
|
3296
|
-
loadingMore && hasNextPage && /* @__PURE__ */
|
|
3297
|
-
/* @__PURE__ */
|
|
3298
|
-
/* @__PURE__ */
|
|
3712
|
+
loadingMore && hasNextPage && /* @__PURE__ */ jsx19(Box18, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", children: [
|
|
3713
|
+
/* @__PURE__ */ jsx19(Box18, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx19(Text19, { color: "cyan", children: /* @__PURE__ */ jsx19(SlowSpinner, {}) }) }),
|
|
3714
|
+
/* @__PURE__ */ jsx19(Text19, { color: "cyan", children: "Loading more repositories..." })
|
|
3299
3715
|
] }) }),
|
|
3300
|
-
!loading && !searchLoading && visibleItems.length === 0 && /* @__PURE__ */
|
|
3716
|
+
!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
3717
|
] })
|
|
3302
3718
|
] }) }),
|
|
3303
|
-
/* @__PURE__ */
|
|
3304
|
-
/* @__PURE__ */
|
|
3305
|
-
/* @__PURE__ */
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3719
|
+
/* @__PURE__ */ jsxs18(Box18, { marginTop: 1, paddingX: 1, flexDirection: "column", children: [
|
|
3720
|
+
/* @__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" }) }),
|
|
3721
|
+
/* @__PURE__ */ jsx19(Box18, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsxs18(Text19, { color: "gray", dimColor: modalOpen ? true : void 0, children: [
|
|
3722
|
+
"/ Search \u2022 S Sort \u2022 D Direction \u2022 T Density",
|
|
3723
|
+
!starsMode && " \u2022 V Visibility",
|
|
3724
|
+
ownerContext === "personal" && " \u2022 Shift+S Stars"
|
|
3725
|
+
] }) }),
|
|
3726
|
+
/* @__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" }) }),
|
|
3727
|
+
/* @__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" }) }),
|
|
3728
|
+
/* @__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
3729
|
] }),
|
|
3310
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
3311
|
-
/* @__PURE__ */
|
|
3312
|
-
debugMessages.length === 0 ? /* @__PURE__ */
|
|
3730
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsxs18(Box18, { marginTop: 1, borderStyle: "single", borderColor: "yellow", paddingX: 1, flexDirection: "column", children: [
|
|
3731
|
+
/* @__PURE__ */ jsx19(Text19, { bold: true, color: "yellow", children: "Debug Messages:" }),
|
|
3732
|
+
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
3733
|
] }),
|
|
3314
|
-
copyToast && /* @__PURE__ */
|
|
3734
|
+
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
3735
|
] });
|
|
3316
3736
|
}
|
|
3317
3737
|
|
|
3318
3738
|
// src/ui/components/auth/AuthMethodSelector.tsx
|
|
3319
|
-
import { useState as
|
|
3320
|
-
import { Box as
|
|
3739
|
+
import { useState as useState16 } from "react";
|
|
3740
|
+
import { Box as Box19, Text as Text20, useInput as useInput16 } from "ink";
|
|
3321
3741
|
import chalk14 from "chalk";
|
|
3322
|
-
import { jsx as
|
|
3742
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3323
3743
|
function AuthMethodSelector({ onSelect, onQuit }) {
|
|
3324
|
-
const [selectedIndex, setSelectedIndex] =
|
|
3744
|
+
const [selectedIndex, setSelectedIndex] = useState16(0);
|
|
3325
3745
|
const methods = [
|
|
3326
3746
|
{
|
|
3327
3747
|
key: "oauth",
|
|
@@ -3334,7 +3754,7 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3334
3754
|
description: "Manually enter a GitHub Personal Access Token"
|
|
3335
3755
|
}
|
|
3336
3756
|
];
|
|
3337
|
-
|
|
3757
|
+
useInput16((input, key) => {
|
|
3338
3758
|
if (key.escape || input?.toLowerCase() === "q") {
|
|
3339
3759
|
if (onQuit) {
|
|
3340
3760
|
onQuit();
|
|
@@ -3353,33 +3773,33 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3353
3773
|
onSelect("pat");
|
|
3354
3774
|
}
|
|
3355
3775
|
});
|
|
3356
|
-
return /* @__PURE__ */
|
|
3357
|
-
/* @__PURE__ */
|
|
3358
|
-
/* @__PURE__ */
|
|
3776
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, children: [
|
|
3777
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, marginBottom: 1, children: "Choose Authentication Method" }),
|
|
3778
|
+
/* @__PURE__ */ jsx20(Box19, { flexDirection: "column", marginY: 1, children: methods.map((method, index) => {
|
|
3359
3779
|
const isSelected = index === selectedIndex;
|
|
3360
3780
|
const prefix = isSelected ? chalk14.cyan("\u203A") : " ";
|
|
3361
3781
|
const numberPrefix = `${index + 1}.`;
|
|
3362
|
-
return /* @__PURE__ */
|
|
3363
|
-
/* @__PURE__ */
|
|
3782
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", marginBottom: 1, children: [
|
|
3783
|
+
/* @__PURE__ */ jsx20(Text20, { children: /* @__PURE__ */ jsxs19(Text20, { color: isSelected ? "cyan" : void 0, bold: isSelected, children: [
|
|
3364
3784
|
prefix,
|
|
3365
3785
|
" ",
|
|
3366
3786
|
numberPrefix,
|
|
3367
3787
|
" ",
|
|
3368
3788
|
method.label
|
|
3369
3789
|
] }) }),
|
|
3370
|
-
/* @__PURE__ */
|
|
3790
|
+
/* @__PURE__ */ jsxs19(Text20, { color: "gray", dimColor: true, children: [
|
|
3371
3791
|
" ",
|
|
3372
3792
|
method.description
|
|
3373
3793
|
] })
|
|
3374
3794
|
] }, method.key);
|
|
3375
3795
|
}) }),
|
|
3376
|
-
/* @__PURE__ */
|
|
3796
|
+
/* @__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
3797
|
] });
|
|
3378
3798
|
}
|
|
3379
3799
|
|
|
3380
3800
|
// src/ui/components/auth/OAuthProgress.tsx
|
|
3381
|
-
import { Box as
|
|
3382
|
-
import { jsx as
|
|
3801
|
+
import { Box as Box20, Text as Text21 } from "ink";
|
|
3802
|
+
import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3383
3803
|
function OAuthProgress({ status, error, deviceCode }) {
|
|
3384
3804
|
const statusMessages = {
|
|
3385
3805
|
initializing: {
|
|
@@ -3416,69 +3836,69 @@ function OAuthProgress({ status, error, deviceCode }) {
|
|
|
3416
3836
|
}
|
|
3417
3837
|
};
|
|
3418
3838
|
const { message, showSpinner } = statusMessages[status];
|
|
3419
|
-
return /* @__PURE__ */
|
|
3420
|
-
/* @__PURE__ */
|
|
3421
|
-
/* @__PURE__ */
|
|
3422
|
-
/* @__PURE__ */
|
|
3423
|
-
/* @__PURE__ */
|
|
3839
|
+
return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "single", borderColor: status === "error" ? "red" : "cyan", paddingX: 2, paddingY: 1, children: [
|
|
3840
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, marginBottom: 1, children: "GitHub OAuth Authentication" }),
|
|
3841
|
+
/* @__PURE__ */ jsx21(Box20, { marginY: 1, children: showSpinner ? /* @__PURE__ */ jsxs20(Box20, { children: [
|
|
3842
|
+
/* @__PURE__ */ jsx21(Text21, { color: "green", children: /* @__PURE__ */ jsx21(SlowSpinner, { interval: 2e3 }) }),
|
|
3843
|
+
/* @__PURE__ */ jsxs20(Text21, { children: [
|
|
3424
3844
|
" ",
|
|
3425
3845
|
message
|
|
3426
3846
|
] })
|
|
3427
|
-
] }) : /* @__PURE__ */
|
|
3847
|
+
] }) : /* @__PURE__ */ jsxs20(Text21, { color: status === "error" ? "red" : "green", children: [
|
|
3428
3848
|
status === "error" ? "\u2717" : "\u2713",
|
|
3429
3849
|
" ",
|
|
3430
3850
|
message
|
|
3431
3851
|
] }) }),
|
|
3432
|
-
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */
|
|
3433
|
-
/* @__PURE__ */
|
|
3434
|
-
/* @__PURE__ */
|
|
3435
|
-
/* @__PURE__ */
|
|
3436
|
-
/* @__PURE__ */
|
|
3852
|
+
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */ jsxs20(Box20, { marginY: 1, flexDirection: "column", children: [
|
|
3853
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, color: "cyan", marginBottom: 1, children: "\u{1F4CB} Please complete these steps:" }),
|
|
3854
|
+
/* @__PURE__ */ jsxs20(Box20, { marginBottom: 1, children: [
|
|
3855
|
+
/* @__PURE__ */ jsx21(Text21, { children: "1. Visit: " }),
|
|
3856
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, color: "blue", children: deviceCode.verification_uri })
|
|
3437
3857
|
] }),
|
|
3438
|
-
/* @__PURE__ */
|
|
3439
|
-
/* @__PURE__ */
|
|
3440
|
-
/* @__PURE__ */
|
|
3858
|
+
/* @__PURE__ */ jsxs20(Box20, { marginBottom: 1, flexDirection: "column", children: [
|
|
3859
|
+
/* @__PURE__ */ jsx21(Text21, { children: "2. Enter this code:" }),
|
|
3860
|
+
/* @__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
3861
|
] }),
|
|
3442
|
-
status === "waiting_for_authorization" && /* @__PURE__ */
|
|
3443
|
-
status === "polling_for_token" && /* @__PURE__ */
|
|
3444
|
-
/* @__PURE__ */
|
|
3445
|
-
/* @__PURE__ */
|
|
3862
|
+
status === "waiting_for_authorization" && /* @__PURE__ */ jsx21(Text21, { color: "gray", marginTop: 1, children: "Your browser should open automatically." }),
|
|
3863
|
+
status === "polling_for_token" && /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", marginTop: 1, children: [
|
|
3864
|
+
/* @__PURE__ */ jsx21(Text21, { color: "gray", children: "Waiting for you to complete authorization in your browser..." }),
|
|
3865
|
+
/* @__PURE__ */ jsx21(Text21, { color: "gray", dimColor: true, marginTop: 1, children: "This will timeout in 15 minutes. Press Esc to cancel." })
|
|
3446
3866
|
] })
|
|
3447
3867
|
] }),
|
|
3448
|
-
status === "error" && error && /* @__PURE__ */
|
|
3449
|
-
/* @__PURE__ */
|
|
3450
|
-
/* @__PURE__ */
|
|
3868
|
+
status === "error" && error && /* @__PURE__ */ jsxs20(Box20, { marginY: 1, flexDirection: "column", children: [
|
|
3869
|
+
/* @__PURE__ */ jsx21(Text21, { color: "red", children: error }),
|
|
3870
|
+
/* @__PURE__ */ jsx21(Text21, { color: "gray", marginTop: 1, children: "Press Esc to go back and try again." })
|
|
3451
3871
|
] }),
|
|
3452
|
-
status === "success" && /* @__PURE__ */
|
|
3872
|
+
status === "success" && /* @__PURE__ */ jsx21(Text21, { color: "gray", marginTop: 1, children: "Returning to application..." })
|
|
3453
3873
|
] });
|
|
3454
3874
|
}
|
|
3455
3875
|
|
|
3456
3876
|
// src/ui/App.tsx
|
|
3457
|
-
import { jsx as
|
|
3877
|
+
import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3458
3878
|
var packageJson = require_package();
|
|
3459
3879
|
function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlineTokenEphemeral }) {
|
|
3460
3880
|
const { exit } = useApp2();
|
|
3461
3881
|
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] =
|
|
3882
|
+
const [mode, setMode] = useState17("checking");
|
|
3883
|
+
const [token, setToken] = useState17(null);
|
|
3884
|
+
const [input, setInput] = useState17("");
|
|
3885
|
+
const [error, setError] = useState17(null);
|
|
3886
|
+
const [viewer, setViewer] = useState17(null);
|
|
3887
|
+
const [rateLimitReset, setRateLimitReset] = useState17(null);
|
|
3888
|
+
const [wasRateLimited, setWasRateLimited] = useState17(false);
|
|
3889
|
+
const [orgContext, setOrgContext] = useState17("personal");
|
|
3890
|
+
const [authMethod, setAuthMethod] = useState17("pat");
|
|
3891
|
+
const [oauthStatus, setOAuthStatus] = useState17("initializing");
|
|
3892
|
+
const [tokenSource, setTokenSource] = useState17("pat");
|
|
3893
|
+
const [sessionTokenOrigin, setSessionTokenOrigin] = useState17("stored");
|
|
3894
|
+
const [deviceCodeResponse, setDeviceCodeResponse] = useState17(null);
|
|
3895
|
+
const [oauthDeviceCode, setOauthDeviceCode] = useState17(null);
|
|
3896
|
+
const [dims, setDims] = useState17(() => {
|
|
3477
3897
|
const cols = stdout?.columns ?? 100;
|
|
3478
3898
|
const rows = stdout?.rows ?? 30;
|
|
3479
3899
|
return { cols, rows };
|
|
3480
3900
|
});
|
|
3481
|
-
|
|
3901
|
+
useEffect12(() => {
|
|
3482
3902
|
if (!stdout) return;
|
|
3483
3903
|
const onResize = () => {
|
|
3484
3904
|
const cols = stdout.columns ?? 100;
|
|
@@ -3490,7 +3910,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3490
3910
|
stdout.off?.("resize", onResize);
|
|
3491
3911
|
};
|
|
3492
3912
|
}, [stdout]);
|
|
3493
|
-
|
|
3913
|
+
useEffect12(() => {
|
|
3494
3914
|
const env = getTokenFromEnv();
|
|
3495
3915
|
const stored = getStoredToken();
|
|
3496
3916
|
const source = getTokenSource();
|
|
@@ -3514,7 +3934,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3514
3934
|
setMode("auth_method_selection");
|
|
3515
3935
|
}
|
|
3516
3936
|
}, [inlineToken2]);
|
|
3517
|
-
|
|
3937
|
+
useEffect12(() => {
|
|
3518
3938
|
if (mode !== "oauth_flow") return;
|
|
3519
3939
|
(async () => {
|
|
3520
3940
|
try {
|
|
@@ -3566,7 +3986,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3566
3986
|
setMode("oauth_flow");
|
|
3567
3987
|
}
|
|
3568
3988
|
};
|
|
3569
|
-
|
|
3989
|
+
useEffect12(() => {
|
|
3570
3990
|
(async () => {
|
|
3571
3991
|
if (mode !== "validating" || !token) return;
|
|
3572
3992
|
const timeoutId = setTimeout(() => {
|
|
@@ -3678,7 +4098,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3678
4098
|
setTokenSource("pat");
|
|
3679
4099
|
setMode("auth_method_selection");
|
|
3680
4100
|
};
|
|
3681
|
-
|
|
4101
|
+
useInput17((input2, key) => {
|
|
3682
4102
|
if ((mode === "prompt" || mode === "auth_method_selection") && key.escape) {
|
|
3683
4103
|
exit();
|
|
3684
4104
|
}
|
|
@@ -3710,19 +4130,19 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3710
4130
|
}
|
|
3711
4131
|
});
|
|
3712
4132
|
const verticalPadding = Math.floor(dims.rows * 0.05);
|
|
3713
|
-
const header = useMemo2(() => /* @__PURE__ */
|
|
3714
|
-
/* @__PURE__ */
|
|
3715
|
-
/* @__PURE__ */
|
|
4133
|
+
const header = useMemo2(() => /* @__PURE__ */ jsxs21(Box21, { flexDirection: "row", justifyContent: "space-between", marginBottom: 1, children: [
|
|
4134
|
+
/* @__PURE__ */ jsxs21(Box21, { flexDirection: "row", gap: 1, children: [
|
|
4135
|
+
/* @__PURE__ */ jsxs21(Text22, { bold: true, color: "cyan", children: [
|
|
3716
4136
|
" ",
|
|
3717
4137
|
"GitHub Repository Manager"
|
|
3718
4138
|
] }),
|
|
3719
|
-
/* @__PURE__ */
|
|
4139
|
+
/* @__PURE__ */ jsxs21(Text22, { color: "gray", dimColor: true, children: [
|
|
3720
4140
|
"v",
|
|
3721
4141
|
packageJson.version
|
|
3722
4142
|
] }),
|
|
3723
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
4143
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsx22(Text22, { backgroundColor: "blue", color: "white", children: " debug mode " })
|
|
3724
4144
|
] }),
|
|
3725
|
-
viewer && /* @__PURE__ */
|
|
4145
|
+
viewer && /* @__PURE__ */ jsx22(Text22, { color: "gray", children: orgContext !== "personal" && orgContext.login ? `${orgContext.login}/@${viewer} ` : `@${viewer} ` })
|
|
3726
4146
|
] }), [viewer, orgContext]);
|
|
3727
4147
|
if (mode === "rate_limited") {
|
|
3728
4148
|
const formatResetTime = (resetTime) => {
|
|
@@ -3745,70 +4165,70 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3745
4165
|
return "Unknown";
|
|
3746
4166
|
}
|
|
3747
4167
|
};
|
|
3748
|
-
return /* @__PURE__ */
|
|
4168
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3749
4169
|
header,
|
|
3750
|
-
/* @__PURE__ */
|
|
3751
|
-
/* @__PURE__ */
|
|
3752
|
-
/* @__PURE__ */
|
|
3753
|
-
/* @__PURE__ */
|
|
3754
|
-
rateLimitReset && /* @__PURE__ */
|
|
3755
|
-
/* @__PURE__ */
|
|
3756
|
-
/* @__PURE__ */
|
|
4170
|
+
/* @__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: [
|
|
4171
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, color: "yellow", marginBottom: 1, children: "\u26A0\uFE0F Rate Limit Exceeded" }),
|
|
4172
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", marginBottom: 1, children: "You've hit GitHub's API rate limit for your token." }),
|
|
4173
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", marginBottom: 1, children: "This happens when you make too many requests in a short time." }),
|
|
4174
|
+
rateLimitReset && /* @__PURE__ */ jsxs21(Box21, { marginTop: 1, marginBottom: 1, children: [
|
|
4175
|
+
/* @__PURE__ */ jsxs21(Text22, { children: [
|
|
4176
|
+
/* @__PURE__ */ jsx22(Text22, { color: "cyan", children: "Reset in:" }),
|
|
3757
4177
|
" ",
|
|
3758
|
-
/* @__PURE__ */
|
|
4178
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, children: formatResetTime(rateLimitReset) })
|
|
3759
4179
|
] }),
|
|
3760
|
-
/* @__PURE__ */
|
|
4180
|
+
/* @__PURE__ */ jsxs21(Text22, { color: "gray", dimColor: true, children: [
|
|
3761
4181
|
"(",
|
|
3762
4182
|
new Date(rateLimitReset).toLocaleTimeString(),
|
|
3763
4183
|
")"
|
|
3764
4184
|
] })
|
|
3765
4185
|
] }),
|
|
3766
|
-
/* @__PURE__ */
|
|
3767
|
-
/* @__PURE__ */
|
|
3768
|
-
/* @__PURE__ */
|
|
3769
|
-
/* @__PURE__ */
|
|
3770
|
-
/* @__PURE__ */
|
|
4186
|
+
/* @__PURE__ */ jsxs21(Box21, { marginTop: 2, flexDirection: "column", gap: 1, children: [
|
|
4187
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, children: "What would you like to do?" }),
|
|
4188
|
+
/* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", paddingLeft: 2, children: [
|
|
4189
|
+
/* @__PURE__ */ jsxs21(Text22, { children: [
|
|
4190
|
+
/* @__PURE__ */ jsx22(Text22, { color: "cyan", bold: true, children: "R" }),
|
|
3771
4191
|
" - Retry now ",
|
|
3772
4192
|
rateLimitReset && formatResetTime(rateLimitReset) !== "Now (should be reset)" ? "(likely to fail until reset)" : "(should work now)"
|
|
3773
4193
|
] }),
|
|
3774
|
-
/* @__PURE__ */
|
|
3775
|
-
/* @__PURE__ */
|
|
4194
|
+
/* @__PURE__ */ jsxs21(Text22, { children: [
|
|
4195
|
+
/* @__PURE__ */ jsx22(Text22, { color: "cyan", bold: true, children: "L" }),
|
|
3776
4196
|
" - Logout and choose authentication method"
|
|
3777
4197
|
] }),
|
|
3778
|
-
/* @__PURE__ */
|
|
3779
|
-
/* @__PURE__ */
|
|
4198
|
+
/* @__PURE__ */ jsxs21(Text22, { children: [
|
|
4199
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", bold: true, children: "Q/Esc" }),
|
|
3780
4200
|
" - Quit application"
|
|
3781
4201
|
] })
|
|
3782
4202
|
] })
|
|
3783
4203
|
] }),
|
|
3784
|
-
/* @__PURE__ */
|
|
4204
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", dimColor: true, marginTop: 2, children: "Tip: Using multiple tokens or waiting between requests can help avoid rate limits." })
|
|
3785
4205
|
] }) })
|
|
3786
4206
|
] });
|
|
3787
4207
|
}
|
|
3788
4208
|
if (mode === "auth_method_selection") {
|
|
3789
|
-
return /* @__PURE__ */
|
|
4209
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3790
4210
|
header,
|
|
3791
|
-
/* @__PURE__ */
|
|
3792
|
-
/* @__PURE__ */
|
|
3793
|
-
error && /* @__PURE__ */
|
|
4211
|
+
/* @__PURE__ */ jsx22(Box21, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", alignItems: "center", children: [
|
|
4212
|
+
/* @__PURE__ */ jsx22(AuthMethodSelector, { onSelect: handleAuthMethodSelect }),
|
|
4213
|
+
error && /* @__PURE__ */ jsx22(Text22, { color: "red", marginTop: 1, children: error })
|
|
3794
4214
|
] }) })
|
|
3795
4215
|
] });
|
|
3796
4216
|
}
|
|
3797
4217
|
if (mode === "oauth_flow") {
|
|
3798
|
-
return /* @__PURE__ */
|
|
4218
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3799
4219
|
header,
|
|
3800
|
-
/* @__PURE__ */
|
|
4220
|
+
/* @__PURE__ */ jsx22(Box21, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx22(OAuthProgress, { status: oauthStatus, error: error || void 0, deviceCode: oauthDeviceCode || void 0 }) })
|
|
3801
4221
|
] });
|
|
3802
4222
|
}
|
|
3803
4223
|
if (mode === "prompt") {
|
|
3804
|
-
return /* @__PURE__ */
|
|
4224
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3805
4225
|
header,
|
|
3806
|
-
/* @__PURE__ */
|
|
3807
|
-
/* @__PURE__ */
|
|
3808
|
-
/* @__PURE__ */
|
|
3809
|
-
/* @__PURE__ */
|
|
3810
|
-
/* @__PURE__ */
|
|
3811
|
-
/* @__PURE__ */
|
|
4226
|
+
/* @__PURE__ */ jsx22(Box21, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs21(Box21, { borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, flexDirection: "column", children: [
|
|
4227
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, marginBottom: 1, children: "Authentication Required" }),
|
|
4228
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", marginBottom: 1, children: "Enter your GitHub Personal Access Token" }),
|
|
4229
|
+
/* @__PURE__ */ jsxs21(Box21, { children: [
|
|
4230
|
+
/* @__PURE__ */ jsx22(Text22, { children: "Token: " }),
|
|
4231
|
+
/* @__PURE__ */ jsx22(
|
|
3812
4232
|
TextInput6,
|
|
3813
4233
|
{
|
|
3814
4234
|
value: input,
|
|
@@ -3818,30 +4238,30 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3818
4238
|
}
|
|
3819
4239
|
)
|
|
3820
4240
|
] }),
|
|
3821
|
-
error && /* @__PURE__ */
|
|
3822
|
-
/* @__PURE__ */
|
|
3823
|
-
/* @__PURE__ */
|
|
4241
|
+
error && /* @__PURE__ */ jsx22(Text22, { color: "red", marginTop: 1, children: error }),
|
|
4242
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", dimColor: true, marginTop: 1, children: "The token will be stored securely in your local config" }),
|
|
4243
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to go back" })
|
|
3824
4244
|
] }) })
|
|
3825
4245
|
] });
|
|
3826
4246
|
}
|
|
3827
4247
|
if (mode === "validating" || mode === "checking") {
|
|
3828
|
-
return /* @__PURE__ */
|
|
4248
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3829
4249
|
header,
|
|
3830
|
-
/* @__PURE__ */
|
|
3831
|
-
/* @__PURE__ */
|
|
3832
|
-
mode === "validating" && /* @__PURE__ */
|
|
4250
|
+
/* @__PURE__ */ jsx22(Box21, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", alignItems: "center", children: [
|
|
4251
|
+
/* @__PURE__ */ jsx22(Text22, { color: "yellow", children: "Validating token..." }),
|
|
4252
|
+
mode === "validating" && /* @__PURE__ */ jsx22(Text22, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to cancel" })
|
|
3833
4253
|
] }) })
|
|
3834
4254
|
] });
|
|
3835
4255
|
}
|
|
3836
4256
|
if (mode === "error") {
|
|
3837
|
-
return /* @__PURE__ */
|
|
4257
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3838
4258
|
header,
|
|
3839
|
-
/* @__PURE__ */
|
|
4259
|
+
/* @__PURE__ */ jsx22(Box21, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx22(Text22, { color: "red", children: error ?? "Unexpected error" }) })
|
|
3840
4260
|
] });
|
|
3841
4261
|
}
|
|
3842
|
-
return /* @__PURE__ */
|
|
4262
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3843
4263
|
header,
|
|
3844
|
-
/* @__PURE__ */
|
|
4264
|
+
/* @__PURE__ */ jsx22(
|
|
3845
4265
|
RepoList,
|
|
3846
4266
|
{
|
|
3847
4267
|
token,
|
|
@@ -3856,7 +4276,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3856
4276
|
}
|
|
3857
4277
|
|
|
3858
4278
|
// src/index.tsx
|
|
3859
|
-
import { jsx as
|
|
4279
|
+
import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3860
4280
|
var argv = process.argv.slice(2);
|
|
3861
4281
|
var getFlagValue = (name) => {
|
|
3862
4282
|
const idx = argv.findIndex((a) => a === `--${name}` || a.startsWith(`--${name}=`));
|
|
@@ -3969,8 +4389,8 @@ var inlineToken = (() => {
|
|
|
3969
4389
|
})();
|
|
3970
4390
|
logger.debug("Rendering UI");
|
|
3971
4391
|
var { unmount } = render(
|
|
3972
|
-
/* @__PURE__ */
|
|
3973
|
-
/* @__PURE__ */
|
|
3974
|
-
/* @__PURE__ */
|
|
4392
|
+
/* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", children: [
|
|
4393
|
+
/* @__PURE__ */ jsx23(App, { initialOrgSlug, inlineToken, inlineTokenEphemeral: Boolean(inlineToken) }),
|
|
4394
|
+
/* @__PURE__ */ jsx23(Text23, { color: "gray" })
|
|
3975
4395
|
] })
|
|
3976
4396
|
);
|