gh-manager-cli 1.40.2 → 1.42.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/dist/index.js CHANGED
@@ -17,7 +17,6 @@ import {
17
17
  makeClient,
18
18
  purgeApolloCacheFiles,
19
19
  renameRepositoryById,
20
- searchRepositoriesUnified,
21
20
  starRepository,
22
21
  syncForkWithUpstream,
23
22
  unarchiveRepositoryById,
@@ -34,7 +33,7 @@ var require_package = __commonJS({
34
33
  "package.json"(exports, module) {
35
34
  module.exports = {
36
35
  name: "gh-manager-cli",
37
- version: "1.40.2",
36
+ version: "1.42.0",
38
37
  private: false,
39
38
  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
39
  license: "MIT",
@@ -97,6 +96,7 @@ var require_package = __commonJS({
97
96
  chalk: "^5.6.0",
98
97
  dotenv: "^17.2.1",
99
98
  "env-paths": "^3.0.0",
99
+ "fuse.js": "^7.4.1",
100
100
  graphql: "^16.11.0",
101
101
  ink: "^6.2.3",
102
102
  "ink-spinner": "^5.0.0",
@@ -157,7 +157,7 @@ import { render, Box as Box23, Text as Text24 } from "ink";
157
157
  import "dotenv/config";
158
158
 
159
159
  // src/ui/App.tsx
160
- import { useEffect as useEffect13, useMemo as useMemo2, useState as useState18 } from "react";
160
+ import { useEffect as useEffect13, useMemo as useMemo3, useState as useState18 } from "react";
161
161
  import { Box as Box22, Text as Text23, useApp as useApp2, useStdout as useStdout2, useInput as useInput18 } from "ink";
162
162
  import TextInput6 from "ink-text-input";
163
163
 
@@ -407,10 +407,126 @@ async function openGitHubAuthorizationPage() {
407
407
  }
408
408
 
409
409
  // src/ui/views/RepoList.tsx
410
- import React16, { useEffect as useEffect12, useMemo, useState as useState16, useRef, useCallback } from "react";
410
+ import React16, { useEffect as useEffect12, useMemo as useMemo2, useState as useState16, useRef, useCallback } from "react";
411
411
  import { Box as Box19, Text as Text20, useApp, useInput as useInput16, useStdout } from "ink";
412
412
  import TextInput5 from "ink-text-input";
413
- import chalk14 from "chalk";
413
+ import chalk15 from "chalk";
414
+
415
+ // src/config/themes.ts
416
+ var THEMES = {
417
+ default: {
418
+ name: "default",
419
+ label: "Default",
420
+ primary: "cyan",
421
+ secondary: "blue",
422
+ success: "green",
423
+ warning: "yellow",
424
+ error: "red",
425
+ muted: "gray",
426
+ text: "white",
427
+ selected: "cyan",
428
+ private: "yellow",
429
+ archived: "gray",
430
+ internal: "magenta",
431
+ fork: "blue",
432
+ dim: "gray"
433
+ },
434
+ ocean: {
435
+ name: "ocean",
436
+ label: "Ocean",
437
+ primary: "blueBright",
438
+ secondary: "cyan",
439
+ success: "greenBright",
440
+ warning: "yellowBright",
441
+ error: "redBright",
442
+ muted: "blue",
443
+ text: "whiteBright",
444
+ selected: "blueBright",
445
+ private: "cyan",
446
+ archived: "blue",
447
+ internal: "magenta",
448
+ fork: "cyanBright",
449
+ dim: "blue"
450
+ },
451
+ forest: {
452
+ name: "forest",
453
+ label: "Forest",
454
+ primary: "green",
455
+ secondary: "greenBright",
456
+ success: "greenBright",
457
+ warning: "yellow",
458
+ error: "red",
459
+ muted: "gray",
460
+ text: "white",
461
+ selected: "green",
462
+ private: "yellow",
463
+ archived: "gray",
464
+ internal: "magenta",
465
+ fork: "greenBright",
466
+ dim: "gray"
467
+ },
468
+ monochrome: {
469
+ name: "monochrome",
470
+ label: "Monochrome",
471
+ primary: "white",
472
+ secondary: "whiteBright",
473
+ success: "whiteBright",
474
+ warning: "white",
475
+ error: "white",
476
+ muted: "gray",
477
+ text: "white",
478
+ selected: "whiteBright",
479
+ private: "white",
480
+ archived: "gray",
481
+ internal: "white",
482
+ fork: "white",
483
+ dim: "gray"
484
+ }
485
+ };
486
+ var THEME_ORDER = ["default", "ocean", "forest", "monochrome"];
487
+ function getTheme(name) {
488
+ return THEMES[name] ?? THEMES.default;
489
+ }
490
+ function nextTheme(current) {
491
+ const idx = THEME_ORDER.indexOf(current);
492
+ return THEME_ORDER[(idx + 1) % THEME_ORDER.length];
493
+ }
494
+
495
+ // src/ui/hooks/useTheme.ts
496
+ import { useMemo } from "react";
497
+ import chalk from "chalk";
498
+ function chalkFor(color) {
499
+ return chalk[color] ?? chalk.white;
500
+ }
501
+ function bgChalkFor(color) {
502
+ const bgKey = "bg" + color.charAt(0).toUpperCase() + color.slice(1);
503
+ return chalk[bgKey] ?? chalk.bgWhite;
504
+ }
505
+ function useTheme(name) {
506
+ return useMemo(() => {
507
+ const theme = getTheme(name);
508
+ const c = {
509
+ primary: chalkFor(theme.primary),
510
+ secondary: chalkFor(theme.secondary),
511
+ success: chalkFor(theme.success),
512
+ warning: chalkFor(theme.warning),
513
+ error: chalkFor(theme.error),
514
+ muted: chalkFor(theme.muted),
515
+ text: chalkFor(theme.text),
516
+ selected: chalkFor(theme.selected),
517
+ private: chalkFor(theme.private),
518
+ archived: chalkFor(theme.archived),
519
+ internal: chalkFor(theme.internal),
520
+ fork: chalkFor(theme.fork),
521
+ dim: chalkFor(theme.dim),
522
+ arrow: bgChalkFor(theme.primary).black,
523
+ arrowMuted: bgChalkFor(theme.muted).whiteBright,
524
+ btnPrimary: bgChalkFor(theme.primary).black.bold,
525
+ btnMuted: chalk.bgGray.white.bold
526
+ };
527
+ return { theme, c };
528
+ }, [name]);
529
+ }
414
530
 
415
531
  // src/services/apolloMeta.ts
416
532
  import fs2 from "fs";
@@ -448,11 +564,6 @@ function makeApolloKey(opts) {
448
564
  const affiliations = opts.affiliations || "OWNER";
449
565
  return `viewer:${v}|context:${context}|affiliations:${affiliations}|sort:${opts.sortKey}:${opts.sortDir}|ps:${opts.pageSize}|forks:${opts.forkTracking ? "1" : "0"}`;
450
566
  }
451
- function makeSearchKey(opts) {
452
- const v = opts.viewer || "unknown";
453
- const query = (opts.q || "").trim().toLowerCase();
454
- return `search:${query}|viewer:${v}|sort:${opts.sortKey}:${opts.sortDir}|ps:${opts.pageSize}|forks:${opts.forkTracking ? "1" : "0"}`;
455
- }
456
567
  function isFresh(key, ttlMs = Number(process.env.APOLLO_TTL_MS || 30 * 60 * 1e3)) {
457
568
  const meta = readMeta();
458
569
  const iso = meta.fetched[key];
@@ -467,13 +578,33 @@ function markFetched(key) {
467
578
  writeMeta(meta);
468
579
  }
469
580
 
581
+ // src/lib/fuzzySearch.ts
582
+ import Fuse from "fuse.js";
583
+ var FUSE_OPTIONS = {
584
+ keys: [
585
+ { name: "name", weight: 0.4 },
586
+ { name: "nameWithOwner", weight: 0.3 },
587
+ { name: "description", weight: 0.2 },
588
+ { name: "primaryLanguage.name", weight: 0.1 }
589
+ ],
590
+ threshold: 0.4,
591
+ ignoreLocation: true,
592
+ includeScore: true
593
+ };
594
+ function fuzzySearch(repos, query) {
595
+ const q = query.trim();
596
+ if (!q) return [];
597
+ const fuse = new Fuse(repos, FUSE_OPTIONS);
598
+ return fuse.search(q).map((r) => r.item);
599
+ }
600
+
470
601
  // src/ui/views/RepoList.tsx
471
602
  import { exec } from "child_process";
472
603
 
473
604
  // src/ui/OrgSwitcher.tsx
474
605
  import { useEffect, useState } from "react";
475
606
  import { Box, Text, useInput } from "ink";
476
- import chalk from "chalk";
607
+ import chalk2 from "chalk";
477
608
  import { jsx, jsxs } from "react/jsx-runtime";
478
609
  function OrgSwitcher({ token, currentContext, onSelect, onClose }) {
479
610
  const [organizations, setOrganizations] = useState([]);
@@ -560,12 +691,12 @@ function OrgSwitcher({ token, currentContext, onSelect, onClose }) {
560
691
  refreshing && /* @__PURE__ */ jsx(Text, { color: "yellow", children: "(Refreshing...)" })
561
692
  ] }),
562
693
  loading && !refreshing ? /* @__PURE__ */ jsx(Text, { color: "yellow", children: "Loading..." }) : error ? /* @__PURE__ */ jsx(Text, { color: "red", children: error }) : /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
563
- /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { children: cursor === 0 ? chalk.bgCyan.black(" \u2192 ") + " " + chalk.bold("Personal Account") + (isPersonalContext ? chalk.green(" \u2713") : "") : " " + chalk.gray("Personal Account") + (isPersonalContext ? chalk.green(" \u2713") : "") }) }),
694
+ /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { children: cursor === 0 ? chalk2.bgCyan.black(" \u2192 ") + " " + chalk2.bold("Personal Account") + (isPersonalContext ? chalk2.green(" \u2713") : "") : " " + chalk2.gray("Personal Account") + (isPersonalContext ? chalk2.green(" \u2713") : "") }) }),
564
695
  organizations.map((org, index) => {
565
696
  const isEnterprise = enterpriseOrgs.has(org.login);
566
697
  const isCurrent = cursor === index + 1;
567
698
  const isActiveContext = !isPersonalContext && currentContext.login === org.login;
568
- return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { children: isCurrent ? chalk.bgCyan.black(" \u2192 ") + " " + chalk.bold(org.name || org.login) + (isEnterprise ? chalk.yellow(" (ENT)") : "") + chalk.gray(` (@${org.login})`) + (isActiveContext ? chalk.green(" \u2713") : "") : " " + chalk.gray(org.name || org.login) + (isEnterprise ? chalk.gray(" (ENT)") : "") + chalk.gray(` (@${org.login})`) + (isActiveContext ? chalk.green(" \u2713") : "") }) }, org.id);
699
+ return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { children: isCurrent ? chalk2.bgCyan.black(" \u2192 ") + " " + chalk2.bold(org.name || org.login) + (isEnterprise ? chalk2.yellow(" (ENT)") : "") + chalk2.gray(` (@${org.login})`) + (isActiveContext ? chalk2.green(" \u2713") : "") : " " + chalk2.gray(org.name || org.login) + (isEnterprise ? chalk2.gray(" (ENT)") : "") + chalk2.gray(` (@${org.login})`) + (isActiveContext ? chalk2.green(" \u2713") : "") }) }, org.id);
569
700
  }),
570
701
  organizations.length === 0 && /* @__PURE__ */ jsx(Text, { color: "gray", dimColor: true, children: "No organisations found" })
571
702
  ] }),
@@ -584,13 +715,15 @@ function OrgSwitcher({ token, currentContext, onSelect, onClose }) {
584
715
  // src/ui/components/modals/ArchiveFilterModal.tsx
585
716
  import { useState as useState2, useEffect as useEffect2 } from "react";
586
717
  import { Box as Box2, Text as Text2, useInput as useInput2 } from "ink";
587
- import chalk2 from "chalk";
718
+ import chalk3 from "chalk";
588
719
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
589
720
  function ArchiveFilterModal({
590
721
  currentFilter,
591
722
  onSelect,
592
- onCancel
723
+ onCancel,
724
+ theme: themeProp
593
725
  }) {
726
+ const { theme, c } = useTheme(themeProp?.name ?? "default");
594
727
  const options = ["all", "unarchived", "archived"];
595
728
  const [focusedOption, setFocusedOption] = useState2(currentFilter);
596
729
  useEffect2(() => {
@@ -603,8 +736,7 @@ function ArchiveFilterModal({
603
736
  }
604
737
  if (key.leftArrow || key.upArrow) {
605
738
  if (focusedOption === "cancel") {
606
- const lastIndex = options.length - 1;
607
- setFocusedOption(options[lastIndex]);
739
+ setFocusedOption(options[options.length - 1]);
608
740
  } else {
609
741
  const idx = options.indexOf(focusedOption);
610
742
  if (idx > 0) setFocusedOption(options[idx - 1]);
@@ -613,11 +745,8 @@ function ArchiveFilterModal({
613
745
  if (key.rightArrow || key.downArrow) {
614
746
  if (focusedOption !== "cancel") {
615
747
  const idx = options.indexOf(focusedOption);
616
- if (idx < options.length - 1) {
617
- setFocusedOption(options[idx + 1]);
618
- } else {
619
- setFocusedOption("cancel");
620
- }
748
+ if (idx < options.length - 1) setFocusedOption(options[idx + 1]);
749
+ else setFocusedOption("cancel");
621
750
  }
622
751
  }
623
752
  if (key.tab) {
@@ -625,19 +754,13 @@ function ArchiveFilterModal({
625
754
  setFocusedOption(options[0]);
626
755
  } else {
627
756
  const idx = options.indexOf(focusedOption);
628
- if (idx < options.length - 1) {
629
- setFocusedOption(options[idx + 1]);
630
- } else {
631
- setFocusedOption("cancel");
632
- }
757
+ if (idx < options.length - 1) setFocusedOption(options[idx + 1]);
758
+ else setFocusedOption("cancel");
633
759
  }
634
760
  }
635
761
  if (key.return) {
636
- if (focusedOption === "cancel") {
637
- onCancel();
638
- } else {
639
- onSelect(focusedOption);
640
- }
762
+ if (focusedOption === "cancel") onCancel();
763
+ else onSelect(focusedOption);
641
764
  }
642
765
  if (input) {
643
766
  const u = input.toUpperCase();
@@ -656,24 +779,24 @@ function ArchiveFilterModal({
656
779
  return "Archived Only";
657
780
  }
658
781
  };
659
- const getColor = (filter) => {
660
- if (filter === currentFilter) return "green";
661
- return focusedOption === filter ? "cyan" : "gray";
782
+ const getOptionChalk = (filter) => {
783
+ if (filter === currentFilter) return c.success;
784
+ return focusedOption === filter ? c.primary : c.muted;
662
785
  };
663
- return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, width: 45, children: [
786
+ return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", borderStyle: "round", borderColor: theme.primary, paddingX: 2, paddingY: 1, width: 45, children: [
664
787
  /* @__PURE__ */ jsx2(Text2, { bold: true, children: "Archive Filter" }),
665
788
  /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", marginTop: 1, children: [
666
789
  options.map((option) => /* @__PURE__ */ jsx2(Box2, { paddingX: 1, children: /* @__PURE__ */ jsxs2(Text2, { children: [
667
- focusedOption === option ? chalk2.bgCyan.black(" \u2192 ") : " ",
668
- focusedOption === option ? chalk2[getColor(option)].bold(getLabel(option)) : chalk2[getColor(option)](getLabel(option)),
669
- option === currentFilter && chalk2.green(" \u2713")
790
+ focusedOption === option ? c.arrow(" \u2192 ") : " ",
791
+ focusedOption === option ? getOptionChalk(option).bold(getLabel(option)) : getOptionChalk(option)(getLabel(option)),
792
+ option === currentFilter && c.success(" \u2713")
670
793
  ] }) }, option)),
671
794
  /* @__PURE__ */ jsx2(Box2, { paddingX: 1, children: /* @__PURE__ */ jsxs2(Text2, { children: [
672
- focusedOption === "cancel" ? chalk2.bgWhite.black(" \u2192 ") : " ",
673
- focusedOption === "cancel" ? chalk2.white.bold("Cancel") : chalk2.gray("Cancel")
795
+ focusedOption === "cancel" ? c.arrowMuted(" \u2192 ") : " ",
796
+ focusedOption === "cancel" ? chalk3.white.bold("Cancel") : c.muted("Cancel")
674
797
  ] }) })
675
798
  ] }),
676
- /* @__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" }) })
799
+ /* @__PURE__ */ jsx2(Box2, { marginTop: 1, children: /* @__PURE__ */ jsx2(Text2, { color: theme.muted, dimColor: true, children: "\u2191\u2193/Enter \u2022 L All \u2022 U Unarchived \u2022 R Archived \u2022 Esc" }) })
677
800
  ] });
678
801
  }
679
802
 
@@ -681,7 +804,7 @@ function ArchiveFilterModal({
681
804
  import { useState as useState4, useEffect as useEffect4 } from "react";
682
805
  import { Box as Box3, Text as Text4, useInput as useInput3 } from "ink";
683
806
  import TextInput from "ink-text-input";
684
- import chalk3 from "chalk";
807
+ import chalk4 from "chalk";
685
808
 
686
809
  // src/ui/components/common/SlowSpinner.tsx
687
810
  import { useEffect as useEffect3, useState as useState3 } from "react";
@@ -705,18 +828,18 @@ import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
705
828
  // src/ui/components/modals/ArchiveModal.tsx
706
829
  import { useState as useState5 } from "react";
707
830
  import { Box as Box4, Text as Text5, useInput as useInput4 } from "ink";
708
- import chalk4 from "chalk";
831
+ import chalk5 from "chalk";
709
832
  import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
710
833
 
711
834
  // src/ui/components/modals/SyncModal.tsx
712
835
  import { useState as useState6 } from "react";
713
836
  import { Box as Box5, Text as Text6, useInput as useInput5 } from "ink";
714
- import chalk5 from "chalk";
837
+ import chalk6 from "chalk";
715
838
  import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
716
839
 
717
840
  // src/ui/components/modals/InfoModal.tsx
718
841
  import { Box as Box6, Text as Text7, useInput as useInput6 } from "ink";
719
- import chalk6 from "chalk";
842
+ import chalk7 from "chalk";
720
843
 
721
844
  // src/lib/utils.ts
722
845
  function truncate(str, max = 80) {
@@ -836,20 +959,22 @@ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
836
959
  // src/ui/components/modals/LogoutModal.tsx
837
960
  import { useState as useState7 } from "react";
838
961
  import { Box as Box7, Text as Text8, useInput as useInput7 } from "ink";
839
- import chalk7 from "chalk";
962
+ import chalk8 from "chalk";
840
963
  import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
841
964
 
842
965
  // src/ui/components/modals/VisibilityModal.tsx
843
966
  import { useState as useState8, useEffect as useEffect5 } from "react";
844
967
  import { Box as Box8, Text as Text9, useInput as useInput8 } from "ink";
845
- import chalk8 from "chalk";
968
+ import chalk9 from "chalk";
846
969
  import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
847
970
  function VisibilityModal({
848
971
  currentFilter,
849
972
  isEnterprise,
850
973
  onSelect,
851
- onCancel
974
+ onCancel,
975
+ theme: themeProp
852
976
  }) {
977
+ const { theme, c } = useTheme(themeProp?.name ?? "default");
853
978
  const options = ["all", "public", "private"];
854
979
  const [selectedIndex, setSelectedIndex] = useState8(0);
855
980
  const [focusedOption, setFocusedOption] = useState8("all");
@@ -912,13 +1037,9 @@ function VisibilityModal({
912
1037
  }
913
1038
  if (input) {
914
1039
  const upperInput = input.toUpperCase();
915
- if (upperInput === "A") {
916
- onSelect("all");
917
- } else if (upperInput === "P") {
918
- onSelect("public");
919
- } else if (upperInput === "R") {
920
- onSelect("private");
921
- }
1040
+ if (upperInput === "A") onSelect("all");
1041
+ else if (upperInput === "P") onSelect("public");
1042
+ else if (upperInput === "R") onSelect("private");
922
1043
  }
923
1044
  });
924
1045
  const getButtonLabel = (filter) => {
@@ -931,39 +1052,39 @@ function VisibilityModal({
931
1052
  return isEnterprise ? "Private/Internal" : "Private Only";
932
1053
  }
933
1054
  };
934
- const getButtonColor = (filter) => {
935
- if (filter === currentFilter) {
936
- return "green";
937
- }
938
- return focusedOption === filter ? "cyan" : "gray";
1055
+ const getOptionChalk = (filter) => {
1056
+ if (filter === currentFilter) return c.success;
1057
+ return focusedOption === filter ? c.primary : c.muted;
939
1058
  };
940
- return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, width: 45, children: [
1059
+ return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", borderStyle: "round", borderColor: theme.primary, paddingX: 2, paddingY: 1, width: 45, children: [
941
1060
  /* @__PURE__ */ jsx9(Text9, { bold: true, children: "Visibility Filter" }),
942
1061
  /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", marginTop: 1, children: [
943
1062
  options.map((option) => /* @__PURE__ */ jsx9(Box8, { paddingX: 1, children: /* @__PURE__ */ jsxs8(Text9, { children: [
944
- focusedOption === option ? chalk8.bgCyan.black(" \u2192 ") : " ",
945
- focusedOption === option ? chalk8[getButtonColor(option)].bold(getButtonLabel(option)) : chalk8[getButtonColor(option)](getButtonLabel(option)),
946
- option === currentFilter && chalk8.green(" \u2713")
1063
+ focusedOption === option ? c.arrow(" \u2192 ") : " ",
1064
+ focusedOption === option ? getOptionChalk(option).bold(getButtonLabel(option)) : getOptionChalk(option)(getButtonLabel(option)),
1065
+ option === currentFilter && c.success(" \u2713")
947
1066
  ] }) }, option)),
948
1067
  /* @__PURE__ */ jsx9(Box8, { paddingX: 1, children: /* @__PURE__ */ jsxs8(Text9, { children: [
949
- focusedOption === "cancel" ? chalk8.bgWhite.black(" \u2192 ") : " ",
950
- focusedOption === "cancel" ? chalk8.white.bold("Cancel") : chalk8.gray("Cancel")
1068
+ focusedOption === "cancel" ? c.arrowMuted(" \u2192 ") : " ",
1069
+ focusedOption === "cancel" ? chalk9.white.bold("Cancel") : c.muted("Cancel")
951
1070
  ] }) })
952
1071
  ] }),
953
- /* @__PURE__ */ jsx9(Box8, { marginTop: 1, children: /* @__PURE__ */ jsx9(Text9, { color: "gray", dimColor: true, children: "\u2191\u2193/Enter \u2022 A/P/R \u2022 Esc" }) })
1072
+ /* @__PURE__ */ jsx9(Box8, { marginTop: 1, children: /* @__PURE__ */ jsx9(Text9, { color: theme.muted, dimColor: true, children: "\u2191\u2193/Enter \u2022 A/P/R \u2022 Esc" }) })
954
1073
  ] });
955
1074
  }
956
1075
 
957
1076
  // src/ui/components/modals/SortModal.tsx
958
1077
  import { useState as useState9, useEffect as useEffect6 } from "react";
959
1078
  import { Box as Box9, Text as Text10, useInput as useInput9 } from "ink";
960
- import chalk9 from "chalk";
1079
+ import chalk10 from "chalk";
961
1080
  import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
962
1081
  function SortModal({
963
1082
  currentSort,
964
1083
  onSelect,
965
- onCancel
1084
+ onCancel,
1085
+ theme: themeProp
966
1086
  }) {
1087
+ const { theme, c } = useTheme(themeProp?.name ?? "default");
967
1088
  const options = ["updated", "pushed", "name", "stars"];
968
1089
  const [selectedIndex, setSelectedIndex] = useState9(0);
969
1090
  const [focusedOption, setFocusedOption] = useState9("updated");
@@ -1026,15 +1147,10 @@ function SortModal({
1026
1147
  }
1027
1148
  if (input) {
1028
1149
  const upperInput = input.toUpperCase();
1029
- if (upperInput === "U") {
1030
- onSelect("updated");
1031
- } else if (upperInput === "P") {
1032
- onSelect("pushed");
1033
- } else if (upperInput === "N") {
1034
- onSelect("name");
1035
- } else if (upperInput === "S") {
1036
- onSelect("stars");
1037
- }
1150
+ if (upperInput === "U") onSelect("updated");
1151
+ else if (upperInput === "P") onSelect("pushed");
1152
+ else if (upperInput === "N") onSelect("name");
1153
+ else if (upperInput === "S") onSelect("stars");
1038
1154
  }
1039
1155
  });
1040
1156
  const getButtonLabel = (sort) => {
@@ -1049,52 +1165,40 @@ function SortModal({
1049
1165
  return "Stars";
1050
1166
  }
1051
1167
  };
1052
- const getButtonDescription = (sort) => {
1053
- switch (sort) {
1054
- case "updated":
1055
- return "When the repository was last modified";
1056
- case "pushed":
1057
- return "When code was last pushed";
1058
- case "name":
1059
- return "Alphabetical by repository name";
1060
- case "stars":
1061
- return "Number of stars";
1062
- }
1168
+ const getOptionChalk = (option) => {
1169
+ if (option === currentSort) return c.success;
1170
+ return focusedOption === option ? c.primary : c.muted;
1063
1171
  };
1064
- const getButtonColor = (sort) => {
1065
- if (sort === currentSort) {
1066
- return "green";
1067
- }
1068
- return focusedOption === sort ? "cyan" : "gray";
1069
- };
1070
- return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, width: 40, children: [
1172
+ return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", borderStyle: "round", borderColor: theme.primary, paddingX: 2, paddingY: 1, width: 40, children: [
1071
1173
  /* @__PURE__ */ jsx10(Text10, { bold: true, children: "Sort By" }),
1072
1174
  /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", marginTop: 1, children: [
1073
1175
  options.map((option) => /* @__PURE__ */ jsx10(Box9, { paddingX: 1, children: /* @__PURE__ */ jsxs9(Text10, { children: [
1074
- focusedOption === option ? chalk9.bgCyan.black(" \u2192 ") : " ",
1075
- focusedOption === option ? chalk9[getButtonColor(option)].bold(getButtonLabel(option)) : chalk9[getButtonColor(option)](getButtonLabel(option)),
1076
- option === currentSort && chalk9.green(" \u2713")
1176
+ focusedOption === option ? c.arrow(" \u2192 ") : " ",
1177
+ focusedOption === option ? getOptionChalk(option).bold(getButtonLabel(option)) : getOptionChalk(option)(getButtonLabel(option)),
1178
+ option === currentSort && c.success(" \u2713")
1077
1179
  ] }) }, option)),
1078
1180
  /* @__PURE__ */ jsx10(Box9, { paddingX: 1, children: /* @__PURE__ */ jsxs9(Text10, { children: [
1079
- focusedOption === "cancel" ? chalk9.bgWhite.black(" \u2192 ") : " ",
1080
- focusedOption === "cancel" ? chalk9.white.bold("Cancel") : chalk9.gray("Cancel")
1181
+ focusedOption === "cancel" ? c.arrowMuted(" \u2192 ") : " ",
1182
+ focusedOption === "cancel" ? chalk10.white.bold("Cancel") : c.muted("Cancel")
1081
1183
  ] }) })
1082
1184
  ] }),
1083
- /* @__PURE__ */ jsx10(Box9, { marginTop: 1, children: /* @__PURE__ */ jsx10(Text10, { color: "gray", dimColor: true, children: "\u2191\u2193/Enter \u2022 U/P/N/S \u2022 Esc" }) })
1185
+ /* @__PURE__ */ jsx10(Box9, { marginTop: 1, children: /* @__PURE__ */ jsx10(Text10, { color: theme.muted, dimColor: true, children: "\u2191\u2193/Enter \u2022 U/P/N/S \u2022 Esc" }) })
1084
1186
  ] });
1085
1187
  }
1086
1188
 
1087
1189
  // src/ui/components/modals/SortDirectionModal.tsx
1088
1190
  import { useState as useState10, useEffect as useEffect7 } from "react";
1089
1191
  import { Box as Box10, Text as Text11, useInput as useInput10 } from "ink";
1090
- import chalk10 from "chalk";
1192
+ import chalk11 from "chalk";
1091
1193
  import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
1092
1194
  function SortDirectionModal({
1093
1195
  currentDirection,
1094
1196
  currentSortKey,
1095
1197
  onSelect,
1096
- onCancel
1198
+ onCancel,
1199
+ theme: themeProp
1097
1200
  }) {
1201
+ const { theme, c } = useTheme(themeProp?.name ?? "default");
1098
1202
  const options = ["desc", "asc"];
1099
1203
  const [focusedOption, setFocusedOption] = useState10(currentDirection);
1100
1204
  useEffect7(() => {
@@ -1110,40 +1214,25 @@ function SortDirectionModal({
1110
1214
  setFocusedOption(options[options.length - 1]);
1111
1215
  } else if (focusedOption === "asc") {
1112
1216
  setFocusedOption("desc");
1113
- } else if (focusedOption === "desc") {
1114
1217
  }
1115
1218
  }
1116
1219
  if (key.rightArrow || key.downArrow) {
1117
- if (focusedOption === "desc") {
1118
- setFocusedOption("asc");
1119
- } else if (focusedOption === "asc") {
1120
- setFocusedOption("cancel");
1121
- } else if (focusedOption === "cancel") {
1122
- }
1220
+ if (focusedOption === "desc") setFocusedOption("asc");
1221
+ else if (focusedOption === "asc") setFocusedOption("cancel");
1123
1222
  }
1124
1223
  if (key.tab) {
1125
- if (focusedOption === "desc") {
1126
- setFocusedOption("asc");
1127
- } else if (focusedOption === "asc") {
1128
- setFocusedOption("cancel");
1129
- } else if (focusedOption === "cancel") {
1130
- setFocusedOption("desc");
1131
- }
1224
+ if (focusedOption === "desc") setFocusedOption("asc");
1225
+ else if (focusedOption === "asc") setFocusedOption("cancel");
1226
+ else if (focusedOption === "cancel") setFocusedOption("desc");
1132
1227
  }
1133
1228
  if (key.return) {
1134
- if (focusedOption === "cancel") {
1135
- onCancel();
1136
- } else {
1137
- onSelect(focusedOption);
1138
- }
1229
+ if (focusedOption === "cancel") onCancel();
1230
+ else onSelect(focusedOption);
1139
1231
  }
1140
1232
  if (input) {
1141
1233
  const upperInput = input.toUpperCase();
1142
- if (upperInput === "A") {
1143
- onSelect("asc");
1144
- } else if (upperInput === "D") {
1145
- onSelect("desc");
1146
- }
1234
+ if (upperInput === "A") onSelect("asc");
1235
+ else if (upperInput === "D") onSelect("desc");
1147
1236
  }
1148
1237
  });
1149
1238
  const getButtonLabel = (direction) => {
@@ -1184,11 +1273,9 @@ function SortDirectionModal({
1184
1273
  }
1185
1274
  }
1186
1275
  };
1187
- const getButtonColor = (direction) => {
1188
- if (direction === currentDirection) {
1189
- return "green";
1190
- }
1191
- return focusedOption === direction ? "cyan" : "gray";
1276
+ const getOptionChalk = (direction) => {
1277
+ if (direction === currentDirection) return c.success;
1278
+ return focusedOption === direction ? c.primary : c.muted;
1192
1279
  };
1193
1280
  const formatSortKey = () => {
1194
1281
  switch (currentSortKey) {
@@ -1202,30 +1289,30 @@ function SortDirectionModal({
1202
1289
  return "Stars";
1203
1290
  }
1204
1291
  };
1205
- return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, width: 45, children: [
1292
+ return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", borderStyle: "round", borderColor: theme.primary, paddingX: 2, paddingY: 1, width: 45, children: [
1206
1293
  /* @__PURE__ */ jsx11(Text11, { bold: true, children: "Sort Direction" }),
1207
- /* @__PURE__ */ jsxs10(Text11, { color: "gray", dimColor: true, children: [
1294
+ /* @__PURE__ */ jsxs10(Text11, { color: theme.muted, dimColor: true, children: [
1208
1295
  "Sorting by: ",
1209
1296
  formatSortKey()
1210
1297
  ] }),
1211
1298
  /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", marginTop: 1, children: [
1212
1299
  options.map((option) => /* @__PURE__ */ jsx11(Box10, { paddingX: 1, marginBottom: 0, children: /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
1213
1300
  /* @__PURE__ */ jsxs10(Text11, { children: [
1214
- focusedOption === option ? chalk10.bgCyan.black(" \u2192 ") : " ",
1215
- focusedOption === option ? chalk10[getButtonColor(option)].bold(getButtonLabel(option)) : chalk10[getButtonColor(option)](getButtonLabel(option)),
1216
- option === currentDirection && chalk10.green(" \u2713")
1301
+ focusedOption === option ? c.arrow(" \u2192 ") : " ",
1302
+ focusedOption === option ? getOptionChalk(option).bold(getButtonLabel(option)) : getOptionChalk(option)(getButtonLabel(option)),
1303
+ option === currentDirection && c.success(" \u2713")
1217
1304
  ] }),
1218
- /* @__PURE__ */ jsxs10(Text11, { color: "gray", dimColor: true, children: [
1305
+ /* @__PURE__ */ jsxs10(Text11, { color: theme.muted, dimColor: true, children: [
1219
1306
  " ",
1220
1307
  getButtonDescription(option)
1221
1308
  ] })
1222
1309
  ] }) }, option)),
1223
1310
  /* @__PURE__ */ jsx11(Box10, { paddingX: 1, marginTop: 1, children: /* @__PURE__ */ jsxs10(Text11, { children: [
1224
- focusedOption === "cancel" ? chalk10.bgWhite.black(" \u2192 ") : " ",
1225
- focusedOption === "cancel" ? chalk10.white.bold("Cancel") : chalk10.gray("Cancel")
1311
+ focusedOption === "cancel" ? c.arrowMuted(" \u2192 ") : " ",
1312
+ focusedOption === "cancel" ? chalk11.white.bold("Cancel") : c.muted("Cancel")
1226
1313
  ] }) })
1227
1314
  ] }),
1228
- /* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx11(Text11, { color: "gray", dimColor: true, children: "\u2191\u2193/Enter \u2022 A/D \u2022 Esc" }) })
1315
+ /* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx11(Text11, { color: theme.muted, dimColor: true, children: "\u2191\u2193/Enter \u2022 A/D \u2022 Esc" }) })
1229
1316
  ] });
1230
1317
  }
1231
1318
 
@@ -1233,7 +1320,7 @@ function SortDirectionModal({
1233
1320
  import { useState as useState11, useEffect as useEffect8 } from "react";
1234
1321
  import { Box as Box11, Text as Text12, useInput as useInput11 } from "ink";
1235
1322
  import TextInput2 from "ink-text-input";
1236
- import chalk11 from "chalk";
1323
+ import chalk12 from "chalk";
1237
1324
  import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1238
1325
  var ChangeVisibilityModal = ({
1239
1326
  isOpen,
@@ -1244,8 +1331,10 @@ var ChangeVisibilityModal = ({
1244
1331
  onVisibilityChange,
1245
1332
  onClose,
1246
1333
  changing: externalChanging,
1247
- error: externalError
1334
+ error: externalError,
1335
+ theme: themeProp
1248
1336
  }) => {
1337
+ const { c } = useTheme(themeProp?.name ?? "default");
1249
1338
  const getAvailableOptions = () => {
1250
1339
  if (currentVisibility === "PUBLIC") {
1251
1340
  return isEnterprise ? ["PRIVATE", "INTERNAL"] : ["PRIVATE"];
@@ -1365,7 +1454,7 @@ var ChangeVisibilityModal = ({
1365
1454
  alignItems: "center",
1366
1455
  justifyContent: "center",
1367
1456
  flexDirection: "column",
1368
- children: /* @__PURE__ */ jsx12(Text12, { children: chalk11.bgGray.white.bold(" Cancel ") })
1457
+ children: /* @__PURE__ */ jsx12(Text12, { children: c.btnMuted(" Cancel ") })
1369
1458
  }
1370
1459
  ) }),
1371
1460
  /* @__PURE__ */ jsx12(Box11, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsx12(Text12, { color: "gray", children: "Press Enter to Cancel \u2022 C to cancel" }) })
@@ -1390,7 +1479,7 @@ var ChangeVisibilityModal = ({
1390
1479
  alignItems: "center",
1391
1480
  justifyContent: "center",
1392
1481
  flexDirection: "column",
1393
- 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)) })
1482
+ children: /* @__PURE__ */ jsx12(Text12, { children: focusedButton === "option" && selectedOptionIndex === index ? chalk12[`bg${getVisibilityLabel(option) === "Public" ? "Green" : getVisibilityLabel(option) === "Private" ? "Yellow" : "Cyan"}`].black.bold(` ${getVisibilityLabel(option)} `) : chalk12[getVisibilityColor(option)](getVisibilityLabel(option)) })
1394
1483
  },
1395
1484
  option
1396
1485
  )),
@@ -1404,7 +1493,7 @@ var ChangeVisibilityModal = ({
1404
1493
  alignItems: "center",
1405
1494
  justifyContent: "center",
1406
1495
  flexDirection: "column",
1407
- children: /* @__PURE__ */ jsx12(Text12, { children: focusedButton === "cancel" ? chalk11.bgGray.white.bold(" Cancel ") : chalk11.gray.bold("Cancel") })
1496
+ children: /* @__PURE__ */ jsx12(Text12, { children: focusedButton === "cancel" ? c.btnMuted(" Cancel ") : c.muted.bold("Cancel") })
1408
1497
  }
1409
1498
  )
1410
1499
  ] }),
@@ -1440,9 +1529,10 @@ var ChangeVisibilityModal = ({
1440
1529
  // src/ui/components/modals/CopyUrlModal.tsx
1441
1530
  import { useState as useState12 } from "react";
1442
1531
  import { Box as Box12, Text as Text13, useInput as useInput12 } from "ink";
1443
- import chalk12 from "chalk";
1532
+ import chalk13 from "chalk";
1444
1533
  import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1445
- function CopyUrlModal({ repo, terminalWidth, onClose, onCopy }) {
1534
+ function CopyUrlModal({ repo, terminalWidth, onClose, onCopy, theme: themeProp }) {
1535
+ const { theme, c } = useTheme(themeProp?.name ?? "default");
1446
1536
  const [copyError, setCopyError] = useState12(null);
1447
1537
  const [selectedType, setSelectedType] = useState12("SSH");
1448
1538
  const urlTypes = ["SSH", "HTTPS"];
@@ -1510,53 +1600,53 @@ function CopyUrlModal({ repo, terminalWidth, onClose, onCopy }) {
1510
1600
  {
1511
1601
  flexDirection: "column",
1512
1602
  borderStyle: "round",
1513
- borderColor: "blue",
1603
+ borderColor: theme.secondary,
1514
1604
  paddingX: 3,
1515
1605
  paddingY: 2,
1516
1606
  width: Math.min(terminalWidth - 8, 80),
1517
1607
  children: [
1518
- /* @__PURE__ */ jsx13(Text13, { bold: true, color: "blue", children: "Copy Repository URL" }),
1608
+ /* @__PURE__ */ jsx13(Text13, { bold: true, color: theme.secondary, children: "Copy Repository URL" }),
1519
1609
  /* @__PURE__ */ jsx13(Box12, { height: 1, children: /* @__PURE__ */ jsx13(Text13, { children: " " }) }),
1520
- /* @__PURE__ */ jsx13(Text13, { children: chalk12.bold(repo.nameWithOwner) }),
1610
+ /* @__PURE__ */ jsx13(Text13, { children: chalk13.bold(repo.nameWithOwner) }),
1521
1611
  /* @__PURE__ */ jsx13(Box12, { height: 1, children: /* @__PURE__ */ jsx13(Text13, { children: " " }) }),
1522
- /* @__PURE__ */ jsx13(Text13, { color: "gray", children: "SSH URL:" }),
1612
+ /* @__PURE__ */ jsx13(Text13, { color: theme.muted, children: "SSH URL:" }),
1523
1613
  /* @__PURE__ */ jsx13(
1524
1614
  Box12,
1525
1615
  {
1526
1616
  paddingX: 2,
1527
1617
  paddingY: 1,
1528
1618
  borderStyle: "single",
1529
- borderColor: selectedType === "SSH" ? "blue" : "gray",
1530
- children: /* @__PURE__ */ jsxs12(Text13, { color: selectedType === "SSH" ? "blue" : void 0, children: [
1619
+ borderColor: selectedType === "SSH" ? theme.secondary : theme.muted,
1620
+ children: /* @__PURE__ */ jsxs12(Text13, { color: selectedType === "SSH" ? theme.secondary : void 0, children: [
1531
1621
  selectedType === "SSH" ? "\u25B6 " : " ",
1532
1622
  sshUrl
1533
1623
  ] })
1534
1624
  }
1535
1625
  ),
1536
1626
  /* @__PURE__ */ jsx13(Box12, { height: 1, children: /* @__PURE__ */ jsx13(Text13, { children: " " }) }),
1537
- /* @__PURE__ */ jsx13(Text13, { color: "gray", children: "HTTPS URL:" }),
1627
+ /* @__PURE__ */ jsx13(Text13, { color: theme.muted, children: "HTTPS URL:" }),
1538
1628
  /* @__PURE__ */ jsx13(
1539
1629
  Box12,
1540
1630
  {
1541
1631
  paddingX: 2,
1542
1632
  paddingY: 1,
1543
1633
  borderStyle: "single",
1544
- borderColor: selectedType === "HTTPS" ? "blue" : "gray",
1545
- children: /* @__PURE__ */ jsxs12(Text13, { color: selectedType === "HTTPS" ? "blue" : void 0, children: [
1634
+ borderColor: selectedType === "HTTPS" ? theme.secondary : theme.muted,
1635
+ children: /* @__PURE__ */ jsxs12(Text13, { color: selectedType === "HTTPS" ? theme.secondary : void 0, children: [
1546
1636
  selectedType === "HTTPS" ? "\u25B6 " : " ",
1547
1637
  httpsUrl
1548
1638
  ] })
1549
1639
  }
1550
1640
  ),
1551
1641
  /* @__PURE__ */ jsx13(Box12, { height: 1, children: /* @__PURE__ */ jsx13(Text13, { children: " " }) }),
1552
- /* @__PURE__ */ jsxs12(Text13, { color: "gray", children: [
1642
+ /* @__PURE__ */ jsxs12(Text13, { color: theme.muted, children: [
1553
1643
  "\u2191\u2193 Select \u2022 Enter/Y to copy ",
1554
1644
  selectedType,
1555
1645
  " \u2022 S copy SSH \u2022 H copy HTTPS \u2022 Esc/Q/C to close"
1556
1646
  ] }),
1557
1647
  copyError && /* @__PURE__ */ jsxs12(Fragment5, { children: [
1558
1648
  /* @__PURE__ */ jsx13(Box12, { height: 1, children: /* @__PURE__ */ jsx13(Text13, { children: " " }) }),
1559
- /* @__PURE__ */ jsx13(Text13, { color: "red", children: copyError })
1649
+ /* @__PURE__ */ jsx13(Text13, { color: theme.error, children: copyError })
1560
1650
  ] })
1561
1651
  ]
1562
1652
  }
@@ -1568,7 +1658,8 @@ import { useState as useState13, useEffect as useEffect9 } from "react";
1568
1658
  import { Box as Box13, Text as Text14, useInput as useInput13 } from "ink";
1569
1659
  import TextInput3 from "ink-text-input";
1570
1660
  import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1571
- function RenameModal({ repo, onRename, onCancel }) {
1661
+ function RenameModal({ repo, onRename, onCancel, theme: themeProp }) {
1662
+ const { theme } = useTheme(themeProp?.name ?? "default");
1572
1663
  const [newName, setNewName] = useState13("");
1573
1664
  const [renaming, setRenaming] = useState13(false);
1574
1665
  const [renameError, setRenameError] = useState13(null);
@@ -1614,14 +1705,14 @@ function RenameModal({ repo, onRename, onCancel }) {
1614
1705
  {
1615
1706
  flexDirection: "column",
1616
1707
  borderStyle: "round",
1617
- borderColor: "cyan",
1708
+ borderColor: theme.primary,
1618
1709
  paddingX: 3,
1619
1710
  paddingY: 2,
1620
1711
  width: 80,
1621
1712
  children: [
1622
- /* @__PURE__ */ jsx14(Text14, { bold: true, color: "cyan", children: "Rename Repository" }),
1713
+ /* @__PURE__ */ jsx14(Text14, { bold: true, color: theme.primary, children: "Rename Repository" }),
1623
1714
  /* @__PURE__ */ jsx14(Box13, { height: 1, children: /* @__PURE__ */ jsx14(Text14, { children: " " }) }),
1624
- /* @__PURE__ */ jsxs13(Text14, { color: "gray", children: [
1715
+ /* @__PURE__ */ jsxs13(Text14, { color: theme.muted, children: [
1625
1716
  "Current: ",
1626
1717
  repo.nameWithOwner
1627
1718
  ] }),
@@ -1644,12 +1735,12 @@ function RenameModal({ repo, onRename, onCancel }) {
1644
1735
  ] }),
1645
1736
  renaming ? /* @__PURE__ */ jsx14(Box13, { marginTop: 2, justifyContent: "center", children: /* @__PURE__ */ jsxs13(Box13, { flexDirection: "row", children: [
1646
1737
  /* @__PURE__ */ jsx14(Box13, { marginRight: 1, children: /* @__PURE__ */ jsx14(SlowSpinner, {}) }),
1647
- /* @__PURE__ */ jsx14(Text14, { color: "cyan", children: "Renaming repository..." })
1738
+ /* @__PURE__ */ jsx14(Text14, { color: theme.primary, children: "Renaming repository..." })
1648
1739
  ] }) }) : /* @__PURE__ */ jsxs13(Fragment6, { children: [
1649
- /* @__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}"` }) }),
1650
- /* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "gray", children: "Press Esc to cancel" }) })
1740
+ /* @__PURE__ */ jsx14(Box13, { marginTop: 2, children: /* @__PURE__ */ jsx14(Text14, { color: theme.muted, children: isDisabled ? "Enter a different name to rename" : `Press Enter to rename to "${newName}"` }) }),
1741
+ /* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: theme.muted, children: "Press Esc to cancel" }) })
1651
1742
  ] }),
1652
- renameError && /* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "red", children: renameError }) })
1743
+ renameError && /* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: theme.error, children: renameError }) })
1653
1744
  ]
1654
1745
  }
1655
1746
  );
@@ -1667,8 +1758,10 @@ function StarModal({
1667
1758
  onConfirm,
1668
1759
  onCancel,
1669
1760
  isStarring = false,
1670
- error = null
1761
+ error = null,
1762
+ theme: themeProp
1671
1763
  }) {
1764
+ const { theme } = useTheme(themeProp?.name ?? "default");
1672
1765
  const [focusedButton, setFocusedButton] = useState14("cancel");
1673
1766
  useInput14((input, key) => {
1674
1767
  if (!visible) return;
@@ -1709,12 +1802,12 @@ function StarModal({
1709
1802
  {
1710
1803
  flexDirection: "column",
1711
1804
  borderStyle: "round",
1712
- borderColor: "yellow",
1805
+ borderColor: theme.warning,
1713
1806
  paddingX: 2,
1714
1807
  paddingY: 1,
1715
1808
  marginTop: 1,
1716
1809
  children: [
1717
- /* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsxs14(Text15, { bold: true, color: "yellow", children: [
1810
+ /* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsxs14(Text15, { bold: true, color: theme.warning, children: [
1718
1811
  "\u2B50 ",
1719
1812
  action,
1720
1813
  " Repository"
@@ -1723,7 +1816,7 @@ function StarModal({
1723
1816
  "Are you sure you want to ",
1724
1817
  actionLower,
1725
1818
  " ",
1726
- /* @__PURE__ */ jsx15(Text15, { bold: true, color: "cyan", children: repo.nameWithOwner }),
1819
+ /* @__PURE__ */ jsx15(Text15, { bold: true, color: theme.primary, children: repo.nameWithOwner }),
1727
1820
  "?"
1728
1821
  ] }) }),
1729
1822
  repo.description && /* @__PURE__ */ jsx15(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx15(Text15, { dimColor: true, wrap: "wrap", children: repo.description }) }),
@@ -1733,11 +1826,11 @@ function StarModal({
1733
1826
  " \u2022 Forks: ",
1734
1827
  repo.forkCount
1735
1828
  ] }) }),
1736
- error && /* @__PURE__ */ jsx15(Box14, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs14(Text15, { color: "red", wrap: "wrap", children: [
1829
+ error && /* @__PURE__ */ jsx15(Box14, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs14(Text15, { color: theme.error, wrap: "wrap", children: [
1737
1830
  error.includes("OAuth access restrictions") ? "\u26A0\uFE0F " : "Error: ",
1738
1831
  error
1739
1832
  ] }) }),
1740
- isStarring ? /* @__PURE__ */ jsx15(Box14, { children: /* @__PURE__ */ jsxs14(Text15, { color: "yellow", children: [
1833
+ isStarring ? /* @__PURE__ */ jsx15(Box14, { children: /* @__PURE__ */ jsxs14(Text15, { color: theme.warning, children: [
1741
1834
  actionGerund,
1742
1835
  "..."
1743
1836
  ] }) }) : /* @__PURE__ */ jsxs14(Fragment7, { children: [
@@ -1788,8 +1881,10 @@ function UnstarModal({
1788
1881
  onConfirm,
1789
1882
  onCancel,
1790
1883
  isUnstarring = false,
1791
- error = null
1884
+ error = null,
1885
+ theme: themeProp
1792
1886
  }) {
1887
+ const { theme } = useTheme(themeProp?.name ?? "default");
1793
1888
  const [focusedButton, setFocusedButton] = useState15("cancel");
1794
1889
  useInput15((input, key) => {
1795
1890
  if (!visible) return;
@@ -1803,23 +1898,14 @@ function UnstarModal({
1803
1898
  setFocusedButton("unstar");
1804
1899
  }
1805
1900
  if (key.return || input === "y" || input === "Y") {
1806
- if (focusedButton === "unstar") {
1807
- onConfirm();
1808
- } else {
1809
- onCancel();
1810
- }
1811
- }
1812
- if (input === "n" || input === "N") {
1813
- onCancel();
1814
- }
1815
- if (input === "u" || input === "U") {
1816
- onConfirm();
1901
+ if (focusedButton === "unstar") onConfirm();
1902
+ else onCancel();
1817
1903
  }
1904
+ if (input === "n" || input === "N") onCancel();
1905
+ if (input === "u" || input === "U") onConfirm();
1818
1906
  });
1819
1907
  useEffect11(() => {
1820
- if (visible) {
1821
- setFocusedButton("cancel");
1822
- }
1908
+ if (visible) setFocusedButton("cancel");
1823
1909
  }, [visible]);
1824
1910
  if (!visible || !repo) return null;
1825
1911
  return /* @__PURE__ */ jsxs15(
@@ -1827,16 +1913,16 @@ function UnstarModal({
1827
1913
  {
1828
1914
  flexDirection: "column",
1829
1915
  borderStyle: "round",
1830
- borderColor: "yellow",
1916
+ borderColor: theme.warning,
1831
1917
  paddingX: 2,
1832
1918
  paddingY: 1,
1833
1919
  marginTop: 1,
1834
1920
  children: [
1835
- /* @__PURE__ */ jsx16(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx16(Text16, { bold: true, color: "yellow", children: "\u2B50 Unstar Repository" }) }),
1921
+ /* @__PURE__ */ jsx16(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx16(Text16, { bold: true, color: theme.warning, children: "\u2B50 Unstar Repository" }) }),
1836
1922
  /* @__PURE__ */ jsx16(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsxs15(Text16, { children: [
1837
1923
  "Are you sure you want to unstar",
1838
1924
  " ",
1839
- /* @__PURE__ */ jsx16(Text16, { bold: true, color: "cyan", children: repo.nameWithOwner }),
1925
+ /* @__PURE__ */ jsx16(Text16, { bold: true, color: theme.primary, children: repo.nameWithOwner }),
1840
1926
  "?"
1841
1927
  ] }) }),
1842
1928
  repo.description && /* @__PURE__ */ jsx16(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx16(Text16, { dimColor: true, wrap: "wrap", children: repo.description }) }),
@@ -1846,11 +1932,11 @@ function UnstarModal({
1846
1932
  " \u2022 Forks: ",
1847
1933
  repo.forkCount
1848
1934
  ] }) }),
1849
- error && /* @__PURE__ */ jsx16(Box15, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs15(Text16, { color: "red", wrap: "wrap", children: [
1935
+ error && /* @__PURE__ */ jsx16(Box15, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs15(Text16, { color: theme.error, wrap: "wrap", children: [
1850
1936
  error.includes("OAuth access restrictions") ? "\u26A0\uFE0F " : "Error: ",
1851
1937
  error
1852
1938
  ] }) }),
1853
- isUnstarring ? /* @__PURE__ */ jsx16(Box15, { children: /* @__PURE__ */ jsx16(Text16, { color: "yellow", children: "Unstarring..." }) }) : /* @__PURE__ */ jsxs15(Fragment8, { children: [
1939
+ isUnstarring ? /* @__PURE__ */ jsx16(Box15, { children: /* @__PURE__ */ jsx16(Text16, { color: theme.warning, children: "Unstarring..." }) }) : /* @__PURE__ */ jsxs15(Fragment8, { children: [
1854
1940
  /* @__PURE__ */ jsxs15(Box15, { gap: 2, children: [
1855
1941
  /* @__PURE__ */ jsx16(Box15, { children: /* @__PURE__ */ jsxs15(
1856
1942
  Text16,
@@ -1869,7 +1955,7 @@ function UnstarModal({
1869
1955
  Text16,
1870
1956
  {
1871
1957
  backgroundColor: focusedButton === "unstar" ? "yellow" : void 0,
1872
- color: focusedButton === "unstar" ? "black" : "yellow",
1958
+ color: focusedButton === "unstar" ? "black" : theme.warning,
1873
1959
  bold: focusedButton === "unstar",
1874
1960
  children: [
1875
1961
  " ",
@@ -1888,7 +1974,7 @@ function UnstarModal({
1888
1974
 
1889
1975
  // src/ui/components/repo/RepoRow.tsx
1890
1976
  import { Box as Box16, Text as Text17 } from "ink";
1891
- import chalk13 from "chalk";
1977
+ import chalk14 from "chalk";
1892
1978
  import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
1893
1979
  function RepoRow({
1894
1980
  repo,
@@ -1898,43 +1984,45 @@ function RepoRow({
1898
1984
  spacingLines,
1899
1985
  dim,
1900
1986
  forkTracking,
1901
- starsMode = false
1987
+ starsMode = false,
1988
+ theme: themeProp
1902
1989
  }) {
1990
+ const { theme, c } = useTheme(themeProp?.name ?? "default");
1903
1991
  const langName = repo.primaryLanguage?.name || "";
1904
1992
  const langColor = repo.primaryLanguage?.color || "#666666";
1905
1993
  const hasCommitData = repo.isFork && repo.parent && repo.defaultBranchRef && repo.parent.defaultBranchRef && repo.parent.defaultBranchRef.target?.history && repo.defaultBranchRef.target?.history;
1906
1994
  const commitsBehind = hasCommitData ? repo.parent.defaultBranchRef.target.history.totalCount - repo.defaultBranchRef.target.history.totalCount : 0;
1907
1995
  const showCommitsBehind = forkTracking && hasCommitData;
1908
1996
  let line1 = "";
1909
- const numColor = selected ? chalk13.cyan : chalk13.gray;
1910
- const nameColor = selected ? chalk13.cyan.bold : chalk13.white;
1997
+ const numColor = selected ? c.selected : c.muted;
1998
+ const nameColor = selected ? c.selected.bold : c.text;
1911
1999
  line1 += numColor(`${String(index).padStart(3, " ")}.`);
1912
2000
  if (repo.viewerHasStarred) {
1913
- line1 += chalk13.yellow(" \u2B50");
2001
+ line1 += c.warning(" \u2B50");
1914
2002
  }
1915
2003
  line1 += nameColor(` ${repo.nameWithOwner}`);
1916
2004
  if (repo.visibility === "INTERNAL") {
1917
- line1 += chalk13.magenta(" Internal");
2005
+ line1 += c.internal(" Internal");
1918
2006
  } else if (repo.visibility === "PRIVATE" || repo.isPrivate && !repo.visibility) {
1919
- line1 += chalk13.yellow(" Private");
2007
+ line1 += c.private(" Private");
1920
2008
  }
1921
2009
  if (starsMode && repo.owner && repo.owner.__typename === "Organization") {
1922
- line1 += chalk13.gray(" [org]");
2010
+ line1 += c.muted(" [org]");
1923
2011
  }
1924
- if (repo.isArchived) line1 += " " + chalk13.bgGray.whiteBright(" Archived ") + " ";
2012
+ if (repo.isArchived) line1 += " " + chalk14.bgGray.whiteBright(" Archived ") + " ";
1925
2013
  if (repo.isFork && repo.parent) {
1926
- line1 += chalk13.blue(` Fork of ${repo.parent.nameWithOwner}`);
2014
+ line1 += c.fork(` Fork of ${repo.parent.nameWithOwner}`);
1927
2015
  if (showCommitsBehind) {
1928
2016
  if (commitsBehind > 0) {
1929
- line1 += chalk13.yellow(` (${commitsBehind} behind)`);
2017
+ line1 += c.warning(` (${commitsBehind} behind)`);
1930
2018
  } else {
1931
- line1 += chalk13.green(` (0 behind)`);
2019
+ line1 += c.success(` (0 behind)`);
1932
2020
  }
1933
2021
  }
1934
2022
  }
1935
2023
  let line2 = " ";
1936
- const metaColor = selected ? chalk13.white : chalk13.gray;
1937
- if (langName) line2 += chalk13.hex(langColor)("\u25CF ") + metaColor(`${langName} `);
2024
+ const metaColor = selected ? c.text : c.muted;
2025
+ if (langName) line2 += chalk14.hex(langColor)("\u25CF ") + metaColor(`${langName} `);
1938
2026
  line2 += metaColor(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount} Updated ${formatDate(repo.updatedAt)}`);
1939
2027
  const line3 = repo.description ? ` ${truncate(repo.description, Math.max(30, maxWidth - 10))}` : null;
1940
2028
  let fullText = line1 + "\n" + line2;
@@ -1943,7 +2031,7 @@ function RepoRow({
1943
2031
  const spacingBelow = spacingLines - spacingAbove;
1944
2032
  return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", backgroundColor: selected ? "gray" : void 0, children: [
1945
2033
  spacingAbove > 0 && /* @__PURE__ */ jsx17(Box16, { height: spacingAbove, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) }),
1946
- /* @__PURE__ */ jsx17(Text17, { children: dim ? chalk13.dim(fullText) : fullText }),
2034
+ /* @__PURE__ */ jsx17(Text17, { children: dim ? chalk14.dim(fullText) : fullText }),
1947
2035
  spacingBelow > 0 && /* @__PURE__ */ jsx17(Box16, { height: spacingBelow, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) })
1948
2036
  ] });
1949
2037
  }
@@ -1955,64 +2043,53 @@ import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
1955
2043
 
1956
2044
  // src/ui/components/repo/RepoListHeader.tsx
1957
2045
  import { Box as Box18, Text as Text19 } from "ink";
1958
- import { Fragment as Fragment9, jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
2046
+ import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
1959
2047
  function RepoListHeader({
1960
2048
  ownerContext,
1961
2049
  sortKey,
1962
2050
  sortDir,
1963
2051
  forkTracking,
1964
2052
  filter,
1965
- searchActive,
1966
- searchLoading,
2053
+ filterActive,
1967
2054
  visibilityFilter = "all",
1968
2055
  archiveFilter = "all",
1969
2056
  isEnterprise = false,
1970
- starsMode = false
2057
+ starsMode = false,
2058
+ theme: themeProp
1971
2059
  }) {
1972
- const contextLabel = ownerContext === "personal" ? "Personal Account" : ownerContext?.type === "organization" ? `Organization: ${ownerContext.name ?? ownerContext.login}` : "";
2060
+ const { theme } = useTheme(themeProp?.name ?? "default");
2061
+ const contextLabel = ownerContext === "personal" ? "Personal Account" : ownerContext?.type === "organization" ? `Organisation: ${ownerContext.name ?? ownerContext.login}` : "";
1973
2062
  const visibilityLabel = visibilityFilter === "public" ? "Public" : visibilityFilter === "private" ? isEnterprise ? "Private/Internal" : "Private" : visibilityFilter === "internal" ? "Internal" : "";
1974
2063
  return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", gap: 2, marginBottom: 1, children: [
1975
2064
  contextLabel && /* @__PURE__ */ jsx19(Text19, { children: contextLabel }),
1976
- starsMode && /* @__PURE__ */ jsx19(Text19, { color: "yellow", bold: true, children: "\u2B50 Stars Mode" }),
1977
- /* @__PURE__ */ jsxs18(Text19, { color: "gray", dimColor: true, children: [
2065
+ starsMode && /* @__PURE__ */ jsx19(Text19, { color: theme.warning, bold: true, children: "\u2B50 Stars Mode" }),
2066
+ /* @__PURE__ */ jsxs18(Text19, { color: theme.muted, dimColor: true, children: [
1978
2067
  "Sort: ",
1979
- sortKey,
1980
- " ",
1981
- sortDir === "asc" ? "\u2191" : "\u2193"
2068
+ filterActive ? "relevance" : `${sortKey} ${sortDir === "asc" ? "\u2191" : "\u2193"}`
1982
2069
  ] }),
1983
- /* @__PURE__ */ jsxs18(Text19, { color: "gray", dimColor: true, children: [
2070
+ /* @__PURE__ */ jsxs18(Text19, { color: theme.muted, dimColor: true, children: [
1984
2071
  "Fork Status - Commits Behind: ",
1985
2072
  forkTracking ? "ON" : "OFF"
1986
2073
  ] }),
1987
- !!visibilityLabel && !starsMode && /* @__PURE__ */ jsxs18(Text19, { color: "yellow", children: [
2074
+ !!visibilityLabel && !starsMode && /* @__PURE__ */ jsxs18(Text19, { color: theme.warning, children: [
1988
2075
  "Visibility: ",
1989
2076
  visibilityLabel
1990
2077
  ] }),
1991
- archiveFilter !== "all" && /* @__PURE__ */ jsxs18(Text19, { color: "cyan", children: [
2078
+ archiveFilter !== "all" && /* @__PURE__ */ jsxs18(Text19, { color: theme.primary, children: [
1992
2079
  "Archive: ",
1993
2080
  archiveFilter === "archived" ? "Archived" : "Unarchived"
1994
2081
  ] }),
1995
- filter && !searchActive && /* @__PURE__ */ jsxs18(Text19, { color: "cyan", children: [
1996
- 'Filter: "',
1997
- filter,
2082
+ (filterActive || starsMode && filter.trim().length > 0) && /* @__PURE__ */ jsxs18(Text19, { color: theme.primary, children: [
2083
+ starsMode ? "Filter" : "Search",
2084
+ ': "',
2085
+ filter.trim(),
1998
2086
  '"'
1999
- ] }),
2000
- searchActive && /* @__PURE__ */ jsxs18(Fragment9, { children: [
2001
- /* @__PURE__ */ jsxs18(Text19, { color: "cyan", children: [
2002
- 'Search: "',
2003
- filter.trim(),
2004
- '"'
2005
- ] }),
2006
- searchLoading && /* @__PURE__ */ jsx19(Box18, { marginLeft: 1, children: /* @__PURE__ */ jsxs18(Text19, { color: "cyan", children: [
2007
- /* @__PURE__ */ jsx19(SlowSpinner, {}),
2008
- " Searching\u2026"
2009
- ] }) })
2010
2087
  ] })
2011
2088
  ] });
2012
2089
  }
2013
2090
 
2014
2091
  // src/ui/views/RepoList.tsx
2015
- import { Fragment as Fragment10, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
2092
+ import { Fragment as Fragment9, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
2016
2093
  var getPageSize = () => {
2017
2094
  const envValue = process.env.REPOS_PER_FETCH;
2018
2095
  if (envValue) {
@@ -2027,7 +2104,7 @@ var PAGE_SIZE = getPageSize();
2027
2104
  function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextChange, initialOrgSlug: initialOrgSlug2 }) {
2028
2105
  const { exit } = useApp();
2029
2106
  const { stdout } = useStdout();
2030
- const client = useMemo(() => makeClient(token), [token]);
2107
+ const client = useMemo2(() => makeClient(token), [token]);
2031
2108
  const [debugMessages, setDebugMessages] = useState16([]);
2032
2109
  const addDebugMessage = useCallback((msg) => {
2033
2110
  if (process.env.GH_MANAGER_DEBUG === "1") {
@@ -2066,16 +2143,15 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2066
2143
  const [prevRestRateLimit, setPrevRestRateLimit] = useState16(void 0);
2067
2144
  const [density, setDensity] = useState16(2);
2068
2145
  const [prefsLoaded, setPrefsLoaded] = useState16(false);
2146
+ const [themeName, setThemeName] = useState16("default");
2147
+ const [themeToast, setThemeToast] = useState16(null);
2148
+ const themeToastTimerRef = useRef(null);
2149
+ const { theme, c: tc } = useTheme(themeName);
2069
2150
  const [ownerContext, setOwnerContext] = useState16("personal");
2070
2151
  const [ownerAffiliations, setOwnerAffiliations] = useState16(["OWNER"]);
2071
2152
  const [orgSwitcherOpen, setOrgSwitcherOpen] = useState16(false);
2072
2153
  const [operationCount, setOperationCount] = useState16(0);
2073
2154
  const [showSponsorReminder, setShowSponsorReminder] = useState16(false);
2074
- const [searchItems, setSearchItems] = useState16([]);
2075
- const [searchEndCursor, setSearchEndCursor] = useState16(null);
2076
- const [searchHasNextPage, setSearchHasNextPage] = useState16(false);
2077
- const [searchTotalCount, setSearchTotalCount] = useState16(0);
2078
- const [searchLoading, setSearchLoading] = useState16(false);
2079
2155
  const [deleteMode, setDeleteMode] = useState16(false);
2080
2156
  const [deleteTarget, setDeleteTarget] = useState16(null);
2081
2157
  const [deleteCode, setDeleteCode] = useState16("");
@@ -2269,7 +2345,6 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2269
2345
  return r;
2270
2346
  };
2271
2347
  setItems((prev) => prev.map(updateRepo));
2272
- setSearchItems((prev) => prev.map(updateRepo));
2273
2348
  trackSuccessfulOperation();
2274
2349
  setStarMode(false);
2275
2350
  setStarTarget(null);
@@ -2327,7 +2402,6 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2327
2402
  return r;
2328
2403
  };
2329
2404
  setItems((prev) => prev.map(updateSyncedRepo));
2330
- setSearchItems((prev) => prev.map(updateSyncedRepo));
2331
2405
  closeSyncModal();
2332
2406
  } catch (e) {
2333
2407
  setSyncing(false);
@@ -2348,7 +2422,6 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2348
2422
  await updateCacheAfterArchive(token, id, !isArchived);
2349
2423
  const updateRepo = (r) => r.id === id ? { ...r, isArchived: !isArchived } : r;
2350
2424
  setItems((prev) => prev.map(updateRepo));
2351
- setSearchItems((prev) => prev.map(updateRepo));
2352
2425
  trackSuccessfulOperation();
2353
2426
  closeArchiveModal();
2354
2427
  } catch (e) {
@@ -2366,7 +2439,6 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2366
2439
  await updateCacheAfterRename(token, id, newName, newNameWithOwner);
2367
2440
  const updateRepo = (r) => r.id === id ? { ...r, name: newName, nameWithOwner: newNameWithOwner } : r;
2368
2441
  setItems((prev) => prev.map(updateRepo));
2369
- setSearchItems((prev) => prev.map(updateRepo));
2370
2442
  closeRenameModal();
2371
2443
  } catch (error2) {
2372
2444
  throw error2;
@@ -2401,9 +2473,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2401
2473
  }
2402
2474
  useEffect12(() => {
2403
2475
  return () => {
2404
- if (copyToastTimerRef.current) {
2405
- clearTimeout(copyToastTimerRef.current);
2406
- }
2476
+ if (copyToastTimerRef.current) clearTimeout(copyToastTimerRef.current);
2477
+ if (themeToastTimerRef.current) clearTimeout(themeToastTimerRef.current);
2407
2478
  };
2408
2479
  }, []);
2409
2480
  async function handleVisibilityChange(newVisibility) {
@@ -2416,18 +2487,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2416
2487
  const shouldRemove = visibilityFilter === "public" && newVisibility !== "PUBLIC" || visibilityFilter === "private" && newVisibility !== "PRIVATE" && newVisibility !== "INTERNAL";
2417
2488
  if (shouldRemove) {
2418
2489
  setItems((prev) => prev.filter((r) => r.id !== id));
2419
- setSearchItems((prev) => prev.filter((r) => r.id !== id));
2420
2490
  setTotalCount((c) => Math.max(0, c - 1));
2421
- if (searchActive) {
2422
- setSearchTotalCount((c) => Math.max(0, c - 1));
2423
- }
2424
- const currentItemsLength = searchActive ? searchItems.length : items.length;
2425
- setCursor((c) => Math.max(0, Math.min(c, currentItemsLength - 2)));
2491
+ setCursor((c) => Math.max(0, Math.min(c, items.length - 2)));
2426
2492
  } else {
2427
2493
  const isPrivate = newVisibility === "PRIVATE";
2428
2494
  const updateRepo = (r) => r.id === id ? { ...r, visibility: newVisibility, isPrivate } : r;
2429
2495
  setItems((prev) => prev.map(updateRepo));
2430
- setSearchItems((prev) => prev.map(updateRepo));
2431
2496
  }
2432
2497
  closeChangeVisibilityModal();
2433
2498
  } catch (e) {
@@ -2440,9 +2505,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2440
2505
  setCursor(0);
2441
2506
  setOrgSwitcherOpen(false);
2442
2507
  setItems([]);
2443
- setSearchItems([]);
2444
2508
  setTotalCount(0);
2445
- setSearchTotalCount(0);
2446
2509
  setFilter("");
2447
2510
  setFilterMode(false);
2448
2511
  setVisibilityFilter("all");
@@ -2489,11 +2552,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2489
2552
  const targetId = deleteTarget.id;
2490
2553
  await updateCacheAfterDelete(token, targetId);
2491
2554
  setItems((prev) => prev.filter((r) => r.id !== targetId));
2492
- setSearchItems((prev) => prev.filter((r) => r.id !== targetId));
2493
2555
  setTotalCount((c) => Math.max(0, c - 1));
2494
- if (searchActive) {
2495
- setSearchTotalCount((c) => Math.max(0, c - 1));
2496
- }
2497
2556
  trackSuccessfulOperation();
2498
2557
  setDeleteMode(false);
2499
2558
  setDeleteTarget(null);
@@ -2616,64 +2675,6 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2616
2675
  setLoadingMore(false);
2617
2676
  }
2618
2677
  };
2619
- const fetchSearchPage = async (after, reset = false, policy, searchQuery) => {
2620
- const query = searchQuery ?? filter;
2621
- addDebugMessage(`[fetchSearchPage] query="${query}", searchQuery="${searchQuery}", filter="${filter}"`);
2622
- if (!viewerLogin) {
2623
- addDebugMessage("\u274C No viewerLogin for search");
2624
- return;
2625
- }
2626
- setSearchLoading(true);
2627
- try {
2628
- const orderBy = { field: sortFieldMap[sortKey], direction: sortDir.toUpperCase() };
2629
- const orgLogin = ownerContext !== "personal" ? ownerContext.login : void 0;
2630
- addDebugMessage(`[fetchSearchPage] Calling API with viewer="${viewerLogin}", orgLogin="${orgLogin || "none"}", query="${query.trim()}"`);
2631
- const page = await searchRepositoriesUnified(
2632
- token,
2633
- viewerLogin,
2634
- query.trim(),
2635
- PAGE_SIZE,
2636
- after ?? null,
2637
- orderBy.field,
2638
- orderBy.direction,
2639
- forkTracking,
2640
- policy ?? (after ? "network-only" : "cache-first"),
2641
- orgLogin
2642
- );
2643
- addDebugMessage(`[fetchSearchPage] API returned ${page.nodes.length} results, totalCount=${page.totalCount}`);
2644
- if (page.nodes.length > 0) {
2645
- addDebugMessage(`[fetchSearchPage] First result: ${page.nodes[0].name}`);
2646
- }
2647
- setSearchItems((prev) => reset || !after ? page.nodes : [...prev, ...page.nodes]);
2648
- setSearchEndCursor(page.endCursor);
2649
- setSearchHasNextPage(page.hasNextPage);
2650
- setSearchTotalCount(page.totalCount);
2651
- if (!after) {
2652
- try {
2653
- const key = makeSearchKey({
2654
- viewer: viewerLogin || "unknown",
2655
- q: query.trim(),
2656
- sortKey,
2657
- sortDir,
2658
- pageSize: PAGE_SIZE,
2659
- forkTracking
2660
- });
2661
- markFetched(key);
2662
- } catch {
2663
- }
2664
- }
2665
- setError(null);
2666
- } catch (e) {
2667
- const errorMsg = `Failed to search: ${e.message || e}`;
2668
- addDebugMessage(`\u274C Search error: ${e.message || e}`);
2669
- if (e.stack) {
2670
- addDebugMessage(`Stack: ${e.stack.split("\n")[0]}`);
2671
- }
2672
- setError(errorMsg);
2673
- } finally {
2674
- setSearchLoading(false);
2675
- }
2676
- };
2677
2678
  useEffect12(() => {
2678
2679
  const ui = getUIPrefs();
2679
2680
  if (ui.density !== void 0) setDensity(ui.density);
@@ -2690,6 +2691,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2690
2691
  if (ui.archiveFilter && ["all", "unarchived", "archived"].includes(ui.archiveFilter)) {
2691
2692
  setArchiveFilter(ui.archiveFilter);
2692
2693
  }
2694
+ if (ui.theme && ["default", "ocean", "forest", "monochrome"].includes(ui.theme)) {
2695
+ setThemeName(ui.theme);
2696
+ }
2693
2697
  if (ui.ownerContext) {
2694
2698
  setOwnerContext(ui.ownerContext);
2695
2699
  if (onOrgContextChange) {
@@ -2727,64 +2731,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2727
2731
  setCursor(0);
2728
2732
  fetchPage(null, true, false, void 0, policy);
2729
2733
  }, [client, prefsLoaded, ownerContext, ownerAffiliations]);
2730
- useEffect12(() => {
2731
- if (searchActive) {
2732
- if (!searchLoading && filter.trim().length >= 3) {
2733
- let policy = "cache-first";
2734
- try {
2735
- const key = makeSearchKey({
2736
- viewer: viewerLogin || "unknown",
2737
- q: filter.trim(),
2738
- sortKey,
2739
- sortDir,
2740
- pageSize: PAGE_SIZE,
2741
- forkTracking
2742
- });
2743
- policy = isFresh(key, 90 * 1e3) ? "cache-first" : "network-only";
2744
- } catch {
2745
- }
2746
- fetchSearchPage(null, true, policy);
2747
- }
2748
- }
2749
- }, [sortKey, sortDir]);
2750
2734
  useEffect12(() => {
2751
2735
  if (visibilityFilter !== "all" || previousVisibilityFilter.current && previousVisibilityFilter.current !== visibilityFilter) {
2752
- if (!searchActive) {
2753
- if (items.length > 0) {
2754
- let policy = "network-only";
2755
- const orgLogin = ownerContext !== "personal" ? ownerContext.login : void 0;
2756
- fetchPage(null, true, true, void 0, policy);
2757
- }
2758
- } else {
2759
- if (!searchLoading && filter.trim().length >= 3) {
2760
- let policy = "network-only";
2761
- fetchSearchPage(null, true, policy);
2762
- }
2736
+ if (items.length > 0) {
2737
+ fetchPage(null, true, true, void 0, "network-only");
2763
2738
  }
2764
2739
  }
2765
2740
  previousVisibilityFilter.current = visibilityFilter;
2766
2741
  }, [visibilityFilter]);
2767
- useEffect12(() => {
2768
- if (viewerLogin && searchActive && !searchLoading && searchItems.length === 0) {
2769
- let policy = "cache-first";
2770
- try {
2771
- const orgLogin = ownerContext !== "personal" ? ownerContext.login : void 0;
2772
- const key = makeSearchKey({
2773
- viewer: viewerLogin || "unknown",
2774
- q: filter.trim(),
2775
- sortKey,
2776
- sortDir,
2777
- pageSize: PAGE_SIZE,
2778
- forkTracking,
2779
- ownerContext: orgLogin ? `org:${orgLogin}` : "personal",
2780
- affiliations: ownerAffiliations.join(",")
2781
- });
2782
- policy = isFresh(key, 90 * 1e3) ? "cache-first" : "network-only";
2783
- } catch {
2784
- }
2785
- fetchSearchPage(null, true, policy);
2786
- }
2787
- }, [viewerLogin]);
2788
2742
  useInput16((input, key) => {
2789
2743
  if (error) {
2790
2744
  if (input && input.toUpperCase() === "Q") {
@@ -2969,15 +2923,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2969
2923
  if (key.escape) {
2970
2924
  setFilterMode(false);
2971
2925
  setFilter("");
2972
- setSearchItems([]);
2973
- setSearchEndCursor(null);
2974
- setSearchHasNextPage(false);
2975
- setSearchTotalCount(0);
2976
2926
  setCursor(0);
2977
2927
  addDebugMessage("[ESC] Cleared search and returned to normal listing");
2978
2928
  return;
2979
2929
  }
2980
- if (key.downArrow && (searchActive || starsMode && filter.trim().length > 0) && visibleItems.length > 0) {
2930
+ if (key.downArrow && (filterActive || starsMode && filter.trim().length > 0) && visibleItems.length > 0) {
2981
2931
  setFilterMode(false);
2982
2932
  setCursor(0);
2983
2933
  addDebugMessage("[DOWN] Exited filter mode and selected first result");
@@ -2985,14 +2935,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2985
2935
  }
2986
2936
  return;
2987
2937
  }
2988
- if (key.escape && (searchActive || starsMode && filter.trim().length > 0)) {
2938
+ if (key.escape && (filterActive || starsMode && filter.trim().length > 0)) {
2989
2939
  setFilter("");
2990
- if (!starsMode) {
2991
- setSearchItems([]);
2992
- setSearchEndCursor(null);
2993
- setSearchHasNextPage(false);
2994
- setSearchTotalCount(0);
2995
- }
2996
2940
  setCursor(0);
2997
2941
  addDebugMessage("[ESC] Cleared filter and returned to normal listing");
2998
2942
  return;
@@ -3142,11 +3086,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3142
3086
  setOrgSwitcherOpen(true);
3143
3087
  return;
3144
3088
  }
3145
- if (input && input.toUpperCase() === "S" && !key.shift && !key.ctrl) {
3089
+ if (input && input.toUpperCase() === "S" && !key.shift && !key.ctrl && !filterActive) {
3146
3090
  setSortMode(true);
3147
3091
  return;
3148
3092
  }
3149
- if (input && input.toUpperCase() === "D") {
3093
+ if (input && input.toUpperCase() === "D" && !filterActive) {
3150
3094
  setSortDirectionMode(true);
3151
3095
  return;
3152
3096
  }
@@ -3158,16 +3102,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3158
3102
  setFilterMode(false);
3159
3103
  if (newStarsMode) {
3160
3104
  setVisibilityFilter("all");
3161
- setSearchItems([]);
3162
- setSearchEndCursor(null);
3163
- setSearchHasNextPage(false);
3164
- setSearchTotalCount(0);
3165
3105
  fetchStarredRepositories(null, true);
3166
- } else {
3167
- setSearchItems([]);
3168
- setSearchEndCursor(null);
3169
- setSearchHasNextPage(false);
3170
- setSearchTotalCount(0);
3171
3106
  }
3172
3107
  return;
3173
3108
  }
@@ -3196,7 +3131,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3196
3131
  if (repo) openInBrowser(`https://github.com/${repo.nameWithOwner}`);
3197
3132
  return;
3198
3133
  }
3199
- if (input && input.toUpperCase() === "T") {
3134
+ if (key.shift && input === "T") {
3135
+ const next = nextTheme(themeName);
3136
+ setThemeName(next);
3137
+ storeUIPrefs({ theme: next });
3138
+ if (themeToastTimerRef.current) clearTimeout(themeToastTimerRef.current);
3139
+ setThemeToast(`Theme: ${getTheme(next).label}`);
3140
+ themeToastTimerRef.current = setTimeout(() => setThemeToast(null), 2500);
3141
+ return;
3142
+ }
3143
+ if (input && input.toUpperCase() === "T" && !key.shift) {
3200
3144
  setDensity((d) => {
3201
3145
  const next = (d + 1) % 3;
3202
3146
  storeUIPrefs({ density: next });
@@ -3215,7 +3159,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3215
3159
  return;
3216
3160
  }
3217
3161
  });
3218
- const filtered = useMemo(() => {
3162
+ const filtered = useMemo2(() => {
3219
3163
  let result = items;
3220
3164
  if (visibilityFilter === "private") {
3221
3165
  result = result.filter((r) => r.visibility === "PRIVATE" || r.visibility === "INTERNAL");
@@ -3225,15 +3169,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3225
3169
  } else if (archiveFilter === "unarchived") {
3226
3170
  result = result.filter((r) => !r.isArchived);
3227
3171
  }
3228
- const q = filter.trim().toLowerCase();
3229
- if (q) {
3230
- result = result.filter(
3231
- (r) => r.nameWithOwner.toLowerCase().includes(q) || (r.description ? r.description.toLowerCase().includes(q) : false)
3232
- );
3233
- }
3234
3172
  return result;
3235
- }, [items, filter, visibilityFilter, archiveFilter]);
3236
- const filteredAndSorted = useMemo(() => {
3173
+ }, [items, visibilityFilter, archiveFilter]);
3174
+ const filteredAndSorted = useMemo2(() => {
3237
3175
  const arr = [...filtered];
3238
3176
  const dir = sortDir === "asc" ? 1 : -1;
3239
3177
  arr.sort((a, b) => {
@@ -3253,22 +3191,20 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3253
3191
  });
3254
3192
  return arr;
3255
3193
  }, [filtered, sortKey, sortDir]);
3256
- const searchActive = !starsMode && filter.trim().length >= 3;
3257
- const filteredSearchItems = useMemo(() => {
3258
- let result = searchItems;
3194
+ const filterActive = !starsMode && filter.trim().length > 0;
3195
+ const fuzzyItems = useMemo2(() => {
3196
+ if (!filterActive) return [];
3197
+ let results = fuzzySearch(items, filter);
3259
3198
  if (visibilityFilter === "private") {
3260
- result = result.filter((r) => r.visibility === "PRIVATE" || r.visibility === "INTERNAL");
3199
+ results = results.filter((r) => r.visibility === "PRIVATE" || r.visibility === "INTERNAL");
3261
3200
  } else if (visibilityFilter === "public") {
3262
- result = result.filter((r) => r.visibility === "PUBLIC");
3263
- }
3264
- if (archiveFilter === "archived") {
3265
- result = result.filter((r) => r.isArchived);
3266
- } else if (archiveFilter === "unarchived") {
3267
- result = result.filter((r) => !r.isArchived);
3201
+ results = results.filter((r) => r.visibility === "PUBLIC");
3268
3202
  }
3269
- return result;
3270
- }, [searchItems, visibilityFilter, archiveFilter]);
3271
- const filteredStarredItems = useMemo(() => {
3203
+ if (archiveFilter === "archived") results = results.filter((r) => r.isArchived);
3204
+ else if (archiveFilter === "unarchived") results = results.filter((r) => !r.isArchived);
3205
+ return results;
3206
+ }, [filterActive, items, filter, visibilityFilter, archiveFilter]);
3207
+ const filteredStarredItems = useMemo2(() => {
3272
3208
  let result = starredItems;
3273
3209
  if (filter && filter.trim().length > 0) {
3274
3210
  const lowerFilter = filter.toLowerCase();
@@ -3283,44 +3219,33 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3283
3219
  }
3284
3220
  return result;
3285
3221
  }, [starredItems, filter, archiveFilter]);
3286
- const visibleItems = starsMode ? filteredStarredItems : searchActive ? filteredSearchItems : filteredAndSorted;
3287
- useEffect12(() => {
3288
- if (searchActive) {
3289
- addDebugMessage(`[State] searchActive=${searchActive}, searchItems=${searchItems.length}, visibleItems=${visibleItems.length}, filter="${filter}"`);
3290
- }
3291
- }, [searchActive, searchItems.length, visibleItems.length, filter]);
3222
+ const visibleItems = starsMode ? filteredStarredItems : filterActive ? fuzzyItems : filteredAndSorted;
3292
3223
  useEffect12(() => {
3293
3224
  setCursor((c) => Math.min(c, Math.max(0, visibleItems.length - 1)));
3294
- }, [searchActive, searchItems.length, items.length, visibleItems.length]);
3225
+ }, [filterActive, items.length, visibleItems.length]);
3295
3226
  const headerHeight = 2;
3296
3227
  const footerHeight = 4;
3297
3228
  const containerPadding = 2;
3298
3229
  const contentHeight = Math.max(1, availableHeight - headerHeight - footerHeight - containerPadding);
3299
3230
  const listHeight = Math.max(1, contentHeight - (filterMode ? 2 : 0) - 2);
3300
3231
  const spacingLines = density;
3301
- const windowed = useMemo(
3232
+ const windowed = useMemo2(
3302
3233
  () => computeWindow(visibleItems, cursor, listHeight, spacingLines),
3303
3234
  [visibleItems, cursor, listHeight, spacingLines]
3304
3235
  );
3305
3236
  useEffect12(() => {
3306
- const prefetchThreshold = Math.floor(visibleItems.length * 0.8);
3307
- const nearEnd = visibleItems.length > 0 && cursor >= prefetchThreshold;
3308
- const rawItemsLength = starsMode ? starredItems.length : searchActive ? searchItems.length : items.length;
3237
+ const rawItemsLength = starsMode ? starredItems.length : items.length;
3309
3238
  const filterDrainedPage = visibleItems.length === 0 && archiveFilter !== "all" && rawItemsLength > 0;
3310
3239
  if (starsMode) {
3311
3240
  if (!starredLoading && starredHasNextPage) {
3312
3241
  fetchStarredRepositories(starredEndCursor);
3313
3242
  }
3314
- } else if (searchActive) {
3315
- if (!searchLoading && searchHasNextPage && (nearEnd || filterDrainedPage)) {
3316
- fetchSearchPage(searchEndCursor);
3317
- }
3318
3243
  } else {
3319
3244
  if (!loading && !loadingMore && hasNextPage) {
3320
3245
  fetchPage(endCursor);
3321
3246
  }
3322
3247
  }
3323
- }, [cursor, visibleItems.length, archiveFilter, items.length, starredItems.length, searchItems.length, starsMode, starredLoading, starredHasNextPage, starredEndCursor, searchActive, searchLoading, searchHasNextPage, searchEndCursor, loading, loadingMore, hasNextPage, endCursor]);
3248
+ }, [visibleItems.length, archiveFilter, items.length, starredItems.length, starsMode, starredLoading, starredHasNextPage, starredEndCursor, loading, loadingMore, hasNextPage, endCursor]);
3324
3249
  function openInBrowser(url) {
3325
3250
  const platform = process.platform;
3326
3251
  const cmd = platform === "darwin" ? `open "${url}"` : platform === "win32" ? `start "" "${url}"` : `xdg-open "${url}"`;
@@ -3328,35 +3253,35 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3328
3253
  }
3329
3254
  const lowRate = rateLimit && rateLimit.remaining <= Math.ceil(rateLimit.limit * 0.1) || restRateLimit && restRateLimit.core.remaining <= Math.ceil(restRateLimit.core.limit * 0.1);
3330
3255
  const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || archiveFilterMode || sortMode || sortDirectionMode || changeVisibilityMode || copyUrlMode || renameMode;
3331
- const headerBar = useMemo(() => /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: [
3256
+ const headerBar = useMemo2(() => /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: [
3332
3257
  /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", gap: 1, children: [
3333
- /* @__PURE__ */ jsxs19(Text20, { color: "cyan", bold: !modalOpen, dimColor: modalOpen, children: [
3258
+ /* @__PURE__ */ jsxs19(Text20, { color: theme.primary, bold: !modalOpen, dimColor: modalOpen, children: [
3334
3259
  " ",
3335
3260
  ownerContext === "personal" ? "Personal" : ownerContext.name || ownerContext.login,
3336
3261
  ownerContext !== "personal" && isEnterpriseOrg && " (ENT)"
3337
3262
  ] }),
3338
- /* @__PURE__ */ jsx20(Text20, { bold: true, color: modalOpen ? "gray" : void 0, dimColor: modalOpen ? true : void 0, children: "Repositories" }),
3339
- /* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
3263
+ /* @__PURE__ */ jsx20(Text20, { bold: true, color: modalOpen ? theme.muted : void 0, dimColor: modalOpen ? true : void 0, children: "Repositories" }),
3264
+ /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, children: [
3340
3265
  "(",
3341
3266
  visibleItems.length,
3342
3267
  "/",
3343
- searchActive ? searchTotalCount : totalCount,
3268
+ totalCount,
3344
3269
  ")"
3345
3270
  ] }),
3346
- loadingMore && hasNextPage && !starsMode && !searchActive && totalCount > 0 && /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: ` \xB7 loading ${items.length}/${totalCount}` }),
3347
- (loading || searchLoading || loadingMore) && /* @__PURE__ */ jsx20(Box19, { width: 2, flexShrink: 0, flexGrow: 0, marginLeft: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "yellow", children: /* @__PURE__ */ jsx20(SlowSpinner, {}) }) })
3271
+ loadingMore && hasNextPage && !starsMode && totalCount > 0 && /* @__PURE__ */ jsx20(Text20, { color: theme.primary, children: ` \xB7 loading ${items.length}/${totalCount}` }),
3272
+ (loading || loadingMore) && /* @__PURE__ */ jsx20(Box19, { width: 2, flexShrink: 0, flexGrow: 0, marginLeft: 1, children: /* @__PURE__ */ jsx20(Text20, { color: theme.warning, children: /* @__PURE__ */ jsx20(SlowSpinner, {}) }) })
3348
3273
  ] }),
3349
- (rateLimit || restRateLimit) && /* @__PURE__ */ jsxs19(Text20, { color: lowRate ? "yellow" : "gray", children: [
3274
+ (rateLimit || restRateLimit) && /* @__PURE__ */ jsxs19(Text20, { color: lowRate ? theme.warning : theme.muted, children: [
3350
3275
  "GraphQL: ",
3351
3276
  rateLimit ? `${rateLimit.remaining}/${rateLimit.limit}` : "---/---",
3352
- prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */ jsx20(Text20, { color: rateLimit.remaining < prevRateLimit ? "red" : "green", children: ` (${rateLimit.remaining - prevRateLimit > 0 ? "+" : ""}${rateLimit.remaining - prevRateLimit})` }),
3277
+ prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */ jsx20(Text20, { color: rateLimit.remaining < prevRateLimit ? theme.error : theme.success, children: ` (${rateLimit.remaining - prevRateLimit > 0 ? "+" : ""}${rateLimit.remaining - prevRateLimit})` }),
3353
3278
  " | ",
3354
3279
  "REST: ",
3355
3280
  restRateLimit ? `${restRateLimit.core.remaining}/${restRateLimit.core.limit}` : "---/---",
3356
- 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})` }),
3281
+ prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */ jsx20(Text20, { color: restRateLimit.core.remaining < prevRestRateLimit ? theme.error : theme.success, children: ` (${restRateLimit.core.remaining - prevRestRateLimit > 0 ? "+" : ""}${restRateLimit.core.remaining - prevRestRateLimit})` }),
3357
3282
  " "
3358
3283
  ] })
3359
- ] }), [visibleItems.length, searchActive, searchTotalCount, totalCount, loading, searchLoading, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg, restRateLimit, prevRestRateLimit]);
3284
+ ] }), [visibleItems.length, totalCount, loading, loadingMore, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg, restRateLimit, prevRestRateLimit, starsMode, hasNextPage, items.length, theme]);
3360
3285
  if (error) {
3361
3286
  return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: availableHeight, children: [
3362
3287
  /* @__PURE__ */ jsx20(Box19, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", gap: 1, children: [
@@ -3393,7 +3318,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3393
3318
  /* @__PURE__ */ jsx20(Text20, { color: "gray", children: "Your support helps craft more open-source tools" }),
3394
3319
  /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: "\u{1F496} github.com/sponsors/wiiiimm" })
3395
3320
  ] }) }) }),
3396
- /* @__PURE__ */ jsx20(Box19, { borderStyle: "single", borderColor: modalOpen ? "gray" : "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: deleteMode && deleteTarget ? (
3321
+ /* @__PURE__ */ jsx20(Box19, { borderStyle: "single", borderColor: modalOpen ? theme.muted : theme.warning, paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: deleteMode && deleteTarget ? (
3397
3322
  // Centered modal; hide list content while modal is open
3398
3323
  /* @__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: [
3399
3324
  /* @__PURE__ */ jsx20(Text20, { bold: true, children: "Delete Confirmation" }),
@@ -3403,14 +3328,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3403
3328
  const langName = deleteTarget.primaryLanguage?.name || "";
3404
3329
  const langColor = deleteTarget.primaryLanguage?.color || "#666666";
3405
3330
  let line1 = "";
3406
- line1 += chalk14.white(deleteTarget.nameWithOwner);
3407
- if (deleteTarget.isPrivate) line1 += chalk14.yellow(" Private");
3408
- if (deleteTarget.isArchived) line1 += chalk14.gray.dim(" Archived");
3409
- if (deleteTarget.isFork && deleteTarget.parent) line1 += chalk14.blue(` Fork of ${deleteTarget.parent.nameWithOwner}`);
3331
+ line1 += tc.text(deleteTarget.nameWithOwner);
3332
+ if (deleteTarget.isPrivate) line1 += tc.private(" Private");
3333
+ if (deleteTarget.isArchived) line1 += tc.archived.dim(" Archived");
3334
+ if (deleteTarget.isFork && deleteTarget.parent) line1 += tc.fork(` Fork of ${deleteTarget.parent.nameWithOwner}`);
3410
3335
  let line2 = "";
3411
- if (langName) line2 += chalk14.hex(langColor)("\u25CF ") + chalk14.gray(`${langName} `);
3412
- line2 += chalk14.gray(`\u2605 ${deleteTarget.stargazerCount} \u2442 ${deleteTarget.forkCount} Updated ${formatDate(deleteTarget.updatedAt)}`);
3413
- return /* @__PURE__ */ jsxs19(Fragment10, { children: [
3336
+ if (langName) line2 += chalk15.hex(langColor)("\u25CF ") + tc.muted(`${langName} `);
3337
+ line2 += tc.muted(`\u2605 ${deleteTarget.stargazerCount} \u2442 ${deleteTarget.forkCount} Updated ${formatDate(deleteTarget.updatedAt)}`);
3338
+ return /* @__PURE__ */ jsxs19(Fragment9, { children: [
3414
3339
  /* @__PURE__ */ jsx20(Text20, { children: line1 }),
3415
3340
  /* @__PURE__ */ jsx20(Text20, { children: line2 })
3416
3341
  ] });
@@ -3462,7 +3387,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3462
3387
  alignItems: "center",
3463
3388
  justifyContent: "center",
3464
3389
  flexDirection: "column",
3465
- children: /* @__PURE__ */ jsx20(Text20, { children: confirmFocus === "delete" ? chalk14.bgRed.white.bold(" Delete ") : chalk14.red.bold("Delete") })
3390
+ children: /* @__PURE__ */ jsx20(Text20, { children: confirmFocus === "delete" ? chalk15.bgRed.white.bold(" Delete ") : tc.error.bold("Delete") })
3466
3391
  }
3467
3392
  ),
3468
3393
  /* @__PURE__ */ jsx20(
@@ -3475,7 +3400,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3475
3400
  alignItems: "center",
3476
3401
  justifyContent: "center",
3477
3402
  flexDirection: "column",
3478
- children: /* @__PURE__ */ jsx20(Text20, { children: confirmFocus === "cancel" ? chalk14.bgGray.white.bold(" Cancel ") : chalk14.gray.bold("Cancel") })
3403
+ children: /* @__PURE__ */ jsx20(Text20, { children: confirmFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
3479
3404
  }
3480
3405
  )
3481
3406
  ] }),
@@ -3518,7 +3443,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3518
3443
  alignItems: "center",
3519
3444
  justifyContent: "center",
3520
3445
  flexDirection: "column",
3521
- 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") })
3446
+ children: /* @__PURE__ */ jsx20(Text20, { children: archiveFocus === "confirm" ? chalk15.bgGreen.white.bold(` ${archiveTarget.isArchived ? "Unarchive" : "Archive"} `) : (archiveTarget.isArchived ? tc.success : tc.warning).bold(archiveTarget.isArchived ? "Unarchive" : "Archive") })
3522
3447
  }
3523
3448
  ),
3524
3449
  /* @__PURE__ */ jsx20(
@@ -3531,11 +3456,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3531
3456
  alignItems: "center",
3532
3457
  justifyContent: "center",
3533
3458
  flexDirection: "column",
3534
- children: /* @__PURE__ */ jsx20(Text20, { children: archiveFocus === "cancel" ? chalk14.bgGray.white.bold(" Cancel ") : chalk14.gray.bold("Cancel") })
3459
+ children: /* @__PURE__ */ jsx20(Text20, { children: archiveFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
3535
3460
  }
3536
3461
  )
3537
3462
  ] }),
3538
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
3463
+ /* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, children: [
3539
3464
  "Press Enter to ",
3540
3465
  archiveFocus === "confirm" ? archiveTarget.isArchived ? "Unarchive" : "Archive" : "Cancel",
3541
3466
  " | Y to ",
@@ -3580,7 +3505,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3580
3505
  alignItems: "center",
3581
3506
  justifyContent: "center",
3582
3507
  flexDirection: "column",
3583
- children: /* @__PURE__ */ jsx20(Text20, { children: syncFocus === "confirm" ? chalk14.bgBlue.white.bold(" Sync ") : chalk14.blue.bold("Sync") })
3508
+ children: /* @__PURE__ */ jsx20(Text20, { children: syncFocus === "confirm" ? tc.btnPrimary(" Sync ") : tc.primary.bold("Sync") })
3584
3509
  }
3585
3510
  ),
3586
3511
  /* @__PURE__ */ jsx20(
@@ -3593,11 +3518,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3593
3518
  alignItems: "center",
3594
3519
  justifyContent: "center",
3595
3520
  flexDirection: "column",
3596
- children: /* @__PURE__ */ jsx20(Text20, { children: syncFocus === "cancel" ? chalk14.bgGray.white.bold(" Cancel ") : chalk14.gray.bold("Cancel") })
3521
+ children: /* @__PURE__ */ jsx20(Text20, { children: syncFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
3597
3522
  }
3598
3523
  )
3599
3524
  ] }),
3600
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
3525
+ /* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, children: [
3601
3526
  "Press Enter to ",
3602
3527
  syncFocus === "confirm" ? "Sync" : "Cancel",
3603
3528
  " | Y to Sync | C to Cancel"
@@ -3617,40 +3542,40 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3617
3542
  }
3618
3543
  }
3619
3544
  ) }),
3620
- syncError && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "magenta", children: syncError }) }),
3621
- syncing && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "yellow", children: "Syncing..." }) })
3622
- ] }) }) : 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: [
3545
+ syncError && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: theme.error, children: syncError }) }),
3546
+ syncing && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: theme.warning, children: "Syncing..." }) })
3547
+ ] }) }) : logoutMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.primary, paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
3623
3548
  /* @__PURE__ */ jsx20(Text20, { bold: true, children: "Logout Confirmation" }),
3624
- /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: "Are you sure you want to log out?" }),
3549
+ /* @__PURE__ */ jsx20(Text20, { color: theme.primary, children: "Are you sure you want to log out?" }),
3625
3550
  /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
3626
3551
  /* @__PURE__ */ jsx20(
3627
3552
  Box19,
3628
3553
  {
3629
3554
  borderStyle: "round",
3630
- borderColor: "cyan",
3555
+ borderColor: theme.primary,
3631
3556
  height: 3,
3632
3557
  width: 20,
3633
3558
  alignItems: "center",
3634
3559
  justifyContent: "center",
3635
3560
  flexDirection: "column",
3636
- children: /* @__PURE__ */ jsx20(Text20, { children: logoutFocus === "confirm" ? chalk14.bgCyan.white.bold(" Logout ") : chalk14.cyan.bold("Logout") })
3561
+ children: /* @__PURE__ */ jsx20(Text20, { children: logoutFocus === "confirm" ? tc.btnPrimary(" Logout ") : tc.primary.bold("Logout") })
3637
3562
  }
3638
3563
  ),
3639
3564
  /* @__PURE__ */ jsx20(
3640
3565
  Box19,
3641
3566
  {
3642
3567
  borderStyle: "round",
3643
- borderColor: logoutFocus === "cancel" ? "white" : "gray",
3568
+ borderColor: logoutFocus === "cancel" ? "white" : theme.muted,
3644
3569
  height: 3,
3645
3570
  width: 20,
3646
3571
  alignItems: "center",
3647
3572
  justifyContent: "center",
3648
3573
  flexDirection: "column",
3649
- children: /* @__PURE__ */ jsx20(Text20, { children: logoutFocus === "cancel" ? chalk14.bgGray.white.bold(" Cancel ") : chalk14.gray.bold("Cancel") })
3574
+ children: /* @__PURE__ */ jsx20(Text20, { children: logoutFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
3650
3575
  }
3651
3576
  )
3652
3577
  ] }),
3653
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
3578
+ /* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, children: [
3654
3579
  "Press Enter to ",
3655
3580
  logoutFocus === "confirm" ? "Logout" : "Cancel",
3656
3581
  " | Y to Logout | C to Cancel"
@@ -3665,41 +3590,41 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3665
3590
  }
3666
3591
  ) }) : infoMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: (() => {
3667
3592
  const repo = infoRepo || visibleItems[cursor];
3668
- if (!repo) return /* @__PURE__ */ jsx20(Text20, { color: "red", children: "No repository selected." });
3593
+ if (!repo) return /* @__PURE__ */ jsx20(Text20, { color: theme.error, children: "No repository selected." });
3669
3594
  const langName = repo.primaryLanguage?.name || "N/A";
3670
3595
  const langColor = repo.primaryLanguage?.color || "#666666";
3671
- return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 90), children: [
3596
+ return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.internal, paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 90), children: [
3672
3597
  /* @__PURE__ */ jsxs19(Text20, { bold: true, children: [
3673
3598
  "Repository Info ",
3674
- infoRepo ? chalk14.dim("(cached)") : ""
3599
+ infoRepo ? tc.muted("(cached)") : ""
3675
3600
  ] }),
3676
3601
  /* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
3677
- /* @__PURE__ */ jsx20(Text20, { children: chalk14.bold(repo.nameWithOwner) }),
3678
- repo.description && /* @__PURE__ */ jsx20(Text20, { color: "gray", children: repo.description }),
3602
+ /* @__PURE__ */ jsx20(Text20, { children: tc.text.bold(repo.nameWithOwner) }),
3603
+ repo.description && /* @__PURE__ */ jsx20(Text20, { color: theme.muted, children: repo.description }),
3679
3604
  /* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
3680
3605
  /* @__PURE__ */ jsxs19(Text20, { children: [
3681
- repo.visibility === "PRIVATE" ? chalk14.yellow("Private") : repo.visibility === "INTERNAL" ? chalk14.magenta("Internal") : chalk14.green("Public"),
3682
- repo.isArchived ? chalk14.gray(" Archived") : "",
3683
- repo.isFork ? chalk14.blue(" Fork") : ""
3606
+ repo.visibility === "PRIVATE" ? tc.private("Private") : repo.visibility === "INTERNAL" ? tc.internal("Internal") : tc.success("Public"),
3607
+ repo.isArchived ? tc.archived(" Archived") : "",
3608
+ repo.isFork ? tc.fork(" Fork") : ""
3684
3609
  ] }),
3685
- /* @__PURE__ */ jsx20(Text20, { children: chalk14.gray(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount}`) }),
3610
+ /* @__PURE__ */ jsx20(Text20, { children: tc.muted(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount}`) }),
3686
3611
  /* @__PURE__ */ jsxs19(Text20, { children: [
3687
- chalk14.hex(langColor)(`\u25CF `),
3688
- chalk14.gray(`${langName}`)
3612
+ chalk15.hex(langColor)(`\u25CF `),
3613
+ tc.muted(`${langName}`)
3689
3614
  ] }),
3690
- /* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
3615
+ /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, children: [
3691
3616
  "Updated: ",
3692
3617
  formatDate(repo.updatedAt),
3693
3618
  " \u2022 Pushed: ",
3694
3619
  formatDate(repo.pushedAt)
3695
3620
  ] }),
3696
- /* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
3621
+ /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, children: [
3697
3622
  "Size: ",
3698
3623
  repo.diskUsage,
3699
3624
  " KB"
3700
3625
  ] }),
3701
3626
  /* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
3702
- /* @__PURE__ */ jsx20(Text20, { color: "gray", children: "Press Esc or I to close" })
3627
+ /* @__PURE__ */ jsx20(Text20, { color: theme.muted, children: "Press Esc or I to close" })
3703
3628
  ] });
3704
3629
  })() }) : archiveFilterMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3705
3630
  ArchiveFilterModal,
@@ -3711,7 +3636,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3711
3636
  setCursor(0);
3712
3637
  storeUIPrefs({ archiveFilter: filter2 });
3713
3638
  },
3714
- onCancel: () => setArchiveFilterMode(false)
3639
+ onCancel: () => setArchiveFilterMode(false),
3640
+ theme
3715
3641
  }
3716
3642
  ) }) : visibilityMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3717
3643
  VisibilityModal,
@@ -3724,7 +3650,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3724
3650
  setCursor(0);
3725
3651
  storeUIPrefs({ visibilityFilter: filter2 });
3726
3652
  },
3727
- onCancel: () => setVisibilityMode(false)
3653
+ onCancel: () => setVisibilityMode(false),
3654
+ theme
3728
3655
  }
3729
3656
  ) }) : sortMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3730
3657
  SortModal,
@@ -3736,7 +3663,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3736
3663
  setCursor(0);
3737
3664
  storeUIPrefs({ sortKey: sort });
3738
3665
  },
3739
- onCancel: () => setSortMode(false)
3666
+ onCancel: () => setSortMode(false),
3667
+ theme
3740
3668
  }
3741
3669
  ) }) : sortDirectionMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3742
3670
  SortDirectionModal,
@@ -3749,7 +3677,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3749
3677
  setCursor(0);
3750
3678
  storeUIPrefs({ sortDir: direction });
3751
3679
  },
3752
- onCancel: () => setSortDirectionMode(false)
3680
+ onCancel: () => setSortDirectionMode(false),
3681
+ theme
3753
3682
  }
3754
3683
  ) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3755
3684
  ChangeVisibilityModal,
@@ -3762,14 +3691,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3762
3691
  onVisibilityChange: handleVisibilityChange,
3763
3692
  onClose: closeChangeVisibilityModal,
3764
3693
  changing: changingVisibility,
3765
- error: changeVisibilityError
3694
+ error: changeVisibilityError,
3695
+ theme
3766
3696
  }
3767
3697
  ) }) : renameMode && renameTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3768
3698
  RenameModal,
3769
3699
  {
3770
3700
  repo: renameTarget,
3771
3701
  onRename: executeRename,
3772
- onCancel: closeRenameModal
3702
+ onCancel: closeRenameModal,
3703
+ theme
3773
3704
  }
3774
3705
  ) }) : copyUrlMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3775
3706
  CopyUrlModal,
@@ -3777,7 +3708,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3777
3708
  repo: copyUrlTarget,
3778
3709
  terminalWidth,
3779
3710
  onClose: closeCopyUrlModal,
3780
- onCopy: handleCopyUrl
3711
+ onCopy: handleCopyUrl,
3712
+ theme
3781
3713
  }
3782
3714
  ) }) : unstarMode && unstarTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3783
3715
  UnstarModal,
@@ -3787,7 +3719,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3787
3719
  onConfirm: handleUnstar,
3788
3720
  onCancel: closeUnstarModal,
3789
3721
  isUnstarring: unstarring,
3790
- error: unstarError
3722
+ error: unstarError,
3723
+ theme
3791
3724
  }
3792
3725
  ) }) : starMode && starTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3793
3726
  StarModal,
@@ -3798,9 +3731,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3798
3731
  onConfirm: handleStar,
3799
3732
  onCancel: closeStarModal,
3800
3733
  isStarring: starring,
3801
- error: starError
3734
+ error: starError,
3735
+ theme
3802
3736
  }
3803
- ) }) : /* @__PURE__ */ jsxs19(Fragment10, { children: [
3737
+ ) }) : /* @__PURE__ */ jsxs19(Fragment9, { children: [
3804
3738
  /* @__PURE__ */ jsx20(
3805
3739
  RepoListHeader,
3806
3740
  {
@@ -3809,12 +3743,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3809
3743
  sortDir,
3810
3744
  forkTracking,
3811
3745
  filter,
3812
- searchActive,
3813
- searchLoading,
3746
+ filterActive,
3814
3747
  visibilityFilter,
3815
3748
  archiveFilter,
3816
3749
  isEnterprise: isEnterpriseOrg,
3817
- starsMode
3750
+ starsMode,
3751
+ theme
3818
3752
  }
3819
3753
  ),
3820
3754
  filterMode && /* @__PURE__ */ jsxs19(Box19, { marginBottom: 1, children: [
@@ -3824,86 +3758,71 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3824
3758
  {
3825
3759
  value: filter,
3826
3760
  onChange: (val) => {
3827
- addDebugMessage(`[onChange] val="${val}"`);
3828
3761
  setFilter(val);
3829
- const q = (val || "").trim();
3830
- addDebugMessage(`[onChange] trimmed="${q}", len=${q.length}`);
3831
- if (q.length >= 3) {
3832
- addDebugMessage(`[onChange] Triggering search for "${q}"`);
3833
- let policy = "cache-first";
3834
- try {
3835
- const key = makeSearchKey({
3836
- viewer: viewerLogin || "unknown",
3837
- q,
3838
- sortKey,
3839
- sortDir,
3840
- pageSize: PAGE_SIZE,
3841
- forkTracking
3842
- });
3843
- policy = isFresh(key, 90 * 1e3) ? "cache-first" : "network-only";
3844
- } catch {
3845
- }
3846
- addDebugMessage(`[onChange] Calling fetchSearchPage with q="${q}"`);
3847
- fetchSearchPage(null, true, policy, q);
3848
- } else {
3849
- setSearchItems([]);
3850
- setSearchEndCursor(null);
3851
- setSearchHasNextPage(false);
3852
- setSearchTotalCount(0);
3853
- }
3854
3762
  },
3855
3763
  onSubmit: () => {
3856
3764
  setFilterMode(false);
3857
3765
  },
3858
- placeholder: starsMode ? "Type to filter starred repositories..." : "Type to search (3+ chars for server search)..."
3766
+ placeholder: starsMode ? "Type to filter starred repositories..." : "Type to fuzzy-search repositories..."
3859
3767
  }
3860
3768
  )
3861
3769
  ] }),
3862
3770
  /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: listHeight, children: [
3863
- 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) => {
3771
+ visibleItems.slice(windowed.start, windowed.end).map((repo, i) => {
3864
3772
  const idx = windowed.start + i;
3865
3773
  return /* @__PURE__ */ jsx20(
3866
3774
  RepoRow,
3867
3775
  {
3868
3776
  repo,
3869
- selected: filterMode && searchActive ? false : idx === cursor,
3777
+ selected: filterMode ? false : idx === cursor,
3870
3778
  index: idx + 1,
3871
3779
  maxWidth: terminalWidth - 6,
3872
3780
  spacingLines,
3873
3781
  forkTracking,
3874
- starsMode
3782
+ starsMode,
3783
+ theme
3875
3784
  },
3876
3785
  repo.nameWithOwner
3877
3786
  );
3878
3787
  }),
3879
- loadingMore && hasNextPage && !starsMode && !searchActive && /* @__PURE__ */ jsx20(Box19, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", children: [
3788
+ loadingMore && hasNextPage && !starsMode && /* @__PURE__ */ jsx20(Box19, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", children: [
3880
3789
  /* @__PURE__ */ jsx20(Box19, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: /* @__PURE__ */ jsx20(SlowSpinner, {}) }) }),
3881
3790
  /* @__PURE__ */ jsxs19(Text20, { color: "cyan", children: [
3882
3791
  "Loading repositories\u2026 ",
3883
3792
  totalCount > 0 ? `(${items.length}/${totalCount})` : `(${items.length})`
3884
3793
  ] })
3885
3794
  ] }) }),
3886
- loadingMore && hasNextPage && (starsMode || searchActive) && /* @__PURE__ */ jsx20(Box19, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", children: [
3795
+ loadingMore && hasNextPage && starsMode && /* @__PURE__ */ jsx20(Box19, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", children: [
3887
3796
  /* @__PURE__ */ jsx20(Box19, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: /* @__PURE__ */ jsx20(SlowSpinner, {}) }) }),
3888
3797
  /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: "Loading more repositories..." })
3889
3798
  ] }) }),
3890
- !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" }) })
3799
+ filterActive && hasNextPage && !starsMode && /* @__PURE__ */ jsx20(Box19, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs19(Text20, { color: "yellow", dimColor: true, children: [
3800
+ "Still loading repos (",
3801
+ items.length,
3802
+ "/",
3803
+ totalCount > 0 ? totalCount : "?",
3804
+ ") \u2014 fuzzy results may be incomplete"
3805
+ ] }) }),
3806
+ !loading && visibleItems.length === 0 && !(filterActive && hasNextPage && !starsMode) && /* @__PURE__ */ jsx20(Box19, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "gray", dimColor: true, children: filter ? "No repositories match your search" : "No repositories found" }) })
3891
3807
  ] })
3892
3808
  ] }) }),
3893
3809
  /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, paddingX: 1, flexDirection: "column", children: [
3894
- /* @__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" }) }),
3895
- /* @__PURE__ */ jsx20(Box19, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: "gray", dimColor: modalOpen ? true : void 0, children: [
3896
- "/ Search \u2022 S Sort \u2022 D Direction \u2022 T Density \u2022 A Archive Filter",
3810
+ /* @__PURE__ */ jsx20(Box19, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx20(Text20, { color: theme.muted, dimColor: modalOpen ? true : void 0, children: "\u2191\u2193 Navigate \u2022 Ctrl+G Top \u2022 G Bottom \u2022 \u23CE/O Open \u2022 R Refresh" }) }),
3811
+ /* @__PURE__ */ jsx20(Box19, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, dimColor: modalOpen ? true : void 0, children: [
3812
+ "/ Search",
3813
+ !filterActive && " \u2022 S Sort \u2022 D Direction",
3814
+ " \u2022 T Density \u2022 Shift+T Theme \u2022 A Archive Filter",
3897
3815
  !starsMode && " \u2022 V Visibility Filter"
3898
3816
  ] }) }),
3899
- /* @__PURE__ */ jsx20(Box19, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx20(Text20, { color: "gray", dimColor: modalOpen ? true : void 0, children: starsMode ? "Shift+S My Repos \u2022 I Info \u2022 C Copy URL \u2022 U Unstar Repository" : `${ownerContext === "personal" ? "Shift+S Starred \u2022 " : ""}I Info \u2022 C Copy URL \u2022 Ctrl+S Un/Star \u2022 Ctrl+R Rename \u2022 Ctrl+A Un/Archive \u2022 Ctrl+V Change Visibility \u2022 Ctrl+F Sync Fork` }) }),
3900
- /* @__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" }) }),
3901
- /* @__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" }) })
3817
+ /* @__PURE__ */ jsx20(Box19, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx20(Text20, { color: theme.muted, dimColor: modalOpen ? true : void 0, children: starsMode ? "Shift+S My Repos \u2022 I Info \u2022 C Copy URL \u2022 U Unstar Repository" : `${ownerContext === "personal" ? "Shift+S Starred \u2022 " : ""}I Info \u2022 C Copy URL \u2022 Ctrl+S Un/Star \u2022 Ctrl+R Rename \u2022 Ctrl+A Un/Archive \u2022 Ctrl+V Change Visibility \u2022 Ctrl+F Sync Fork` }) }),
3818
+ /* @__PURE__ */ jsx20(Box19, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx20(Text20, { color: theme.muted, dimColor: modalOpen ? true : void 0, children: "K Cache Info \u2022 W Org Switch \u2022 Del/Backspace Delete \u2022 Ctrl+L Logout \u2022 Q Quit" }) }),
3819
+ /* @__PURE__ */ jsx20(Box19, { width: terminalWidth, justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: theme.warning, dimColor: modalOpen ? true : void 0, children: "\u{1F496} Sponsor on GitHub: github.com/sponsors/wiiiimm" }) })
3902
3820
  ] }),
3903
3821
  process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, borderStyle: "single", borderColor: "yellow", paddingX: 1, flexDirection: "column", children: [
3904
3822
  /* @__PURE__ */ jsx20(Text20, { bold: true, color: "yellow", children: "Debug Messages:" }),
3905
3823
  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))
3906
3824
  ] }),
3825
+ themeToast && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx20(Box19, { borderStyle: "round", borderColor: theme.primary, paddingX: 2, paddingY: 0, children: /* @__PURE__ */ jsx20(Text20, { color: theme.primary, children: themeToast }) }) }),
3907
3826
  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 }) }) })
3908
3827
  ] });
3909
3828
  }
@@ -3911,7 +3830,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3911
3830
  // src/ui/components/auth/AuthMethodSelector.tsx
3912
3831
  import { useState as useState17 } from "react";
3913
3832
  import { Box as Box20, Text as Text21, useInput as useInput17 } from "ink";
3914
- import chalk15 from "chalk";
3833
+ import chalk16 from "chalk";
3915
3834
  import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
3916
3835
  function AuthMethodSelector({ onSelect, onQuit }) {
3917
3836
  const [selectedIndex, setSelectedIndex] = useState17(0);
@@ -3950,7 +3869,7 @@ function AuthMethodSelector({ onSelect, onQuit }) {
3950
3869
  /* @__PURE__ */ jsx21(Text21, { bold: true, marginBottom: 1, children: "Choose Authentication Method" }),
3951
3870
  /* @__PURE__ */ jsx21(Box20, { flexDirection: "column", marginY: 1, children: methods.map((method, index) => {
3952
3871
  const isSelected = index === selectedIndex;
3953
- const prefix = isSelected ? chalk15.cyan("\u203A") : " ";
3872
+ const prefix = isSelected ? chalk16.cyan("\u203A") : " ";
3954
3873
  const numberPrefix = `${index + 1}.`;
3955
3874
  return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", marginBottom: 1, children: [
3956
3875
  /* @__PURE__ */ jsx21(Text21, { children: /* @__PURE__ */ jsxs20(Text21, { color: isSelected ? "cyan" : void 0, bold: isSelected, children: [
@@ -4303,7 +4222,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
4303
4222
  }
4304
4223
  });
4305
4224
  const verticalPadding = Math.floor(dims.rows * 0.05);
4306
- const header = useMemo2(() => /* @__PURE__ */ jsxs22(Box22, { flexDirection: "row", justifyContent: "space-between", marginBottom: 1, children: [
4225
+ const header = useMemo3(() => /* @__PURE__ */ jsxs22(Box22, { flexDirection: "row", justifyContent: "space-between", marginBottom: 1, children: [
4307
4226
  /* @__PURE__ */ jsxs22(Box22, { flexDirection: "row", gap: 1, children: [
4308
4227
  /* @__PURE__ */ jsxs22(Text23, { bold: true, color: "cyan", children: [
4309
4228
  " ",