gh-manager-cli 1.38.1 → 1.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/index.js +749 -642
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var require_package = __commonJS({
|
|
|
34
34
|
"package.json"(exports, module) {
|
|
35
35
|
module.exports = {
|
|
36
36
|
name: "gh-manager-cli",
|
|
37
|
-
version: "1.
|
|
37
|
+
version: "1.39.0",
|
|
38
38
|
private: false,
|
|
39
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",
|
|
40
40
|
license: "MIT",
|
|
@@ -152,12 +152,12 @@ var require_package = __commonJS({
|
|
|
152
152
|
|
|
153
153
|
// src/index.tsx
|
|
154
154
|
var import_package = __toESM(require_package(), 1);
|
|
155
|
-
import { render, Box as
|
|
155
|
+
import { render, Box as Box23, Text as Text24 } from "ink";
|
|
156
156
|
import "dotenv/config";
|
|
157
157
|
|
|
158
158
|
// src/ui/App.tsx
|
|
159
|
-
import { useEffect as
|
|
160
|
-
import { Box as
|
|
159
|
+
import { useEffect as useEffect13, useMemo as useMemo2, useState as useState18 } from "react";
|
|
160
|
+
import { Box as Box22, Text as Text23, useApp as useApp2, useStdout as useStdout2, useInput as useInput18 } from "ink";
|
|
161
161
|
import TextInput6 from "ink-text-input";
|
|
162
162
|
|
|
163
163
|
// src/config/config.ts
|
|
@@ -406,10 +406,10 @@ async function openGitHubAuthorizationPage() {
|
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
// src/ui/views/RepoList.tsx
|
|
409
|
-
import
|
|
410
|
-
import { Box as
|
|
409
|
+
import React16, { useEffect as useEffect12, useMemo, useState as useState16, useRef, useCallback } from "react";
|
|
410
|
+
import { Box as Box19, Text as Text20, useApp, useInput as useInput16, useStdout } from "ink";
|
|
411
411
|
import TextInput5 from "ink-text-input";
|
|
412
|
-
import
|
|
412
|
+
import chalk14 from "chalk";
|
|
413
413
|
|
|
414
414
|
// src/services/apolloMeta.ts
|
|
415
415
|
import fs2 from "fs";
|
|
@@ -580,46 +580,142 @@ function OrgSwitcher({ token, currentContext, onSelect, onClose }) {
|
|
|
580
580
|
] });
|
|
581
581
|
}
|
|
582
582
|
|
|
583
|
+
// src/ui/components/modals/ArchiveFilterModal.tsx
|
|
584
|
+
import { useState as useState2, useEffect as useEffect2 } from "react";
|
|
585
|
+
import { Box as Box2, Text as Text2, useInput as useInput2 } from "ink";
|
|
586
|
+
import chalk2 from "chalk";
|
|
587
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
588
|
+
function ArchiveFilterModal({
|
|
589
|
+
currentFilter,
|
|
590
|
+
onSelect,
|
|
591
|
+
onCancel
|
|
592
|
+
}) {
|
|
593
|
+
const options = ["all", "unarchived", "archived"];
|
|
594
|
+
const [focusedOption, setFocusedOption] = useState2(currentFilter);
|
|
595
|
+
useEffect2(() => {
|
|
596
|
+
setFocusedOption(currentFilter);
|
|
597
|
+
}, [currentFilter]);
|
|
598
|
+
useInput2((input, key) => {
|
|
599
|
+
if (key.escape || input && input.toUpperCase() === "C") {
|
|
600
|
+
onCancel();
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
if (key.leftArrow || key.upArrow) {
|
|
604
|
+
if (focusedOption === "cancel") {
|
|
605
|
+
const lastIndex = options.length - 1;
|
|
606
|
+
setFocusedOption(options[lastIndex]);
|
|
607
|
+
} else {
|
|
608
|
+
const idx = options.indexOf(focusedOption);
|
|
609
|
+
if (idx > 0) setFocusedOption(options[idx - 1]);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
if (key.rightArrow || key.downArrow) {
|
|
613
|
+
if (focusedOption !== "cancel") {
|
|
614
|
+
const idx = options.indexOf(focusedOption);
|
|
615
|
+
if (idx < options.length - 1) {
|
|
616
|
+
setFocusedOption(options[idx + 1]);
|
|
617
|
+
} else {
|
|
618
|
+
setFocusedOption("cancel");
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
if (key.tab) {
|
|
623
|
+
if (focusedOption === "cancel") {
|
|
624
|
+
setFocusedOption(options[0]);
|
|
625
|
+
} else {
|
|
626
|
+
const idx = options.indexOf(focusedOption);
|
|
627
|
+
if (idx < options.length - 1) {
|
|
628
|
+
setFocusedOption(options[idx + 1]);
|
|
629
|
+
} else {
|
|
630
|
+
setFocusedOption("cancel");
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
if (key.return) {
|
|
635
|
+
if (focusedOption === "cancel") {
|
|
636
|
+
onCancel();
|
|
637
|
+
} else {
|
|
638
|
+
onSelect(focusedOption);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (input) {
|
|
642
|
+
const u = input.toUpperCase();
|
|
643
|
+
if (u === "L") onSelect("all");
|
|
644
|
+
else if (u === "U") onSelect("unarchived");
|
|
645
|
+
else if (u === "R") onSelect("archived");
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
const getLabel = (filter) => {
|
|
649
|
+
switch (filter) {
|
|
650
|
+
case "all":
|
|
651
|
+
return "All Repositories";
|
|
652
|
+
case "unarchived":
|
|
653
|
+
return "Unarchived Only";
|
|
654
|
+
case "archived":
|
|
655
|
+
return "Archived Only";
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
const getColor = (filter) => {
|
|
659
|
+
if (filter === currentFilter) return "green";
|
|
660
|
+
return focusedOption === filter ? "cyan" : "gray";
|
|
661
|
+
};
|
|
662
|
+
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, width: 45, children: [
|
|
663
|
+
/* @__PURE__ */ jsx2(Text2, { bold: true, children: "Archive Filter" }),
|
|
664
|
+
/* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
665
|
+
options.map((option) => /* @__PURE__ */ jsx2(Box2, { paddingX: 1, children: /* @__PURE__ */ jsxs2(Text2, { children: [
|
|
666
|
+
focusedOption === option ? chalk2.bgCyan.black(" \u2192 ") : " ",
|
|
667
|
+
focusedOption === option ? chalk2[getColor(option)].bold(getLabel(option)) : chalk2[getColor(option)](getLabel(option)),
|
|
668
|
+
option === currentFilter && chalk2.green(" \u2713")
|
|
669
|
+
] }) }, option)),
|
|
670
|
+
/* @__PURE__ */ jsx2(Box2, { paddingX: 1, children: /* @__PURE__ */ jsxs2(Text2, { children: [
|
|
671
|
+
focusedOption === "cancel" ? chalk2.bgWhite.black(" \u2192 ") : " ",
|
|
672
|
+
focusedOption === "cancel" ? chalk2.white.bold("Cancel") : chalk2.gray("Cancel")
|
|
673
|
+
] }) })
|
|
674
|
+
] }),
|
|
675
|
+
/* @__PURE__ */ jsx2(Box2, { marginTop: 1, children: /* @__PURE__ */ jsx2(Text2, { color: "gray", dimColor: true, children: "\u2191\u2193/Enter \u2022 L All \u2022 U Unarchived \u2022 R Archived \u2022 Esc" }) })
|
|
676
|
+
] });
|
|
677
|
+
}
|
|
678
|
+
|
|
583
679
|
// src/ui/components/modals/DeleteModal.tsx
|
|
584
|
-
import { useState as
|
|
585
|
-
import { Box as
|
|
680
|
+
import { useState as useState4, useEffect as useEffect4 } from "react";
|
|
681
|
+
import { Box as Box3, Text as Text4, useInput as useInput3 } from "ink";
|
|
586
682
|
import TextInput from "ink-text-input";
|
|
587
|
-
import
|
|
683
|
+
import chalk3 from "chalk";
|
|
588
684
|
|
|
589
685
|
// src/ui/components/common/SlowSpinner.tsx
|
|
590
|
-
import { useEffect as
|
|
591
|
-
import { Text as
|
|
592
|
-
import { jsx as
|
|
686
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
687
|
+
import { Text as Text3 } from "ink";
|
|
688
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
593
689
|
function SlowSpinner({ interval = 500 } = {}) {
|
|
594
690
|
const frames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
595
|
-
const [frame, setFrame] =
|
|
596
|
-
|
|
691
|
+
const [frame, setFrame] = useState3(0);
|
|
692
|
+
useEffect3(() => {
|
|
597
693
|
const timer = setInterval(() => {
|
|
598
694
|
setFrame((f) => (f + 1) % frames.length);
|
|
599
695
|
}, interval);
|
|
600
696
|
return () => clearInterval(timer);
|
|
601
697
|
}, [frames.length, interval]);
|
|
602
|
-
return /* @__PURE__ */
|
|
698
|
+
return /* @__PURE__ */ jsx3(Text3, { children: frames[frame] });
|
|
603
699
|
}
|
|
604
700
|
|
|
605
701
|
// src/ui/components/modals/DeleteModal.tsx
|
|
606
|
-
import { Fragment, jsx as
|
|
702
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
607
703
|
|
|
608
704
|
// src/ui/components/modals/ArchiveModal.tsx
|
|
609
|
-
import { useState as useState4 } from "react";
|
|
610
|
-
import { Box as Box3, Text as Text4, useInput as useInput3 } from "ink";
|
|
611
|
-
import chalk3 from "chalk";
|
|
612
|
-
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
613
|
-
|
|
614
|
-
// src/ui/components/modals/SyncModal.tsx
|
|
615
705
|
import { useState as useState5 } from "react";
|
|
616
706
|
import { Box as Box4, Text as Text5, useInput as useInput4 } from "ink";
|
|
617
707
|
import chalk4 from "chalk";
|
|
618
|
-
import { Fragment as
|
|
708
|
+
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
619
709
|
|
|
620
|
-
// src/ui/components/modals/
|
|
710
|
+
// src/ui/components/modals/SyncModal.tsx
|
|
711
|
+
import { useState as useState6 } from "react";
|
|
621
712
|
import { Box as Box5, Text as Text6, useInput as useInput5 } from "ink";
|
|
622
713
|
import chalk5 from "chalk";
|
|
714
|
+
import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
715
|
+
|
|
716
|
+
// src/ui/components/modals/InfoModal.tsx
|
|
717
|
+
import { Box as Box6, Text as Text7, useInput as useInput6 } from "ink";
|
|
718
|
+
import chalk6 from "chalk";
|
|
623
719
|
|
|
624
720
|
// src/lib/utils.ts
|
|
625
721
|
function truncate(str, max = 80) {
|
|
@@ -685,19 +781,19 @@ async function copyToClipboard(text) {
|
|
|
685
781
|
}
|
|
686
782
|
|
|
687
783
|
// src/ui/components/modals/InfoModal.tsx
|
|
688
|
-
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
689
|
-
|
|
690
|
-
// src/ui/components/modals/LogoutModal.tsx
|
|
691
|
-
import { useState as useState6 } from "react";
|
|
692
|
-
import { Box as Box6, Text as Text7, useInput as useInput6 } from "ink";
|
|
693
|
-
import chalk6 from "chalk";
|
|
694
784
|
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
695
785
|
|
|
696
|
-
// src/ui/components/modals/
|
|
697
|
-
import { useState as useState7
|
|
786
|
+
// src/ui/components/modals/LogoutModal.tsx
|
|
787
|
+
import { useState as useState7 } from "react";
|
|
698
788
|
import { Box as Box7, Text as Text8, useInput as useInput7 } from "ink";
|
|
699
789
|
import chalk7 from "chalk";
|
|
700
790
|
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
791
|
+
|
|
792
|
+
// src/ui/components/modals/VisibilityModal.tsx
|
|
793
|
+
import { useState as useState8, useEffect as useEffect5 } from "react";
|
|
794
|
+
import { Box as Box8, Text as Text9, useInput as useInput8 } from "ink";
|
|
795
|
+
import chalk8 from "chalk";
|
|
796
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
701
797
|
function VisibilityModal({
|
|
702
798
|
currentFilter,
|
|
703
799
|
isEnterprise,
|
|
@@ -705,16 +801,16 @@ function VisibilityModal({
|
|
|
705
801
|
onCancel
|
|
706
802
|
}) {
|
|
707
803
|
const options = ["all", "public", "private"];
|
|
708
|
-
const [selectedIndex, setSelectedIndex] =
|
|
709
|
-
const [focusedOption, setFocusedOption] =
|
|
710
|
-
|
|
804
|
+
const [selectedIndex, setSelectedIndex] = useState8(0);
|
|
805
|
+
const [focusedOption, setFocusedOption] = useState8("all");
|
|
806
|
+
useEffect5(() => {
|
|
711
807
|
const currentIndex = options.indexOf(currentFilter);
|
|
712
808
|
if (currentIndex !== -1) {
|
|
713
809
|
setSelectedIndex(currentIndex);
|
|
714
810
|
setFocusedOption(currentFilter);
|
|
715
811
|
}
|
|
716
812
|
}, [currentFilter]);
|
|
717
|
-
|
|
813
|
+
useInput8((input, key) => {
|
|
718
814
|
if (key.escape || input && input.toUpperCase() === "C") {
|
|
719
815
|
onCancel();
|
|
720
816
|
return;
|
|
@@ -791,44 +887,44 @@ function VisibilityModal({
|
|
|
791
887
|
}
|
|
792
888
|
return focusedOption === filter ? "cyan" : "gray";
|
|
793
889
|
};
|
|
794
|
-
return /* @__PURE__ */
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
options.map((option) => /* @__PURE__ */
|
|
798
|
-
focusedOption === option ?
|
|
799
|
-
focusedOption === option ?
|
|
800
|
-
option === currentFilter &&
|
|
890
|
+
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, width: 45, children: [
|
|
891
|
+
/* @__PURE__ */ jsx9(Text9, { bold: true, children: "Visibility Filter" }),
|
|
892
|
+
/* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", marginTop: 1, children: [
|
|
893
|
+
options.map((option) => /* @__PURE__ */ jsx9(Box8, { paddingX: 1, children: /* @__PURE__ */ jsxs8(Text9, { children: [
|
|
894
|
+
focusedOption === option ? chalk8.bgCyan.black(" \u2192 ") : " ",
|
|
895
|
+
focusedOption === option ? chalk8[getButtonColor(option)].bold(getButtonLabel(option)) : chalk8[getButtonColor(option)](getButtonLabel(option)),
|
|
896
|
+
option === currentFilter && chalk8.green(" \u2713")
|
|
801
897
|
] }) }, option)),
|
|
802
|
-
/* @__PURE__ */
|
|
803
|
-
focusedOption === "cancel" ?
|
|
804
|
-
focusedOption === "cancel" ?
|
|
898
|
+
/* @__PURE__ */ jsx9(Box8, { paddingX: 1, children: /* @__PURE__ */ jsxs8(Text9, { children: [
|
|
899
|
+
focusedOption === "cancel" ? chalk8.bgWhite.black(" \u2192 ") : " ",
|
|
900
|
+
focusedOption === "cancel" ? chalk8.white.bold("Cancel") : chalk8.gray("Cancel")
|
|
805
901
|
] }) })
|
|
806
902
|
] }),
|
|
807
|
-
/* @__PURE__ */
|
|
903
|
+
/* @__PURE__ */ jsx9(Box8, { marginTop: 1, children: /* @__PURE__ */ jsx9(Text9, { color: "gray", dimColor: true, children: "\u2191\u2193/Enter \u2022 A/P/R \u2022 Esc" }) })
|
|
808
904
|
] });
|
|
809
905
|
}
|
|
810
906
|
|
|
811
907
|
// src/ui/components/modals/SortModal.tsx
|
|
812
|
-
import { useState as
|
|
813
|
-
import { Box as
|
|
814
|
-
import
|
|
815
|
-
import { jsx as
|
|
908
|
+
import { useState as useState9, useEffect as useEffect6 } from "react";
|
|
909
|
+
import { Box as Box9, Text as Text10, useInput as useInput9 } from "ink";
|
|
910
|
+
import chalk9 from "chalk";
|
|
911
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
816
912
|
function SortModal({
|
|
817
913
|
currentSort,
|
|
818
914
|
onSelect,
|
|
819
915
|
onCancel
|
|
820
916
|
}) {
|
|
821
917
|
const options = ["updated", "pushed", "name", "stars"];
|
|
822
|
-
const [selectedIndex, setSelectedIndex] =
|
|
823
|
-
const [focusedOption, setFocusedOption] =
|
|
824
|
-
|
|
918
|
+
const [selectedIndex, setSelectedIndex] = useState9(0);
|
|
919
|
+
const [focusedOption, setFocusedOption] = useState9("updated");
|
|
920
|
+
useEffect6(() => {
|
|
825
921
|
const currentIndex = options.indexOf(currentSort);
|
|
826
922
|
if (currentIndex !== -1) {
|
|
827
923
|
setSelectedIndex(currentIndex);
|
|
828
924
|
setFocusedOption(currentSort);
|
|
829
925
|
}
|
|
830
926
|
}, [currentSort]);
|
|
831
|
-
|
|
927
|
+
useInput9((input, key) => {
|
|
832
928
|
if (key.escape || input && input.toUpperCase() === "C") {
|
|
833
929
|
onCancel();
|
|
834
930
|
return;
|
|
@@ -921,28 +1017,28 @@ function SortModal({
|
|
|
921
1017
|
}
|
|
922
1018
|
return focusedOption === sort ? "cyan" : "gray";
|
|
923
1019
|
};
|
|
924
|
-
return /* @__PURE__ */
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
options.map((option) => /* @__PURE__ */
|
|
928
|
-
focusedOption === option ?
|
|
929
|
-
focusedOption === option ?
|
|
930
|
-
option === currentSort &&
|
|
1020
|
+
return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, width: 40, children: [
|
|
1021
|
+
/* @__PURE__ */ jsx10(Text10, { bold: true, children: "Sort By" }),
|
|
1022
|
+
/* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", marginTop: 1, children: [
|
|
1023
|
+
options.map((option) => /* @__PURE__ */ jsx10(Box9, { paddingX: 1, children: /* @__PURE__ */ jsxs9(Text10, { children: [
|
|
1024
|
+
focusedOption === option ? chalk9.bgCyan.black(" \u2192 ") : " ",
|
|
1025
|
+
focusedOption === option ? chalk9[getButtonColor(option)].bold(getButtonLabel(option)) : chalk9[getButtonColor(option)](getButtonLabel(option)),
|
|
1026
|
+
option === currentSort && chalk9.green(" \u2713")
|
|
931
1027
|
] }) }, option)),
|
|
932
|
-
/* @__PURE__ */
|
|
933
|
-
focusedOption === "cancel" ?
|
|
934
|
-
focusedOption === "cancel" ?
|
|
1028
|
+
/* @__PURE__ */ jsx10(Box9, { paddingX: 1, children: /* @__PURE__ */ jsxs9(Text10, { children: [
|
|
1029
|
+
focusedOption === "cancel" ? chalk9.bgWhite.black(" \u2192 ") : " ",
|
|
1030
|
+
focusedOption === "cancel" ? chalk9.white.bold("Cancel") : chalk9.gray("Cancel")
|
|
935
1031
|
] }) })
|
|
936
1032
|
] }),
|
|
937
|
-
/* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ jsx10(Box9, { marginTop: 1, children: /* @__PURE__ */ jsx10(Text10, { color: "gray", dimColor: true, children: "\u2191\u2193/Enter \u2022 U/P/N/S \u2022 Esc" }) })
|
|
938
1034
|
] });
|
|
939
1035
|
}
|
|
940
1036
|
|
|
941
1037
|
// src/ui/components/modals/SortDirectionModal.tsx
|
|
942
|
-
import { useState as
|
|
943
|
-
import { Box as
|
|
944
|
-
import
|
|
945
|
-
import { jsx as
|
|
1038
|
+
import { useState as useState10, useEffect as useEffect7 } from "react";
|
|
1039
|
+
import { Box as Box10, Text as Text11, useInput as useInput10 } from "ink";
|
|
1040
|
+
import chalk10 from "chalk";
|
|
1041
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
946
1042
|
function SortDirectionModal({
|
|
947
1043
|
currentDirection,
|
|
948
1044
|
currentSortKey,
|
|
@@ -950,11 +1046,11 @@ function SortDirectionModal({
|
|
|
950
1046
|
onCancel
|
|
951
1047
|
}) {
|
|
952
1048
|
const options = ["desc", "asc"];
|
|
953
|
-
const [focusedOption, setFocusedOption] =
|
|
954
|
-
|
|
1049
|
+
const [focusedOption, setFocusedOption] = useState10(currentDirection);
|
|
1050
|
+
useEffect7(() => {
|
|
955
1051
|
setFocusedOption(currentDirection);
|
|
956
1052
|
}, [currentDirection]);
|
|
957
|
-
|
|
1053
|
+
useInput10((input, key) => {
|
|
958
1054
|
if (key.escape || input && input.toUpperCase() === "C") {
|
|
959
1055
|
onCancel();
|
|
960
1056
|
return;
|
|
@@ -1056,39 +1152,39 @@ function SortDirectionModal({
|
|
|
1056
1152
|
return "Stars";
|
|
1057
1153
|
}
|
|
1058
1154
|
};
|
|
1059
|
-
return /* @__PURE__ */
|
|
1060
|
-
/* @__PURE__ */
|
|
1061
|
-
/* @__PURE__ */
|
|
1155
|
+
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, width: 45, children: [
|
|
1156
|
+
/* @__PURE__ */ jsx11(Text11, { bold: true, children: "Sort Direction" }),
|
|
1157
|
+
/* @__PURE__ */ jsxs10(Text11, { color: "gray", dimColor: true, children: [
|
|
1062
1158
|
"Sorting by: ",
|
|
1063
1159
|
formatSortKey()
|
|
1064
1160
|
] }),
|
|
1065
|
-
/* @__PURE__ */
|
|
1066
|
-
options.map((option) => /* @__PURE__ */
|
|
1067
|
-
/* @__PURE__ */
|
|
1068
|
-
focusedOption === option ?
|
|
1069
|
-
focusedOption === option ?
|
|
1070
|
-
option === currentDirection &&
|
|
1161
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", marginTop: 1, children: [
|
|
1162
|
+
options.map((option) => /* @__PURE__ */ jsx11(Box10, { paddingX: 1, marginBottom: 0, children: /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
|
|
1163
|
+
/* @__PURE__ */ jsxs10(Text11, { children: [
|
|
1164
|
+
focusedOption === option ? chalk10.bgCyan.black(" \u2192 ") : " ",
|
|
1165
|
+
focusedOption === option ? chalk10[getButtonColor(option)].bold(getButtonLabel(option)) : chalk10[getButtonColor(option)](getButtonLabel(option)),
|
|
1166
|
+
option === currentDirection && chalk10.green(" \u2713")
|
|
1071
1167
|
] }),
|
|
1072
|
-
/* @__PURE__ */
|
|
1168
|
+
/* @__PURE__ */ jsxs10(Text11, { color: "gray", dimColor: true, children: [
|
|
1073
1169
|
" ",
|
|
1074
1170
|
getButtonDescription(option)
|
|
1075
1171
|
] })
|
|
1076
1172
|
] }) }, option)),
|
|
1077
|
-
/* @__PURE__ */
|
|
1078
|
-
focusedOption === "cancel" ?
|
|
1079
|
-
focusedOption === "cancel" ?
|
|
1173
|
+
/* @__PURE__ */ jsx11(Box10, { paddingX: 1, marginTop: 1, children: /* @__PURE__ */ jsxs10(Text11, { children: [
|
|
1174
|
+
focusedOption === "cancel" ? chalk10.bgWhite.black(" \u2192 ") : " ",
|
|
1175
|
+
focusedOption === "cancel" ? chalk10.white.bold("Cancel") : chalk10.gray("Cancel")
|
|
1080
1176
|
] }) })
|
|
1081
1177
|
] }),
|
|
1082
|
-
/* @__PURE__ */
|
|
1178
|
+
/* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx11(Text11, { color: "gray", dimColor: true, children: "\u2191\u2193/Enter \u2022 A/D \u2022 Esc" }) })
|
|
1083
1179
|
] });
|
|
1084
1180
|
}
|
|
1085
1181
|
|
|
1086
1182
|
// src/ui/components/modals/ChangeVisibilityModal.tsx
|
|
1087
|
-
import { useState as
|
|
1088
|
-
import { Box as
|
|
1183
|
+
import { useState as useState11, useEffect as useEffect8 } from "react";
|
|
1184
|
+
import { Box as Box11, Text as Text12, useInput as useInput11 } from "ink";
|
|
1089
1185
|
import TextInput2 from "ink-text-input";
|
|
1090
|
-
import
|
|
1091
|
-
import { Fragment as Fragment4, jsx as
|
|
1186
|
+
import chalk11 from "chalk";
|
|
1187
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1092
1188
|
var ChangeVisibilityModal = ({
|
|
1093
1189
|
isOpen,
|
|
1094
1190
|
repoName,
|
|
@@ -1111,17 +1207,17 @@ var ChangeVisibilityModal = ({
|
|
|
1111
1207
|
return ["PUBLIC"];
|
|
1112
1208
|
};
|
|
1113
1209
|
const availableOptions = getAvailableOptions();
|
|
1114
|
-
const [selectedOptionIndex, setSelectedOptionIndex] =
|
|
1115
|
-
const [focusedButton, setFocusedButton] =
|
|
1210
|
+
const [selectedOptionIndex, setSelectedOptionIndex] = useState11(0);
|
|
1211
|
+
const [focusedButton, setFocusedButton] = useState11(isFork ? "cancel" : "option");
|
|
1116
1212
|
const changing = externalChanging ?? false;
|
|
1117
1213
|
const error = externalError ?? null;
|
|
1118
|
-
|
|
1214
|
+
useEffect8(() => {
|
|
1119
1215
|
if (isOpen) {
|
|
1120
1216
|
setSelectedOptionIndex(0);
|
|
1121
1217
|
setFocusedButton(isFork ? "cancel" : "option");
|
|
1122
1218
|
}
|
|
1123
1219
|
}, [isOpen, isFork]);
|
|
1124
|
-
|
|
1220
|
+
useInput11((input, key) => {
|
|
1125
1221
|
if (!isOpen) return;
|
|
1126
1222
|
if (key.escape || input?.toLowerCase() === "c") {
|
|
1127
1223
|
onClose();
|
|
@@ -1193,8 +1289,8 @@ var ChangeVisibilityModal = ({
|
|
|
1193
1289
|
}
|
|
1194
1290
|
};
|
|
1195
1291
|
const borderColor = isFork ? "red" : getVisibilityColor(currentVisibility);
|
|
1196
|
-
return /* @__PURE__ */
|
|
1197
|
-
|
|
1292
|
+
return /* @__PURE__ */ jsxs11(
|
|
1293
|
+
Box11,
|
|
1198
1294
|
{
|
|
1199
1295
|
flexDirection: "column",
|
|
1200
1296
|
borderStyle: "round",
|
|
@@ -1203,14 +1299,14 @@ var ChangeVisibilityModal = ({
|
|
|
1203
1299
|
paddingY: 2,
|
|
1204
1300
|
width: 80,
|
|
1205
1301
|
children: [
|
|
1206
|
-
/* @__PURE__ */
|
|
1207
|
-
isFork ? /* @__PURE__ */
|
|
1208
|
-
/* @__PURE__ */
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1212
|
-
/* @__PURE__ */
|
|
1213
|
-
|
|
1302
|
+
/* @__PURE__ */ jsx12(Text12, { bold: true, children: isFork ? "Visibility Change Not Available" : "Change Repository Visibility" }),
|
|
1303
|
+
isFork ? /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
1304
|
+
/* @__PURE__ */ jsx12(Text12, { color: "red", children: "\u26A0\uFE0F Cannot change visibility of forked repositories" }),
|
|
1305
|
+
/* @__PURE__ */ jsx12(Box11, { height: 1, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) }),
|
|
1306
|
+
/* @__PURE__ */ jsx12(Text12, { children: repoName }),
|
|
1307
|
+
/* @__PURE__ */ jsx12(Box11, { marginTop: 1, children: /* @__PURE__ */ jsx12(Text12, { children: "GitHub does not allow changing the visibility of forked repositories. The fork must have the same visibility as its parent repository." }) }),
|
|
1308
|
+
/* @__PURE__ */ jsx12(Box11, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsx12(
|
|
1309
|
+
Box11,
|
|
1214
1310
|
{
|
|
1215
1311
|
borderStyle: "round",
|
|
1216
1312
|
borderColor: "white",
|
|
@@ -1219,23 +1315,23 @@ var ChangeVisibilityModal = ({
|
|
|
1219
1315
|
alignItems: "center",
|
|
1220
1316
|
justifyContent: "center",
|
|
1221
1317
|
flexDirection: "column",
|
|
1222
|
-
children: /* @__PURE__ */
|
|
1318
|
+
children: /* @__PURE__ */ jsx12(Text12, { children: chalk11.bgGray.white.bold(" Cancel ") })
|
|
1223
1319
|
}
|
|
1224
1320
|
) }),
|
|
1225
|
-
/* @__PURE__ */
|
|
1226
|
-
] }) : /* @__PURE__ */
|
|
1227
|
-
/* @__PURE__ */
|
|
1228
|
-
/* @__PURE__ */
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
/* @__PURE__ */
|
|
1321
|
+
/* @__PURE__ */ jsx12(Box11, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsx12(Text12, { color: "gray", children: "Press Enter to Cancel \u2022 C to cancel" }) })
|
|
1322
|
+
] }) : /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
1323
|
+
/* @__PURE__ */ jsx12(Text12, { color: borderColor, children: "\u26A0\uFE0F Change repository visibility?" }),
|
|
1324
|
+
/* @__PURE__ */ jsx12(Box11, { height: 1, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) }),
|
|
1325
|
+
/* @__PURE__ */ jsx12(Text12, { children: repoName }),
|
|
1326
|
+
/* @__PURE__ */ jsx12(Box11, { marginTop: 1, children: /* @__PURE__ */ jsxs11(Text12, { children: [
|
|
1231
1327
|
"Current visibility:",
|
|
1232
1328
|
" ",
|
|
1233
|
-
/* @__PURE__ */
|
|
1329
|
+
/* @__PURE__ */ jsx12(Text12, { color: getVisibilityColor(currentVisibility), children: getVisibilityLabel(currentVisibility) })
|
|
1234
1330
|
] }) }),
|
|
1235
|
-
/* @__PURE__ */
|
|
1236
|
-
/* @__PURE__ */
|
|
1237
|
-
availableOptions.map((option, index) => /* @__PURE__ */
|
|
1238
|
-
|
|
1331
|
+
/* @__PURE__ */ jsx12(Box11, { marginTop: 1, children: /* @__PURE__ */ jsx12(Text12, { children: "Change to:" }) }),
|
|
1332
|
+
/* @__PURE__ */ jsxs11(Box11, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 3, children: [
|
|
1333
|
+
availableOptions.map((option, index) => /* @__PURE__ */ jsx12(
|
|
1334
|
+
Box11,
|
|
1239
1335
|
{
|
|
1240
1336
|
borderStyle: "round",
|
|
1241
1337
|
borderColor: focusedButton === "option" && selectedOptionIndex === index ? getVisibilityColor(option) : "gray",
|
|
@@ -1244,12 +1340,12 @@ var ChangeVisibilityModal = ({
|
|
|
1244
1340
|
alignItems: "center",
|
|
1245
1341
|
justifyContent: "center",
|
|
1246
1342
|
flexDirection: "column",
|
|
1247
|
-
children: /* @__PURE__ */
|
|
1343
|
+
children: /* @__PURE__ */ jsx12(Text12, { children: focusedButton === "option" && selectedOptionIndex === index ? chalk11[`bg${getVisibilityLabel(option) === "Public" ? "Green" : getVisibilityLabel(option) === "Private" ? "Yellow" : "Cyan"}`].black.bold(` ${getVisibilityLabel(option)} `) : chalk11[getVisibilityColor(option)](getVisibilityLabel(option)) })
|
|
1248
1344
|
},
|
|
1249
1345
|
option
|
|
1250
1346
|
)),
|
|
1251
|
-
/* @__PURE__ */
|
|
1252
|
-
|
|
1347
|
+
/* @__PURE__ */ jsx12(
|
|
1348
|
+
Box11,
|
|
1253
1349
|
{
|
|
1254
1350
|
borderStyle: "round",
|
|
1255
1351
|
borderColor: focusedButton === "cancel" ? "white" : "gray",
|
|
@@ -1258,18 +1354,18 @@ var ChangeVisibilityModal = ({
|
|
|
1258
1354
|
alignItems: "center",
|
|
1259
1355
|
justifyContent: "center",
|
|
1260
1356
|
flexDirection: "column",
|
|
1261
|
-
children: /* @__PURE__ */
|
|
1357
|
+
children: /* @__PURE__ */ jsx12(Text12, { children: focusedButton === "cancel" ? chalk11.bgGray.white.bold(" Cancel ") : chalk11.gray.bold("Cancel") })
|
|
1262
1358
|
}
|
|
1263
1359
|
)
|
|
1264
1360
|
] }),
|
|
1265
|
-
/* @__PURE__ */
|
|
1361
|
+
/* @__PURE__ */ jsx12(Box11, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs11(Text12, { color: "gray", children: [
|
|
1266
1362
|
availableOptions.length > 1 ? "\u2191\u2193 Select Option \u2022 " : "",
|
|
1267
1363
|
"\u2190 \u2192 Navigate \u2022 Press Enter to ",
|
|
1268
1364
|
focusedButton === "option" ? "Change" : "Cancel",
|
|
1269
1365
|
" \u2022 Y to confirm \u2022 C to cancel"
|
|
1270
1366
|
] }) })
|
|
1271
1367
|
] }),
|
|
1272
|
-
/* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ jsx12(Box11, { marginTop: 1, children: /* @__PURE__ */ jsx12(
|
|
1273
1369
|
TextInput2,
|
|
1274
1370
|
{
|
|
1275
1371
|
value: "",
|
|
@@ -1284,23 +1380,23 @@ var ChangeVisibilityModal = ({
|
|
|
1284
1380
|
}
|
|
1285
1381
|
}
|
|
1286
1382
|
) }),
|
|
1287
|
-
error && /* @__PURE__ */
|
|
1288
|
-
changing && /* @__PURE__ */
|
|
1383
|
+
error && /* @__PURE__ */ jsx12(Box11, { marginTop: 1, children: /* @__PURE__ */ jsx12(Text12, { color: "magenta", children: error }) }),
|
|
1384
|
+
changing && /* @__PURE__ */ jsx12(Box11, { marginTop: 1, children: /* @__PURE__ */ jsx12(Text12, { color: "yellow", children: "Changing visibility..." }) })
|
|
1289
1385
|
]
|
|
1290
1386
|
}
|
|
1291
1387
|
);
|
|
1292
1388
|
};
|
|
1293
1389
|
|
|
1294
1390
|
// src/ui/components/modals/CopyUrlModal.tsx
|
|
1295
|
-
import { useState as
|
|
1296
|
-
import { Box as
|
|
1297
|
-
import
|
|
1298
|
-
import { Fragment as Fragment5, jsx as
|
|
1391
|
+
import { useState as useState12 } from "react";
|
|
1392
|
+
import { Box as Box12, Text as Text13, useInput as useInput12 } from "ink";
|
|
1393
|
+
import chalk12 from "chalk";
|
|
1394
|
+
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1299
1395
|
function CopyUrlModal({ repo, terminalWidth, onClose, onCopy }) {
|
|
1300
|
-
const [copyError, setCopyError] =
|
|
1301
|
-
const [selectedType, setSelectedType] =
|
|
1396
|
+
const [copyError, setCopyError] = useState12(null);
|
|
1397
|
+
const [selectedType, setSelectedType] = useState12("SSH");
|
|
1302
1398
|
const urlTypes = ["SSH", "HTTPS"];
|
|
1303
|
-
|
|
1399
|
+
useInput12((input, key) => {
|
|
1304
1400
|
if (!repo) return;
|
|
1305
1401
|
const ch = input?.toLowerCase();
|
|
1306
1402
|
if (key.escape || ch === "c" || ch === "q") {
|
|
@@ -1345,7 +1441,7 @@ function CopyUrlModal({ repo, terminalWidth, onClose, onCopy }) {
|
|
|
1345
1441
|
}
|
|
1346
1442
|
});
|
|
1347
1443
|
if (!repo) {
|
|
1348
|
-
return /* @__PURE__ */
|
|
1444
|
+
return /* @__PURE__ */ jsx13(Text13, { color: "red", children: "No repository selected." });
|
|
1349
1445
|
}
|
|
1350
1446
|
const sshUrl = `git@github.com:${repo.nameWithOwner}.git`;
|
|
1351
1447
|
const httpsUrl = `https://github.com/${repo.nameWithOwner}.git`;
|
|
@@ -1359,8 +1455,8 @@ function CopyUrlModal({ repo, terminalWidth, onClose, onCopy }) {
|
|
|
1359
1455
|
setCopyError(`Failed to copy ${type} URL: ${message}`);
|
|
1360
1456
|
}
|
|
1361
1457
|
};
|
|
1362
|
-
return /* @__PURE__ */
|
|
1363
|
-
|
|
1458
|
+
return /* @__PURE__ */ jsxs12(
|
|
1459
|
+
Box12,
|
|
1364
1460
|
{
|
|
1365
1461
|
flexDirection: "column",
|
|
1366
1462
|
borderStyle: "round",
|
|
@@ -1369,48 +1465,48 @@ function CopyUrlModal({ repo, terminalWidth, onClose, onCopy }) {
|
|
|
1369
1465
|
paddingY: 2,
|
|
1370
1466
|
width: Math.min(terminalWidth - 8, 80),
|
|
1371
1467
|
children: [
|
|
1372
|
-
/* @__PURE__ */
|
|
1373
|
-
/* @__PURE__ */
|
|
1374
|
-
/* @__PURE__ */
|
|
1375
|
-
/* @__PURE__ */
|
|
1376
|
-
/* @__PURE__ */
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
|
|
1468
|
+
/* @__PURE__ */ jsx13(Text13, { bold: true, color: "blue", children: "Copy Repository URL" }),
|
|
1469
|
+
/* @__PURE__ */ jsx13(Box12, { height: 1, children: /* @__PURE__ */ jsx13(Text13, { children: " " }) }),
|
|
1470
|
+
/* @__PURE__ */ jsx13(Text13, { children: chalk12.bold(repo.nameWithOwner) }),
|
|
1471
|
+
/* @__PURE__ */ jsx13(Box12, { height: 1, children: /* @__PURE__ */ jsx13(Text13, { children: " " }) }),
|
|
1472
|
+
/* @__PURE__ */ jsx13(Text13, { color: "gray", children: "SSH URL:" }),
|
|
1473
|
+
/* @__PURE__ */ jsx13(
|
|
1474
|
+
Box12,
|
|
1379
1475
|
{
|
|
1380
1476
|
paddingX: 2,
|
|
1381
1477
|
paddingY: 1,
|
|
1382
1478
|
borderStyle: "single",
|
|
1383
1479
|
borderColor: selectedType === "SSH" ? "blue" : "gray",
|
|
1384
|
-
children: /* @__PURE__ */
|
|
1480
|
+
children: /* @__PURE__ */ jsxs12(Text13, { color: selectedType === "SSH" ? "blue" : void 0, children: [
|
|
1385
1481
|
selectedType === "SSH" ? "\u25B6 " : " ",
|
|
1386
1482
|
sshUrl
|
|
1387
1483
|
] })
|
|
1388
1484
|
}
|
|
1389
1485
|
),
|
|
1390
|
-
/* @__PURE__ */
|
|
1391
|
-
/* @__PURE__ */
|
|
1392
|
-
/* @__PURE__ */
|
|
1393
|
-
|
|
1486
|
+
/* @__PURE__ */ jsx13(Box12, { height: 1, children: /* @__PURE__ */ jsx13(Text13, { children: " " }) }),
|
|
1487
|
+
/* @__PURE__ */ jsx13(Text13, { color: "gray", children: "HTTPS URL:" }),
|
|
1488
|
+
/* @__PURE__ */ jsx13(
|
|
1489
|
+
Box12,
|
|
1394
1490
|
{
|
|
1395
1491
|
paddingX: 2,
|
|
1396
1492
|
paddingY: 1,
|
|
1397
1493
|
borderStyle: "single",
|
|
1398
1494
|
borderColor: selectedType === "HTTPS" ? "blue" : "gray",
|
|
1399
|
-
children: /* @__PURE__ */
|
|
1495
|
+
children: /* @__PURE__ */ jsxs12(Text13, { color: selectedType === "HTTPS" ? "blue" : void 0, children: [
|
|
1400
1496
|
selectedType === "HTTPS" ? "\u25B6 " : " ",
|
|
1401
1497
|
httpsUrl
|
|
1402
1498
|
] })
|
|
1403
1499
|
}
|
|
1404
1500
|
),
|
|
1405
|
-
/* @__PURE__ */
|
|
1406
|
-
/* @__PURE__ */
|
|
1501
|
+
/* @__PURE__ */ jsx13(Box12, { height: 1, children: /* @__PURE__ */ jsx13(Text13, { children: " " }) }),
|
|
1502
|
+
/* @__PURE__ */ jsxs12(Text13, { color: "gray", children: [
|
|
1407
1503
|
"\u2191\u2193 Select \u2022 Enter/Y to copy ",
|
|
1408
1504
|
selectedType,
|
|
1409
1505
|
" \u2022 S copy SSH \u2022 H copy HTTPS \u2022 Esc/Q/C to close"
|
|
1410
1506
|
] }),
|
|
1411
|
-
copyError && /* @__PURE__ */
|
|
1412
|
-
/* @__PURE__ */
|
|
1413
|
-
/* @__PURE__ */
|
|
1507
|
+
copyError && /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
1508
|
+
/* @__PURE__ */ jsx13(Box12, { height: 1, children: /* @__PURE__ */ jsx13(Text13, { children: " " }) }),
|
|
1509
|
+
/* @__PURE__ */ jsx13(Text13, { color: "red", children: copyError })
|
|
1414
1510
|
] })
|
|
1415
1511
|
]
|
|
1416
1512
|
}
|
|
@@ -1418,21 +1514,21 @@ function CopyUrlModal({ repo, terminalWidth, onClose, onCopy }) {
|
|
|
1418
1514
|
}
|
|
1419
1515
|
|
|
1420
1516
|
// src/ui/components/modals/RenameModal.tsx
|
|
1421
|
-
import { useState as
|
|
1422
|
-
import { Box as
|
|
1517
|
+
import { useState as useState13, useEffect as useEffect9 } from "react";
|
|
1518
|
+
import { Box as Box13, Text as Text14, useInput as useInput13 } from "ink";
|
|
1423
1519
|
import TextInput3 from "ink-text-input";
|
|
1424
|
-
import { Fragment as Fragment6, jsx as
|
|
1520
|
+
import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1425
1521
|
function RenameModal({ repo, onRename, onCancel }) {
|
|
1426
|
-
const [newName, setNewName] =
|
|
1427
|
-
const [renaming, setRenaming] =
|
|
1428
|
-
const [renameError, setRenameError] =
|
|
1429
|
-
|
|
1522
|
+
const [newName, setNewName] = useState13("");
|
|
1523
|
+
const [renaming, setRenaming] = useState13(false);
|
|
1524
|
+
const [renameError, setRenameError] = useState13(null);
|
|
1525
|
+
useEffect9(() => {
|
|
1430
1526
|
if (repo) {
|
|
1431
1527
|
setNewName(repo.name);
|
|
1432
1528
|
setRenameError(null);
|
|
1433
1529
|
}
|
|
1434
1530
|
}, [repo]);
|
|
1435
|
-
|
|
1531
|
+
useInput13((input, key) => {
|
|
1436
1532
|
if (renaming) return;
|
|
1437
1533
|
if (key.escape) {
|
|
1438
1534
|
onCancel();
|
|
@@ -1463,8 +1559,8 @@ function RenameModal({ repo, onRename, onCancel }) {
|
|
|
1463
1559
|
if (!repo) return null;
|
|
1464
1560
|
const owner = repo.nameWithOwner.split("/")[0];
|
|
1465
1561
|
const isDisabled = !newName.trim() || newName === repo.name;
|
|
1466
|
-
return /* @__PURE__ */
|
|
1467
|
-
|
|
1562
|
+
return /* @__PURE__ */ jsxs13(
|
|
1563
|
+
Box13,
|
|
1468
1564
|
{
|
|
1469
1565
|
flexDirection: "column",
|
|
1470
1566
|
borderStyle: "round",
|
|
@@ -1473,20 +1569,20 @@ function RenameModal({ repo, onRename, onCancel }) {
|
|
|
1473
1569
|
paddingY: 2,
|
|
1474
1570
|
width: 80,
|
|
1475
1571
|
children: [
|
|
1476
|
-
/* @__PURE__ */
|
|
1477
|
-
/* @__PURE__ */
|
|
1478
|
-
/* @__PURE__ */
|
|
1572
|
+
/* @__PURE__ */ jsx14(Text14, { bold: true, color: "cyan", children: "Rename Repository" }),
|
|
1573
|
+
/* @__PURE__ */ jsx14(Box13, { height: 1, children: /* @__PURE__ */ jsx14(Text14, { children: " " }) }),
|
|
1574
|
+
/* @__PURE__ */ jsxs13(Text14, { color: "gray", children: [
|
|
1479
1575
|
"Current: ",
|
|
1480
1576
|
repo.nameWithOwner
|
|
1481
1577
|
] }),
|
|
1482
|
-
/* @__PURE__ */
|
|
1483
|
-
/* @__PURE__ */
|
|
1484
|
-
/* @__PURE__ */
|
|
1485
|
-
/* @__PURE__ */
|
|
1578
|
+
/* @__PURE__ */ jsx14(Box13, { height: 1, children: /* @__PURE__ */ jsx14(Text14, { children: " " }) }),
|
|
1579
|
+
/* @__PURE__ */ jsx14(Text14, { children: "New name:" }),
|
|
1580
|
+
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "row", alignItems: "center", children: [
|
|
1581
|
+
/* @__PURE__ */ jsxs13(Text14, { children: [
|
|
1486
1582
|
owner,
|
|
1487
1583
|
"/"
|
|
1488
1584
|
] }),
|
|
1489
|
-
/* @__PURE__ */
|
|
1585
|
+
/* @__PURE__ */ jsx14(
|
|
1490
1586
|
TextInput3,
|
|
1491
1587
|
{
|
|
1492
1588
|
value: newName,
|
|
@@ -1496,24 +1592,24 @@ function RenameModal({ repo, onRename, onCancel }) {
|
|
|
1496
1592
|
}
|
|
1497
1593
|
)
|
|
1498
1594
|
] }),
|
|
1499
|
-
renaming ? /* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
/* @__PURE__ */
|
|
1502
|
-
] }) }) : /* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1504
|
-
/* @__PURE__ */
|
|
1595
|
+
renaming ? /* @__PURE__ */ jsx14(Box13, { marginTop: 2, justifyContent: "center", children: /* @__PURE__ */ jsxs13(Box13, { flexDirection: "row", children: [
|
|
1596
|
+
/* @__PURE__ */ jsx14(Box13, { marginRight: 1, children: /* @__PURE__ */ jsx14(SlowSpinner, {}) }),
|
|
1597
|
+
/* @__PURE__ */ jsx14(Text14, { color: "cyan", children: "Renaming repository..." })
|
|
1598
|
+
] }) }) : /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
1599
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 2, children: /* @__PURE__ */ jsx14(Text14, { color: "gray", children: isDisabled ? "Enter a different name to rename" : `Press Enter to rename to "${newName}"` }) }),
|
|
1600
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "gray", children: "Press Esc to cancel" }) })
|
|
1505
1601
|
] }),
|
|
1506
|
-
renameError && /* @__PURE__ */
|
|
1602
|
+
renameError && /* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "red", children: renameError }) })
|
|
1507
1603
|
]
|
|
1508
1604
|
}
|
|
1509
1605
|
);
|
|
1510
1606
|
}
|
|
1511
1607
|
|
|
1512
1608
|
// src/ui/components/modals/StarModal.tsx
|
|
1513
|
-
import { useEffect as
|
|
1514
|
-
import { Box as
|
|
1515
|
-
import { useInput as
|
|
1516
|
-
import { Fragment as Fragment7, jsx as
|
|
1609
|
+
import { useEffect as useEffect10, useState as useState14 } from "react";
|
|
1610
|
+
import { Box as Box14, Text as Text15 } from "ink";
|
|
1611
|
+
import { useInput as useInput14 } from "ink";
|
|
1612
|
+
import { Fragment as Fragment7, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1517
1613
|
function StarModal({
|
|
1518
1614
|
visible,
|
|
1519
1615
|
repo,
|
|
@@ -1523,8 +1619,8 @@ function StarModal({
|
|
|
1523
1619
|
isStarring = false,
|
|
1524
1620
|
error = null
|
|
1525
1621
|
}) {
|
|
1526
|
-
const [focusedButton, setFocusedButton] =
|
|
1527
|
-
|
|
1622
|
+
const [focusedButton, setFocusedButton] = useState14("cancel");
|
|
1623
|
+
useInput14((input, key) => {
|
|
1528
1624
|
if (!visible) return;
|
|
1529
1625
|
if (key.escape || input === "c" || input === "C") {
|
|
1530
1626
|
onCancel();
|
|
@@ -1549,7 +1645,7 @@ function StarModal({
|
|
|
1549
1645
|
onConfirm();
|
|
1550
1646
|
}
|
|
1551
1647
|
});
|
|
1552
|
-
|
|
1648
|
+
useEffect10(() => {
|
|
1553
1649
|
if (visible) {
|
|
1554
1650
|
setFocusedButton("cancel");
|
|
1555
1651
|
}
|
|
@@ -1558,8 +1654,8 @@ function StarModal({
|
|
|
1558
1654
|
const action = isStarred ? "Unstar" : "Star";
|
|
1559
1655
|
const actionLower = isStarred ? "unstar" : "star";
|
|
1560
1656
|
const actionGerund = isStarred ? "Unstarring" : "Starring";
|
|
1561
|
-
return /* @__PURE__ */
|
|
1562
|
-
|
|
1657
|
+
return /* @__PURE__ */ jsxs14(
|
|
1658
|
+
Box14,
|
|
1563
1659
|
{
|
|
1564
1660
|
flexDirection: "column",
|
|
1565
1661
|
borderStyle: "round",
|
|
@@ -1568,36 +1664,36 @@ function StarModal({
|
|
|
1568
1664
|
paddingY: 1,
|
|
1569
1665
|
marginTop: 1,
|
|
1570
1666
|
children: [
|
|
1571
|
-
/* @__PURE__ */
|
|
1667
|
+
/* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsxs14(Text15, { bold: true, color: "yellow", children: [
|
|
1572
1668
|
"\u2B50 ",
|
|
1573
1669
|
action,
|
|
1574
1670
|
" Repository"
|
|
1575
1671
|
] }) }),
|
|
1576
|
-
/* @__PURE__ */
|
|
1672
|
+
/* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsxs14(Text15, { children: [
|
|
1577
1673
|
"Are you sure you want to ",
|
|
1578
1674
|
actionLower,
|
|
1579
1675
|
" ",
|
|
1580
|
-
/* @__PURE__ */
|
|
1676
|
+
/* @__PURE__ */ jsx15(Text15, { bold: true, color: "cyan", children: repo.nameWithOwner }),
|
|
1581
1677
|
"?"
|
|
1582
1678
|
] }) }),
|
|
1583
|
-
repo.description && /* @__PURE__ */
|
|
1584
|
-
/* @__PURE__ */
|
|
1679
|
+
repo.description && /* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx15(Text15, { dimColor: true, wrap: "wrap", children: repo.description }) }),
|
|
1680
|
+
/* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsxs14(Text15, { dimColor: true, children: [
|
|
1585
1681
|
"Current Stars: ",
|
|
1586
1682
|
repo.stargazerCount,
|
|
1587
1683
|
" \u2022 Forks: ",
|
|
1588
1684
|
repo.forkCount
|
|
1589
1685
|
] }) }),
|
|
1590
|
-
error && /* @__PURE__ */
|
|
1686
|
+
error && /* @__PURE__ */ jsx15(Box14, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs14(Text15, { color: "red", wrap: "wrap", children: [
|
|
1591
1687
|
error.includes("OAuth access restrictions") ? "\u26A0\uFE0F " : "Error: ",
|
|
1592
1688
|
error
|
|
1593
1689
|
] }) }),
|
|
1594
|
-
isStarring ? /* @__PURE__ */
|
|
1690
|
+
isStarring ? /* @__PURE__ */ jsx15(Box14, { children: /* @__PURE__ */ jsxs14(Text15, { color: "yellow", children: [
|
|
1595
1691
|
actionGerund,
|
|
1596
1692
|
"..."
|
|
1597
|
-
] }) }) : /* @__PURE__ */
|
|
1598
|
-
/* @__PURE__ */
|
|
1599
|
-
/* @__PURE__ */
|
|
1600
|
-
|
|
1693
|
+
] }) }) : /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
1694
|
+
/* @__PURE__ */ jsxs14(Box14, { gap: 2, children: [
|
|
1695
|
+
/* @__PURE__ */ jsx15(Box14, { children: /* @__PURE__ */ jsxs14(
|
|
1696
|
+
Text15,
|
|
1601
1697
|
{
|
|
1602
1698
|
backgroundColor: focusedButton === "cancel" ? "white" : void 0,
|
|
1603
1699
|
color: focusedButton === "cancel" ? "black" : "white",
|
|
@@ -1609,8 +1705,8 @@ function StarModal({
|
|
|
1609
1705
|
]
|
|
1610
1706
|
}
|
|
1611
1707
|
) }),
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
|
|
1708
|
+
/* @__PURE__ */ jsx15(Box14, { children: /* @__PURE__ */ jsxs14(
|
|
1709
|
+
Text15,
|
|
1614
1710
|
{
|
|
1615
1711
|
backgroundColor: focusedButton === "star" ? "yellow" : void 0,
|
|
1616
1712
|
color: focusedButton === "star" ? "black" : "yellow",
|
|
@@ -1624,7 +1720,7 @@ function StarModal({
|
|
|
1624
1720
|
}
|
|
1625
1721
|
) })
|
|
1626
1722
|
] }),
|
|
1627
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ jsx15(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx15(Text15, { dimColor: true, children: "Use \u2190 \u2192 to navigate, Enter to select" }) })
|
|
1628
1724
|
] })
|
|
1629
1725
|
]
|
|
1630
1726
|
}
|
|
@@ -1632,10 +1728,10 @@ function StarModal({
|
|
|
1632
1728
|
}
|
|
1633
1729
|
|
|
1634
1730
|
// src/ui/components/modals/UnstarModal.tsx
|
|
1635
|
-
import { useEffect as
|
|
1636
|
-
import { Box as
|
|
1637
|
-
import { useInput as
|
|
1638
|
-
import { Fragment as Fragment8, jsx as
|
|
1731
|
+
import { useEffect as useEffect11, useState as useState15 } from "react";
|
|
1732
|
+
import { Box as Box15, Text as Text16 } from "ink";
|
|
1733
|
+
import { useInput as useInput15 } from "ink";
|
|
1734
|
+
import { Fragment as Fragment8, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1639
1735
|
function UnstarModal({
|
|
1640
1736
|
visible,
|
|
1641
1737
|
repo,
|
|
@@ -1644,8 +1740,8 @@ function UnstarModal({
|
|
|
1644
1740
|
isUnstarring = false,
|
|
1645
1741
|
error = null
|
|
1646
1742
|
}) {
|
|
1647
|
-
const [focusedButton, setFocusedButton] =
|
|
1648
|
-
|
|
1743
|
+
const [focusedButton, setFocusedButton] = useState15("cancel");
|
|
1744
|
+
useInput15((input, key) => {
|
|
1649
1745
|
if (!visible) return;
|
|
1650
1746
|
if (key.escape || input === "c" || input === "C") {
|
|
1651
1747
|
onCancel();
|
|
@@ -1670,14 +1766,14 @@ function UnstarModal({
|
|
|
1670
1766
|
onConfirm();
|
|
1671
1767
|
}
|
|
1672
1768
|
});
|
|
1673
|
-
|
|
1769
|
+
useEffect11(() => {
|
|
1674
1770
|
if (visible) {
|
|
1675
1771
|
setFocusedButton("cancel");
|
|
1676
1772
|
}
|
|
1677
1773
|
}, [visible]);
|
|
1678
1774
|
if (!visible || !repo) return null;
|
|
1679
|
-
return /* @__PURE__ */
|
|
1680
|
-
|
|
1775
|
+
return /* @__PURE__ */ jsxs15(
|
|
1776
|
+
Box15,
|
|
1681
1777
|
{
|
|
1682
1778
|
flexDirection: "column",
|
|
1683
1779
|
borderStyle: "round",
|
|
@@ -1686,28 +1782,28 @@ function UnstarModal({
|
|
|
1686
1782
|
paddingY: 1,
|
|
1687
1783
|
marginTop: 1,
|
|
1688
1784
|
children: [
|
|
1689
|
-
/* @__PURE__ */
|
|
1690
|
-
/* @__PURE__ */
|
|
1785
|
+
/* @__PURE__ */ jsx16(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx16(Text16, { bold: true, color: "yellow", children: "\u2B50 Unstar Repository" }) }),
|
|
1786
|
+
/* @__PURE__ */ jsx16(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsxs15(Text16, { children: [
|
|
1691
1787
|
"Are you sure you want to unstar",
|
|
1692
1788
|
" ",
|
|
1693
|
-
/* @__PURE__ */
|
|
1789
|
+
/* @__PURE__ */ jsx16(Text16, { bold: true, color: "cyan", children: repo.nameWithOwner }),
|
|
1694
1790
|
"?"
|
|
1695
1791
|
] }) }),
|
|
1696
|
-
repo.description && /* @__PURE__ */
|
|
1697
|
-
/* @__PURE__ */
|
|
1792
|
+
repo.description && /* @__PURE__ */ jsx16(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx16(Text16, { dimColor: true, wrap: "wrap", children: repo.description }) }),
|
|
1793
|
+
/* @__PURE__ */ jsx16(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsxs15(Text16, { dimColor: true, children: [
|
|
1698
1794
|
"Stars: ",
|
|
1699
1795
|
repo.stargazerCount,
|
|
1700
1796
|
" \u2022 Forks: ",
|
|
1701
1797
|
repo.forkCount
|
|
1702
1798
|
] }) }),
|
|
1703
|
-
error && /* @__PURE__ */
|
|
1799
|
+
error && /* @__PURE__ */ jsx16(Box15, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs15(Text16, { color: "red", wrap: "wrap", children: [
|
|
1704
1800
|
error.includes("OAuth access restrictions") ? "\u26A0\uFE0F " : "Error: ",
|
|
1705
1801
|
error
|
|
1706
1802
|
] }) }),
|
|
1707
|
-
isUnstarring ? /* @__PURE__ */
|
|
1708
|
-
/* @__PURE__ */
|
|
1709
|
-
/* @__PURE__ */
|
|
1710
|
-
|
|
1803
|
+
isUnstarring ? /* @__PURE__ */ jsx16(Box15, { children: /* @__PURE__ */ jsx16(Text16, { color: "yellow", children: "Unstarring..." }) }) : /* @__PURE__ */ jsxs15(Fragment8, { children: [
|
|
1804
|
+
/* @__PURE__ */ jsxs15(Box15, { gap: 2, children: [
|
|
1805
|
+
/* @__PURE__ */ jsx16(Box15, { children: /* @__PURE__ */ jsxs15(
|
|
1806
|
+
Text16,
|
|
1711
1807
|
{
|
|
1712
1808
|
backgroundColor: focusedButton === "cancel" ? "white" : void 0,
|
|
1713
1809
|
color: focusedButton === "cancel" ? "black" : "white",
|
|
@@ -1719,8 +1815,8 @@ function UnstarModal({
|
|
|
1719
1815
|
]
|
|
1720
1816
|
}
|
|
1721
1817
|
) }),
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
-
|
|
1818
|
+
/* @__PURE__ */ jsx16(Box15, { children: /* @__PURE__ */ jsxs15(
|
|
1819
|
+
Text16,
|
|
1724
1820
|
{
|
|
1725
1821
|
backgroundColor: focusedButton === "unstar" ? "yellow" : void 0,
|
|
1726
1822
|
color: focusedButton === "unstar" ? "black" : "yellow",
|
|
@@ -1733,7 +1829,7 @@ function UnstarModal({
|
|
|
1733
1829
|
}
|
|
1734
1830
|
) })
|
|
1735
1831
|
] }),
|
|
1736
|
-
/* @__PURE__ */
|
|
1832
|
+
/* @__PURE__ */ jsx16(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx16(Text16, { dimColor: true, children: "Use \u2190 \u2192 to navigate, Enter to select" }) })
|
|
1737
1833
|
] })
|
|
1738
1834
|
]
|
|
1739
1835
|
}
|
|
@@ -1741,9 +1837,9 @@ function UnstarModal({
|
|
|
1741
1837
|
}
|
|
1742
1838
|
|
|
1743
1839
|
// src/ui/components/repo/RepoRow.tsx
|
|
1744
|
-
import { Box as
|
|
1745
|
-
import
|
|
1746
|
-
import { jsx as
|
|
1840
|
+
import { Box as Box16, Text as Text17 } from "ink";
|
|
1841
|
+
import chalk13 from "chalk";
|
|
1842
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1747
1843
|
function RepoRow({
|
|
1748
1844
|
repo,
|
|
1749
1845
|
selected,
|
|
@@ -1760,56 +1856,56 @@ function RepoRow({
|
|
|
1760
1856
|
const commitsBehind = hasCommitData ? repo.parent.defaultBranchRef.target.history.totalCount - repo.defaultBranchRef.target.history.totalCount : 0;
|
|
1761
1857
|
const showCommitsBehind = forkTracking && hasCommitData;
|
|
1762
1858
|
let line1 = "";
|
|
1763
|
-
const numColor = selected ?
|
|
1764
|
-
const nameColor = selected ?
|
|
1859
|
+
const numColor = selected ? chalk13.cyan : chalk13.gray;
|
|
1860
|
+
const nameColor = selected ? chalk13.cyan.bold : chalk13.white;
|
|
1765
1861
|
line1 += numColor(`${String(index).padStart(3, " ")}.`);
|
|
1766
1862
|
if (repo.viewerHasStarred) {
|
|
1767
|
-
line1 +=
|
|
1863
|
+
line1 += chalk13.yellow(" \u2B50");
|
|
1768
1864
|
}
|
|
1769
1865
|
line1 += nameColor(` ${repo.nameWithOwner}`);
|
|
1770
1866
|
if (repo.visibility === "INTERNAL") {
|
|
1771
|
-
line1 +=
|
|
1867
|
+
line1 += chalk13.magenta(" Internal");
|
|
1772
1868
|
} else if (repo.visibility === "PRIVATE" || repo.isPrivate && !repo.visibility) {
|
|
1773
|
-
line1 +=
|
|
1869
|
+
line1 += chalk13.yellow(" Private");
|
|
1774
1870
|
}
|
|
1775
1871
|
if (starsMode && repo.owner && repo.owner.__typename === "Organization") {
|
|
1776
|
-
line1 +=
|
|
1872
|
+
line1 += chalk13.gray(" [org]");
|
|
1777
1873
|
}
|
|
1778
|
-
if (repo.isArchived) line1 += " " +
|
|
1874
|
+
if (repo.isArchived) line1 += " " + chalk13.bgGray.whiteBright(" Archived ") + " ";
|
|
1779
1875
|
if (repo.isFork && repo.parent) {
|
|
1780
|
-
line1 +=
|
|
1876
|
+
line1 += chalk13.blue(` Fork of ${repo.parent.nameWithOwner}`);
|
|
1781
1877
|
if (showCommitsBehind) {
|
|
1782
1878
|
if (commitsBehind > 0) {
|
|
1783
|
-
line1 +=
|
|
1879
|
+
line1 += chalk13.yellow(` (${commitsBehind} behind)`);
|
|
1784
1880
|
} else {
|
|
1785
|
-
line1 +=
|
|
1881
|
+
line1 += chalk13.green(` (0 behind)`);
|
|
1786
1882
|
}
|
|
1787
1883
|
}
|
|
1788
1884
|
}
|
|
1789
1885
|
let line2 = " ";
|
|
1790
|
-
const metaColor = selected ?
|
|
1791
|
-
if (langName) line2 +=
|
|
1886
|
+
const metaColor = selected ? chalk13.white : chalk13.gray;
|
|
1887
|
+
if (langName) line2 += chalk13.hex(langColor)("\u25CF ") + metaColor(`${langName} `);
|
|
1792
1888
|
line2 += metaColor(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount} Updated ${formatDate(repo.updatedAt)}`);
|
|
1793
1889
|
const line3 = repo.description ? ` ${truncate(repo.description, Math.max(30, maxWidth - 10))}` : null;
|
|
1794
1890
|
let fullText = line1 + "\n" + line2;
|
|
1795
1891
|
if (line3) fullText += "\n" + metaColor(line3);
|
|
1796
1892
|
const spacingAbove = Math.floor(spacingLines / 2);
|
|
1797
1893
|
const spacingBelow = spacingLines - spacingAbove;
|
|
1798
|
-
return /* @__PURE__ */
|
|
1799
|
-
spacingAbove > 0 && /* @__PURE__ */
|
|
1800
|
-
/* @__PURE__ */
|
|
1801
|
-
spacingBelow > 0 && /* @__PURE__ */
|
|
1894
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", backgroundColor: selected ? "gray" : void 0, children: [
|
|
1895
|
+
spacingAbove > 0 && /* @__PURE__ */ jsx17(Box16, { height: spacingAbove, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) }),
|
|
1896
|
+
/* @__PURE__ */ jsx17(Text17, { children: dim ? chalk13.dim(fullText) : fullText }),
|
|
1897
|
+
spacingBelow > 0 && /* @__PURE__ */ jsx17(Box16, { height: spacingBelow, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) })
|
|
1802
1898
|
] });
|
|
1803
1899
|
}
|
|
1804
1900
|
|
|
1805
1901
|
// src/ui/components/repo/FilterInput.tsx
|
|
1806
|
-
import { Box as
|
|
1902
|
+
import { Box as Box17, Text as Text18 } from "ink";
|
|
1807
1903
|
import TextInput4 from "ink-text-input";
|
|
1808
|
-
import { jsx as
|
|
1904
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1809
1905
|
|
|
1810
1906
|
// src/ui/components/repo/RepoListHeader.tsx
|
|
1811
|
-
import { Box as
|
|
1812
|
-
import { Fragment as Fragment9, jsx as
|
|
1907
|
+
import { Box as Box18, Text as Text19 } from "ink";
|
|
1908
|
+
import { Fragment as Fragment9, jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1813
1909
|
function RepoListHeader({
|
|
1814
1910
|
ownerContext,
|
|
1815
1911
|
sortKey,
|
|
@@ -1825,40 +1921,40 @@ function RepoListHeader({
|
|
|
1825
1921
|
}) {
|
|
1826
1922
|
const contextLabel = ownerContext === "personal" ? "Personal Account" : ownerContext?.type === "organization" ? `Organization: ${ownerContext.name ?? ownerContext.login}` : "";
|
|
1827
1923
|
const visibilityLabel = visibilityFilter === "public" ? "Public" : visibilityFilter === "private" ? isEnterprise ? "Private/Internal" : "Private" : visibilityFilter === "internal" ? "Internal" : "";
|
|
1828
|
-
return /* @__PURE__ */
|
|
1829
|
-
contextLabel && /* @__PURE__ */
|
|
1830
|
-
starsMode && /* @__PURE__ */
|
|
1831
|
-
/* @__PURE__ */
|
|
1924
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", gap: 2, marginBottom: 1, children: [
|
|
1925
|
+
contextLabel && /* @__PURE__ */ jsx19(Text19, { children: contextLabel }),
|
|
1926
|
+
starsMode && /* @__PURE__ */ jsx19(Text19, { color: "yellow", bold: true, children: "\u2B50 Stars Mode" }),
|
|
1927
|
+
/* @__PURE__ */ jsxs18(Text19, { color: "gray", dimColor: true, children: [
|
|
1832
1928
|
"Sort: ",
|
|
1833
1929
|
sortKey,
|
|
1834
1930
|
" ",
|
|
1835
1931
|
sortDir === "asc" ? "\u2191" : "\u2193"
|
|
1836
1932
|
] }),
|
|
1837
|
-
/* @__PURE__ */
|
|
1933
|
+
/* @__PURE__ */ jsxs18(Text19, { color: "gray", dimColor: true, children: [
|
|
1838
1934
|
"Fork Status - Commits Behind: ",
|
|
1839
1935
|
forkTracking ? "ON" : "OFF"
|
|
1840
1936
|
] }),
|
|
1841
|
-
!!visibilityLabel && !starsMode && /* @__PURE__ */
|
|
1937
|
+
!!visibilityLabel && !starsMode && /* @__PURE__ */ jsxs18(Text19, { color: "yellow", children: [
|
|
1842
1938
|
"Visibility: ",
|
|
1843
1939
|
visibilityLabel
|
|
1844
1940
|
] }),
|
|
1845
|
-
archiveFilter !== "all" && /* @__PURE__ */
|
|
1941
|
+
archiveFilter !== "all" && /* @__PURE__ */ jsxs18(Text19, { color: "cyan", children: [
|
|
1846
1942
|
"Archive: ",
|
|
1847
1943
|
archiveFilter === "archived" ? "Archived" : "Unarchived"
|
|
1848
1944
|
] }),
|
|
1849
|
-
filter && !searchActive && /* @__PURE__ */
|
|
1945
|
+
filter && !searchActive && /* @__PURE__ */ jsxs18(Text19, { color: "cyan", children: [
|
|
1850
1946
|
'Filter: "',
|
|
1851
1947
|
filter,
|
|
1852
1948
|
'"'
|
|
1853
1949
|
] }),
|
|
1854
|
-
searchActive && /* @__PURE__ */
|
|
1855
|
-
/* @__PURE__ */
|
|
1950
|
+
searchActive && /* @__PURE__ */ jsxs18(Fragment9, { children: [
|
|
1951
|
+
/* @__PURE__ */ jsxs18(Text19, { color: "cyan", children: [
|
|
1856
1952
|
'Search: "',
|
|
1857
1953
|
filter.trim(),
|
|
1858
1954
|
'"'
|
|
1859
1955
|
] }),
|
|
1860
|
-
searchLoading && /* @__PURE__ */
|
|
1861
|
-
/* @__PURE__ */
|
|
1956
|
+
searchLoading && /* @__PURE__ */ jsx19(Box18, { marginLeft: 1, children: /* @__PURE__ */ jsxs18(Text19, { color: "cyan", children: [
|
|
1957
|
+
/* @__PURE__ */ jsx19(SlowSpinner, {}),
|
|
1862
1958
|
" Searching\u2026"
|
|
1863
1959
|
] }) })
|
|
1864
1960
|
] })
|
|
@@ -1866,7 +1962,7 @@ function RepoListHeader({
|
|
|
1866
1962
|
}
|
|
1867
1963
|
|
|
1868
1964
|
// src/ui/views/RepoList.tsx
|
|
1869
|
-
import { Fragment as Fragment10, jsx as
|
|
1965
|
+
import { Fragment as Fragment10, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1870
1966
|
var getPageSize = () => {
|
|
1871
1967
|
const envValue = process.env.REPOS_PER_FETCH;
|
|
1872
1968
|
if (envValue) {
|
|
@@ -1882,17 +1978,17 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1882
1978
|
const { exit } = useApp();
|
|
1883
1979
|
const { stdout } = useStdout();
|
|
1884
1980
|
const client = useMemo(() => makeClient(token), [token]);
|
|
1885
|
-
const [debugMessages, setDebugMessages] =
|
|
1981
|
+
const [debugMessages, setDebugMessages] = useState16([]);
|
|
1886
1982
|
const addDebugMessage = useCallback((msg) => {
|
|
1887
1983
|
if (process.env.GH_MANAGER_DEBUG === "1") {
|
|
1888
1984
|
setDebugMessages((prev) => [...prev.slice(-9), msg]);
|
|
1889
1985
|
}
|
|
1890
1986
|
}, []);
|
|
1891
1987
|
const handleOrgContextChangeRef = useRef(onOrgContextChange);
|
|
1892
|
-
|
|
1988
|
+
useEffect12(() => {
|
|
1893
1989
|
handleOrgContextChangeRef.current = onOrgContextChange;
|
|
1894
1990
|
}, [onOrgContextChange]);
|
|
1895
|
-
|
|
1991
|
+
React16.useEffect(() => {
|
|
1896
1992
|
addDebugMessage(`[RepoList] Component mounted`);
|
|
1897
1993
|
logger.info("RepoList component mounted", {
|
|
1898
1994
|
token: token ? "present" : "missing",
|
|
@@ -1904,86 +2000,87 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1904
2000
|
}, []);
|
|
1905
2001
|
const terminalWidth = stdout?.columns ?? 80;
|
|
1906
2002
|
const availableHeight = maxVisibleRows ?? 20;
|
|
1907
|
-
const [items, setItems] =
|
|
1908
|
-
const [cursor, setCursor] =
|
|
1909
|
-
const [endCursor, setEndCursor] =
|
|
1910
|
-
const [hasNextPage, setHasNextPage] =
|
|
1911
|
-
const [totalCount, setTotalCount] =
|
|
1912
|
-
const [loading, setLoading] =
|
|
1913
|
-
const [sortingLoading, setSortingLoading] =
|
|
1914
|
-
const [refreshing, setRefreshing] =
|
|
1915
|
-
const [loadingMore, setLoadingMore] =
|
|
1916
|
-
const [error, setError] =
|
|
1917
|
-
const [rateLimit, setRateLimit] =
|
|
1918
|
-
const [prevRateLimit, setPrevRateLimit] =
|
|
1919
|
-
const [restRateLimit, setRestRateLimit] =
|
|
1920
|
-
const [prevRestRateLimit, setPrevRestRateLimit] =
|
|
1921
|
-
const [density, setDensity] =
|
|
1922
|
-
const [prefsLoaded, setPrefsLoaded] =
|
|
1923
|
-
const [ownerContext, setOwnerContext] =
|
|
1924
|
-
const [ownerAffiliations, setOwnerAffiliations] =
|
|
1925
|
-
const [orgSwitcherOpen, setOrgSwitcherOpen] =
|
|
1926
|
-
const [operationCount, setOperationCount] =
|
|
1927
|
-
const [showSponsorReminder, setShowSponsorReminder] =
|
|
1928
|
-
const [searchItems, setSearchItems] =
|
|
1929
|
-
const [searchEndCursor, setSearchEndCursor] =
|
|
1930
|
-
const [searchHasNextPage, setSearchHasNextPage] =
|
|
1931
|
-
const [searchTotalCount, setSearchTotalCount] =
|
|
1932
|
-
const [searchLoading, setSearchLoading] =
|
|
1933
|
-
const [deleteMode, setDeleteMode] =
|
|
1934
|
-
const [deleteTarget, setDeleteTarget] =
|
|
1935
|
-
const [deleteCode, setDeleteCode] =
|
|
1936
|
-
const [typedCode, setTypedCode] =
|
|
1937
|
-
const [deleting, setDeleting] =
|
|
1938
|
-
const [deleteError, setDeleteError] =
|
|
1939
|
-
const [deleteConfirmStage, setDeleteConfirmStage] =
|
|
1940
|
-
const [confirmFocus, setConfirmFocus] =
|
|
1941
|
-
const [archiveMode, setArchiveMode] =
|
|
1942
|
-
const [archiveTarget, setArchiveTarget] =
|
|
1943
|
-
const [archiving, setArchiving] =
|
|
1944
|
-
const [archiveError, setArchiveError] =
|
|
1945
|
-
const [archiveFocus, setArchiveFocus] =
|
|
1946
|
-
const [syncMode, setSyncMode] =
|
|
1947
|
-
const [syncTarget, setSyncTarget] =
|
|
1948
|
-
const [syncing, setSyncing] =
|
|
1949
|
-
const [syncError, setSyncError] =
|
|
1950
|
-
const [syncFocus, setSyncFocus] =
|
|
1951
|
-
const [renameMode, setRenameMode] =
|
|
1952
|
-
const [renameTarget, setRenameTarget] =
|
|
1953
|
-
const [copyUrlMode, setCopyUrlMode] =
|
|
1954
|
-
const [copyUrlTarget, setCopyUrlTarget] =
|
|
1955
|
-
const [copyToast, setCopyToast] =
|
|
1956
|
-
const [syncTrigger, setSyncTrigger] =
|
|
1957
|
-
const [infoMode, setInfoMode] =
|
|
1958
|
-
const [infoRepo, setInfoRepo] =
|
|
1959
|
-
const [logoutMode, setLogoutMode] =
|
|
1960
|
-
const [logoutFocus, setLogoutFocus] =
|
|
1961
|
-
const [logoutError, setLogoutError] =
|
|
1962
|
-
const [
|
|
1963
|
-
const [
|
|
1964
|
-
const [
|
|
1965
|
-
const [
|
|
1966
|
-
const [
|
|
1967
|
-
const [
|
|
1968
|
-
const [
|
|
1969
|
-
const [
|
|
1970
|
-
const [
|
|
1971
|
-
const [
|
|
1972
|
-
const [
|
|
1973
|
-
const [
|
|
1974
|
-
const [
|
|
1975
|
-
const [
|
|
1976
|
-
const [
|
|
1977
|
-
const [
|
|
1978
|
-
const [
|
|
1979
|
-
const [
|
|
1980
|
-
const [
|
|
1981
|
-
const [
|
|
1982
|
-
const [
|
|
1983
|
-
const [
|
|
1984
|
-
const [
|
|
2003
|
+
const [items, setItems] = useState16([]);
|
|
2004
|
+
const [cursor, setCursor] = useState16(0);
|
|
2005
|
+
const [endCursor, setEndCursor] = useState16(null);
|
|
2006
|
+
const [hasNextPage, setHasNextPage] = useState16(false);
|
|
2007
|
+
const [totalCount, setTotalCount] = useState16(0);
|
|
2008
|
+
const [loading, setLoading] = useState16(true);
|
|
2009
|
+
const [sortingLoading, setSortingLoading] = useState16(false);
|
|
2010
|
+
const [refreshing, setRefreshing] = useState16(false);
|
|
2011
|
+
const [loadingMore, setLoadingMore] = useState16(false);
|
|
2012
|
+
const [error, setError] = useState16(null);
|
|
2013
|
+
const [rateLimit, setRateLimit] = useState16(void 0);
|
|
2014
|
+
const [prevRateLimit, setPrevRateLimit] = useState16(void 0);
|
|
2015
|
+
const [restRateLimit, setRestRateLimit] = useState16(void 0);
|
|
2016
|
+
const [prevRestRateLimit, setPrevRestRateLimit] = useState16(void 0);
|
|
2017
|
+
const [density, setDensity] = useState16(2);
|
|
2018
|
+
const [prefsLoaded, setPrefsLoaded] = useState16(false);
|
|
2019
|
+
const [ownerContext, setOwnerContext] = useState16("personal");
|
|
2020
|
+
const [ownerAffiliations, setOwnerAffiliations] = useState16(["OWNER"]);
|
|
2021
|
+
const [orgSwitcherOpen, setOrgSwitcherOpen] = useState16(false);
|
|
2022
|
+
const [operationCount, setOperationCount] = useState16(0);
|
|
2023
|
+
const [showSponsorReminder, setShowSponsorReminder] = useState16(false);
|
|
2024
|
+
const [searchItems, setSearchItems] = useState16([]);
|
|
2025
|
+
const [searchEndCursor, setSearchEndCursor] = useState16(null);
|
|
2026
|
+
const [searchHasNextPage, setSearchHasNextPage] = useState16(false);
|
|
2027
|
+
const [searchTotalCount, setSearchTotalCount] = useState16(0);
|
|
2028
|
+
const [searchLoading, setSearchLoading] = useState16(false);
|
|
2029
|
+
const [deleteMode, setDeleteMode] = useState16(false);
|
|
2030
|
+
const [deleteTarget, setDeleteTarget] = useState16(null);
|
|
2031
|
+
const [deleteCode, setDeleteCode] = useState16("");
|
|
2032
|
+
const [typedCode, setTypedCode] = useState16("");
|
|
2033
|
+
const [deleting, setDeleting] = useState16(false);
|
|
2034
|
+
const [deleteError, setDeleteError] = useState16(null);
|
|
2035
|
+
const [deleteConfirmStage, setDeleteConfirmStage] = useState16(false);
|
|
2036
|
+
const [confirmFocus, setConfirmFocus] = useState16("delete");
|
|
2037
|
+
const [archiveMode, setArchiveMode] = useState16(false);
|
|
2038
|
+
const [archiveTarget, setArchiveTarget] = useState16(null);
|
|
2039
|
+
const [archiving, setArchiving] = useState16(false);
|
|
2040
|
+
const [archiveError, setArchiveError] = useState16(null);
|
|
2041
|
+
const [archiveFocus, setArchiveFocus] = useState16("confirm");
|
|
2042
|
+
const [syncMode, setSyncMode] = useState16(false);
|
|
2043
|
+
const [syncTarget, setSyncTarget] = useState16(null);
|
|
2044
|
+
const [syncing, setSyncing] = useState16(false);
|
|
2045
|
+
const [syncError, setSyncError] = useState16(null);
|
|
2046
|
+
const [syncFocus, setSyncFocus] = useState16("confirm");
|
|
2047
|
+
const [renameMode, setRenameMode] = useState16(false);
|
|
2048
|
+
const [renameTarget, setRenameTarget] = useState16(null);
|
|
2049
|
+
const [copyUrlMode, setCopyUrlMode] = useState16(false);
|
|
2050
|
+
const [copyUrlTarget, setCopyUrlTarget] = useState16(null);
|
|
2051
|
+
const [copyToast, setCopyToast] = useState16(null);
|
|
2052
|
+
const [syncTrigger, setSyncTrigger] = useState16(false);
|
|
2053
|
+
const [infoMode, setInfoMode] = useState16(false);
|
|
2054
|
+
const [infoRepo, setInfoRepo] = useState16(null);
|
|
2055
|
+
const [logoutMode, setLogoutMode] = useState16(false);
|
|
2056
|
+
const [logoutFocus, setLogoutFocus] = useState16("confirm");
|
|
2057
|
+
const [logoutError, setLogoutError] = useState16(null);
|
|
2058
|
+
const [archiveFilterMode, setArchiveFilterMode] = useState16(false);
|
|
2059
|
+
const [visibilityMode, setVisibilityMode] = useState16(false);
|
|
2060
|
+
const [isEnterpriseOrg, setIsEnterpriseOrg] = useState16(false);
|
|
2061
|
+
const [hasInternalRepos, setHasInternalRepos] = useState16(false);
|
|
2062
|
+
const [changeVisibilityMode, setChangeVisibilityMode] = useState16(false);
|
|
2063
|
+
const [changeVisibilityTarget, setChangeVisibilityTarget] = useState16(null);
|
|
2064
|
+
const [changingVisibility, setChangingVisibility] = useState16(false);
|
|
2065
|
+
const [changeVisibilityError, setChangeVisibilityError] = useState16(null);
|
|
2066
|
+
const [sortMode, setSortMode] = useState16(false);
|
|
2067
|
+
const [sortDirectionMode, setSortDirectionMode] = useState16(false);
|
|
2068
|
+
const [starsMode, setStarsMode] = useState16(false);
|
|
2069
|
+
const [starredItems, setStarredItems] = useState16([]);
|
|
2070
|
+
const [starredEndCursor, setStarredEndCursor] = useState16(null);
|
|
2071
|
+
const [starredHasNextPage, setStarredHasNextPage] = useState16(false);
|
|
2072
|
+
const [starredTotalCount, setStarredTotalCount] = useState16(0);
|
|
2073
|
+
const [starredLoading, setStarredLoading] = useState16(false);
|
|
2074
|
+
const [unstarMode, setUnstarMode] = useState16(false);
|
|
2075
|
+
const [unstarTarget, setUnstarTarget] = useState16(null);
|
|
2076
|
+
const [unstarring, setUnstarring] = useState16(false);
|
|
2077
|
+
const [unstarError, setUnstarError] = useState16(null);
|
|
2078
|
+
const [starMode, setStarMode] = useState16(false);
|
|
2079
|
+
const [starTarget, setStarTarget] = useState16(null);
|
|
2080
|
+
const [starring, setStarring] = useState16(false);
|
|
2081
|
+
const [starError, setStarError] = useState16(null);
|
|
1985
2082
|
const appliedInitialOrg = useRef(false);
|
|
1986
|
-
|
|
2083
|
+
useEffect12(() => {
|
|
1987
2084
|
(async () => {
|
|
1988
2085
|
if (appliedInitialOrg.current) return;
|
|
1989
2086
|
if (!initialOrgSlug2) return;
|
|
@@ -2252,7 +2349,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2252
2349
|
throw error2;
|
|
2253
2350
|
}
|
|
2254
2351
|
}
|
|
2255
|
-
|
|
2352
|
+
useEffect12(() => {
|
|
2256
2353
|
return () => {
|
|
2257
2354
|
if (copyToastTimerRef.current) {
|
|
2258
2355
|
clearTimeout(copyToastTimerRef.current);
|
|
@@ -2360,14 +2457,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2360
2457
|
setDeleteError("Failed to delete repository. Ensure delete_repo scope and admin permissions.");
|
|
2361
2458
|
}
|
|
2362
2459
|
}
|
|
2363
|
-
const [filter, setFilter] =
|
|
2364
|
-
const [filterMode, setFilterMode] =
|
|
2365
|
-
const [sortKey, setSortKey] =
|
|
2366
|
-
const [sortDir, setSortDir] =
|
|
2367
|
-
const [forkTracking, setForkTracking] =
|
|
2368
|
-
const [visibilityFilter, setVisibilityFilter] =
|
|
2460
|
+
const [filter, setFilter] = useState16("");
|
|
2461
|
+
const [filterMode, setFilterMode] = useState16(false);
|
|
2462
|
+
const [sortKey, setSortKey] = useState16("updated");
|
|
2463
|
+
const [sortDir, setSortDir] = useState16("desc");
|
|
2464
|
+
const [forkTracking, setForkTracking] = useState16(true);
|
|
2465
|
+
const [visibilityFilter, setVisibilityFilter] = useState16("all");
|
|
2369
2466
|
const previousVisibilityFilter = useRef("all");
|
|
2370
|
-
const [archiveFilter, setArchiveFilter] =
|
|
2467
|
+
const [archiveFilter, setArchiveFilter] = useState16("all");
|
|
2371
2468
|
const sortFieldMap = {
|
|
2372
2469
|
"updated": "UPDATED_AT",
|
|
2373
2470
|
"pushed": "PUSHED_AT",
|
|
@@ -2527,7 +2624,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2527
2624
|
setSearchLoading(false);
|
|
2528
2625
|
}
|
|
2529
2626
|
};
|
|
2530
|
-
|
|
2627
|
+
useEffect12(() => {
|
|
2531
2628
|
const ui = getUIPrefs();
|
|
2532
2629
|
if (ui.density !== void 0) setDensity(ui.density);
|
|
2533
2630
|
if (ui.sortKey && ["updated", "pushed", "name", "stars"].includes(ui.sortKey)) {
|
|
@@ -2560,7 +2657,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2560
2657
|
}
|
|
2561
2658
|
setPrefsLoaded(true);
|
|
2562
2659
|
}, [onOrgContextChange]);
|
|
2563
|
-
|
|
2660
|
+
useEffect12(() => {
|
|
2564
2661
|
if (!prefsLoaded) return;
|
|
2565
2662
|
let policy = "cache-first";
|
|
2566
2663
|
const orgLogin = ownerContext !== "personal" ? ownerContext.login : void 0;
|
|
@@ -2580,7 +2677,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2580
2677
|
setCursor(0);
|
|
2581
2678
|
fetchPage(null, true, false, void 0, policy);
|
|
2582
2679
|
}, [client, prefsLoaded, ownerContext, ownerAffiliations]);
|
|
2583
|
-
|
|
2680
|
+
useEffect12(() => {
|
|
2584
2681
|
if (!searchActive) {
|
|
2585
2682
|
if (items.length > 0) {
|
|
2586
2683
|
let policy = "cache-first";
|
|
@@ -2619,7 +2716,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2619
2716
|
}
|
|
2620
2717
|
}
|
|
2621
2718
|
}, [sortKey, sortDir]);
|
|
2622
|
-
|
|
2719
|
+
useEffect12(() => {
|
|
2623
2720
|
if (visibilityFilter !== "all" || previousVisibilityFilter.current && previousVisibilityFilter.current !== visibilityFilter) {
|
|
2624
2721
|
if (!searchActive) {
|
|
2625
2722
|
if (items.length > 0) {
|
|
@@ -2636,7 +2733,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2636
2733
|
}
|
|
2637
2734
|
previousVisibilityFilter.current = visibilityFilter;
|
|
2638
2735
|
}, [visibilityFilter]);
|
|
2639
|
-
|
|
2736
|
+
useEffect12(() => {
|
|
2640
2737
|
if (viewerLogin && searchActive && !searchLoading && searchItems.length === 0) {
|
|
2641
2738
|
let policy = "cache-first";
|
|
2642
2739
|
try {
|
|
@@ -2657,7 +2754,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2657
2754
|
fetchSearchPage(null, true, policy);
|
|
2658
2755
|
}
|
|
2659
2756
|
}, [viewerLogin]);
|
|
2660
|
-
|
|
2757
|
+
useInput16((input, key) => {
|
|
2661
2758
|
if (error) {
|
|
2662
2759
|
if (input && input.toUpperCase() === "Q") {
|
|
2663
2760
|
try {
|
|
@@ -2822,6 +2919,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2822
2919
|
if (copyUrlMode) {
|
|
2823
2920
|
return;
|
|
2824
2921
|
}
|
|
2922
|
+
if (archiveFilterMode) {
|
|
2923
|
+
return;
|
|
2924
|
+
}
|
|
2825
2925
|
if (visibilityMode) {
|
|
2826
2926
|
return;
|
|
2827
2927
|
}
|
|
@@ -3074,12 +3174,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3074
3174
|
return;
|
|
3075
3175
|
}
|
|
3076
3176
|
if (input && input.toUpperCase() === "A" && !key.ctrl) {
|
|
3077
|
-
|
|
3078
|
-
const next = f === "all" ? "unarchived" : f === "unarchived" ? "archived" : "all";
|
|
3079
|
-
storeUIPrefs({ archiveFilter: next });
|
|
3080
|
-
return next;
|
|
3081
|
-
});
|
|
3082
|
-
setCursor(0);
|
|
3177
|
+
setArchiveFilterMode(true);
|
|
3083
3178
|
return;
|
|
3084
3179
|
}
|
|
3085
3180
|
if (input && input.toUpperCase() === "V") {
|
|
@@ -3158,12 +3253,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3158
3253
|
return result;
|
|
3159
3254
|
}, [starredItems, filter, archiveFilter]);
|
|
3160
3255
|
const visibleItems = starsMode ? filteredStarredItems : searchActive ? filteredSearchItems : filteredAndSorted;
|
|
3161
|
-
|
|
3256
|
+
useEffect12(() => {
|
|
3162
3257
|
if (searchActive) {
|
|
3163
3258
|
addDebugMessage(`[State] searchActive=${searchActive}, searchItems=${searchItems.length}, visibleItems=${visibleItems.length}, filter="${filter}"`);
|
|
3164
3259
|
}
|
|
3165
3260
|
}, [searchActive, searchItems.length, visibleItems.length, filter]);
|
|
3166
|
-
|
|
3261
|
+
useEffect12(() => {
|
|
3167
3262
|
setCursor((c) => Math.min(c, Math.max(0, (searchActive ? searchItems.length : items.length) - 1)));
|
|
3168
3263
|
}, [searchActive, searchItems.length, items.length]);
|
|
3169
3264
|
const headerHeight = 2;
|
|
@@ -3184,7 +3279,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3184
3279
|
const end = Math.min(total, start + visibleRepos + buffer);
|
|
3185
3280
|
return { start, end };
|
|
3186
3281
|
}, [visibleItems.length, cursor, listHeight, spacingLines]);
|
|
3187
|
-
|
|
3282
|
+
useEffect12(() => {
|
|
3188
3283
|
const prefetchThreshold = Math.floor(visibleItems.length * 0.8);
|
|
3189
3284
|
const nearEnd = visibleItems.length > 0 && cursor >= prefetchThreshold;
|
|
3190
3285
|
const rawItemsLength = starsMode ? starredItems.length : searchActive ? searchItems.length : items.length;
|
|
@@ -3213,101 +3308,101 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3213
3308
|
exec(cmd);
|
|
3214
3309
|
}
|
|
3215
3310
|
const lowRate = rateLimit && rateLimit.remaining <= Math.ceil(rateLimit.limit * 0.1) || restRateLimit && restRateLimit.core.remaining <= Math.ceil(restRateLimit.core.limit * 0.1);
|
|
3216
|
-
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || sortMode || sortDirectionMode || changeVisibilityMode || copyUrlMode || renameMode;
|
|
3217
|
-
const headerBar = useMemo(() => /* @__PURE__ */
|
|
3218
|
-
/* @__PURE__ */
|
|
3219
|
-
/* @__PURE__ */
|
|
3311
|
+
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || archiveFilterMode || sortMode || sortDirectionMode || changeVisibilityMode || copyUrlMode || renameMode;
|
|
3312
|
+
const headerBar = useMemo(() => /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: [
|
|
3313
|
+
/* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", gap: 1, children: [
|
|
3314
|
+
/* @__PURE__ */ jsxs19(Text20, { color: "cyan", bold: !modalOpen, dimColor: modalOpen, children: [
|
|
3220
3315
|
" ",
|
|
3221
3316
|
ownerContext === "personal" ? "Personal" : ownerContext.name || ownerContext.login,
|
|
3222
3317
|
ownerContext !== "personal" && isEnterpriseOrg && " (ENT)"
|
|
3223
3318
|
] }),
|
|
3224
|
-
/* @__PURE__ */
|
|
3225
|
-
/* @__PURE__ */
|
|
3319
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, color: modalOpen ? "gray" : void 0, dimColor: modalOpen ? true : void 0, children: "Repositories" }),
|
|
3320
|
+
/* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
|
|
3226
3321
|
"(",
|
|
3227
3322
|
visibleItems.length,
|
|
3228
3323
|
"/",
|
|
3229
3324
|
searchActive ? searchTotalCount : totalCount,
|
|
3230
3325
|
")"
|
|
3231
3326
|
] }),
|
|
3232
|
-
(loading || searchLoading) && /* @__PURE__ */
|
|
3327
|
+
(loading || searchLoading) && /* @__PURE__ */ jsx20(Box19, { width: 2, flexShrink: 0, flexGrow: 0, marginLeft: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "yellow", children: /* @__PURE__ */ jsx20(SlowSpinner, {}) }) })
|
|
3233
3328
|
] }),
|
|
3234
|
-
(rateLimit || restRateLimit) && /* @__PURE__ */
|
|
3329
|
+
(rateLimit || restRateLimit) && /* @__PURE__ */ jsxs19(Text20, { color: lowRate ? "yellow" : "gray", children: [
|
|
3235
3330
|
"GraphQL: ",
|
|
3236
3331
|
rateLimit ? `${rateLimit.remaining}/${rateLimit.limit}` : "---/---",
|
|
3237
|
-
prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */
|
|
3332
|
+
prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */ jsx20(Text20, { color: rateLimit.remaining < prevRateLimit ? "red" : "green", children: ` (${rateLimit.remaining - prevRateLimit > 0 ? "+" : ""}${rateLimit.remaining - prevRateLimit})` }),
|
|
3238
3333
|
" | ",
|
|
3239
3334
|
"REST: ",
|
|
3240
3335
|
restRateLimit ? `${restRateLimit.core.remaining}/${restRateLimit.core.limit}` : "---/---",
|
|
3241
|
-
prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */
|
|
3336
|
+
prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */ jsx20(Text20, { color: restRateLimit.core.remaining < prevRestRateLimit ? "red" : "green", children: ` (${restRateLimit.core.remaining - prevRestRateLimit > 0 ? "+" : ""}${restRateLimit.core.remaining - prevRestRateLimit})` }),
|
|
3242
3337
|
" "
|
|
3243
3338
|
] })
|
|
3244
3339
|
] }), [visibleItems.length, searchActive, searchTotalCount, totalCount, loading, searchLoading, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg, restRateLimit, prevRestRateLimit]);
|
|
3245
3340
|
if (error) {
|
|
3246
|
-
return /* @__PURE__ */
|
|
3247
|
-
/* @__PURE__ */
|
|
3248
|
-
/* @__PURE__ */
|
|
3249
|
-
/* @__PURE__ */
|
|
3341
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: availableHeight, children: [
|
|
3342
|
+
/* @__PURE__ */ jsx20(Box19, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", gap: 1, children: [
|
|
3343
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, children: " Repositories" }),
|
|
3344
|
+
/* @__PURE__ */ jsx20(Text20, { color: "red", children: "(Error)" })
|
|
3250
3345
|
] }) }),
|
|
3251
|
-
/* @__PURE__ */
|
|
3252
|
-
/* @__PURE__ */
|
|
3253
|
-
/* @__PURE__ */
|
|
3346
|
+
/* @__PURE__ */ jsx20(Box19, { borderStyle: "single", borderColor: "red", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx20(Box19, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", alignItems: "center", children: [
|
|
3347
|
+
/* @__PURE__ */ jsx20(Text20, { color: "red", children: error }),
|
|
3348
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "gray", dimColor: true, children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
3254
3349
|
] }) }) }),
|
|
3255
|
-
/* @__PURE__ */
|
|
3350
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "gray", children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
3256
3351
|
] });
|
|
3257
3352
|
}
|
|
3258
3353
|
if (loading && items.length === 0 || sortingLoading) {
|
|
3259
|
-
return /* @__PURE__ */
|
|
3260
|
-
/* @__PURE__ */
|
|
3261
|
-
/* @__PURE__ */
|
|
3262
|
-
/* @__PURE__ */
|
|
3354
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: availableHeight, children: [
|
|
3355
|
+
/* @__PURE__ */ jsx20(Box19, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", gap: 1, children: [
|
|
3356
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, children: " Repositories" }),
|
|
3357
|
+
/* @__PURE__ */ jsx20(Text20, { color: "gray", children: "(Loading...)" })
|
|
3263
3358
|
] }) }),
|
|
3264
|
-
/* @__PURE__ */
|
|
3265
|
-
/* @__PURE__ */
|
|
3266
|
-
/* @__PURE__ */
|
|
3267
|
-
/* @__PURE__ */
|
|
3359
|
+
/* @__PURE__ */ jsx20(Box19, { borderStyle: "single", borderColor: "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx20(Box19, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx20(Box19, { flexDirection: "column", alignItems: "center", children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", alignItems: "center", children: [
|
|
3360
|
+
/* @__PURE__ */ jsxs19(Box19, { height: 1, flexDirection: "row", children: [
|
|
3361
|
+
/* @__PURE__ */ jsx20(Box19, { width: 2, flexShrink: 0, flexGrow: 0, children: /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: /* @__PURE__ */ jsx20(SlowSpinner, {}) }) }),
|
|
3362
|
+
/* @__PURE__ */ jsx20(Text20, { color: "cyan", children: refreshing ? "Refreshing..." : sortingLoading ? "Applying sort..." : "Loading repositories..." })
|
|
3268
3363
|
] }),
|
|
3269
|
-
/* @__PURE__ */
|
|
3364
|
+
/* @__PURE__ */ jsx20(Box19, { height: 1, marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "gray", children: refreshing ? "Fetching latest repository data" : sortingLoading ? `Sorting by ${sortKey} (${sortDir === "asc" ? "ascending" : "descending"})` : "Fetching your GitHub repositories" }) })
|
|
3270
3365
|
] }) }) }) }),
|
|
3271
|
-
/* @__PURE__ */
|
|
3366
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "gray", children: "Please wait..." }) })
|
|
3272
3367
|
] });
|
|
3273
3368
|
}
|
|
3274
|
-
return /* @__PURE__ */
|
|
3369
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: availableHeight, children: [
|
|
3275
3370
|
headerBar,
|
|
3276
|
-
showSponsorReminder && /* @__PURE__ */
|
|
3277
|
-
/* @__PURE__ */
|
|
3278
|
-
/* @__PURE__ */
|
|
3279
|
-
/* @__PURE__ */
|
|
3371
|
+
showSponsorReminder && /* @__PURE__ */ jsx20(Box19, { marginX: 1, marginBottom: 1, children: /* @__PURE__ */ jsx20(Box19, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", alignItems: "center", children: [
|
|
3372
|
+
/* @__PURE__ */ jsx20(Text20, { color: "yellow", children: "\u{1F49A} Thanks for using gh-manager-cli!" }),
|
|
3373
|
+
/* @__PURE__ */ jsx20(Text20, { color: "gray", children: "Your support helps craft more open-source tools" }),
|
|
3374
|
+
/* @__PURE__ */ jsx20(Text20, { color: "cyan", children: "\u{1F496} github.com/sponsors/wiiiimm" })
|
|
3280
3375
|
] }) }) }),
|
|
3281
|
-
/* @__PURE__ */
|
|
3376
|
+
/* @__PURE__ */ jsx20(Box19, { borderStyle: "single", borderColor: modalOpen ? "gray" : "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: deleteMode && deleteTarget ? (
|
|
3282
3377
|
// Centered modal; hide list content while modal is open
|
|
3283
|
-
/* @__PURE__ */
|
|
3284
|
-
/* @__PURE__ */
|
|
3285
|
-
/* @__PURE__ */
|
|
3286
|
-
/* @__PURE__ */
|
|
3378
|
+
/* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
3379
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, children: "Delete Confirmation" }),
|
|
3380
|
+
/* @__PURE__ */ jsx20(Text20, { color: "red", children: "\u26A0\uFE0F Delete repository?" }),
|
|
3381
|
+
/* @__PURE__ */ jsx20(Box19, { height: 2, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
|
|
3287
3382
|
(() => {
|
|
3288
3383
|
const langName = deleteTarget.primaryLanguage?.name || "";
|
|
3289
3384
|
const langColor = deleteTarget.primaryLanguage?.color || "#666666";
|
|
3290
3385
|
let line1 = "";
|
|
3291
|
-
line1 +=
|
|
3292
|
-
if (deleteTarget.isPrivate) line1 +=
|
|
3293
|
-
if (deleteTarget.isArchived) line1 +=
|
|
3294
|
-
if (deleteTarget.isFork && deleteTarget.parent) line1 +=
|
|
3386
|
+
line1 += chalk14.white(deleteTarget.nameWithOwner);
|
|
3387
|
+
if (deleteTarget.isPrivate) line1 += chalk14.yellow(" Private");
|
|
3388
|
+
if (deleteTarget.isArchived) line1 += chalk14.gray.dim(" Archived");
|
|
3389
|
+
if (deleteTarget.isFork && deleteTarget.parent) line1 += chalk14.blue(` Fork of ${deleteTarget.parent.nameWithOwner}`);
|
|
3295
3390
|
let line2 = "";
|
|
3296
|
-
if (langName) line2 +=
|
|
3297
|
-
line2 +=
|
|
3298
|
-
return /* @__PURE__ */
|
|
3299
|
-
/* @__PURE__ */
|
|
3300
|
-
/* @__PURE__ */
|
|
3391
|
+
if (langName) line2 += chalk14.hex(langColor)("\u25CF ") + chalk14.gray(`${langName} `);
|
|
3392
|
+
line2 += chalk14.gray(`\u2605 ${deleteTarget.stargazerCount} \u2442 ${deleteTarget.forkCount} Updated ${formatDate(deleteTarget.updatedAt)}`);
|
|
3393
|
+
return /* @__PURE__ */ jsxs19(Fragment10, { children: [
|
|
3394
|
+
/* @__PURE__ */ jsx20(Text20, { children: line1 }),
|
|
3395
|
+
/* @__PURE__ */ jsx20(Text20, { children: line2 })
|
|
3301
3396
|
] });
|
|
3302
3397
|
})(),
|
|
3303
|
-
/* @__PURE__ */
|
|
3398
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsxs19(Text20, { children: [
|
|
3304
3399
|
"Type ",
|
|
3305
|
-
/* @__PURE__ */
|
|
3400
|
+
/* @__PURE__ */ jsx20(Text20, { color: "yellow", bold: true, children: deleteCode }),
|
|
3306
3401
|
" to confirm."
|
|
3307
3402
|
] }) }),
|
|
3308
|
-
!deleteConfirmStage && /* @__PURE__ */
|
|
3309
|
-
/* @__PURE__ */
|
|
3310
|
-
/* @__PURE__ */
|
|
3403
|
+
!deleteConfirmStage && /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, children: [
|
|
3404
|
+
/* @__PURE__ */ jsx20(Text20, { children: "Confirm code: " }),
|
|
3405
|
+
/* @__PURE__ */ jsx20(
|
|
3311
3406
|
TextInput5,
|
|
3312
3407
|
{
|
|
3313
3408
|
value: typedCode,
|
|
@@ -3334,11 +3429,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3334
3429
|
}
|
|
3335
3430
|
)
|
|
3336
3431
|
] }),
|
|
3337
|
-
deleteConfirmStage && /* @__PURE__ */
|
|
3338
|
-
/* @__PURE__ */
|
|
3339
|
-
/* @__PURE__ */
|
|
3340
|
-
/* @__PURE__ */
|
|
3341
|
-
|
|
3432
|
+
deleteConfirmStage && /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, flexDirection: "column", children: [
|
|
3433
|
+
/* @__PURE__ */ jsx20(Text20, { color: "red", children: "This action will permanently delete the repository. This cannot be undone." }),
|
|
3434
|
+
/* @__PURE__ */ jsxs19(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3435
|
+
/* @__PURE__ */ jsx20(
|
|
3436
|
+
Box19,
|
|
3342
3437
|
{
|
|
3343
3438
|
borderStyle: "round",
|
|
3344
3439
|
borderColor: "red",
|
|
@@ -3347,11 +3442,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3347
3442
|
alignItems: "center",
|
|
3348
3443
|
justifyContent: "center",
|
|
3349
3444
|
flexDirection: "column",
|
|
3350
|
-
children: /* @__PURE__ */
|
|
3445
|
+
children: /* @__PURE__ */ jsx20(Text20, { children: confirmFocus === "delete" ? chalk14.bgRed.white.bold(" Delete ") : chalk14.red.bold("Delete") })
|
|
3351
3446
|
}
|
|
3352
3447
|
),
|
|
3353
|
-
/* @__PURE__ */
|
|
3354
|
-
|
|
3448
|
+
/* @__PURE__ */ jsx20(
|
|
3449
|
+
Box19,
|
|
3355
3450
|
{
|
|
3356
3451
|
borderStyle: "round",
|
|
3357
3452
|
borderColor: confirmFocus === "cancel" ? "white" : "gray",
|
|
@@ -3360,16 +3455,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3360
3455
|
alignItems: "center",
|
|
3361
3456
|
justifyContent: "center",
|
|
3362
3457
|
flexDirection: "column",
|
|
3363
|
-
children: /* @__PURE__ */
|
|
3458
|
+
children: /* @__PURE__ */ jsx20(Text20, { children: confirmFocus === "cancel" ? chalk14.bgGray.white.bold(" Cancel ") : chalk14.gray.bold("Cancel") })
|
|
3364
3459
|
}
|
|
3365
3460
|
)
|
|
3366
3461
|
] }),
|
|
3367
|
-
/* @__PURE__ */
|
|
3462
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
|
|
3368
3463
|
"Press Enter to ",
|
|
3369
3464
|
confirmFocus === "delete" ? "Delete" : "Cancel",
|
|
3370
3465
|
" | Y to Delete | C to Cancel"
|
|
3371
3466
|
] }) }),
|
|
3372
|
-
/* @__PURE__ */
|
|
3467
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(
|
|
3373
3468
|
TextInput5,
|
|
3374
3469
|
{
|
|
3375
3470
|
value: "",
|
|
@@ -3383,18 +3478,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3383
3478
|
}
|
|
3384
3479
|
) })
|
|
3385
3480
|
] }),
|
|
3386
|
-
deleteError && /* @__PURE__ */
|
|
3387
|
-
deleting && /* @__PURE__ */
|
|
3481
|
+
deleteError && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "magenta", children: deleteError }) }),
|
|
3482
|
+
deleting && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "yellow", children: "Deleting..." }) })
|
|
3388
3483
|
] }) })
|
|
3389
|
-
) : archiveMode && archiveTarget ? /* @__PURE__ */
|
|
3390
|
-
/* @__PURE__ */
|
|
3391
|
-
/* @__PURE__ */
|
|
3392
|
-
/* @__PURE__ */
|
|
3393
|
-
/* @__PURE__ */
|
|
3394
|
-
/* @__PURE__ */
|
|
3395
|
-
/* @__PURE__ */
|
|
3396
|
-
/* @__PURE__ */
|
|
3397
|
-
|
|
3484
|
+
) : archiveMode && archiveTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: archiveTarget.isArchived ? "green" : "yellow", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
3485
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, children: archiveTarget.isArchived ? "Unarchive Confirmation" : "Archive Confirmation" }),
|
|
3486
|
+
/* @__PURE__ */ jsx20(Text20, { color: archiveTarget.isArchived ? "green" : "yellow", children: archiveTarget.isArchived ? "\u21BA Unarchive repository?" : "\u26A0\uFE0F Archive repository?" }),
|
|
3487
|
+
/* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
|
|
3488
|
+
/* @__PURE__ */ jsx20(Text20, { children: archiveTarget.nameWithOwner }),
|
|
3489
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { children: archiveTarget.isArchived ? "This will make the repository active again." : "This will make the repository read-only." }) }),
|
|
3490
|
+
/* @__PURE__ */ jsxs19(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3491
|
+
/* @__PURE__ */ jsx20(
|
|
3492
|
+
Box19,
|
|
3398
3493
|
{
|
|
3399
3494
|
borderStyle: "round",
|
|
3400
3495
|
borderColor: archiveTarget.isArchived ? "green" : "yellow",
|
|
@@ -3403,11 +3498,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3403
3498
|
alignItems: "center",
|
|
3404
3499
|
justifyContent: "center",
|
|
3405
3500
|
flexDirection: "column",
|
|
3406
|
-
children: /* @__PURE__ */
|
|
3501
|
+
children: /* @__PURE__ */ jsx20(Text20, { children: archiveFocus === "confirm" ? chalk14.bgGreen.white.bold(` ${archiveTarget.isArchived ? "Unarchive" : "Archive"} `) : chalk14.bold[archiveTarget.isArchived ? "green" : "yellow"](archiveTarget.isArchived ? "Unarchive" : "Archive") })
|
|
3407
3502
|
}
|
|
3408
3503
|
),
|
|
3409
|
-
/* @__PURE__ */
|
|
3410
|
-
|
|
3504
|
+
/* @__PURE__ */ jsx20(
|
|
3505
|
+
Box19,
|
|
3411
3506
|
{
|
|
3412
3507
|
borderStyle: "round",
|
|
3413
3508
|
borderColor: archiveFocus === "cancel" ? "white" : "gray",
|
|
@@ -3416,18 +3511,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3416
3511
|
alignItems: "center",
|
|
3417
3512
|
justifyContent: "center",
|
|
3418
3513
|
flexDirection: "column",
|
|
3419
|
-
children: /* @__PURE__ */
|
|
3514
|
+
children: /* @__PURE__ */ jsx20(Text20, { children: archiveFocus === "cancel" ? chalk14.bgGray.white.bold(" Cancel ") : chalk14.gray.bold("Cancel") })
|
|
3420
3515
|
}
|
|
3421
3516
|
)
|
|
3422
3517
|
] }),
|
|
3423
|
-
/* @__PURE__ */
|
|
3518
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
|
|
3424
3519
|
"Press Enter to ",
|
|
3425
3520
|
archiveFocus === "confirm" ? archiveTarget.isArchived ? "Unarchive" : "Archive" : "Cancel",
|
|
3426
3521
|
" | Y to ",
|
|
3427
3522
|
archiveTarget.isArchived ? "Unarchive" : "Archive",
|
|
3428
3523
|
" | C to Cancel"
|
|
3429
3524
|
] }) }),
|
|
3430
|
-
/* @__PURE__ */
|
|
3525
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(
|
|
3431
3526
|
TextInput5,
|
|
3432
3527
|
{
|
|
3433
3528
|
value: "",
|
|
@@ -3442,21 +3537,21 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3442
3537
|
}
|
|
3443
3538
|
}
|
|
3444
3539
|
) }),
|
|
3445
|
-
archiveError && /* @__PURE__ */
|
|
3446
|
-
archiving && /* @__PURE__ */
|
|
3447
|
-
] }) }) : syncMode && syncTarget ? /* @__PURE__ */
|
|
3448
|
-
/* @__PURE__ */
|
|
3449
|
-
/* @__PURE__ */
|
|
3450
|
-
/* @__PURE__ */
|
|
3451
|
-
/* @__PURE__ */
|
|
3452
|
-
syncTarget.parent && /* @__PURE__ */
|
|
3540
|
+
archiveError && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "magenta", children: archiveError }) }),
|
|
3541
|
+
archiving && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "yellow", children: archiveTarget.isArchived ? "Unarchiving..." : "Archiving..." }) })
|
|
3542
|
+
] }) }) : syncMode && syncTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
3543
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, children: "Sync Fork Confirmation" }),
|
|
3544
|
+
/* @__PURE__ */ jsx20(Text20, { color: "blue", children: "\u27F2 Sync fork with upstream?" }),
|
|
3545
|
+
/* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
|
|
3546
|
+
/* @__PURE__ */ jsx20(Text20, { children: syncTarget.nameWithOwner }),
|
|
3547
|
+
syncTarget.parent && /* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
|
|
3453
3548
|
"Upstream: ",
|
|
3454
3549
|
syncTarget.parent.nameWithOwner
|
|
3455
3550
|
] }),
|
|
3456
|
-
/* @__PURE__ */
|
|
3457
|
-
/* @__PURE__ */
|
|
3458
|
-
/* @__PURE__ */
|
|
3459
|
-
|
|
3551
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { children: "This will merge upstream changes into your fork." }) }),
|
|
3552
|
+
/* @__PURE__ */ jsxs19(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3553
|
+
/* @__PURE__ */ jsx20(
|
|
3554
|
+
Box19,
|
|
3460
3555
|
{
|
|
3461
3556
|
borderStyle: "round",
|
|
3462
3557
|
borderColor: "blue",
|
|
@@ -3465,11 +3560,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3465
3560
|
alignItems: "center",
|
|
3466
3561
|
justifyContent: "center",
|
|
3467
3562
|
flexDirection: "column",
|
|
3468
|
-
children: /* @__PURE__ */
|
|
3563
|
+
children: /* @__PURE__ */ jsx20(Text20, { children: syncFocus === "confirm" ? chalk14.bgBlue.white.bold(" Sync ") : chalk14.blue.bold("Sync") })
|
|
3469
3564
|
}
|
|
3470
3565
|
),
|
|
3471
|
-
/* @__PURE__ */
|
|
3472
|
-
|
|
3566
|
+
/* @__PURE__ */ jsx20(
|
|
3567
|
+
Box19,
|
|
3473
3568
|
{
|
|
3474
3569
|
borderStyle: "round",
|
|
3475
3570
|
borderColor: syncFocus === "cancel" ? "white" : "gray",
|
|
@@ -3478,16 +3573,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3478
3573
|
alignItems: "center",
|
|
3479
3574
|
justifyContent: "center",
|
|
3480
3575
|
flexDirection: "column",
|
|
3481
|
-
children: /* @__PURE__ */
|
|
3576
|
+
children: /* @__PURE__ */ jsx20(Text20, { children: syncFocus === "cancel" ? chalk14.bgGray.white.bold(" Cancel ") : chalk14.gray.bold("Cancel") })
|
|
3482
3577
|
}
|
|
3483
3578
|
)
|
|
3484
3579
|
] }),
|
|
3485
|
-
/* @__PURE__ */
|
|
3580
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
|
|
3486
3581
|
"Press Enter to ",
|
|
3487
3582
|
syncFocus === "confirm" ? "Sync" : "Cancel",
|
|
3488
3583
|
" | Y to Sync | C to Cancel"
|
|
3489
3584
|
] }) }),
|
|
3490
|
-
/* @__PURE__ */
|
|
3585
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(
|
|
3491
3586
|
TextInput5,
|
|
3492
3587
|
{
|
|
3493
3588
|
value: "",
|
|
@@ -3502,14 +3597,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3502
3597
|
}
|
|
3503
3598
|
}
|
|
3504
3599
|
) }),
|
|
3505
|
-
syncError && /* @__PURE__ */
|
|
3506
|
-
syncing && /* @__PURE__ */
|
|
3507
|
-
] }) }) : logoutMode ? /* @__PURE__ */
|
|
3508
|
-
/* @__PURE__ */
|
|
3509
|
-
/* @__PURE__ */
|
|
3510
|
-
/* @__PURE__ */
|
|
3511
|
-
/* @__PURE__ */
|
|
3512
|
-
|
|
3600
|
+
syncError && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "magenta", children: syncError }) }),
|
|
3601
|
+
syncing && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "yellow", children: "Syncing..." }) })
|
|
3602
|
+
] }) }) : logoutMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
3603
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, children: "Logout Confirmation" }),
|
|
3604
|
+
/* @__PURE__ */ jsx20(Text20, { color: "cyan", children: "Are you sure you want to log out?" }),
|
|
3605
|
+
/* @__PURE__ */ jsxs19(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
3606
|
+
/* @__PURE__ */ jsx20(
|
|
3607
|
+
Box19,
|
|
3513
3608
|
{
|
|
3514
3609
|
borderStyle: "round",
|
|
3515
3610
|
borderColor: "cyan",
|
|
@@ -3518,11 +3613,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3518
3613
|
alignItems: "center",
|
|
3519
3614
|
justifyContent: "center",
|
|
3520
3615
|
flexDirection: "column",
|
|
3521
|
-
children: /* @__PURE__ */
|
|
3616
|
+
children: /* @__PURE__ */ jsx20(Text20, { children: logoutFocus === "confirm" ? chalk14.bgCyan.white.bold(" Logout ") : chalk14.cyan.bold("Logout") })
|
|
3522
3617
|
}
|
|
3523
3618
|
),
|
|
3524
|
-
/* @__PURE__ */
|
|
3525
|
-
|
|
3619
|
+
/* @__PURE__ */ jsx20(
|
|
3620
|
+
Box19,
|
|
3526
3621
|
{
|
|
3527
3622
|
borderStyle: "round",
|
|
3528
3623
|
borderColor: logoutFocus === "cancel" ? "white" : "gray",
|
|
@@ -3531,16 +3626,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3531
3626
|
alignItems: "center",
|
|
3532
3627
|
justifyContent: "center",
|
|
3533
3628
|
flexDirection: "column",
|
|
3534
|
-
children: /* @__PURE__ */
|
|
3629
|
+
children: /* @__PURE__ */ jsx20(Text20, { children: logoutFocus === "cancel" ? chalk14.bgGray.white.bold(" Cancel ") : chalk14.gray.bold("Cancel") })
|
|
3535
3630
|
}
|
|
3536
3631
|
)
|
|
3537
3632
|
] }),
|
|
3538
|
-
/* @__PURE__ */
|
|
3633
|
+
/* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
|
|
3539
3634
|
"Press Enter to ",
|
|
3540
3635
|
logoutFocus === "confirm" ? "Logout" : "Cancel",
|
|
3541
3636
|
" | Y to Logout | C to Cancel"
|
|
3542
3637
|
] }) })
|
|
3543
|
-
] }) }) : orgSwitcherOpen ? /* @__PURE__ */
|
|
3638
|
+
] }) }) : orgSwitcherOpen ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
|
|
3544
3639
|
OrgSwitcher,
|
|
3545
3640
|
{
|
|
3546
3641
|
token,
|
|
@@ -3548,45 +3643,57 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3548
3643
|
onSelect: handleOrgContextChange,
|
|
3549
3644
|
onClose: () => setOrgSwitcherOpen(false)
|
|
3550
3645
|
}
|
|
3551
|
-
) }) : infoMode ? /* @__PURE__ */
|
|
3646
|
+
) }) : infoMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: (() => {
|
|
3552
3647
|
const repo = infoRepo || visibleItems[cursor];
|
|
3553
|
-
if (!repo) return /* @__PURE__ */
|
|
3648
|
+
if (!repo) return /* @__PURE__ */ jsx20(Text20, { color: "red", children: "No repository selected." });
|
|
3554
3649
|
const langName = repo.primaryLanguage?.name || "N/A";
|
|
3555
3650
|
const langColor = repo.primaryLanguage?.color || "#666666";
|
|
3556
|
-
return /* @__PURE__ */
|
|
3557
|
-
/* @__PURE__ */
|
|
3651
|
+
return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 90), children: [
|
|
3652
|
+
/* @__PURE__ */ jsxs19(Text20, { bold: true, children: [
|
|
3558
3653
|
"Repository Info ",
|
|
3559
|
-
infoRepo ?
|
|
3654
|
+
infoRepo ? chalk14.dim("(cached)") : ""
|
|
3560
3655
|
] }),
|
|
3561
|
-
/* @__PURE__ */
|
|
3562
|
-
/* @__PURE__ */
|
|
3563
|
-
repo.description && /* @__PURE__ */
|
|
3564
|
-
/* @__PURE__ */
|
|
3565
|
-
/* @__PURE__ */
|
|
3566
|
-
repo.visibility === "PRIVATE" ?
|
|
3567
|
-
repo.isArchived ?
|
|
3568
|
-
repo.isFork ?
|
|
3656
|
+
/* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
|
|
3657
|
+
/* @__PURE__ */ jsx20(Text20, { children: chalk14.bold(repo.nameWithOwner) }),
|
|
3658
|
+
repo.description && /* @__PURE__ */ jsx20(Text20, { color: "gray", children: repo.description }),
|
|
3659
|
+
/* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
|
|
3660
|
+
/* @__PURE__ */ jsxs19(Text20, { children: [
|
|
3661
|
+
repo.visibility === "PRIVATE" ? chalk14.yellow("Private") : repo.visibility === "INTERNAL" ? chalk14.magenta("Internal") : chalk14.green("Public"),
|
|
3662
|
+
repo.isArchived ? chalk14.gray(" Archived") : "",
|
|
3663
|
+
repo.isFork ? chalk14.blue(" Fork") : ""
|
|
3569
3664
|
] }),
|
|
3570
|
-
/* @__PURE__ */
|
|
3571
|
-
/* @__PURE__ */
|
|
3572
|
-
|
|
3573
|
-
|
|
3665
|
+
/* @__PURE__ */ jsx20(Text20, { children: chalk14.gray(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount}`) }),
|
|
3666
|
+
/* @__PURE__ */ jsxs19(Text20, { children: [
|
|
3667
|
+
chalk14.hex(langColor)(`\u25CF `),
|
|
3668
|
+
chalk14.gray(`${langName}`)
|
|
3574
3669
|
] }),
|
|
3575
|
-
/* @__PURE__ */
|
|
3670
|
+
/* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
|
|
3576
3671
|
"Updated: ",
|
|
3577
3672
|
formatDate(repo.updatedAt),
|
|
3578
3673
|
" \u2022 Pushed: ",
|
|
3579
3674
|
formatDate(repo.pushedAt)
|
|
3580
3675
|
] }),
|
|
3581
|
-
/* @__PURE__ */
|
|
3676
|
+
/* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
|
|
3582
3677
|
"Size: ",
|
|
3583
3678
|
repo.diskUsage,
|
|
3584
3679
|
" KB"
|
|
3585
3680
|
] }),
|
|
3586
|
-
/* @__PURE__ */
|
|
3587
|
-
/* @__PURE__ */
|
|
3681
|
+
/* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
|
|
3682
|
+
/* @__PURE__ */ jsx20(Text20, { color: "gray", children: "Press Esc or I to close" })
|
|
3588
3683
|
] });
|
|
3589
|
-
})() }) :
|
|
3684
|
+
})() }) : archiveFilterMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
|
|
3685
|
+
ArchiveFilterModal,
|
|
3686
|
+
{
|
|
3687
|
+
currentFilter: archiveFilter,
|
|
3688
|
+
onSelect: (filter2) => {
|
|
3689
|
+
setArchiveFilter(filter2);
|
|
3690
|
+
setArchiveFilterMode(false);
|
|
3691
|
+
setCursor(0);
|
|
3692
|
+
storeUIPrefs({ archiveFilter: filter2 });
|
|
3693
|
+
},
|
|
3694
|
+
onCancel: () => setArchiveFilterMode(false)
|
|
3695
|
+
}
|
|
3696
|
+
) }) : visibilityMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
|
|
3590
3697
|
VisibilityModal,
|
|
3591
3698
|
{
|
|
3592
3699
|
currentFilter: visibilityFilter,
|
|
@@ -3599,7 +3706,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3599
3706
|
},
|
|
3600
3707
|
onCancel: () => setVisibilityMode(false)
|
|
3601
3708
|
}
|
|
3602
|
-
) }) : sortMode ? /* @__PURE__ */
|
|
3709
|
+
) }) : sortMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
|
|
3603
3710
|
SortModal,
|
|
3604
3711
|
{
|
|
3605
3712
|
currentSort: sortKey,
|
|
@@ -3611,7 +3718,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3611
3718
|
},
|
|
3612
3719
|
onCancel: () => setSortMode(false)
|
|
3613
3720
|
}
|
|
3614
|
-
) }) : sortDirectionMode ? /* @__PURE__ */
|
|
3721
|
+
) }) : sortDirectionMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
|
|
3615
3722
|
SortDirectionModal,
|
|
3616
3723
|
{
|
|
3617
3724
|
currentDirection: sortDir,
|
|
@@ -3624,7 +3731,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3624
3731
|
},
|
|
3625
3732
|
onCancel: () => setSortDirectionMode(false)
|
|
3626
3733
|
}
|
|
3627
|
-
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */
|
|
3734
|
+
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
|
|
3628
3735
|
ChangeVisibilityModal,
|
|
3629
3736
|
{
|
|
3630
3737
|
isOpen: changeVisibilityMode,
|
|
@@ -3637,14 +3744,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3637
3744
|
changing: changingVisibility,
|
|
3638
3745
|
error: changeVisibilityError
|
|
3639
3746
|
}
|
|
3640
|
-
) }) : renameMode && renameTarget ? /* @__PURE__ */
|
|
3747
|
+
) }) : renameMode && renameTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
|
|
3641
3748
|
RenameModal,
|
|
3642
3749
|
{
|
|
3643
3750
|
repo: renameTarget,
|
|
3644
3751
|
onRename: executeRename,
|
|
3645
3752
|
onCancel: closeRenameModal
|
|
3646
3753
|
}
|
|
3647
|
-
) }) : copyUrlMode ? /* @__PURE__ */
|
|
3754
|
+
) }) : copyUrlMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
|
|
3648
3755
|
CopyUrlModal,
|
|
3649
3756
|
{
|
|
3650
3757
|
repo: copyUrlTarget,
|
|
@@ -3652,7 +3759,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3652
3759
|
onClose: closeCopyUrlModal,
|
|
3653
3760
|
onCopy: handleCopyUrl
|
|
3654
3761
|
}
|
|
3655
|
-
) }) : unstarMode && unstarTarget ? /* @__PURE__ */
|
|
3762
|
+
) }) : unstarMode && unstarTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
|
|
3656
3763
|
UnstarModal,
|
|
3657
3764
|
{
|
|
3658
3765
|
visible: unstarMode,
|
|
@@ -3662,7 +3769,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3662
3769
|
isUnstarring: unstarring,
|
|
3663
3770
|
error: unstarError
|
|
3664
3771
|
}
|
|
3665
|
-
) }) : starMode && starTarget ? /* @__PURE__ */
|
|
3772
|
+
) }) : starMode && starTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
|
|
3666
3773
|
StarModal,
|
|
3667
3774
|
{
|
|
3668
3775
|
visible: starMode,
|
|
@@ -3673,8 +3780,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3673
3780
|
isStarring: starring,
|
|
3674
3781
|
error: starError
|
|
3675
3782
|
}
|
|
3676
|
-
) }) : /* @__PURE__ */
|
|
3677
|
-
/* @__PURE__ */
|
|
3783
|
+
) }) : /* @__PURE__ */ jsxs19(Fragment10, { children: [
|
|
3784
|
+
/* @__PURE__ */ jsx20(
|
|
3678
3785
|
RepoListHeader,
|
|
3679
3786
|
{
|
|
3680
3787
|
ownerContext,
|
|
@@ -3690,9 +3797,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3690
3797
|
starsMode
|
|
3691
3798
|
}
|
|
3692
3799
|
),
|
|
3693
|
-
filterMode && /* @__PURE__ */
|
|
3694
|
-
/* @__PURE__ */
|
|
3695
|
-
/* @__PURE__ */
|
|
3800
|
+
filterMode && /* @__PURE__ */ jsxs19(Box19, { marginBottom: 1, children: [
|
|
3801
|
+
/* @__PURE__ */ jsx20(Text20, { children: "Search: " }),
|
|
3802
|
+
/* @__PURE__ */ jsx20(
|
|
3696
3803
|
TextInput5,
|
|
3697
3804
|
{
|
|
3698
3805
|
value: filter,
|
|
@@ -3732,10 +3839,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3732
3839
|
}
|
|
3733
3840
|
)
|
|
3734
3841
|
] }),
|
|
3735
|
-
/* @__PURE__ */
|
|
3736
|
-
filterMode && filter.trim().length > 0 && filter.trim().length < 3 ? /* @__PURE__ */
|
|
3842
|
+
/* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: listHeight, children: [
|
|
3843
|
+
filterMode && filter.trim().length > 0 && filter.trim().length < 3 ? /* @__PURE__ */ jsx20(Box19, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "gray", dimColor: true, children: "Type at least 3 characters to search" }) }) : visibleItems.slice(windowed.start, windowed.end).map((repo, i) => {
|
|
3737
3844
|
const idx = windowed.start + i;
|
|
3738
|
-
return /* @__PURE__ */
|
|
3845
|
+
return /* @__PURE__ */ jsx20(
|
|
3739
3846
|
RepoRow,
|
|
3740
3847
|
{
|
|
3741
3848
|
repo,
|
|
@@ -3749,39 +3856,39 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3749
3856
|
repo.nameWithOwner
|
|
3750
3857
|
);
|
|
3751
3858
|
}),
|
|
3752
|
-
loadingMore && hasNextPage && /* @__PURE__ */
|
|
3753
|
-
/* @__PURE__ */
|
|
3754
|
-
/* @__PURE__ */
|
|
3859
|
+
loadingMore && hasNextPage && /* @__PURE__ */ jsx20(Box19, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", children: [
|
|
3860
|
+
/* @__PURE__ */ jsx20(Box19, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: /* @__PURE__ */ jsx20(SlowSpinner, {}) }) }),
|
|
3861
|
+
/* @__PURE__ */ jsx20(Text20, { color: "cyan", children: "Loading more repositories..." })
|
|
3755
3862
|
] }) }),
|
|
3756
|
-
!loading && !searchLoading && visibleItems.length === 0 && /* @__PURE__ */
|
|
3863
|
+
!loading && !searchLoading && visibleItems.length === 0 && /* @__PURE__ */ jsx20(Box19, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "gray", dimColor: true, children: searchActive ? "No repositories match your search" : filter ? "No repositories match your filter" : "No repositories found" }) })
|
|
3757
3864
|
] })
|
|
3758
3865
|
] }) }),
|
|
3759
|
-
/* @__PURE__ */
|
|
3760
|
-
/* @__PURE__ */
|
|
3761
|
-
/* @__PURE__ */
|
|
3762
|
-
"/ Search \u2022 S Sort \u2022 D Direction \u2022 T Density \u2022 A Archive",
|
|
3866
|
+
/* @__PURE__ */ jsxs19(Box19, { marginTop: 1, paddingX: 1, flexDirection: "column", children: [
|
|
3867
|
+
/* @__PURE__ */ jsx20(Box19, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx20(Text20, { 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" }) }),
|
|
3868
|
+
/* @__PURE__ */ jsx20(Box19, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: "gray", dimColor: modalOpen ? true : void 0, children: [
|
|
3869
|
+
"/ Search \u2022 S Sort \u2022 D Direction \u2022 T Density \u2022 A Archive Filter",
|
|
3763
3870
|
!starsMode && " \u2022 V Visibility Filter",
|
|
3764
3871
|
ownerContext === "personal" && " \u2022 Shift+S Stars"
|
|
3765
3872
|
] }) }),
|
|
3766
|
-
/* @__PURE__ */
|
|
3767
|
-
/* @__PURE__ */
|
|
3768
|
-
/* @__PURE__ */
|
|
3873
|
+
/* @__PURE__ */ jsx20(Box19, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx20(Text20, { 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" }) }),
|
|
3874
|
+
/* @__PURE__ */ jsx20(Box19, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx20(Text20, { 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" }) }),
|
|
3875
|
+
/* @__PURE__ */ jsx20(Box19, { width: terminalWidth, justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "yellow", dimColor: modalOpen ? true : void 0, children: "\u{1F496} Sponsor on GitHub: github.com/sponsors/wiiiimm" }) })
|
|
3769
3876
|
] }),
|
|
3770
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
3771
|
-
/* @__PURE__ */
|
|
3772
|
-
debugMessages.length === 0 ? /* @__PURE__ */
|
|
3877
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, borderStyle: "single", borderColor: "yellow", paddingX: 1, flexDirection: "column", children: [
|
|
3878
|
+
/* @__PURE__ */ jsx20(Text20, { bold: true, color: "yellow", children: "Debug Messages:" }),
|
|
3879
|
+
debugMessages.length === 0 ? /* @__PURE__ */ jsx20(Text20, { color: "gray", children: "No debug messages yet..." }) : debugMessages.map((msg, i) => /* @__PURE__ */ jsx20(Text20, { color: "gray", children: msg }, i))
|
|
3773
3880
|
] }),
|
|
3774
|
-
copyToast && /* @__PURE__ */
|
|
3881
|
+
copyToast && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx20(Box19, { borderStyle: "round", borderColor: copyToast.includes("Failed") ? "red" : "green", paddingX: 2, paddingY: 0, children: /* @__PURE__ */ jsx20(Text20, { color: copyToast.includes("Failed") ? "red" : "green", children: copyToast }) }) })
|
|
3775
3882
|
] });
|
|
3776
3883
|
}
|
|
3777
3884
|
|
|
3778
3885
|
// src/ui/components/auth/AuthMethodSelector.tsx
|
|
3779
|
-
import { useState as
|
|
3780
|
-
import { Box as
|
|
3781
|
-
import
|
|
3782
|
-
import { jsx as
|
|
3886
|
+
import { useState as useState17 } from "react";
|
|
3887
|
+
import { Box as Box20, Text as Text21, useInput as useInput17 } from "ink";
|
|
3888
|
+
import chalk15 from "chalk";
|
|
3889
|
+
import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3783
3890
|
function AuthMethodSelector({ onSelect, onQuit }) {
|
|
3784
|
-
const [selectedIndex, setSelectedIndex] =
|
|
3891
|
+
const [selectedIndex, setSelectedIndex] = useState17(0);
|
|
3785
3892
|
const methods = [
|
|
3786
3893
|
{
|
|
3787
3894
|
key: "oauth",
|
|
@@ -3794,7 +3901,7 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3794
3901
|
description: "Manually enter a GitHub Personal Access Token"
|
|
3795
3902
|
}
|
|
3796
3903
|
];
|
|
3797
|
-
|
|
3904
|
+
useInput17((input, key) => {
|
|
3798
3905
|
if (key.escape || input?.toLowerCase() === "q") {
|
|
3799
3906
|
if (onQuit) {
|
|
3800
3907
|
onQuit();
|
|
@@ -3813,33 +3920,33 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3813
3920
|
onSelect("pat");
|
|
3814
3921
|
}
|
|
3815
3922
|
});
|
|
3816
|
-
return /* @__PURE__ */
|
|
3817
|
-
/* @__PURE__ */
|
|
3818
|
-
/* @__PURE__ */
|
|
3923
|
+
return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, children: [
|
|
3924
|
+
/* @__PURE__ */ jsx21(Text21, { bold: true, marginBottom: 1, children: "Choose Authentication Method" }),
|
|
3925
|
+
/* @__PURE__ */ jsx21(Box20, { flexDirection: "column", marginY: 1, children: methods.map((method, index) => {
|
|
3819
3926
|
const isSelected = index === selectedIndex;
|
|
3820
|
-
const prefix = isSelected ?
|
|
3927
|
+
const prefix = isSelected ? chalk15.cyan("\u203A") : " ";
|
|
3821
3928
|
const numberPrefix = `${index + 1}.`;
|
|
3822
|
-
return /* @__PURE__ */
|
|
3823
|
-
/* @__PURE__ */
|
|
3929
|
+
return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", marginBottom: 1, children: [
|
|
3930
|
+
/* @__PURE__ */ jsx21(Text21, { children: /* @__PURE__ */ jsxs20(Text21, { color: isSelected ? "cyan" : void 0, bold: isSelected, children: [
|
|
3824
3931
|
prefix,
|
|
3825
3932
|
" ",
|
|
3826
3933
|
numberPrefix,
|
|
3827
3934
|
" ",
|
|
3828
3935
|
method.label
|
|
3829
3936
|
] }) }),
|
|
3830
|
-
/* @__PURE__ */
|
|
3937
|
+
/* @__PURE__ */ jsxs20(Text21, { color: "gray", dimColor: true, children: [
|
|
3831
3938
|
" ",
|
|
3832
3939
|
method.description
|
|
3833
3940
|
] })
|
|
3834
3941
|
] }, method.key);
|
|
3835
3942
|
}) }),
|
|
3836
|
-
/* @__PURE__ */
|
|
3943
|
+
/* @__PURE__ */ jsx21(Text21, { color: "gray", dimColor: true, marginTop: 1, children: "Use arrow keys to navigate, Enter to select, or press 1/2 \u2022 Q/Esc to quit" })
|
|
3837
3944
|
] });
|
|
3838
3945
|
}
|
|
3839
3946
|
|
|
3840
3947
|
// src/ui/components/auth/OAuthProgress.tsx
|
|
3841
|
-
import { Box as
|
|
3842
|
-
import { jsx as
|
|
3948
|
+
import { Box as Box21, Text as Text22 } from "ink";
|
|
3949
|
+
import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3843
3950
|
function OAuthProgress({ status, error, deviceCode }) {
|
|
3844
3951
|
const statusMessages = {
|
|
3845
3952
|
initializing: {
|
|
@@ -3876,69 +3983,69 @@ function OAuthProgress({ status, error, deviceCode }) {
|
|
|
3876
3983
|
}
|
|
3877
3984
|
};
|
|
3878
3985
|
const { message, showSpinner } = statusMessages[status];
|
|
3879
|
-
return /* @__PURE__ */
|
|
3880
|
-
/* @__PURE__ */
|
|
3881
|
-
/* @__PURE__ */
|
|
3882
|
-
/* @__PURE__ */
|
|
3883
|
-
/* @__PURE__ */
|
|
3986
|
+
return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", borderStyle: "single", borderColor: status === "error" ? "red" : "cyan", paddingX: 2, paddingY: 1, children: [
|
|
3987
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, marginBottom: 1, children: "GitHub OAuth Authentication" }),
|
|
3988
|
+
/* @__PURE__ */ jsx22(Box21, { marginY: 1, children: showSpinner ? /* @__PURE__ */ jsxs21(Box21, { children: [
|
|
3989
|
+
/* @__PURE__ */ jsx22(Text22, { color: "green", children: /* @__PURE__ */ jsx22(SlowSpinner, { interval: 2e3 }) }),
|
|
3990
|
+
/* @__PURE__ */ jsxs21(Text22, { children: [
|
|
3884
3991
|
" ",
|
|
3885
3992
|
message
|
|
3886
3993
|
] })
|
|
3887
|
-
] }) : /* @__PURE__ */
|
|
3994
|
+
] }) : /* @__PURE__ */ jsxs21(Text22, { color: status === "error" ? "red" : "green", children: [
|
|
3888
3995
|
status === "error" ? "\u2717" : "\u2713",
|
|
3889
3996
|
" ",
|
|
3890
3997
|
message
|
|
3891
3998
|
] }) }),
|
|
3892
|
-
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */
|
|
3893
|
-
/* @__PURE__ */
|
|
3894
|
-
/* @__PURE__ */
|
|
3895
|
-
/* @__PURE__ */
|
|
3896
|
-
/* @__PURE__ */
|
|
3999
|
+
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */ jsxs21(Box21, { marginY: 1, flexDirection: "column", children: [
|
|
4000
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, color: "cyan", marginBottom: 1, children: "\u{1F4CB} Please complete these steps:" }),
|
|
4001
|
+
/* @__PURE__ */ jsxs21(Box21, { marginBottom: 1, children: [
|
|
4002
|
+
/* @__PURE__ */ jsx22(Text22, { children: "1. Visit: " }),
|
|
4003
|
+
/* @__PURE__ */ jsx22(Text22, { bold: true, color: "blue", children: deviceCode.verification_uri })
|
|
3897
4004
|
] }),
|
|
3898
|
-
/* @__PURE__ */
|
|
3899
|
-
/* @__PURE__ */
|
|
3900
|
-
/* @__PURE__ */
|
|
4005
|
+
/* @__PURE__ */ jsxs21(Box21, { marginBottom: 1, flexDirection: "column", children: [
|
|
4006
|
+
/* @__PURE__ */ jsx22(Text22, { children: "2. Enter this code:" }),
|
|
4007
|
+
/* @__PURE__ */ jsx22(Box21, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, marginTop: 1, children: /* @__PURE__ */ jsx22(Text22, { bold: true, color: "yellow", children: deviceCode.user_code }) })
|
|
3901
4008
|
] }),
|
|
3902
|
-
status === "waiting_for_authorization" && /* @__PURE__ */
|
|
3903
|
-
status === "polling_for_token" && /* @__PURE__ */
|
|
3904
|
-
/* @__PURE__ */
|
|
3905
|
-
/* @__PURE__ */
|
|
4009
|
+
status === "waiting_for_authorization" && /* @__PURE__ */ jsx22(Text22, { color: "gray", marginTop: 1, children: "Your browser should open automatically." }),
|
|
4010
|
+
status === "polling_for_token" && /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", marginTop: 1, children: [
|
|
4011
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", children: "Waiting for you to complete authorization in your browser..." }),
|
|
4012
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", dimColor: true, marginTop: 1, children: "This will timeout in 15 minutes. Press Esc to cancel." })
|
|
3906
4013
|
] })
|
|
3907
4014
|
] }),
|
|
3908
|
-
status === "error" && error && /* @__PURE__ */
|
|
3909
|
-
/* @__PURE__ */
|
|
3910
|
-
/* @__PURE__ */
|
|
4015
|
+
status === "error" && error && /* @__PURE__ */ jsxs21(Box21, { marginY: 1, flexDirection: "column", children: [
|
|
4016
|
+
/* @__PURE__ */ jsx22(Text22, { color: "red", children: error }),
|
|
4017
|
+
/* @__PURE__ */ jsx22(Text22, { color: "gray", marginTop: 1, children: "Press Esc to go back and try again." })
|
|
3911
4018
|
] }),
|
|
3912
|
-
status === "success" && /* @__PURE__ */
|
|
4019
|
+
status === "success" && /* @__PURE__ */ jsx22(Text22, { color: "gray", marginTop: 1, children: "Returning to application..." })
|
|
3913
4020
|
] });
|
|
3914
4021
|
}
|
|
3915
4022
|
|
|
3916
4023
|
// src/ui/App.tsx
|
|
3917
|
-
import { jsx as
|
|
4024
|
+
import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3918
4025
|
var packageJson = require_package();
|
|
3919
4026
|
function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlineTokenEphemeral }) {
|
|
3920
4027
|
const { exit } = useApp2();
|
|
3921
4028
|
const { stdout } = useStdout2();
|
|
3922
|
-
const [mode, setMode] =
|
|
3923
|
-
const [token, setToken] =
|
|
3924
|
-
const [input, setInput] =
|
|
3925
|
-
const [error, setError] =
|
|
3926
|
-
const [viewer, setViewer] =
|
|
3927
|
-
const [rateLimitReset, setRateLimitReset] =
|
|
3928
|
-
const [wasRateLimited, setWasRateLimited] =
|
|
3929
|
-
const [orgContext, setOrgContext] =
|
|
3930
|
-
const [authMethod, setAuthMethod] =
|
|
3931
|
-
const [oauthStatus, setOAuthStatus] =
|
|
3932
|
-
const [tokenSource, setTokenSource] =
|
|
3933
|
-
const [sessionTokenOrigin, setSessionTokenOrigin] =
|
|
3934
|
-
const [deviceCodeResponse, setDeviceCodeResponse] =
|
|
3935
|
-
const [oauthDeviceCode, setOauthDeviceCode] =
|
|
3936
|
-
const [dims, setDims] =
|
|
4029
|
+
const [mode, setMode] = useState18("checking");
|
|
4030
|
+
const [token, setToken] = useState18(null);
|
|
4031
|
+
const [input, setInput] = useState18("");
|
|
4032
|
+
const [error, setError] = useState18(null);
|
|
4033
|
+
const [viewer, setViewer] = useState18(null);
|
|
4034
|
+
const [rateLimitReset, setRateLimitReset] = useState18(null);
|
|
4035
|
+
const [wasRateLimited, setWasRateLimited] = useState18(false);
|
|
4036
|
+
const [orgContext, setOrgContext] = useState18("personal");
|
|
4037
|
+
const [authMethod, setAuthMethod] = useState18("pat");
|
|
4038
|
+
const [oauthStatus, setOAuthStatus] = useState18("initializing");
|
|
4039
|
+
const [tokenSource, setTokenSource] = useState18("pat");
|
|
4040
|
+
const [sessionTokenOrigin, setSessionTokenOrigin] = useState18("stored");
|
|
4041
|
+
const [deviceCodeResponse, setDeviceCodeResponse] = useState18(null);
|
|
4042
|
+
const [oauthDeviceCode, setOauthDeviceCode] = useState18(null);
|
|
4043
|
+
const [dims, setDims] = useState18(() => {
|
|
3937
4044
|
const cols = stdout?.columns ?? 100;
|
|
3938
4045
|
const rows = stdout?.rows ?? 30;
|
|
3939
4046
|
return { cols, rows };
|
|
3940
4047
|
});
|
|
3941
|
-
|
|
4048
|
+
useEffect13(() => {
|
|
3942
4049
|
if (!stdout) return;
|
|
3943
4050
|
const onResize = () => {
|
|
3944
4051
|
const cols = stdout.columns ?? 100;
|
|
@@ -3950,7 +4057,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3950
4057
|
stdout.off?.("resize", onResize);
|
|
3951
4058
|
};
|
|
3952
4059
|
}, [stdout]);
|
|
3953
|
-
|
|
4060
|
+
useEffect13(() => {
|
|
3954
4061
|
const env = getTokenFromEnv();
|
|
3955
4062
|
const stored = getStoredToken();
|
|
3956
4063
|
const source = getTokenSource();
|
|
@@ -3974,7 +4081,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3974
4081
|
setMode("auth_method_selection");
|
|
3975
4082
|
}
|
|
3976
4083
|
}, [inlineToken2]);
|
|
3977
|
-
|
|
4084
|
+
useEffect13(() => {
|
|
3978
4085
|
if (mode !== "oauth_flow") return;
|
|
3979
4086
|
(async () => {
|
|
3980
4087
|
try {
|
|
@@ -4026,7 +4133,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4026
4133
|
setMode("oauth_flow");
|
|
4027
4134
|
}
|
|
4028
4135
|
};
|
|
4029
|
-
|
|
4136
|
+
useEffect13(() => {
|
|
4030
4137
|
(async () => {
|
|
4031
4138
|
if (mode !== "validating" || !token) return;
|
|
4032
4139
|
const timeoutId = setTimeout(() => {
|
|
@@ -4138,7 +4245,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4138
4245
|
setTokenSource("pat");
|
|
4139
4246
|
setMode("auth_method_selection");
|
|
4140
4247
|
};
|
|
4141
|
-
|
|
4248
|
+
useInput18((input2, key) => {
|
|
4142
4249
|
if ((mode === "prompt" || mode === "auth_method_selection") && key.escape) {
|
|
4143
4250
|
exit();
|
|
4144
4251
|
}
|
|
@@ -4170,19 +4277,19 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4170
4277
|
}
|
|
4171
4278
|
});
|
|
4172
4279
|
const verticalPadding = Math.floor(dims.rows * 0.05);
|
|
4173
|
-
const header = useMemo2(() => /* @__PURE__ */
|
|
4174
|
-
/* @__PURE__ */
|
|
4175
|
-
/* @__PURE__ */
|
|
4280
|
+
const header = useMemo2(() => /* @__PURE__ */ jsxs22(Box22, { flexDirection: "row", justifyContent: "space-between", marginBottom: 1, children: [
|
|
4281
|
+
/* @__PURE__ */ jsxs22(Box22, { flexDirection: "row", gap: 1, children: [
|
|
4282
|
+
/* @__PURE__ */ jsxs22(Text23, { bold: true, color: "cyan", children: [
|
|
4176
4283
|
" ",
|
|
4177
4284
|
"GitHub Repository Manager"
|
|
4178
4285
|
] }),
|
|
4179
|
-
/* @__PURE__ */
|
|
4286
|
+
/* @__PURE__ */ jsxs22(Text23, { color: "gray", dimColor: true, children: [
|
|
4180
4287
|
"v",
|
|
4181
4288
|
packageJson.version
|
|
4182
4289
|
] }),
|
|
4183
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
4290
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsx23(Text23, { backgroundColor: "blue", color: "white", children: " debug mode " })
|
|
4184
4291
|
] }),
|
|
4185
|
-
viewer && /* @__PURE__ */
|
|
4292
|
+
viewer && /* @__PURE__ */ jsx23(Text23, { color: "gray", children: orgContext !== "personal" && orgContext.login ? `${orgContext.login}/@${viewer} ` : `@${viewer} ` })
|
|
4186
4293
|
] }), [viewer, orgContext]);
|
|
4187
4294
|
if (mode === "rate_limited") {
|
|
4188
4295
|
const formatResetTime = (resetTime) => {
|
|
@@ -4205,70 +4312,70 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4205
4312
|
return "Unknown";
|
|
4206
4313
|
}
|
|
4207
4314
|
};
|
|
4208
|
-
return /* @__PURE__ */
|
|
4315
|
+
return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4209
4316
|
header,
|
|
4210
|
-
/* @__PURE__ */
|
|
4211
|
-
/* @__PURE__ */
|
|
4212
|
-
/* @__PURE__ */
|
|
4213
|
-
/* @__PURE__ */
|
|
4214
|
-
rateLimitReset && /* @__PURE__ */
|
|
4215
|
-
/* @__PURE__ */
|
|
4216
|
-
/* @__PURE__ */
|
|
4317
|
+
/* @__PURE__ */ jsx23(Box22, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs22(Box22, { borderStyle: "single", borderColor: "yellow", paddingX: 3, paddingY: 2, flexDirection: "column", width: Math.min(dims.cols - 8, 80), children: [
|
|
4318
|
+
/* @__PURE__ */ jsx23(Text23, { bold: true, color: "yellow", marginBottom: 1, children: "\u26A0\uFE0F Rate Limit Exceeded" }),
|
|
4319
|
+
/* @__PURE__ */ jsx23(Text23, { color: "gray", marginBottom: 1, children: "You've hit GitHub's API rate limit for your token." }),
|
|
4320
|
+
/* @__PURE__ */ jsx23(Text23, { color: "gray", marginBottom: 1, children: "This happens when you make too many requests in a short time." }),
|
|
4321
|
+
rateLimitReset && /* @__PURE__ */ jsxs22(Box22, { marginTop: 1, marginBottom: 1, children: [
|
|
4322
|
+
/* @__PURE__ */ jsxs22(Text23, { children: [
|
|
4323
|
+
/* @__PURE__ */ jsx23(Text23, { color: "cyan", children: "Reset in:" }),
|
|
4217
4324
|
" ",
|
|
4218
|
-
/* @__PURE__ */
|
|
4325
|
+
/* @__PURE__ */ jsx23(Text23, { bold: true, children: formatResetTime(rateLimitReset) })
|
|
4219
4326
|
] }),
|
|
4220
|
-
/* @__PURE__ */
|
|
4327
|
+
/* @__PURE__ */ jsxs22(Text23, { color: "gray", dimColor: true, children: [
|
|
4221
4328
|
"(",
|
|
4222
4329
|
new Date(rateLimitReset).toLocaleTimeString(),
|
|
4223
4330
|
")"
|
|
4224
4331
|
] })
|
|
4225
4332
|
] }),
|
|
4226
|
-
/* @__PURE__ */
|
|
4227
|
-
/* @__PURE__ */
|
|
4228
|
-
/* @__PURE__ */
|
|
4229
|
-
/* @__PURE__ */
|
|
4230
|
-
/* @__PURE__ */
|
|
4333
|
+
/* @__PURE__ */ jsxs22(Box22, { marginTop: 2, flexDirection: "column", gap: 1, children: [
|
|
4334
|
+
/* @__PURE__ */ jsx23(Text23, { bold: true, children: "What would you like to do?" }),
|
|
4335
|
+
/* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", paddingLeft: 2, children: [
|
|
4336
|
+
/* @__PURE__ */ jsxs22(Text23, { children: [
|
|
4337
|
+
/* @__PURE__ */ jsx23(Text23, { color: "cyan", bold: true, children: "R" }),
|
|
4231
4338
|
" - Retry now ",
|
|
4232
4339
|
rateLimitReset && formatResetTime(rateLimitReset) !== "Now (should be reset)" ? "(likely to fail until reset)" : "(should work now)"
|
|
4233
4340
|
] }),
|
|
4234
|
-
/* @__PURE__ */
|
|
4235
|
-
/* @__PURE__ */
|
|
4341
|
+
/* @__PURE__ */ jsxs22(Text23, { children: [
|
|
4342
|
+
/* @__PURE__ */ jsx23(Text23, { color: "cyan", bold: true, children: "L" }),
|
|
4236
4343
|
" - Logout and choose authentication method"
|
|
4237
4344
|
] }),
|
|
4238
|
-
/* @__PURE__ */
|
|
4239
|
-
/* @__PURE__ */
|
|
4345
|
+
/* @__PURE__ */ jsxs22(Text23, { children: [
|
|
4346
|
+
/* @__PURE__ */ jsx23(Text23, { color: "gray", bold: true, children: "Q/Esc" }),
|
|
4240
4347
|
" - Quit application"
|
|
4241
4348
|
] })
|
|
4242
4349
|
] })
|
|
4243
4350
|
] }),
|
|
4244
|
-
/* @__PURE__ */
|
|
4351
|
+
/* @__PURE__ */ jsx23(Text23, { color: "gray", dimColor: true, marginTop: 2, children: "Tip: Using multiple tokens or waiting between requests can help avoid rate limits." })
|
|
4245
4352
|
] }) })
|
|
4246
4353
|
] });
|
|
4247
4354
|
}
|
|
4248
4355
|
if (mode === "auth_method_selection") {
|
|
4249
|
-
return /* @__PURE__ */
|
|
4356
|
+
return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4250
4357
|
header,
|
|
4251
|
-
/* @__PURE__ */
|
|
4252
|
-
/* @__PURE__ */
|
|
4253
|
-
error && /* @__PURE__ */
|
|
4358
|
+
/* @__PURE__ */ jsx23(Box22, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", alignItems: "center", children: [
|
|
4359
|
+
/* @__PURE__ */ jsx23(AuthMethodSelector, { onSelect: handleAuthMethodSelect }),
|
|
4360
|
+
error && /* @__PURE__ */ jsx23(Text23, { color: "red", marginTop: 1, children: error })
|
|
4254
4361
|
] }) })
|
|
4255
4362
|
] });
|
|
4256
4363
|
}
|
|
4257
4364
|
if (mode === "oauth_flow") {
|
|
4258
|
-
return /* @__PURE__ */
|
|
4365
|
+
return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4259
4366
|
header,
|
|
4260
|
-
/* @__PURE__ */
|
|
4367
|
+
/* @__PURE__ */ jsx23(Box22, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx23(OAuthProgress, { status: oauthStatus, error: error || void 0, deviceCode: oauthDeviceCode || void 0 }) })
|
|
4261
4368
|
] });
|
|
4262
4369
|
}
|
|
4263
4370
|
if (mode === "prompt") {
|
|
4264
|
-
return /* @__PURE__ */
|
|
4371
|
+
return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4265
4372
|
header,
|
|
4266
|
-
/* @__PURE__ */
|
|
4267
|
-
/* @__PURE__ */
|
|
4268
|
-
/* @__PURE__ */
|
|
4269
|
-
/* @__PURE__ */
|
|
4270
|
-
/* @__PURE__ */
|
|
4271
|
-
/* @__PURE__ */
|
|
4373
|
+
/* @__PURE__ */ jsx23(Box22, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs22(Box22, { borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, flexDirection: "column", children: [
|
|
4374
|
+
/* @__PURE__ */ jsx23(Text23, { bold: true, marginBottom: 1, children: "Authentication Required" }),
|
|
4375
|
+
/* @__PURE__ */ jsx23(Text23, { color: "gray", marginBottom: 1, children: "Enter your GitHub Personal Access Token" }),
|
|
4376
|
+
/* @__PURE__ */ jsxs22(Box22, { children: [
|
|
4377
|
+
/* @__PURE__ */ jsx23(Text23, { children: "Token: " }),
|
|
4378
|
+
/* @__PURE__ */ jsx23(
|
|
4272
4379
|
TextInput6,
|
|
4273
4380
|
{
|
|
4274
4381
|
value: input,
|
|
@@ -4278,30 +4385,30 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4278
4385
|
}
|
|
4279
4386
|
)
|
|
4280
4387
|
] }),
|
|
4281
|
-
error && /* @__PURE__ */
|
|
4282
|
-
/* @__PURE__ */
|
|
4283
|
-
/* @__PURE__ */
|
|
4388
|
+
error && /* @__PURE__ */ jsx23(Text23, { color: "red", marginTop: 1, children: error }),
|
|
4389
|
+
/* @__PURE__ */ jsx23(Text23, { color: "gray", dimColor: true, marginTop: 1, children: "The token will be stored securely in your local config" }),
|
|
4390
|
+
/* @__PURE__ */ jsx23(Text23, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to go back" })
|
|
4284
4391
|
] }) })
|
|
4285
4392
|
] });
|
|
4286
4393
|
}
|
|
4287
4394
|
if (mode === "validating" || mode === "checking") {
|
|
4288
|
-
return /* @__PURE__ */
|
|
4395
|
+
return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4289
4396
|
header,
|
|
4290
|
-
/* @__PURE__ */
|
|
4291
|
-
/* @__PURE__ */
|
|
4292
|
-
mode === "validating" && /* @__PURE__ */
|
|
4397
|
+
/* @__PURE__ */ jsx23(Box22, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", alignItems: "center", children: [
|
|
4398
|
+
/* @__PURE__ */ jsx23(Text23, { color: "yellow", children: "Validating token..." }),
|
|
4399
|
+
mode === "validating" && /* @__PURE__ */ jsx23(Text23, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to cancel" })
|
|
4293
4400
|
] }) })
|
|
4294
4401
|
] });
|
|
4295
4402
|
}
|
|
4296
4403
|
if (mode === "error") {
|
|
4297
|
-
return /* @__PURE__ */
|
|
4404
|
+
return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4298
4405
|
header,
|
|
4299
|
-
/* @__PURE__ */
|
|
4406
|
+
/* @__PURE__ */ jsx23(Box22, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx23(Text23, { color: "red", children: error ?? "Unexpected error" }) })
|
|
4300
4407
|
] });
|
|
4301
4408
|
}
|
|
4302
|
-
return /* @__PURE__ */
|
|
4409
|
+
return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
4303
4410
|
header,
|
|
4304
|
-
/* @__PURE__ */
|
|
4411
|
+
/* @__PURE__ */ jsx23(
|
|
4305
4412
|
RepoList,
|
|
4306
4413
|
{
|
|
4307
4414
|
token,
|
|
@@ -4316,7 +4423,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
4316
4423
|
}
|
|
4317
4424
|
|
|
4318
4425
|
// src/index.tsx
|
|
4319
|
-
import { jsx as
|
|
4426
|
+
import { jsx as jsx24, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4320
4427
|
var argv = process.argv.slice(2);
|
|
4321
4428
|
var getFlagValue = (name) => {
|
|
4322
4429
|
const idx = argv.findIndex((a) => a === `--${name}` || a.startsWith(`--${name}=`));
|
|
@@ -4429,8 +4536,8 @@ var inlineToken = (() => {
|
|
|
4429
4536
|
})();
|
|
4430
4537
|
logger.debug("Rendering UI");
|
|
4431
4538
|
var { unmount } = render(
|
|
4432
|
-
/* @__PURE__ */
|
|
4433
|
-
/* @__PURE__ */
|
|
4434
|
-
/* @__PURE__ */
|
|
4539
|
+
/* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", children: [
|
|
4540
|
+
/* @__PURE__ */ jsx24(App, { initialOrgSlug, inlineToken, inlineTokenEphemeral: Boolean(inlineToken) }),
|
|
4541
|
+
/* @__PURE__ */ jsx24(Text24, { color: "gray" })
|
|
4435
4542
|
] })
|
|
4436
4543
|
);
|