gh-manager-cli 1.42.0 → 1.43.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
@@ -6,6 +6,8 @@ import {
6
6
  changeRepositoryVisibility,
7
7
  checkOrganizationIsEnterprise,
8
8
  deleteRepositoryRest,
9
+ enrichForksWithAheadBehind,
10
+ fetchRepositoryByOwnerAndName,
9
11
  fetchRestRateLimits,
10
12
  fetchViewerOrganizations,
11
13
  fetchViewerReposPageUnified,
@@ -26,14 +28,14 @@ import {
26
28
  updateCacheAfterRename,
27
29
  updateCacheAfterVisibilityChange,
28
30
  updateCacheWithRepository
29
- } from "./chunk-UOGN2QJU.js";
31
+ } from "./chunk-MKIUBPVD.js";
30
32
 
31
33
  // package.json
32
34
  var require_package = __commonJS({
33
35
  "package.json"(exports, module) {
34
36
  module.exports = {
35
37
  name: "gh-manager-cli",
36
- version: "1.42.0",
38
+ version: "1.43.0",
37
39
  private: false,
38
40
  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",
39
41
  license: "MIT",
@@ -153,12 +155,12 @@ var require_package = __commonJS({
153
155
 
154
156
  // src/index.tsx
155
157
  var import_package = __toESM(require_package(), 1);
156
- import { render, Box as Box23, Text as Text24 } from "ink";
158
+ import { render, Box as Box24, Text as Text25 } from "ink";
157
159
  import "dotenv/config";
158
160
 
159
161
  // src/ui/App.tsx
160
- import { useEffect as useEffect13, useMemo as useMemo3, useState as useState18 } from "react";
161
- import { Box as Box22, Text as Text23, useApp as useApp2, useStdout as useStdout2, useInput as useInput18 } from "ink";
162
+ import { useEffect as useEffect13, useMemo as useMemo3, useState as useState19 } from "react";
163
+ import { Box as Box23, Text as Text24, useApp as useApp2, useStdout as useStdout2, useInput as useInput19 } from "ink";
162
164
  import TextInput6 from "ink-text-input";
163
165
 
164
166
  // src/config/config.ts
@@ -407,8 +409,8 @@ async function openGitHubAuthorizationPage() {
407
409
  }
408
410
 
409
411
  // src/ui/views/RepoList.tsx
410
- import React16, { useEffect as useEffect12, useMemo as useMemo2, useState as useState16, useRef, useCallback } from "react";
411
- import { Box as Box19, Text as Text20, useApp, useInput as useInput16, useStdout } from "ink";
412
+ import React17, { useEffect as useEffect12, useMemo as useMemo2, useState as useState17, useRef, useCallback } from "react";
413
+ import { Box as Box20, Text as Text21, useApp, useInput as useInput17, useStdout } from "ink";
412
414
  import TextInput5 from "ink-text-input";
413
415
  import chalk15 from "chalk";
414
416
 
@@ -619,7 +621,7 @@ function OrgSwitcher({ token, currentContext, onSelect, onClose }) {
619
621
  try {
620
622
  setLoading(true);
621
623
  setError(null);
622
- const client = await import("./github-ASGTM4ZX.js").then((m) => m.makeClient(token));
624
+ const client = await import("./github-6HD7I2UI.js").then((m) => m.makeClient(token));
623
625
  const orgs = await fetchViewerOrganizations(client);
624
626
  setOrganizations(orgs);
625
627
  const entOrgs = /* @__PURE__ */ new Set();
@@ -1870,11 +1872,76 @@ function StarModal({
1870
1872
  );
1871
1873
  }
1872
1874
 
1875
+ // src/ui/components/modals/OpenInBrowserModal.tsx
1876
+ import { useState as useState15 } from "react";
1877
+ import { Box as Box15, Text as Text16, useInput as useInput15 } from "ink";
1878
+ import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
1879
+ function OpenInBrowserModal({ repo, onOpen, onCancel, theme: themeProp }) {
1880
+ const { theme, c } = useTheme(themeProp?.name ?? "default");
1881
+ const [focus, setFocus] = useState15("this");
1882
+ const forkUrl = `https://github.com/${repo.nameWithOwner}`;
1883
+ const upstreamUrl = repo.parent ? `https://github.com/${repo.parent.nameWithOwner}` : null;
1884
+ useInput15((input, key) => {
1885
+ if (key.escape || input.toLowerCase() === "c") {
1886
+ onCancel();
1887
+ return;
1888
+ }
1889
+ if (key.leftArrow || key.rightArrow) {
1890
+ setFocus((prev) => prev === "this" ? "upstream" : "this");
1891
+ return;
1892
+ }
1893
+ if (key.return) {
1894
+ if (focus === "this") {
1895
+ onOpen(forkUrl);
1896
+ } else if (upstreamUrl) {
1897
+ onOpen(upstreamUrl);
1898
+ }
1899
+ return;
1900
+ }
1901
+ if (input.toLowerCase() === "t") {
1902
+ onOpen(forkUrl);
1903
+ return;
1904
+ }
1905
+ if (input.toLowerCase() === "u" && upstreamUrl) {
1906
+ onOpen(upstreamUrl);
1907
+ return;
1908
+ }
1909
+ });
1910
+ return /* @__PURE__ */ jsxs15(
1911
+ Box15,
1912
+ {
1913
+ flexDirection: "column",
1914
+ borderStyle: "round",
1915
+ borderColor: theme.primary,
1916
+ paddingX: 3,
1917
+ paddingY: 2,
1918
+ width: 62,
1919
+ children: [
1920
+ /* @__PURE__ */ jsx16(Text16, { bold: true, color: theme.primary, children: "Open in Browser" }),
1921
+ /* @__PURE__ */ jsx16(Box15, { height: 1, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) }),
1922
+ /* @__PURE__ */ jsx16(Text16, { bold: true, children: repo.nameWithOwner }),
1923
+ repo.parent && /* @__PURE__ */ jsxs15(Text16, { color: theme.muted, children: [
1924
+ "Fork of ",
1925
+ repo.parent.nameWithOwner
1926
+ ] }),
1927
+ /* @__PURE__ */ jsx16(Box15, { height: 1, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) }),
1928
+ /* @__PURE__ */ jsx16(Text16, { children: "Which repository would you like to open?" }),
1929
+ /* @__PURE__ */ jsx16(Box15, { height: 1, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) }),
1930
+ /* @__PURE__ */ jsxs15(Box15, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 4, children: [
1931
+ /* @__PURE__ */ jsx16(Box15, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx16(Text16, { children: focus === "this" ? c.primary.inverse.bold(" This Repository ") : c.primary.bold("This Repository") }) }),
1932
+ /* @__PURE__ */ jsx16(Box15, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx16(Text16, { children: focus === "upstream" ? c.success.inverse.bold(" Parent/Upstream ") : c.success.bold("Parent/Upstream") }) })
1933
+ ] }),
1934
+ /* @__PURE__ */ jsx16(Box15, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsx16(Text16, { color: theme.muted, children: "\u2190/\u2192 Choose \u2022 Enter to Open \u2022 T This \u2022 U Upstream \u2022 C/Esc Cancel" }) })
1935
+ ]
1936
+ }
1937
+ );
1938
+ }
1939
+
1873
1940
  // src/ui/components/modals/UnstarModal.tsx
1874
- import { useEffect as useEffect11, useState as useState15 } from "react";
1875
- import { Box as Box15, Text as Text16 } from "ink";
1876
- import { useInput as useInput15 } from "ink";
1877
- import { Fragment as Fragment8, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
1941
+ import { useEffect as useEffect11, useState as useState16 } from "react";
1942
+ import { Box as Box16, Text as Text17 } from "ink";
1943
+ import { useInput as useInput16 } from "ink";
1944
+ import { Fragment as Fragment8, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
1878
1945
  function UnstarModal({
1879
1946
  visible,
1880
1947
  repo,
@@ -1885,8 +1952,8 @@ function UnstarModal({
1885
1952
  theme: themeProp
1886
1953
  }) {
1887
1954
  const { theme } = useTheme(themeProp?.name ?? "default");
1888
- const [focusedButton, setFocusedButton] = useState15("cancel");
1889
- useInput15((input, key) => {
1955
+ const [focusedButton, setFocusedButton] = useState16("cancel");
1956
+ useInput16((input, key) => {
1890
1957
  if (!visible) return;
1891
1958
  if (key.escape || input === "c" || input === "C") {
1892
1959
  onCancel();
@@ -1908,8 +1975,8 @@ function UnstarModal({
1908
1975
  if (visible) setFocusedButton("cancel");
1909
1976
  }, [visible]);
1910
1977
  if (!visible || !repo) return null;
1911
- return /* @__PURE__ */ jsxs15(
1912
- Box15,
1978
+ return /* @__PURE__ */ jsxs16(
1979
+ Box16,
1913
1980
  {
1914
1981
  flexDirection: "column",
1915
1982
  borderStyle: "round",
@@ -1918,28 +1985,28 @@ function UnstarModal({
1918
1985
  paddingY: 1,
1919
1986
  marginTop: 1,
1920
1987
  children: [
1921
- /* @__PURE__ */ jsx16(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx16(Text16, { bold: true, color: theme.warning, children: "\u2B50 Unstar Repository" }) }),
1922
- /* @__PURE__ */ jsx16(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsxs15(Text16, { children: [
1988
+ /* @__PURE__ */ jsx17(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsx17(Text17, { bold: true, color: theme.warning, children: "\u2B50 Unstar Repository" }) }),
1989
+ /* @__PURE__ */ jsx17(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsxs16(Text17, { children: [
1923
1990
  "Are you sure you want to unstar",
1924
1991
  " ",
1925
- /* @__PURE__ */ jsx16(Text16, { bold: true, color: theme.primary, children: repo.nameWithOwner }),
1992
+ /* @__PURE__ */ jsx17(Text17, { bold: true, color: theme.primary, children: repo.nameWithOwner }),
1926
1993
  "?"
1927
1994
  ] }) }),
1928
- repo.description && /* @__PURE__ */ jsx16(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx16(Text16, { dimColor: true, wrap: "wrap", children: repo.description }) }),
1929
- /* @__PURE__ */ jsx16(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsxs15(Text16, { dimColor: true, children: [
1995
+ repo.description && /* @__PURE__ */ jsx17(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsx17(Text17, { dimColor: true, wrap: "wrap", children: repo.description }) }),
1996
+ /* @__PURE__ */ jsx17(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsxs16(Text17, { dimColor: true, children: [
1930
1997
  "Stars: ",
1931
1998
  repo.stargazerCount,
1932
1999
  " \u2022 Forks: ",
1933
2000
  repo.forkCount
1934
2001
  ] }) }),
1935
- error && /* @__PURE__ */ jsx16(Box15, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs15(Text16, { color: theme.error, wrap: "wrap", children: [
2002
+ error && /* @__PURE__ */ jsx17(Box16, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs16(Text17, { color: theme.error, wrap: "wrap", children: [
1936
2003
  error.includes("OAuth access restrictions") ? "\u26A0\uFE0F " : "Error: ",
1937
2004
  error
1938
2005
  ] }) }),
1939
- isUnstarring ? /* @__PURE__ */ jsx16(Box15, { children: /* @__PURE__ */ jsx16(Text16, { color: theme.warning, children: "Unstarring..." }) }) : /* @__PURE__ */ jsxs15(Fragment8, { children: [
1940
- /* @__PURE__ */ jsxs15(Box15, { gap: 2, children: [
1941
- /* @__PURE__ */ jsx16(Box15, { children: /* @__PURE__ */ jsxs15(
1942
- Text16,
2006
+ isUnstarring ? /* @__PURE__ */ jsx17(Box16, { children: /* @__PURE__ */ jsx17(Text17, { color: theme.warning, children: "Unstarring..." }) }) : /* @__PURE__ */ jsxs16(Fragment8, { children: [
2007
+ /* @__PURE__ */ jsxs16(Box16, { gap: 2, children: [
2008
+ /* @__PURE__ */ jsx17(Box16, { children: /* @__PURE__ */ jsxs16(
2009
+ Text17,
1943
2010
  {
1944
2011
  backgroundColor: focusedButton === "cancel" ? "white" : void 0,
1945
2012
  color: focusedButton === "cancel" ? "black" : "white",
@@ -1951,8 +2018,8 @@ function UnstarModal({
1951
2018
  ]
1952
2019
  }
1953
2020
  ) }),
1954
- /* @__PURE__ */ jsx16(Box15, { children: /* @__PURE__ */ jsxs15(
1955
- Text16,
2021
+ /* @__PURE__ */ jsx17(Box16, { children: /* @__PURE__ */ jsxs16(
2022
+ Text17,
1956
2023
  {
1957
2024
  backgroundColor: focusedButton === "unstar" ? "yellow" : void 0,
1958
2025
  color: focusedButton === "unstar" ? "black" : theme.warning,
@@ -1965,7 +2032,7 @@ function UnstarModal({
1965
2032
  }
1966
2033
  ) })
1967
2034
  ] }),
1968
- /* @__PURE__ */ jsx16(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx16(Text16, { dimColor: true, children: "Use \u2190 \u2192 to navigate, Enter to select" }) })
2035
+ /* @__PURE__ */ jsx17(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "Use \u2190 \u2192 to navigate, Enter to select" }) })
1969
2036
  ] })
1970
2037
  ]
1971
2038
  }
@@ -1973,9 +2040,9 @@ function UnstarModal({
1973
2040
  }
1974
2041
 
1975
2042
  // src/ui/components/repo/RepoRow.tsx
1976
- import { Box as Box16, Text as Text17 } from "ink";
2043
+ import { Box as Box17, Text as Text18 } from "ink";
1977
2044
  import chalk14 from "chalk";
1978
- import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
2045
+ import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
1979
2046
  function RepoRow({
1980
2047
  repo,
1981
2048
  selected,
@@ -1991,8 +2058,11 @@ function RepoRow({
1991
2058
  const langName = repo.primaryLanguage?.name || "";
1992
2059
  const langColor = repo.primaryLanguage?.color || "#666666";
1993
2060
  const hasCommitData = repo.isFork && repo.parent && repo.defaultBranchRef && repo.parent.defaultBranchRef && repo.parent.defaultBranchRef.target?.history && repo.defaultBranchRef.target?.history;
1994
- const commitsBehind = hasCommitData ? repo.parent.defaultBranchRef.target.history.totalCount - repo.defaultBranchRef.target.history.totalCount : 0;
1995
- const showCommitsBehind = forkTracking && hasCommitData;
2061
+ const forkCount = hasCommitData ? repo.defaultBranchRef.target.history.totalCount : 0;
2062
+ const parentCount = hasCommitData ? repo.parent.defaultBranchRef.target.history.totalCount : 0;
2063
+ const commitsBehind = hasCommitData ? Math.max(0, parentCount - forkCount) : 0;
2064
+ const commitsAhead = hasCommitData ? Math.max(0, forkCount - parentCount) : 0;
2065
+ const showCommitData = forkTracking && hasCommitData;
1996
2066
  let line1 = "";
1997
2067
  const numColor = selected ? c.selected : c.muted;
1998
2068
  const nameColor = selected ? c.selected.bold : c.text;
@@ -2012,11 +2082,14 @@ function RepoRow({
2012
2082
  if (repo.isArchived) line1 += " " + chalk14.bgGray.whiteBright(" Archived ") + " ";
2013
2083
  if (repo.isFork && repo.parent) {
2014
2084
  line1 += c.fork(` Fork of ${repo.parent.nameWithOwner}`);
2015
- if (showCommitsBehind) {
2016
- if (commitsBehind > 0) {
2017
- line1 += c.warning(` (${commitsBehind} behind)`);
2085
+ if (showCommitData) {
2086
+ const parts = [];
2087
+ if (commitsAhead > 0) parts.push(c.success(`${commitsAhead} ahead`));
2088
+ if (commitsBehind > 0) parts.push(c.warning(`${commitsBehind} behind`));
2089
+ if (parts.length > 0) {
2090
+ line1 += c.muted(` (${parts.join(", ")})`);
2018
2091
  } else {
2019
- line1 += c.success(` (0 behind)`);
2092
+ line1 += c.success(` (up to date)`);
2020
2093
  }
2021
2094
  }
2022
2095
  }
@@ -2029,21 +2102,21 @@ function RepoRow({
2029
2102
  if (line3) fullText += "\n" + metaColor(line3);
2030
2103
  const spacingAbove = Math.floor(spacingLines / 2);
2031
2104
  const spacingBelow = spacingLines - spacingAbove;
2032
- return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", backgroundColor: selected ? "gray" : void 0, children: [
2033
- spacingAbove > 0 && /* @__PURE__ */ jsx17(Box16, { height: spacingAbove, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) }),
2034
- /* @__PURE__ */ jsx17(Text17, { children: dim ? chalk14.dim(fullText) : fullText }),
2035
- spacingBelow > 0 && /* @__PURE__ */ jsx17(Box16, { height: spacingBelow, children: /* @__PURE__ */ jsx17(Text17, { children: " " }) })
2105
+ return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", backgroundColor: selected ? "gray" : void 0, children: [
2106
+ spacingAbove > 0 && /* @__PURE__ */ jsx18(Box17, { height: spacingAbove, children: /* @__PURE__ */ jsx18(Text18, { children: " " }) }),
2107
+ /* @__PURE__ */ jsx18(Text18, { children: dim ? chalk14.dim(fullText) : fullText }),
2108
+ spacingBelow > 0 && /* @__PURE__ */ jsx18(Box17, { height: spacingBelow, children: /* @__PURE__ */ jsx18(Text18, { children: " " }) })
2036
2109
  ] });
2037
2110
  }
2038
2111
 
2039
2112
  // src/ui/components/repo/FilterInput.tsx
2040
- import { Box as Box17, Text as Text18 } from "ink";
2113
+ import { Box as Box18, Text as Text19 } from "ink";
2041
2114
  import TextInput4 from "ink-text-input";
2042
- import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
2115
+ import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
2043
2116
 
2044
2117
  // src/ui/components/repo/RepoListHeader.tsx
2045
- import { Box as Box18, Text as Text19 } from "ink";
2046
- import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
2118
+ import { Box as Box19, Text as Text20 } from "ink";
2119
+ import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
2047
2120
  function RepoListHeader({
2048
2121
  ownerContext,
2049
2122
  sortKey,
@@ -2060,26 +2133,26 @@ function RepoListHeader({
2060
2133
  const { theme } = useTheme(themeProp?.name ?? "default");
2061
2134
  const contextLabel = ownerContext === "personal" ? "Personal Account" : ownerContext?.type === "organization" ? `Organisation: ${ownerContext.name ?? ownerContext.login}` : "";
2062
2135
  const visibilityLabel = visibilityFilter === "public" ? "Public" : visibilityFilter === "private" ? isEnterprise ? "Private/Internal" : "Private" : visibilityFilter === "internal" ? "Internal" : "";
2063
- return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "row", gap: 2, marginBottom: 1, children: [
2064
- contextLabel && /* @__PURE__ */ jsx19(Text19, { children: contextLabel }),
2065
- starsMode && /* @__PURE__ */ jsx19(Text19, { color: theme.warning, bold: true, children: "\u2B50 Stars Mode" }),
2066
- /* @__PURE__ */ jsxs18(Text19, { color: theme.muted, dimColor: true, children: [
2136
+ return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", gap: 2, marginBottom: 1, children: [
2137
+ contextLabel && /* @__PURE__ */ jsx20(Text20, { children: contextLabel }),
2138
+ starsMode && /* @__PURE__ */ jsx20(Text20, { color: theme.warning, bold: true, children: "\u2B50 Stars Mode" }),
2139
+ /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, dimColor: true, children: [
2067
2140
  "Sort: ",
2068
2141
  filterActive ? "relevance" : `${sortKey} ${sortDir === "asc" ? "\u2191" : "\u2193"}`
2069
2142
  ] }),
2070
- /* @__PURE__ */ jsxs18(Text19, { color: theme.muted, dimColor: true, children: [
2143
+ /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, dimColor: true, children: [
2071
2144
  "Fork Status - Commits Behind: ",
2072
2145
  forkTracking ? "ON" : "OFF"
2073
2146
  ] }),
2074
- !!visibilityLabel && !starsMode && /* @__PURE__ */ jsxs18(Text19, { color: theme.warning, children: [
2147
+ !!visibilityLabel && !starsMode && /* @__PURE__ */ jsxs19(Text20, { color: theme.warning, children: [
2075
2148
  "Visibility: ",
2076
2149
  visibilityLabel
2077
2150
  ] }),
2078
- archiveFilter !== "all" && /* @__PURE__ */ jsxs18(Text19, { color: theme.primary, children: [
2151
+ archiveFilter !== "all" && /* @__PURE__ */ jsxs19(Text20, { color: theme.primary, children: [
2079
2152
  "Archive: ",
2080
2153
  archiveFilter === "archived" ? "Archived" : "Unarchived"
2081
2154
  ] }),
2082
- (filterActive || starsMode && filter.trim().length > 0) && /* @__PURE__ */ jsxs18(Text19, { color: theme.primary, children: [
2155
+ (filterActive || starsMode && filter.trim().length > 0) && /* @__PURE__ */ jsxs19(Text20, { color: theme.primary, children: [
2083
2156
  starsMode ? "Filter" : "Search",
2084
2157
  ': "',
2085
2158
  filter.trim(),
@@ -2089,7 +2162,7 @@ function RepoListHeader({
2089
2162
  }
2090
2163
 
2091
2164
  // src/ui/views/RepoList.tsx
2092
- import { Fragment as Fragment9, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
2165
+ import { Fragment as Fragment9, jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
2093
2166
  var getPageSize = () => {
2094
2167
  const envValue = process.env.REPOS_PER_FETCH;
2095
2168
  if (envValue) {
@@ -2105,7 +2178,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2105
2178
  const { exit } = useApp();
2106
2179
  const { stdout } = useStdout();
2107
2180
  const client = useMemo2(() => makeClient(token), [token]);
2108
- const [debugMessages, setDebugMessages] = useState16([]);
2181
+ const [debugMessages, setDebugMessages] = useState17([]);
2109
2182
  const addDebugMessage = useCallback((msg) => {
2110
2183
  if (process.env.GH_MANAGER_DEBUG === "1") {
2111
2184
  setDebugMessages((prev) => [...prev.slice(-9), msg]);
@@ -2115,7 +2188,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2115
2188
  useEffect12(() => {
2116
2189
  handleOrgContextChangeRef.current = onOrgContextChange;
2117
2190
  }, [onOrgContextChange]);
2118
- React16.useEffect(() => {
2191
+ React17.useEffect(() => {
2119
2192
  addDebugMessage(`[RepoList] Component mounted`);
2120
2193
  logger.info("RepoList component mounted", {
2121
2194
  token: token ? "present" : "missing",
@@ -2127,84 +2200,88 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2127
2200
  }, []);
2128
2201
  const terminalWidth = stdout?.columns ?? 80;
2129
2202
  const availableHeight = maxVisibleRows ?? 20;
2130
- const [items, setItems] = useState16([]);
2131
- const [cursor, setCursor] = useState16(0);
2132
- const [endCursor, setEndCursor] = useState16(null);
2133
- const [hasNextPage, setHasNextPage] = useState16(false);
2134
- const [totalCount, setTotalCount] = useState16(0);
2135
- const [loading, setLoading] = useState16(true);
2136
- const [sortingLoading, setSortingLoading] = useState16(false);
2137
- const [refreshing, setRefreshing] = useState16(false);
2138
- const [loadingMore, setLoadingMore] = useState16(false);
2139
- const [error, setError] = useState16(null);
2140
- const [rateLimit, setRateLimit] = useState16(void 0);
2141
- const [prevRateLimit, setPrevRateLimit] = useState16(void 0);
2142
- const [restRateLimit, setRestRateLimit] = useState16(void 0);
2143
- const [prevRestRateLimit, setPrevRestRateLimit] = useState16(void 0);
2144
- const [density, setDensity] = useState16(2);
2145
- const [prefsLoaded, setPrefsLoaded] = useState16(false);
2146
- const [themeName, setThemeName] = useState16("default");
2147
- const [themeToast, setThemeToast] = useState16(null);
2203
+ const [items, setItems] = useState17([]);
2204
+ const [cursor, setCursor] = useState17(0);
2205
+ const [endCursor, setEndCursor] = useState17(null);
2206
+ const [hasNextPage, setHasNextPage] = useState17(false);
2207
+ const [totalCount, setTotalCount] = useState17(0);
2208
+ const [loading, setLoading] = useState17(true);
2209
+ const [sortingLoading, setSortingLoading] = useState17(false);
2210
+ const [refreshing, setRefreshing] = useState17(false);
2211
+ const [loadingMore, setLoadingMore] = useState17(false);
2212
+ const [error, setError] = useState17(null);
2213
+ const [rateLimit, setRateLimit] = useState17(void 0);
2214
+ const [prevRateLimit, setPrevRateLimit] = useState17(void 0);
2215
+ const [restRateLimit, setRestRateLimit] = useState17(void 0);
2216
+ const [prevRestRateLimit, setPrevRestRateLimit] = useState17(void 0);
2217
+ const [density, setDensity] = useState17(2);
2218
+ const [prefsLoaded, setPrefsLoaded] = useState17(false);
2219
+ const [themeName, setThemeName] = useState17("default");
2220
+ const [themeToast, setThemeToast] = useState17(null);
2148
2221
  const themeToastTimerRef = useRef(null);
2149
2222
  const { theme, c: tc } = useTheme(themeName);
2150
- const [ownerContext, setOwnerContext] = useState16("personal");
2151
- const [ownerAffiliations, setOwnerAffiliations] = useState16(["OWNER"]);
2152
- const [orgSwitcherOpen, setOrgSwitcherOpen] = useState16(false);
2153
- const [operationCount, setOperationCount] = useState16(0);
2154
- const [showSponsorReminder, setShowSponsorReminder] = useState16(false);
2155
- const [deleteMode, setDeleteMode] = useState16(false);
2156
- const [deleteTarget, setDeleteTarget] = useState16(null);
2157
- const [deleteCode, setDeleteCode] = useState16("");
2158
- const [typedCode, setTypedCode] = useState16("");
2159
- const [deleting, setDeleting] = useState16(false);
2160
- const [deleteError, setDeleteError] = useState16(null);
2161
- const [deleteConfirmStage, setDeleteConfirmStage] = useState16(false);
2162
- const [confirmFocus, setConfirmFocus] = useState16("delete");
2163
- const [archiveMode, setArchiveMode] = useState16(false);
2164
- const [archiveTarget, setArchiveTarget] = useState16(null);
2165
- const [archiving, setArchiving] = useState16(false);
2166
- const [archiveError, setArchiveError] = useState16(null);
2167
- const [archiveFocus, setArchiveFocus] = useState16("confirm");
2168
- const [syncMode, setSyncMode] = useState16(false);
2169
- const [syncTarget, setSyncTarget] = useState16(null);
2170
- const [syncing, setSyncing] = useState16(false);
2171
- const [syncError, setSyncError] = useState16(null);
2172
- const [syncFocus, setSyncFocus] = useState16("confirm");
2173
- const [renameMode, setRenameMode] = useState16(false);
2174
- const [renameTarget, setRenameTarget] = useState16(null);
2175
- const [copyUrlMode, setCopyUrlMode] = useState16(false);
2176
- const [copyUrlTarget, setCopyUrlTarget] = useState16(null);
2177
- const [copyToast, setCopyToast] = useState16(null);
2178
- const [syncTrigger, setSyncTrigger] = useState16(false);
2179
- const [infoMode, setInfoMode] = useState16(false);
2180
- const [infoRepo, setInfoRepo] = useState16(null);
2181
- const [logoutMode, setLogoutMode] = useState16(false);
2182
- const [logoutFocus, setLogoutFocus] = useState16("confirm");
2183
- const [logoutError, setLogoutError] = useState16(null);
2184
- const [archiveFilterMode, setArchiveFilterMode] = useState16(false);
2185
- const [visibilityMode, setVisibilityMode] = useState16(false);
2186
- const [isEnterpriseOrg, setIsEnterpriseOrg] = useState16(false);
2187
- const [hasInternalRepos, setHasInternalRepos] = useState16(false);
2188
- const [changeVisibilityMode, setChangeVisibilityMode] = useState16(false);
2189
- const [changeVisibilityTarget, setChangeVisibilityTarget] = useState16(null);
2190
- const [changingVisibility, setChangingVisibility] = useState16(false);
2191
- const [changeVisibilityError, setChangeVisibilityError] = useState16(null);
2192
- const [sortMode, setSortMode] = useState16(false);
2193
- const [sortDirectionMode, setSortDirectionMode] = useState16(false);
2194
- const [starsMode, setStarsMode] = useState16(false);
2195
- const [starredItems, setStarredItems] = useState16([]);
2196
- const [starredEndCursor, setStarredEndCursor] = useState16(null);
2197
- const [starredHasNextPage, setStarredHasNextPage] = useState16(false);
2198
- const [starredTotalCount, setStarredTotalCount] = useState16(0);
2199
- const [starredLoading, setStarredLoading] = useState16(false);
2200
- const [unstarMode, setUnstarMode] = useState16(false);
2201
- const [unstarTarget, setUnstarTarget] = useState16(null);
2202
- const [unstarring, setUnstarring] = useState16(false);
2203
- const [unstarError, setUnstarError] = useState16(null);
2204
- const [starMode, setStarMode] = useState16(false);
2205
- const [starTarget, setStarTarget] = useState16(null);
2206
- const [starring, setStarring] = useState16(false);
2207
- const [starError, setStarError] = useState16(null);
2223
+ const [ownerContext, setOwnerContext] = useState17("personal");
2224
+ const [ownerAffiliations, setOwnerAffiliations] = useState17(["OWNER"]);
2225
+ const [orgSwitcherOpen, setOrgSwitcherOpen] = useState17(false);
2226
+ const [operationCount, setOperationCount] = useState17(0);
2227
+ const [showSponsorReminder, setShowSponsorReminder] = useState17(false);
2228
+ const [deleteMode, setDeleteMode] = useState17(false);
2229
+ const [deleteTarget, setDeleteTarget] = useState17(null);
2230
+ const [deleteCode, setDeleteCode] = useState17("");
2231
+ const [typedCode, setTypedCode] = useState17("");
2232
+ const [deleting, setDeleting] = useState17(false);
2233
+ const [deleteError, setDeleteError] = useState17(null);
2234
+ const [deleteConfirmStage, setDeleteConfirmStage] = useState17(false);
2235
+ const [confirmFocus, setConfirmFocus] = useState17("delete");
2236
+ const [archiveMode, setArchiveMode] = useState17(false);
2237
+ const [archiveTarget, setArchiveTarget] = useState17(null);
2238
+ const [archiving, setArchiving] = useState17(false);
2239
+ const [archiveError, setArchiveError] = useState17(null);
2240
+ const [archiveFocus, setArchiveFocus] = useState17("confirm");
2241
+ const [syncMode, setSyncMode] = useState17(false);
2242
+ const [syncTarget, setSyncTarget] = useState17(null);
2243
+ const [syncing, setSyncing] = useState17(false);
2244
+ const [syncError, setSyncError] = useState17(null);
2245
+ const [syncFocus, setSyncFocus] = useState17("confirm");
2246
+ const [renameMode, setRenameMode] = useState17(false);
2247
+ const [renameTarget, setRenameTarget] = useState17(null);
2248
+ const [copyUrlMode, setCopyUrlMode] = useState17(false);
2249
+ const [copyUrlTarget, setCopyUrlTarget] = useState17(null);
2250
+ const [copyToast, setCopyToast] = useState17(null);
2251
+ const [syncTrigger, setSyncTrigger] = useState17(false);
2252
+ const [infoMode, setInfoMode] = useState17(false);
2253
+ const [infoRepo, setInfoRepo] = useState17(null);
2254
+ const [logoutMode, setLogoutMode] = useState17(false);
2255
+ const [logoutFocus, setLogoutFocus] = useState17("confirm");
2256
+ const [logoutError, setLogoutError] = useState17(null);
2257
+ const [archiveFilterMode, setArchiveFilterMode] = useState17(false);
2258
+ const [visibilityMode, setVisibilityMode] = useState17(false);
2259
+ const [isEnterpriseOrg, setIsEnterpriseOrg] = useState17(false);
2260
+ const [hasInternalRepos, setHasInternalRepos] = useState17(false);
2261
+ const [changeVisibilityMode, setChangeVisibilityMode] = useState17(false);
2262
+ const [changeVisibilityTarget, setChangeVisibilityTarget] = useState17(null);
2263
+ const [changingVisibility, setChangingVisibility] = useState17(false);
2264
+ const [changeVisibilityError, setChangeVisibilityError] = useState17(null);
2265
+ const [sortMode, setSortMode] = useState17(false);
2266
+ const [sortDirectionMode, setSortDirectionMode] = useState17(false);
2267
+ const [starsMode, setStarsMode] = useState17(false);
2268
+ const [starredItems, setStarredItems] = useState17([]);
2269
+ const [starredEndCursor, setStarredEndCursor] = useState17(null);
2270
+ const [starredHasNextPage, setStarredHasNextPage] = useState17(false);
2271
+ const [starredTotalCount, setStarredTotalCount] = useState17(0);
2272
+ const [starredLoading, setStarredLoading] = useState17(false);
2273
+ const [unstarMode, setUnstarMode] = useState17(false);
2274
+ const [unstarTarget, setUnstarTarget] = useState17(null);
2275
+ const [unstarring, setUnstarring] = useState17(false);
2276
+ const [unstarError, setUnstarError] = useState17(null);
2277
+ const [starMode, setStarMode] = useState17(false);
2278
+ const [starTarget, setStarTarget] = useState17(null);
2279
+ const [starring, setStarring] = useState17(false);
2280
+ const [starError, setStarError] = useState17(null);
2281
+ const [openInBrowserMode, setOpenInBrowserMode] = useState17(false);
2282
+ const [openInBrowserTarget, setOpenInBrowserTarget] = useState17(null);
2283
+ const [enrichingForks, setEnrichingForks] = useState17(false);
2284
+ const enrichmentDoneRef = useRef(/* @__PURE__ */ new Set());
2208
2285
  const appliedInitialOrg = useRef(false);
2209
2286
  useEffect12(() => {
2210
2287
  (async () => {
@@ -2566,14 +2643,86 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2566
2643
  setDeleteError("Failed to delete repository. Ensure delete_repo scope and admin permissions.");
2567
2644
  }
2568
2645
  }
2569
- const [filter, setFilter] = useState16("");
2570
- const [filterMode, setFilterMode] = useState16(false);
2571
- const [sortKey, setSortKey] = useState16("updated");
2572
- const [sortDir, setSortDir] = useState16("desc");
2573
- const [forkTracking, setForkTracking] = useState16(true);
2574
- const [visibilityFilter, setVisibilityFilter] = useState16("all");
2646
+ const [filter, setFilter] = useState17("");
2647
+ const [filterMode, setFilterMode] = useState17(false);
2648
+ const [sortKey, setSortKey] = useState17("updated");
2649
+ const [sortDir, setSortDir] = useState17("desc");
2650
+ const [forkTracking, setForkTracking] = useState17(true);
2651
+ useEffect12(() => {
2652
+ if (loading || loadingMore || hasNextPage || items.length === 0) return;
2653
+ if (!forkTracking) return;
2654
+ const unenriched = items.filter(
2655
+ (r) => r.isFork && r.parent?.nameWithOwner && !enrichmentDoneRef.current.has(r.id) && !(r.defaultBranchRef?.target?.history && r.parent?.defaultBranchRef?.target?.history)
2656
+ );
2657
+ if (unenriched.length === 0) return;
2658
+ let cancelled = false;
2659
+ setEnrichingForks(true);
2660
+ ;
2661
+ (async () => {
2662
+ const BATCH_DELAY_MS = 200;
2663
+ try {
2664
+ const BATCH_SIZE = 5;
2665
+ for (let i = 0; i < unenriched.length; i += BATCH_SIZE) {
2666
+ if (cancelled) break;
2667
+ const slice = unenriched.slice(i, i + BATCH_SIZE);
2668
+ const batch = slice.map((r) => ({
2669
+ id: r.id,
2670
+ parentNameWithOwner: r.parent.nameWithOwner
2671
+ }));
2672
+ const enriched = await enrichForksWithAheadBehind(client, batch);
2673
+ if (cancelled) break;
2674
+ slice.forEach((r) => enrichmentDoneRef.current.add(r.id));
2675
+ setItems((prev) => prev.map((repo) => {
2676
+ const hit = enriched.find((e) => e.id === repo.id);
2677
+ if (!hit || hit.forkHistoryCount === null || hit.parentHistoryCount === null) return repo;
2678
+ return {
2679
+ ...repo,
2680
+ defaultBranchRef: repo.defaultBranchRef ? {
2681
+ ...repo.defaultBranchRef,
2682
+ target: {
2683
+ ...repo.defaultBranchRef.target || {},
2684
+ history: { totalCount: hit.forkHistoryCount }
2685
+ }
2686
+ } : { name: void 0, target: { history: { totalCount: hit.forkHistoryCount } } },
2687
+ parent: repo.parent ? {
2688
+ ...repo.parent,
2689
+ defaultBranchRef: {
2690
+ ...repo.parent.defaultBranchRef || {},
2691
+ target: {
2692
+ ...repo.parent.defaultBranchRef?.target || {},
2693
+ history: { totalCount: hit.parentHistoryCount }
2694
+ }
2695
+ }
2696
+ } : repo.parent
2697
+ };
2698
+ }));
2699
+ if (i + BATCH_SIZE < unenriched.length) {
2700
+ await new Promise((resolve) => setTimeout(resolve, BATCH_DELAY_MS));
2701
+ }
2702
+ }
2703
+ } catch (err) {
2704
+ logger.error("Fork enrichment failed", { error: err.message });
2705
+ } finally {
2706
+ if (!cancelled) setEnrichingForks(false);
2707
+ }
2708
+ })();
2709
+ return () => {
2710
+ cancelled = true;
2711
+ setEnrichingForks(false);
2712
+ };
2713
+ }, [loading, loadingMore, hasNextPage, items.length, forkTracking]);
2714
+ async function jumpToUpstreamRepo(parentNameWithOwner) {
2715
+ const [parentOwner, parentName] = parentNameWithOwner.split("/");
2716
+ if (!parentOwner || !parentName) return;
2717
+ const repo = await fetchRepositoryByOwnerAndName(client, parentOwner, parentName);
2718
+ if (repo) {
2719
+ setInfoRepo(repo);
2720
+ setInfoMode(true);
2721
+ }
2722
+ }
2723
+ const [visibilityFilter, setVisibilityFilter] = useState17("all");
2575
2724
  const previousVisibilityFilter = useRef("all");
2576
- const [archiveFilter, setArchiveFilter] = useState16("all");
2725
+ const [archiveFilter, setArchiveFilter] = useState17("all");
2577
2726
  const sortFieldMap = {
2578
2727
  "updated": "UPDATED_AT",
2579
2728
  "pushed": "PUSHED_AT",
@@ -2617,6 +2766,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2617
2766
  orgLogin,
2618
2767
  privacy
2619
2768
  );
2769
+ if (reset || !after) {
2770
+ enrichmentDoneRef.current.clear();
2771
+ }
2620
2772
  setItems((prev) => reset || !after ? page.nodes : [...prev, ...page.nodes]);
2621
2773
  setEndCursor(page.endCursor);
2622
2774
  setHasNextPage(page.hasNextPage);
@@ -2739,7 +2891,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2739
2891
  }
2740
2892
  previousVisibilityFilter.current = visibilityFilter;
2741
2893
  }, [visibilityFilter]);
2742
- useInput16((input, key) => {
2894
+ useInput17((input, key) => {
2743
2895
  if (error) {
2744
2896
  if (input && input.toUpperCase() === "Q") {
2745
2897
  try {
@@ -2901,6 +3053,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2901
3053
  if (renameMode) {
2902
3054
  return;
2903
3055
  }
3056
+ if (openInBrowserMode) {
3057
+ return;
3058
+ }
2904
3059
  if (copyUrlMode) {
2905
3060
  return;
2906
3061
  }
@@ -2957,7 +3112,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
2957
3112
  if (key.pageUp) setCursor((c) => Math.max(c - 10, 0));
2958
3113
  if (key.return) {
2959
3114
  const repo = visibleItems[cursor];
2960
- if (repo) openInBrowser(`https://github.com/${repo.nameWithOwner}`);
3115
+ if (repo) {
3116
+ if (repo.isFork && repo.parent) {
3117
+ setOpenInBrowserTarget(repo);
3118
+ setOpenInBrowserMode(true);
3119
+ } else {
3120
+ openInBrowser(`https://github.com/${repo.nameWithOwner}`);
3121
+ }
3122
+ }
2961
3123
  }
2962
3124
  if (key.delete || key.backspace) {
2963
3125
  const repo = visibleItems[cursor];
@@ -3128,7 +3290,33 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3128
3290
  }
3129
3291
  if (input && input.toUpperCase() === "O") {
3130
3292
  const repo = visibleItems[cursor];
3131
- if (repo) openInBrowser(`https://github.com/${repo.nameWithOwner}`);
3293
+ if (repo) {
3294
+ if (repo.isFork && repo.parent) {
3295
+ setOpenInBrowserTarget(repo);
3296
+ setOpenInBrowserMode(true);
3297
+ } else {
3298
+ openInBrowser(`https://github.com/${repo.nameWithOwner}`);
3299
+ }
3300
+ }
3301
+ return;
3302
+ }
3303
+ if (input && input.toUpperCase() === "P") {
3304
+ const repo = visibleItems[cursor];
3305
+ if (repo && repo.isFork && repo.parent?.nameWithOwner) {
3306
+ const parentName = repo.parent.nameWithOwner;
3307
+ const parentIdx = visibleItems.findIndex((r) => r.nameWithOwner === parentName);
3308
+ if (parentIdx >= 0) {
3309
+ setCursor(parentIdx);
3310
+ } else {
3311
+ const cachedParent = items.find((r) => r.nameWithOwner === parentName) || starredItems.find((r) => r.nameWithOwner === parentName);
3312
+ if (cachedParent) {
3313
+ setInfoRepo(cachedParent);
3314
+ setInfoMode(true);
3315
+ } else {
3316
+ jumpToUpstreamRepo(parentName);
3317
+ }
3318
+ }
3319
+ }
3132
3320
  return;
3133
3321
  }
3134
3322
  if (key.shift && input === "T") {
@@ -3252,78 +3440,79 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3252
3440
  exec(cmd);
3253
3441
  }
3254
3442
  const lowRate = rateLimit && rateLimit.remaining <= Math.ceil(rateLimit.limit * 0.1) || restRateLimit && restRateLimit.core.remaining <= Math.ceil(restRateLimit.core.limit * 0.1);
3255
- const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || archiveFilterMode || sortMode || sortDirectionMode || changeVisibilityMode || copyUrlMode || renameMode;
3256
- const headerBar = useMemo2(() => /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: [
3257
- /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", gap: 1, children: [
3258
- /* @__PURE__ */ jsxs19(Text20, { color: theme.primary, bold: !modalOpen, dimColor: modalOpen, children: [
3443
+ const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode || archiveFilterMode || sortMode || sortDirectionMode || changeVisibilityMode || copyUrlMode || renameMode || openInBrowserMode;
3444
+ const headerBar = useMemo2(() => /* @__PURE__ */ jsxs20(Box20, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: [
3445
+ /* @__PURE__ */ jsxs20(Box20, { flexDirection: "row", gap: 1, children: [
3446
+ /* @__PURE__ */ jsxs20(Text21, { color: theme.primary, bold: !modalOpen, dimColor: modalOpen, children: [
3259
3447
  " ",
3260
3448
  ownerContext === "personal" ? "Personal" : ownerContext.name || ownerContext.login,
3261
3449
  ownerContext !== "personal" && isEnterpriseOrg && " (ENT)"
3262
3450
  ] }),
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: [
3451
+ /* @__PURE__ */ jsx21(Text21, { bold: true, color: modalOpen ? theme.muted : void 0, dimColor: modalOpen ? true : void 0, children: "Repositories" }),
3452
+ /* @__PURE__ */ jsxs20(Text21, { color: theme.muted, children: [
3265
3453
  "(",
3266
3454
  visibleItems.length,
3267
3455
  "/",
3268
3456
  totalCount,
3269
3457
  ")"
3270
3458
  ] }),
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, {}) }) })
3459
+ loadingMore && hasNextPage && !starsMode && totalCount > 0 && /* @__PURE__ */ jsx21(Text21, { color: theme.primary, children: ` \xB7 loading ${items.length}/${totalCount}` }),
3460
+ enrichingForks && /* @__PURE__ */ jsx21(Text21, { color: theme.muted, children: ` \xB7 enriching forks\u2026` }),
3461
+ (loading || loadingMore) && /* @__PURE__ */ jsx21(Box20, { width: 2, flexShrink: 0, flexGrow: 0, marginLeft: 1, children: /* @__PURE__ */ jsx21(Text21, { color: theme.warning, children: /* @__PURE__ */ jsx21(SlowSpinner, {}) }) })
3273
3462
  ] }),
3274
- (rateLimit || restRateLimit) && /* @__PURE__ */ jsxs19(Text20, { color: lowRate ? theme.warning : theme.muted, children: [
3463
+ (rateLimit || restRateLimit) && /* @__PURE__ */ jsxs20(Text21, { color: lowRate ? theme.warning : theme.muted, children: [
3275
3464
  "GraphQL: ",
3276
3465
  rateLimit ? `${rateLimit.remaining}/${rateLimit.limit}` : "---/---",
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})` }),
3466
+ prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */ jsx21(Text21, { color: rateLimit.remaining < prevRateLimit ? theme.error : theme.success, children: ` (${rateLimit.remaining - prevRateLimit > 0 ? "+" : ""}${rateLimit.remaining - prevRateLimit})` }),
3278
3467
  " | ",
3279
3468
  "REST: ",
3280
3469
  restRateLimit ? `${restRateLimit.core.remaining}/${restRateLimit.core.limit}` : "---/---",
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})` }),
3470
+ prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */ jsx21(Text21, { color: restRateLimit.core.remaining < prevRestRateLimit ? theme.error : theme.success, children: ` (${restRateLimit.core.remaining - prevRestRateLimit > 0 ? "+" : ""}${restRateLimit.core.remaining - prevRestRateLimit})` }),
3282
3471
  " "
3283
3472
  ] })
3284
- ] }), [visibleItems.length, totalCount, loading, loadingMore, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg, restRateLimit, prevRestRateLimit, starsMode, hasNextPage, items.length, theme]);
3473
+ ] }), [visibleItems.length, totalCount, loading, loadingMore, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg, restRateLimit, prevRestRateLimit, enrichingForks, starsMode, hasNextPage, items.length, theme]);
3285
3474
  if (error) {
3286
- return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: availableHeight, children: [
3287
- /* @__PURE__ */ jsx20(Box19, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", gap: 1, children: [
3288
- /* @__PURE__ */ jsx20(Text20, { bold: true, children: " Repositories" }),
3289
- /* @__PURE__ */ jsx20(Text20, { color: "red", children: "(Error)" })
3475
+ return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", height: availableHeight, children: [
3476
+ /* @__PURE__ */ jsx21(Box20, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "row", gap: 1, children: [
3477
+ /* @__PURE__ */ jsx21(Text21, { bold: true, children: " Repositories" }),
3478
+ /* @__PURE__ */ jsx21(Text21, { color: "red", children: "(Error)" })
3290
3479
  ] }) }),
3291
- /* @__PURE__ */ jsx20(Box19, { borderStyle: "single", borderColor: "red", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx20(Box19, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", alignItems: "center", children: [
3292
- /* @__PURE__ */ jsx20(Text20, { color: "red", children: error }),
3293
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "gray", dimColor: true, children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
3480
+ /* @__PURE__ */ jsx21(Box20, { borderStyle: "single", borderColor: "red", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx21(Box20, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", alignItems: "center", children: [
3481
+ /* @__PURE__ */ jsx21(Text21, { color: "red", children: error }),
3482
+ /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "gray", dimColor: true, children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
3294
3483
  ] }) }) }),
3295
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "gray", children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
3484
+ /* @__PURE__ */ jsx21(Box20, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "gray", children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
3296
3485
  ] });
3297
3486
  }
3298
3487
  if (loading && items.length === 0 || sortingLoading) {
3299
- return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: availableHeight, children: [
3300
- /* @__PURE__ */ jsx20(Box19, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", gap: 1, children: [
3301
- /* @__PURE__ */ jsx20(Text20, { bold: true, children: " Repositories" }),
3302
- /* @__PURE__ */ jsx20(Text20, { color: "gray", children: "(Loading...)" })
3488
+ return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", height: availableHeight, children: [
3489
+ /* @__PURE__ */ jsx21(Box20, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "row", gap: 1, children: [
3490
+ /* @__PURE__ */ jsx21(Text21, { bold: true, children: " Repositories" }),
3491
+ /* @__PURE__ */ jsx21(Text21, { color: "gray", children: "(Loading...)" })
3303
3492
  ] }) }),
3304
- /* @__PURE__ */ jsx20(Box19, { borderStyle: "single", borderColor: "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx20(Box19, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx20(Box19, { flexDirection: "column", alignItems: "center", children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", alignItems: "center", children: [
3305
- /* @__PURE__ */ jsxs19(Box19, { height: 1, flexDirection: "row", children: [
3306
- /* @__PURE__ */ jsx20(Box19, { width: 2, flexShrink: 0, flexGrow: 0, children: /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: /* @__PURE__ */ jsx20(SlowSpinner, {}) }) }),
3307
- /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: refreshing ? "Refreshing..." : sortingLoading ? "Applying sort..." : "Loading repositories..." })
3493
+ /* @__PURE__ */ jsx21(Box20, { borderStyle: "single", borderColor: "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx21(Box20, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx21(Box20, { flexDirection: "column", alignItems: "center", children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", alignItems: "center", children: [
3494
+ /* @__PURE__ */ jsxs20(Box20, { height: 1, flexDirection: "row", children: [
3495
+ /* @__PURE__ */ jsx21(Box20, { width: 2, flexShrink: 0, flexGrow: 0, children: /* @__PURE__ */ jsx21(Text21, { color: "cyan", children: /* @__PURE__ */ jsx21(SlowSpinner, {}) }) }),
3496
+ /* @__PURE__ */ jsx21(Text21, { color: "cyan", children: refreshing ? "Refreshing..." : sortingLoading ? "Applying sort..." : "Loading repositories..." })
3308
3497
  ] }),
3309
- /* @__PURE__ */ jsx20(Box19, { height: 1, marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "gray", children: refreshing ? "Fetching latest repository data" : sortingLoading ? `Sorting by ${sortKey} (${sortDir === "asc" ? "ascending" : "descending"})` : "Fetching your GitHub repositories" }) })
3498
+ /* @__PURE__ */ jsx21(Box20, { height: 1, marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "gray", children: refreshing ? "Fetching latest repository data" : sortingLoading ? `Sorting by ${sortKey} (${sortDir === "asc" ? "ascending" : "descending"})` : "Fetching your GitHub repositories" }) })
3310
3499
  ] }) }) }) }),
3311
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "gray", children: "Please wait..." }) })
3500
+ /* @__PURE__ */ jsx21(Box20, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "gray", children: "Please wait..." }) })
3312
3501
  ] });
3313
3502
  }
3314
- return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: availableHeight, children: [
3503
+ return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", height: availableHeight, children: [
3315
3504
  headerBar,
3316
- showSponsorReminder && /* @__PURE__ */ jsx20(Box19, { marginX: 1, marginBottom: 1, children: /* @__PURE__ */ jsx20(Box19, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", alignItems: "center", children: [
3317
- /* @__PURE__ */ jsx20(Text20, { color: "yellow", children: "\u{1F49A} Thanks for using gh-manager-cli!" }),
3318
- /* @__PURE__ */ jsx20(Text20, { color: "gray", children: "Your support helps craft more open-source tools" }),
3319
- /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: "\u{1F496} github.com/sponsors/wiiiimm" })
3505
+ showSponsorReminder && /* @__PURE__ */ jsx21(Box20, { marginX: 1, marginBottom: 1, children: /* @__PURE__ */ jsx21(Box20, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", alignItems: "center", children: [
3506
+ /* @__PURE__ */ jsx21(Text21, { color: "yellow", children: "\u{1F49A} Thanks for using gh-manager-cli!" }),
3507
+ /* @__PURE__ */ jsx21(Text21, { color: "gray", children: "Your support helps craft more open-source tools" }),
3508
+ /* @__PURE__ */ jsx21(Text21, { color: "cyan", children: "\u{1F496} github.com/sponsors/wiiiimm" })
3320
3509
  ] }) }) }),
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 ? (
3510
+ /* @__PURE__ */ jsx21(Box20, { borderStyle: "single", borderColor: modalOpen ? theme.muted : theme.warning, paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: deleteMode && deleteTarget ? (
3322
3511
  // Centered modal; hide list content while modal is open
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: [
3324
- /* @__PURE__ */ jsx20(Text20, { bold: true, children: "Delete Confirmation" }),
3325
- /* @__PURE__ */ jsx20(Text20, { color: "red", children: "\u26A0\uFE0F Delete repository?" }),
3326
- /* @__PURE__ */ jsx20(Box19, { height: 2, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
3512
+ /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
3513
+ /* @__PURE__ */ jsx21(Text21, { bold: true, children: "Delete Confirmation" }),
3514
+ /* @__PURE__ */ jsx21(Text21, { color: "red", children: "\u26A0\uFE0F Delete repository?" }),
3515
+ /* @__PURE__ */ jsx21(Box20, { height: 2, children: /* @__PURE__ */ jsx21(Text21, { children: " " }) }),
3327
3516
  (() => {
3328
3517
  const langName = deleteTarget.primaryLanguage?.name || "";
3329
3518
  const langColor = deleteTarget.primaryLanguage?.color || "#666666";
@@ -3335,19 +3524,19 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3335
3524
  let line2 = "";
3336
3525
  if (langName) line2 += chalk15.hex(langColor)("\u25CF ") + tc.muted(`${langName} `);
3337
3526
  line2 += tc.muted(`\u2605 ${deleteTarget.stargazerCount} \u2442 ${deleteTarget.forkCount} Updated ${formatDate(deleteTarget.updatedAt)}`);
3338
- return /* @__PURE__ */ jsxs19(Fragment9, { children: [
3339
- /* @__PURE__ */ jsx20(Text20, { children: line1 }),
3340
- /* @__PURE__ */ jsx20(Text20, { children: line2 })
3527
+ return /* @__PURE__ */ jsxs20(Fragment9, { children: [
3528
+ /* @__PURE__ */ jsx21(Text21, { children: line1 }),
3529
+ /* @__PURE__ */ jsx21(Text21, { children: line2 })
3341
3530
  ] });
3342
3531
  })(),
3343
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsxs19(Text20, { children: [
3532
+ /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsxs20(Text21, { children: [
3344
3533
  "Type ",
3345
- /* @__PURE__ */ jsx20(Text20, { color: "yellow", bold: true, children: deleteCode }),
3534
+ /* @__PURE__ */ jsx21(Text21, { color: "yellow", bold: true, children: deleteCode }),
3346
3535
  " to confirm."
3347
3536
  ] }) }),
3348
- !deleteConfirmStage && /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, children: [
3349
- /* @__PURE__ */ jsx20(Text20, { children: "Confirm code: " }),
3350
- /* @__PURE__ */ jsx20(
3537
+ !deleteConfirmStage && /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, children: [
3538
+ /* @__PURE__ */ jsx21(Text21, { children: "Confirm code: " }),
3539
+ /* @__PURE__ */ jsx21(
3351
3540
  TextInput5,
3352
3541
  {
3353
3542
  value: typedCode,
@@ -3374,11 +3563,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3374
3563
  }
3375
3564
  )
3376
3565
  ] }),
3377
- deleteConfirmStage && /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, flexDirection: "column", children: [
3378
- /* @__PURE__ */ jsx20(Text20, { color: "red", children: "This action will permanently delete the repository. This cannot be undone." }),
3379
- /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
3380
- /* @__PURE__ */ jsx20(
3381
- Box19,
3566
+ deleteConfirmStage && /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "column", children: [
3567
+ /* @__PURE__ */ jsx21(Text21, { color: "red", children: "This action will permanently delete the repository. This cannot be undone." }),
3568
+ /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
3569
+ /* @__PURE__ */ jsx21(
3570
+ Box20,
3382
3571
  {
3383
3572
  borderStyle: "round",
3384
3573
  borderColor: "red",
@@ -3387,11 +3576,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3387
3576
  alignItems: "center",
3388
3577
  justifyContent: "center",
3389
3578
  flexDirection: "column",
3390
- children: /* @__PURE__ */ jsx20(Text20, { children: confirmFocus === "delete" ? chalk15.bgRed.white.bold(" Delete ") : tc.error.bold("Delete") })
3579
+ children: /* @__PURE__ */ jsx21(Text21, { children: confirmFocus === "delete" ? chalk15.bgRed.white.bold(" Delete ") : tc.error.bold("Delete") })
3391
3580
  }
3392
3581
  ),
3393
- /* @__PURE__ */ jsx20(
3394
- Box19,
3582
+ /* @__PURE__ */ jsx21(
3583
+ Box20,
3395
3584
  {
3396
3585
  borderStyle: "round",
3397
3586
  borderColor: confirmFocus === "cancel" ? "white" : "gray",
@@ -3400,16 +3589,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3400
3589
  alignItems: "center",
3401
3590
  justifyContent: "center",
3402
3591
  flexDirection: "column",
3403
- children: /* @__PURE__ */ jsx20(Text20, { children: confirmFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
3592
+ children: /* @__PURE__ */ jsx21(Text21, { children: confirmFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
3404
3593
  }
3405
3594
  )
3406
3595
  ] }),
3407
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
3596
+ /* @__PURE__ */ jsx21(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Text21, { color: "gray", children: [
3408
3597
  "Press Enter to ",
3409
3598
  confirmFocus === "delete" ? "Delete" : "Cancel",
3410
3599
  " | Y to Delete | C to Cancel"
3411
3600
  ] }) }),
3412
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(
3601
+ /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(
3413
3602
  TextInput5,
3414
3603
  {
3415
3604
  value: "",
@@ -3423,18 +3612,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3423
3612
  }
3424
3613
  ) })
3425
3614
  ] }),
3426
- deleteError && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "magenta", children: deleteError }) }),
3427
- deleting && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "yellow", children: "Deleting..." }) })
3615
+ deleteError && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "magenta", children: deleteError }) }),
3616
+ deleting && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "yellow", children: "Deleting..." }) })
3428
3617
  ] }) })
3429
- ) : archiveMode && archiveTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: archiveTarget.isArchived ? "green" : "yellow", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
3430
- /* @__PURE__ */ jsx20(Text20, { bold: true, children: archiveTarget.isArchived ? "Unarchive Confirmation" : "Archive Confirmation" }),
3431
- /* @__PURE__ */ jsx20(Text20, { color: archiveTarget.isArchived ? "green" : "yellow", children: archiveTarget.isArchived ? "\u21BA Unarchive repository?" : "\u26A0\uFE0F Archive repository?" }),
3432
- /* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
3433
- /* @__PURE__ */ jsx20(Text20, { children: archiveTarget.nameWithOwner }),
3434
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { children: archiveTarget.isArchived ? "This will make the repository active again." : "This will make the repository read-only." }) }),
3435
- /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
3436
- /* @__PURE__ */ jsx20(
3437
- Box19,
3618
+ ) : archiveMode && archiveTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "round", borderColor: archiveTarget.isArchived ? "green" : "yellow", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
3619
+ /* @__PURE__ */ jsx21(Text21, { bold: true, children: archiveTarget.isArchived ? "Unarchive Confirmation" : "Archive Confirmation" }),
3620
+ /* @__PURE__ */ jsx21(Text21, { color: archiveTarget.isArchived ? "green" : "yellow", children: archiveTarget.isArchived ? "\u21BA Unarchive repository?" : "\u26A0\uFE0F Archive repository?" }),
3621
+ /* @__PURE__ */ jsx21(Box20, { height: 1, children: /* @__PURE__ */ jsx21(Text21, { children: " " }) }),
3622
+ /* @__PURE__ */ jsx21(Text21, { children: archiveTarget.nameWithOwner }),
3623
+ /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { children: archiveTarget.isArchived ? "This will make the repository active again." : "This will make the repository read-only." }) }),
3624
+ /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
3625
+ /* @__PURE__ */ jsx21(
3626
+ Box20,
3438
3627
  {
3439
3628
  borderStyle: "round",
3440
3629
  borderColor: archiveTarget.isArchived ? "green" : "yellow",
@@ -3443,11 +3632,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3443
3632
  alignItems: "center",
3444
3633
  justifyContent: "center",
3445
3634
  flexDirection: "column",
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") })
3635
+ children: /* @__PURE__ */ jsx21(Text21, { children: archiveFocus === "confirm" ? chalk15.bgGreen.white.bold(` ${archiveTarget.isArchived ? "Unarchive" : "Archive"} `) : (archiveTarget.isArchived ? tc.success : tc.warning).bold(archiveTarget.isArchived ? "Unarchive" : "Archive") })
3447
3636
  }
3448
3637
  ),
3449
- /* @__PURE__ */ jsx20(
3450
- Box19,
3638
+ /* @__PURE__ */ jsx21(
3639
+ Box20,
3451
3640
  {
3452
3641
  borderStyle: "round",
3453
3642
  borderColor: archiveFocus === "cancel" ? "white" : "gray",
@@ -3456,18 +3645,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3456
3645
  alignItems: "center",
3457
3646
  justifyContent: "center",
3458
3647
  flexDirection: "column",
3459
- children: /* @__PURE__ */ jsx20(Text20, { children: archiveFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
3648
+ children: /* @__PURE__ */ jsx21(Text21, { children: archiveFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
3460
3649
  }
3461
3650
  )
3462
3651
  ] }),
3463
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, children: [
3652
+ /* @__PURE__ */ jsx21(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Text21, { color: theme.muted, children: [
3464
3653
  "Press Enter to ",
3465
3654
  archiveFocus === "confirm" ? archiveTarget.isArchived ? "Unarchive" : "Archive" : "Cancel",
3466
3655
  " | Y to ",
3467
3656
  archiveTarget.isArchived ? "Unarchive" : "Archive",
3468
3657
  " | C to Cancel"
3469
3658
  ] }) }),
3470
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(
3659
+ /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(
3471
3660
  TextInput5,
3472
3661
  {
3473
3662
  value: "",
@@ -3482,21 +3671,34 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3482
3671
  }
3483
3672
  }
3484
3673
  ) }),
3485
- archiveError && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "magenta", children: archiveError }) }),
3486
- archiving && /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "yellow", children: archiveTarget.isArchived ? "Unarchiving..." : "Archiving..." }) })
3487
- ] }) }) : syncMode && syncTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
3488
- /* @__PURE__ */ jsx20(Text20, { bold: true, children: "Sync Fork Confirmation" }),
3489
- /* @__PURE__ */ jsx20(Text20, { color: "blue", children: "\u27F2 Sync fork with upstream?" }),
3490
- /* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
3491
- /* @__PURE__ */ jsx20(Text20, { children: syncTarget.nameWithOwner }),
3492
- syncTarget.parent && /* @__PURE__ */ jsxs19(Text20, { color: "gray", children: [
3674
+ archiveError && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "magenta", children: archiveError }) }),
3675
+ archiving && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "yellow", children: archiveTarget.isArchived ? "Unarchiving..." : "Archiving..." }) })
3676
+ ] }) }) : syncMode && syncTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
3677
+ /* @__PURE__ */ jsx21(Text21, { bold: true, children: "Sync Fork Confirmation" }),
3678
+ /* @__PURE__ */ jsx21(Text21, { color: "blue", children: "\u27F2 Sync fork with upstream?" }),
3679
+ /* @__PURE__ */ jsx21(Box20, { height: 1, children: /* @__PURE__ */ jsx21(Text21, { children: " " }) }),
3680
+ /* @__PURE__ */ jsx21(Text21, { children: syncTarget.nameWithOwner }),
3681
+ syncTarget.parent && /* @__PURE__ */ jsxs20(Text21, { color: "gray", children: [
3493
3682
  "Upstream: ",
3494
3683
  syncTarget.parent.nameWithOwner
3495
3684
  ] }),
3496
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text20, { children: "This will merge upstream changes into your fork." }) }),
3497
- /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
3498
- /* @__PURE__ */ jsx20(
3499
- Box19,
3685
+ (() => {
3686
+ const hasData = syncTarget.isFork && syncTarget.parent && syncTarget.defaultBranchRef?.target?.history && syncTarget.parent.defaultBranchRef?.target?.history;
3687
+ if (!hasData) return null;
3688
+ const forkC = syncTarget.defaultBranchRef.target.history.totalCount;
3689
+ const parentC = syncTarget.parent.defaultBranchRef.target.history.totalCount;
3690
+ const behind = Math.max(0, parentC - forkC);
3691
+ const ahead = Math.max(0, forkC - parentC);
3692
+ const parts = [];
3693
+ if (ahead > 0) parts.push(chalk15.green(`${ahead} ahead`));
3694
+ if (behind > 0) parts.push(chalk15.yellow(`${behind} behind`));
3695
+ const statusText = parts.length === 0 ? chalk15.green("Your fork is up to date with upstream.") : `This fork is ${parts.join(", ")} of upstream.`;
3696
+ return /* @__PURE__ */ jsx21(Text21, { children: statusText });
3697
+ })(),
3698
+ /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { children: "This will merge upstream changes into your fork." }) }),
3699
+ /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
3700
+ /* @__PURE__ */ jsx21(
3701
+ Box20,
3500
3702
  {
3501
3703
  borderStyle: "round",
3502
3704
  borderColor: "blue",
@@ -3505,11 +3707,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3505
3707
  alignItems: "center",
3506
3708
  justifyContent: "center",
3507
3709
  flexDirection: "column",
3508
- children: /* @__PURE__ */ jsx20(Text20, { children: syncFocus === "confirm" ? tc.btnPrimary(" Sync ") : tc.primary.bold("Sync") })
3710
+ children: /* @__PURE__ */ jsx21(Text21, { children: syncFocus === "confirm" ? tc.btnPrimary(" Sync ") : tc.primary.bold("Sync") })
3509
3711
  }
3510
3712
  ),
3511
- /* @__PURE__ */ jsx20(
3512
- Box19,
3713
+ /* @__PURE__ */ jsx21(
3714
+ Box20,
3513
3715
  {
3514
3716
  borderStyle: "round",
3515
3717
  borderColor: syncFocus === "cancel" ? "white" : "gray",
@@ -3518,16 +3720,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3518
3720
  alignItems: "center",
3519
3721
  justifyContent: "center",
3520
3722
  flexDirection: "column",
3521
- children: /* @__PURE__ */ jsx20(Text20, { children: syncFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
3723
+ children: /* @__PURE__ */ jsx21(Text21, { children: syncFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
3522
3724
  }
3523
3725
  )
3524
3726
  ] }),
3525
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, children: [
3727
+ /* @__PURE__ */ jsx21(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Text21, { color: theme.muted, children: [
3526
3728
  "Press Enter to ",
3527
3729
  syncFocus === "confirm" ? "Sync" : "Cancel",
3528
3730
  " | Y to Sync | C to Cancel"
3529
3731
  ] }) }),
3530
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx20(
3732
+ /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(
3531
3733
  TextInput5,
3532
3734
  {
3533
3735
  value: "",
@@ -3542,14 +3744,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3542
3744
  }
3543
3745
  }
3544
3746
  ) }),
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: [
3548
- /* @__PURE__ */ jsx20(Text20, { bold: true, children: "Logout Confirmation" }),
3549
- /* @__PURE__ */ jsx20(Text20, { color: theme.primary, children: "Are you sure you want to log out?" }),
3550
- /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
3551
- /* @__PURE__ */ jsx20(
3552
- Box19,
3747
+ syncError && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: theme.error, children: syncError }) }),
3748
+ syncing && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: theme.warning, children: "Syncing..." }) })
3749
+ ] }) }) : logoutMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "round", borderColor: theme.primary, paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
3750
+ /* @__PURE__ */ jsx21(Text21, { bold: true, children: "Logout Confirmation" }),
3751
+ /* @__PURE__ */ jsx21(Text21, { color: theme.primary, children: "Are you sure you want to log out?" }),
3752
+ /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
3753
+ /* @__PURE__ */ jsx21(
3754
+ Box20,
3553
3755
  {
3554
3756
  borderStyle: "round",
3555
3757
  borderColor: theme.primary,
@@ -3558,11 +3760,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3558
3760
  alignItems: "center",
3559
3761
  justifyContent: "center",
3560
3762
  flexDirection: "column",
3561
- children: /* @__PURE__ */ jsx20(Text20, { children: logoutFocus === "confirm" ? tc.btnPrimary(" Logout ") : tc.primary.bold("Logout") })
3763
+ children: /* @__PURE__ */ jsx21(Text21, { children: logoutFocus === "confirm" ? tc.btnPrimary(" Logout ") : tc.primary.bold("Logout") })
3562
3764
  }
3563
3765
  ),
3564
- /* @__PURE__ */ jsx20(
3565
- Box19,
3766
+ /* @__PURE__ */ jsx21(
3767
+ Box20,
3566
3768
  {
3567
3769
  borderStyle: "round",
3568
3770
  borderColor: logoutFocus === "cancel" ? "white" : theme.muted,
@@ -3571,16 +3773,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3571
3773
  alignItems: "center",
3572
3774
  justifyContent: "center",
3573
3775
  flexDirection: "column",
3574
- children: /* @__PURE__ */ jsx20(Text20, { children: logoutFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
3776
+ children: /* @__PURE__ */ jsx21(Text21, { children: logoutFocus === "cancel" ? tc.btnMuted(" Cancel ") : tc.muted.bold("Cancel") })
3575
3777
  }
3576
3778
  )
3577
3779
  ] }),
3578
- /* @__PURE__ */ jsx20(Box19, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, children: [
3780
+ /* @__PURE__ */ jsx21(Box20, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs20(Text21, { color: theme.muted, children: [
3579
3781
  "Press Enter to ",
3580
3782
  logoutFocus === "confirm" ? "Logout" : "Cancel",
3581
3783
  " | Y to Logout | C to Cancel"
3582
3784
  ] }) })
3583
- ] }) }) : orgSwitcherOpen ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3785
+ ] }) }) : orgSwitcherOpen ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
3584
3786
  OrgSwitcher,
3585
3787
  {
3586
3788
  token,
@@ -3588,45 +3790,45 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3588
3790
  onSelect: handleOrgContextChange,
3589
3791
  onClose: () => setOrgSwitcherOpen(false)
3590
3792
  }
3591
- ) }) : infoMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: (() => {
3793
+ ) }) : infoMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: (() => {
3592
3794
  const repo = infoRepo || visibleItems[cursor];
3593
- if (!repo) return /* @__PURE__ */ jsx20(Text20, { color: theme.error, children: "No repository selected." });
3795
+ if (!repo) return /* @__PURE__ */ jsx21(Text21, { color: theme.error, children: "No repository selected." });
3594
3796
  const langName = repo.primaryLanguage?.name || "N/A";
3595
3797
  const langColor = repo.primaryLanguage?.color || "#666666";
3596
- return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.internal, paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 90), children: [
3597
- /* @__PURE__ */ jsxs19(Text20, { bold: true, children: [
3798
+ return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "round", borderColor: theme.internal, paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 90), children: [
3799
+ /* @__PURE__ */ jsxs20(Text21, { bold: true, children: [
3598
3800
  "Repository Info ",
3599
3801
  infoRepo ? tc.muted("(cached)") : ""
3600
3802
  ] }),
3601
- /* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
3602
- /* @__PURE__ */ jsx20(Text20, { children: tc.text.bold(repo.nameWithOwner) }),
3603
- repo.description && /* @__PURE__ */ jsx20(Text20, { color: theme.muted, children: repo.description }),
3604
- /* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
3605
- /* @__PURE__ */ jsxs19(Text20, { children: [
3803
+ /* @__PURE__ */ jsx21(Box20, { height: 1, children: /* @__PURE__ */ jsx21(Text21, { children: " " }) }),
3804
+ /* @__PURE__ */ jsx21(Text21, { children: tc.text.bold(repo.nameWithOwner) }),
3805
+ repo.description && /* @__PURE__ */ jsx21(Text21, { color: theme.muted, children: repo.description }),
3806
+ /* @__PURE__ */ jsx21(Box20, { height: 1, children: /* @__PURE__ */ jsx21(Text21, { children: " " }) }),
3807
+ /* @__PURE__ */ jsxs20(Text21, { children: [
3606
3808
  repo.visibility === "PRIVATE" ? tc.private("Private") : repo.visibility === "INTERNAL" ? tc.internal("Internal") : tc.success("Public"),
3607
3809
  repo.isArchived ? tc.archived(" Archived") : "",
3608
3810
  repo.isFork ? tc.fork(" Fork") : ""
3609
3811
  ] }),
3610
- /* @__PURE__ */ jsx20(Text20, { children: tc.muted(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount}`) }),
3611
- /* @__PURE__ */ jsxs19(Text20, { children: [
3812
+ /* @__PURE__ */ jsx21(Text21, { children: tc.muted(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount}`) }),
3813
+ /* @__PURE__ */ jsxs20(Text21, { children: [
3612
3814
  chalk15.hex(langColor)(`\u25CF `),
3613
3815
  tc.muted(`${langName}`)
3614
3816
  ] }),
3615
- /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, children: [
3817
+ /* @__PURE__ */ jsxs20(Text21, { color: theme.muted, children: [
3616
3818
  "Updated: ",
3617
3819
  formatDate(repo.updatedAt),
3618
3820
  " \u2022 Pushed: ",
3619
3821
  formatDate(repo.pushedAt)
3620
3822
  ] }),
3621
- /* @__PURE__ */ jsxs19(Text20, { color: theme.muted, children: [
3823
+ /* @__PURE__ */ jsxs20(Text21, { color: theme.muted, children: [
3622
3824
  "Size: ",
3623
3825
  repo.diskUsage,
3624
3826
  " KB"
3625
3827
  ] }),
3626
- /* @__PURE__ */ jsx20(Box19, { height: 1, children: /* @__PURE__ */ jsx20(Text20, { children: " " }) }),
3627
- /* @__PURE__ */ jsx20(Text20, { color: theme.muted, children: "Press Esc or I to close" })
3828
+ /* @__PURE__ */ jsx21(Box20, { height: 1, children: /* @__PURE__ */ jsx21(Text21, { children: " " }) }),
3829
+ /* @__PURE__ */ jsx21(Text21, { color: theme.muted, children: "Press Esc or I to close" })
3628
3830
  ] });
3629
- })() }) : archiveFilterMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3831
+ })() }) : archiveFilterMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
3630
3832
  ArchiveFilterModal,
3631
3833
  {
3632
3834
  currentFilter: archiveFilter,
@@ -3639,7 +3841,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3639
3841
  onCancel: () => setArchiveFilterMode(false),
3640
3842
  theme
3641
3843
  }
3642
- ) }) : visibilityMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3844
+ ) }) : visibilityMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
3643
3845
  VisibilityModal,
3644
3846
  {
3645
3847
  currentFilter: visibilityFilter,
@@ -3653,7 +3855,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3653
3855
  onCancel: () => setVisibilityMode(false),
3654
3856
  theme
3655
3857
  }
3656
- ) }) : sortMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3858
+ ) }) : sortMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
3657
3859
  SortModal,
3658
3860
  {
3659
3861
  currentSort: sortKey,
@@ -3666,7 +3868,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3666
3868
  onCancel: () => setSortMode(false),
3667
3869
  theme
3668
3870
  }
3669
- ) }) : sortDirectionMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3871
+ ) }) : sortDirectionMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
3670
3872
  SortDirectionModal,
3671
3873
  {
3672
3874
  currentDirection: sortDir,
@@ -3680,7 +3882,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3680
3882
  onCancel: () => setSortDirectionMode(false),
3681
3883
  theme
3682
3884
  }
3683
- ) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3885
+ ) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
3684
3886
  ChangeVisibilityModal,
3685
3887
  {
3686
3888
  isOpen: changeVisibilityMode,
@@ -3694,7 +3896,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3694
3896
  error: changeVisibilityError,
3695
3897
  theme
3696
3898
  }
3697
- ) }) : renameMode && renameTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3899
+ ) }) : renameMode && renameTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
3698
3900
  RenameModal,
3699
3901
  {
3700
3902
  repo: renameTarget,
@@ -3702,7 +3904,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3702
3904
  onCancel: closeRenameModal,
3703
3905
  theme
3704
3906
  }
3705
- ) }) : copyUrlMode ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3907
+ ) }) : copyUrlMode ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
3706
3908
  CopyUrlModal,
3707
3909
  {
3708
3910
  repo: copyUrlTarget,
@@ -3711,7 +3913,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3711
3913
  onCopy: handleCopyUrl,
3712
3914
  theme
3713
3915
  }
3714
- ) }) : unstarMode && unstarTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3916
+ ) }) : unstarMode && unstarTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
3715
3917
  UnstarModal,
3716
3918
  {
3717
3919
  visible: unstarMode,
@@ -3722,7 +3924,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3722
3924
  error: unstarError,
3723
3925
  theme
3724
3926
  }
3725
- ) }) : starMode && starTarget ? /* @__PURE__ */ jsx20(Box19, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx20(
3927
+ ) }) : starMode && starTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
3726
3928
  StarModal,
3727
3929
  {
3728
3930
  visible: starMode,
@@ -3734,8 +3936,23 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3734
3936
  error: starError,
3735
3937
  theme
3736
3938
  }
3737
- ) }) : /* @__PURE__ */ jsxs19(Fragment9, { children: [
3738
- /* @__PURE__ */ jsx20(
3939
+ ) }) : openInBrowserMode && openInBrowserTarget ? /* @__PURE__ */ jsx21(Box20, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx21(
3940
+ OpenInBrowserModal,
3941
+ {
3942
+ repo: openInBrowserTarget,
3943
+ onOpen: (url) => {
3944
+ openInBrowser(url);
3945
+ setOpenInBrowserMode(false);
3946
+ setOpenInBrowserTarget(null);
3947
+ },
3948
+ onCancel: () => {
3949
+ setOpenInBrowserMode(false);
3950
+ setOpenInBrowserTarget(null);
3951
+ },
3952
+ theme
3953
+ }
3954
+ ) }) : /* @__PURE__ */ jsxs20(Fragment9, { children: [
3955
+ /* @__PURE__ */ jsx21(
3739
3956
  RepoListHeader,
3740
3957
  {
3741
3958
  ownerContext,
@@ -3751,9 +3968,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3751
3968
  theme
3752
3969
  }
3753
3970
  ),
3754
- filterMode && /* @__PURE__ */ jsxs19(Box19, { marginBottom: 1, children: [
3755
- /* @__PURE__ */ jsx20(Text20, { children: "Search: " }),
3756
- /* @__PURE__ */ jsx20(
3971
+ filterMode && /* @__PURE__ */ jsxs20(Box20, { marginBottom: 1, children: [
3972
+ /* @__PURE__ */ jsx21(Text21, { children: "Search: " }),
3973
+ /* @__PURE__ */ jsx21(
3757
3974
  TextInput5,
3758
3975
  {
3759
3976
  value: filter,
@@ -3767,10 +3984,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3767
3984
  }
3768
3985
  )
3769
3986
  ] }),
3770
- /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", height: listHeight, children: [
3987
+ /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", height: listHeight, children: [
3771
3988
  visibleItems.slice(windowed.start, windowed.end).map((repo, i) => {
3772
3989
  const idx = windowed.start + i;
3773
- return /* @__PURE__ */ jsx20(
3990
+ return /* @__PURE__ */ jsx21(
3774
3991
  RepoRow,
3775
3992
  {
3776
3993
  repo,
@@ -3785,55 +4002,55 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
3785
4002
  repo.nameWithOwner
3786
4003
  );
3787
4004
  }),
3788
- loadingMore && hasNextPage && !starsMode && /* @__PURE__ */ jsx20(Box19, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", children: [
3789
- /* @__PURE__ */ jsx20(Box19, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: /* @__PURE__ */ jsx20(SlowSpinner, {}) }) }),
3790
- /* @__PURE__ */ jsxs19(Text20, { color: "cyan", children: [
4005
+ loadingMore && hasNextPage && !starsMode && /* @__PURE__ */ jsx21(Box20, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "row", children: [
4006
+ /* @__PURE__ */ jsx21(Box20, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "cyan", children: /* @__PURE__ */ jsx21(SlowSpinner, {}) }) }),
4007
+ /* @__PURE__ */ jsxs20(Text21, { color: "cyan", children: [
3791
4008
  "Loading repositories\u2026 ",
3792
4009
  totalCount > 0 ? `(${items.length}/${totalCount})` : `(${items.length})`
3793
4010
  ] })
3794
4011
  ] }) }),
3795
- loadingMore && hasNextPage && starsMode && /* @__PURE__ */ jsx20(Box19, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs19(Box19, { flexDirection: "row", children: [
3796
- /* @__PURE__ */ jsx20(Box19, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: /* @__PURE__ */ jsx20(SlowSpinner, {}) }) }),
3797
- /* @__PURE__ */ jsx20(Text20, { color: "cyan", children: "Loading more repositories..." })
4012
+ loadingMore && hasNextPage && starsMode && /* @__PURE__ */ jsx21(Box20, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs20(Box20, { flexDirection: "row", children: [
4013
+ /* @__PURE__ */ jsx21(Box20, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "cyan", children: /* @__PURE__ */ jsx21(SlowSpinner, {}) }) }),
4014
+ /* @__PURE__ */ jsx21(Text21, { color: "cyan", children: "Loading more repositories..." })
3798
4015
  ] }) }),
3799
- filterActive && hasNextPage && !starsMode && /* @__PURE__ */ jsx20(Box19, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs19(Text20, { color: "yellow", dimColor: true, children: [
4016
+ filterActive && hasNextPage && !starsMode && /* @__PURE__ */ jsx21(Box20, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs20(Text21, { color: "yellow", dimColor: true, children: [
3800
4017
  "Still loading repos (",
3801
4018
  items.length,
3802
4019
  "/",
3803
4020
  totalCount > 0 ? totalCount : "?",
3804
4021
  ") \u2014 fuzzy results may be incomplete"
3805
4022
  ] }) }),
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" }) })
4023
+ !loading && visibleItems.length === 0 && !(filterActive && hasNextPage && !starsMode) && /* @__PURE__ */ jsx21(Box20, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx21(Text21, { color: "gray", dimColor: true, children: filter ? "No repositories match your search" : "No repositories found" }) })
3807
4024
  ] })
3808
4025
  ] }) }),
3809
- /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, paddingX: 1, flexDirection: "column", children: [
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: [
4026
+ /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, paddingX: 1, flexDirection: "column", children: [
4027
+ /* @__PURE__ */ jsx21(Box20, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx21(Text21, { 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" }) }),
4028
+ /* @__PURE__ */ jsx21(Box20, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsxs20(Text21, { color: theme.muted, dimColor: modalOpen ? true : void 0, children: [
3812
4029
  "/ Search",
3813
4030
  !filterActive && " \u2022 S Sort \u2022 D Direction",
3814
4031
  " \u2022 T Density \u2022 Shift+T Theme \u2022 A Archive Filter",
3815
4032
  !starsMode && " \u2022 V Visibility Filter"
3816
4033
  ] }) }),
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" }) })
4034
+ /* @__PURE__ */ jsx21(Box20, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx21(Text21, { 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 \u2022 P Jump to upstream` }) }),
4035
+ /* @__PURE__ */ jsx21(Box20, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx21(Text21, { 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" }) }),
4036
+ /* @__PURE__ */ jsx21(Box20, { width: terminalWidth, justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx21(Text21, { color: theme.warning, dimColor: modalOpen ? true : void 0, children: "\u{1F496} Sponsor on GitHub: github.com/sponsors/wiiiimm" }) })
3820
4037
  ] }),
3821
- process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, borderStyle: "single", borderColor: "yellow", paddingX: 1, flexDirection: "column", children: [
3822
- /* @__PURE__ */ jsx20(Text20, { bold: true, color: "yellow", children: "Debug Messages:" }),
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))
4038
+ process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, borderStyle: "single", borderColor: "yellow", paddingX: 1, flexDirection: "column", children: [
4039
+ /* @__PURE__ */ jsx21(Text21, { bold: true, color: "yellow", children: "Debug Messages:" }),
4040
+ debugMessages.length === 0 ? /* @__PURE__ */ jsx21(Text21, { color: "gray", children: "No debug messages yet..." }) : debugMessages.map((msg, i) => /* @__PURE__ */ jsx21(Text21, { color: "gray", children: msg }, i))
3824
4041
  ] }),
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 }) }) }),
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 }) }) })
4042
+ themeToast && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx21(Box20, { borderStyle: "round", borderColor: theme.primary, paddingX: 2, paddingY: 0, children: /* @__PURE__ */ jsx21(Text21, { color: theme.primary, children: themeToast }) }) }),
4043
+ copyToast && /* @__PURE__ */ jsx21(Box20, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx21(Box20, { borderStyle: "round", borderColor: copyToast.includes("Failed") ? "red" : "green", paddingX: 2, paddingY: 0, children: /* @__PURE__ */ jsx21(Text21, { color: copyToast.includes("Failed") ? "red" : "green", children: copyToast }) }) })
3827
4044
  ] });
3828
4045
  }
3829
4046
 
3830
4047
  // src/ui/components/auth/AuthMethodSelector.tsx
3831
- import { useState as useState17 } from "react";
3832
- import { Box as Box20, Text as Text21, useInput as useInput17 } from "ink";
4048
+ import { useState as useState18 } from "react";
4049
+ import { Box as Box21, Text as Text22, useInput as useInput18 } from "ink";
3833
4050
  import chalk16 from "chalk";
3834
- import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
4051
+ import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
3835
4052
  function AuthMethodSelector({ onSelect, onQuit }) {
3836
- const [selectedIndex, setSelectedIndex] = useState17(0);
4053
+ const [selectedIndex, setSelectedIndex] = useState18(0);
3837
4054
  const methods = [
3838
4055
  {
3839
4056
  key: "oauth",
@@ -3846,7 +4063,7 @@ function AuthMethodSelector({ onSelect, onQuit }) {
3846
4063
  description: "Manually enter a GitHub Personal Access Token"
3847
4064
  }
3848
4065
  ];
3849
- useInput17((input, key) => {
4066
+ useInput18((input, key) => {
3850
4067
  if (key.escape || input?.toLowerCase() === "q") {
3851
4068
  if (onQuit) {
3852
4069
  onQuit();
@@ -3865,33 +4082,33 @@ function AuthMethodSelector({ onSelect, onQuit }) {
3865
4082
  onSelect("pat");
3866
4083
  }
3867
4084
  });
3868
- return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, children: [
3869
- /* @__PURE__ */ jsx21(Text21, { bold: true, marginBottom: 1, children: "Choose Authentication Method" }),
3870
- /* @__PURE__ */ jsx21(Box20, { flexDirection: "column", marginY: 1, children: methods.map((method, index) => {
4085
+ return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, children: [
4086
+ /* @__PURE__ */ jsx22(Text22, { bold: true, marginBottom: 1, children: "Choose Authentication Method" }),
4087
+ /* @__PURE__ */ jsx22(Box21, { flexDirection: "column", marginY: 1, children: methods.map((method, index) => {
3871
4088
  const isSelected = index === selectedIndex;
3872
4089
  const prefix = isSelected ? chalk16.cyan("\u203A") : " ";
3873
4090
  const numberPrefix = `${index + 1}.`;
3874
- return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", marginBottom: 1, children: [
3875
- /* @__PURE__ */ jsx21(Text21, { children: /* @__PURE__ */ jsxs20(Text21, { color: isSelected ? "cyan" : void 0, bold: isSelected, children: [
4091
+ return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", marginBottom: 1, children: [
4092
+ /* @__PURE__ */ jsx22(Text22, { children: /* @__PURE__ */ jsxs21(Text22, { color: isSelected ? "cyan" : void 0, bold: isSelected, children: [
3876
4093
  prefix,
3877
4094
  " ",
3878
4095
  numberPrefix,
3879
4096
  " ",
3880
4097
  method.label
3881
4098
  ] }) }),
3882
- /* @__PURE__ */ jsxs20(Text21, { color: "gray", dimColor: true, children: [
4099
+ /* @__PURE__ */ jsxs21(Text22, { color: "gray", dimColor: true, children: [
3883
4100
  " ",
3884
4101
  method.description
3885
4102
  ] })
3886
4103
  ] }, method.key);
3887
4104
  }) }),
3888
- /* @__PURE__ */ jsx21(Text21, { color: "gray", dimColor: true, marginTop: 1, children: "Use arrow keys to navigate, Enter to select, or press 1/2 \u2022 Q/Esc to quit" })
4105
+ /* @__PURE__ */ jsx22(Text22, { color: "gray", dimColor: true, marginTop: 1, children: "Use arrow keys to navigate, Enter to select, or press 1/2 \u2022 Q/Esc to quit" })
3889
4106
  ] });
3890
4107
  }
3891
4108
 
3892
4109
  // src/ui/components/auth/OAuthProgress.tsx
3893
- import { Box as Box21, Text as Text22 } from "ink";
3894
- import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
4110
+ import { Box as Box22, Text as Text23 } from "ink";
4111
+ import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
3895
4112
  function OAuthProgress({ status, error, deviceCode }) {
3896
4113
  const statusMessages = {
3897
4114
  initializing: {
@@ -3928,64 +4145,64 @@ function OAuthProgress({ status, error, deviceCode }) {
3928
4145
  }
3929
4146
  };
3930
4147
  const { message, showSpinner } = statusMessages[status];
3931
- return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", borderStyle: "single", borderColor: status === "error" ? "red" : "cyan", paddingX: 2, paddingY: 1, children: [
3932
- /* @__PURE__ */ jsx22(Text22, { bold: true, marginBottom: 1, children: "GitHub OAuth Authentication" }),
3933
- /* @__PURE__ */ jsx22(Box21, { marginY: 1, children: showSpinner ? /* @__PURE__ */ jsxs21(Box21, { children: [
3934
- /* @__PURE__ */ jsx22(Text22, { color: "green", children: /* @__PURE__ */ jsx22(SlowSpinner, { interval: 2e3 }) }),
3935
- /* @__PURE__ */ jsxs21(Text22, { children: [
4148
+ return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", borderStyle: "single", borderColor: status === "error" ? "red" : "cyan", paddingX: 2, paddingY: 1, children: [
4149
+ /* @__PURE__ */ jsx23(Text23, { bold: true, marginBottom: 1, children: "GitHub OAuth Authentication" }),
4150
+ /* @__PURE__ */ jsx23(Box22, { marginY: 1, children: showSpinner ? /* @__PURE__ */ jsxs22(Box22, { children: [
4151
+ /* @__PURE__ */ jsx23(Text23, { color: "green", children: /* @__PURE__ */ jsx23(SlowSpinner, { interval: 2e3 }) }),
4152
+ /* @__PURE__ */ jsxs22(Text23, { children: [
3936
4153
  " ",
3937
4154
  message
3938
4155
  ] })
3939
- ] }) : /* @__PURE__ */ jsxs21(Text22, { color: status === "error" ? "red" : "green", children: [
4156
+ ] }) : /* @__PURE__ */ jsxs22(Text23, { color: status === "error" ? "red" : "green", children: [
3940
4157
  status === "error" ? "\u2717" : "\u2713",
3941
4158
  " ",
3942
4159
  message
3943
4160
  ] }) }),
3944
- (status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */ jsxs21(Box21, { marginY: 1, flexDirection: "column", children: [
3945
- /* @__PURE__ */ jsx22(Text22, { bold: true, color: "cyan", marginBottom: 1, children: "\u{1F4CB} Please complete these steps:" }),
3946
- /* @__PURE__ */ jsxs21(Box21, { marginBottom: 1, children: [
3947
- /* @__PURE__ */ jsx22(Text22, { children: "1. Visit: " }),
3948
- /* @__PURE__ */ jsx22(Text22, { bold: true, color: "blue", children: deviceCode.verification_uri })
4161
+ (status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */ jsxs22(Box22, { marginY: 1, flexDirection: "column", children: [
4162
+ /* @__PURE__ */ jsx23(Text23, { bold: true, color: "cyan", marginBottom: 1, children: "\u{1F4CB} Please complete these steps:" }),
4163
+ /* @__PURE__ */ jsxs22(Box22, { marginBottom: 1, children: [
4164
+ /* @__PURE__ */ jsx23(Text23, { children: "1. Visit: " }),
4165
+ /* @__PURE__ */ jsx23(Text23, { bold: true, color: "blue", children: deviceCode.verification_uri })
3949
4166
  ] }),
3950
- /* @__PURE__ */ jsxs21(Box21, { marginBottom: 1, flexDirection: "column", children: [
3951
- /* @__PURE__ */ jsx22(Text22, { children: "2. Enter this code:" }),
3952
- /* @__PURE__ */ jsx22(Box21, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, marginTop: 1, children: /* @__PURE__ */ jsx22(Text22, { bold: true, color: "yellow", children: deviceCode.user_code }) })
4167
+ /* @__PURE__ */ jsxs22(Box22, { marginBottom: 1, flexDirection: "column", children: [
4168
+ /* @__PURE__ */ jsx23(Text23, { children: "2. Enter this code:" }),
4169
+ /* @__PURE__ */ jsx23(Box22, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, marginTop: 1, children: /* @__PURE__ */ jsx23(Text23, { bold: true, color: "yellow", children: deviceCode.user_code }) })
3953
4170
  ] }),
3954
- status === "waiting_for_authorization" && /* @__PURE__ */ jsx22(Text22, { color: "gray", marginTop: 1, children: "Your browser should open automatically." }),
3955
- status === "polling_for_token" && /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", marginTop: 1, children: [
3956
- /* @__PURE__ */ jsx22(Text22, { color: "gray", children: "Waiting for you to complete authorization in your browser..." }),
3957
- /* @__PURE__ */ jsx22(Text22, { color: "gray", dimColor: true, marginTop: 1, children: "This will timeout in 15 minutes. Press Esc to cancel." })
4171
+ status === "waiting_for_authorization" && /* @__PURE__ */ jsx23(Text23, { color: "gray", marginTop: 1, children: "Your browser should open automatically." }),
4172
+ status === "polling_for_token" && /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", marginTop: 1, children: [
4173
+ /* @__PURE__ */ jsx23(Text23, { color: "gray", children: "Waiting for you to complete authorization in your browser..." }),
4174
+ /* @__PURE__ */ jsx23(Text23, { color: "gray", dimColor: true, marginTop: 1, children: "This will timeout in 15 minutes. Press Esc to cancel." })
3958
4175
  ] })
3959
4176
  ] }),
3960
- status === "error" && error && /* @__PURE__ */ jsxs21(Box21, { marginY: 1, flexDirection: "column", children: [
3961
- /* @__PURE__ */ jsx22(Text22, { color: "red", children: error }),
3962
- /* @__PURE__ */ jsx22(Text22, { color: "gray", marginTop: 1, children: "Press Esc to go back and try again." })
4177
+ status === "error" && error && /* @__PURE__ */ jsxs22(Box22, { marginY: 1, flexDirection: "column", children: [
4178
+ /* @__PURE__ */ jsx23(Text23, { color: "red", children: error }),
4179
+ /* @__PURE__ */ jsx23(Text23, { color: "gray", marginTop: 1, children: "Press Esc to go back and try again." })
3963
4180
  ] }),
3964
- status === "success" && /* @__PURE__ */ jsx22(Text22, { color: "gray", marginTop: 1, children: "Returning to application..." })
4181
+ status === "success" && /* @__PURE__ */ jsx23(Text23, { color: "gray", marginTop: 1, children: "Returning to application..." })
3965
4182
  ] });
3966
4183
  }
3967
4184
 
3968
4185
  // src/ui/App.tsx
3969
- import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
4186
+ import { jsx as jsx24, jsxs as jsxs23 } from "react/jsx-runtime";
3970
4187
  var packageJson = require_package();
3971
4188
  function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlineTokenEphemeral }) {
3972
4189
  const { exit } = useApp2();
3973
4190
  const { stdout } = useStdout2();
3974
- const [mode, setMode] = useState18("checking");
3975
- const [token, setToken] = useState18(null);
3976
- const [input, setInput] = useState18("");
3977
- const [error, setError] = useState18(null);
3978
- const [viewer, setViewer] = useState18(null);
3979
- const [rateLimitReset, setRateLimitReset] = useState18(null);
3980
- const [wasRateLimited, setWasRateLimited] = useState18(false);
3981
- const [orgContext, setOrgContext] = useState18("personal");
3982
- const [authMethod, setAuthMethod] = useState18("pat");
3983
- const [oauthStatus, setOAuthStatus] = useState18("initializing");
3984
- const [tokenSource, setTokenSource] = useState18("pat");
3985
- const [sessionTokenOrigin, setSessionTokenOrigin] = useState18("stored");
3986
- const [deviceCodeResponse, setDeviceCodeResponse] = useState18(null);
3987
- const [oauthDeviceCode, setOauthDeviceCode] = useState18(null);
3988
- const [dims, setDims] = useState18(() => {
4191
+ const [mode, setMode] = useState19("checking");
4192
+ const [token, setToken] = useState19(null);
4193
+ const [input, setInput] = useState19("");
4194
+ const [error, setError] = useState19(null);
4195
+ const [viewer, setViewer] = useState19(null);
4196
+ const [rateLimitReset, setRateLimitReset] = useState19(null);
4197
+ const [wasRateLimited, setWasRateLimited] = useState19(false);
4198
+ const [orgContext, setOrgContext] = useState19("personal");
4199
+ const [authMethod, setAuthMethod] = useState19("pat");
4200
+ const [oauthStatus, setOAuthStatus] = useState19("initializing");
4201
+ const [tokenSource, setTokenSource] = useState19("pat");
4202
+ const [sessionTokenOrigin, setSessionTokenOrigin] = useState19("stored");
4203
+ const [deviceCodeResponse, setDeviceCodeResponse] = useState19(null);
4204
+ const [oauthDeviceCode, setOauthDeviceCode] = useState19(null);
4205
+ const [dims, setDims] = useState19(() => {
3989
4206
  const cols = stdout?.columns ?? 100;
3990
4207
  const rows = stdout?.rows ?? 30;
3991
4208
  return { cols, rows };
@@ -4190,7 +4407,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
4190
4407
  setTokenSource("pat");
4191
4408
  setMode("auth_method_selection");
4192
4409
  };
4193
- useInput18((input2, key) => {
4410
+ useInput19((input2, key) => {
4194
4411
  if ((mode === "prompt" || mode === "auth_method_selection") && key.escape) {
4195
4412
  exit();
4196
4413
  }
@@ -4222,19 +4439,19 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
4222
4439
  }
4223
4440
  });
4224
4441
  const verticalPadding = Math.floor(dims.rows * 0.05);
4225
- const header = useMemo3(() => /* @__PURE__ */ jsxs22(Box22, { flexDirection: "row", justifyContent: "space-between", marginBottom: 1, children: [
4226
- /* @__PURE__ */ jsxs22(Box22, { flexDirection: "row", gap: 1, children: [
4227
- /* @__PURE__ */ jsxs22(Text23, { bold: true, color: "cyan", children: [
4442
+ const header = useMemo3(() => /* @__PURE__ */ jsxs23(Box23, { flexDirection: "row", justifyContent: "space-between", marginBottom: 1, children: [
4443
+ /* @__PURE__ */ jsxs23(Box23, { flexDirection: "row", gap: 1, children: [
4444
+ /* @__PURE__ */ jsxs23(Text24, { bold: true, color: "cyan", children: [
4228
4445
  " ",
4229
4446
  "GitHub Repository Manager"
4230
4447
  ] }),
4231
- /* @__PURE__ */ jsxs22(Text23, { color: "gray", dimColor: true, children: [
4448
+ /* @__PURE__ */ jsxs23(Text24, { color: "gray", dimColor: true, children: [
4232
4449
  "v",
4233
4450
  packageJson.version
4234
4451
  ] }),
4235
- process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsx23(Text23, { backgroundColor: "blue", color: "white", children: " debug mode " })
4452
+ process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsx24(Text24, { backgroundColor: "blue", color: "white", children: " debug mode " })
4236
4453
  ] }),
4237
- viewer && /* @__PURE__ */ jsx23(Text23, { color: "gray", children: orgContext !== "personal" && orgContext.login ? `${orgContext.login}/@${viewer} ` : `@${viewer} ` })
4454
+ viewer && /* @__PURE__ */ jsx24(Text24, { color: "gray", children: orgContext !== "personal" && orgContext.login ? `${orgContext.login}/@${viewer} ` : `@${viewer} ` })
4238
4455
  ] }), [viewer, orgContext]);
4239
4456
  if (mode === "rate_limited") {
4240
4457
  const formatResetTime = (resetTime) => {
@@ -4257,70 +4474,70 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
4257
4474
  return "Unknown";
4258
4475
  }
4259
4476
  };
4260
- return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4477
+ return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4261
4478
  header,
4262
- /* @__PURE__ */ jsx23(Box22, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs22(Box22, { borderStyle: "single", borderColor: "yellow", paddingX: 3, paddingY: 2, flexDirection: "column", width: Math.min(dims.cols - 8, 80), children: [
4263
- /* @__PURE__ */ jsx23(Text23, { bold: true, color: "yellow", marginBottom: 1, children: "\u26A0\uFE0F Rate Limit Exceeded" }),
4264
- /* @__PURE__ */ jsx23(Text23, { color: "gray", marginBottom: 1, children: "You've hit GitHub's API rate limit for your token." }),
4265
- /* @__PURE__ */ jsx23(Text23, { color: "gray", marginBottom: 1, children: "This happens when you make too many requests in a short time." }),
4266
- rateLimitReset && /* @__PURE__ */ jsxs22(Box22, { marginTop: 1, marginBottom: 1, children: [
4267
- /* @__PURE__ */ jsxs22(Text23, { children: [
4268
- /* @__PURE__ */ jsx23(Text23, { color: "cyan", children: "Reset in:" }),
4479
+ /* @__PURE__ */ jsx24(Box23, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs23(Box23, { borderStyle: "single", borderColor: "yellow", paddingX: 3, paddingY: 2, flexDirection: "column", width: Math.min(dims.cols - 8, 80), children: [
4480
+ /* @__PURE__ */ jsx24(Text24, { bold: true, color: "yellow", marginBottom: 1, children: "\u26A0\uFE0F Rate Limit Exceeded" }),
4481
+ /* @__PURE__ */ jsx24(Text24, { color: "gray", marginBottom: 1, children: "You've hit GitHub's API rate limit for your token." }),
4482
+ /* @__PURE__ */ jsx24(Text24, { color: "gray", marginBottom: 1, children: "This happens when you make too many requests in a short time." }),
4483
+ rateLimitReset && /* @__PURE__ */ jsxs23(Box23, { marginTop: 1, marginBottom: 1, children: [
4484
+ /* @__PURE__ */ jsxs23(Text24, { children: [
4485
+ /* @__PURE__ */ jsx24(Text24, { color: "cyan", children: "Reset in:" }),
4269
4486
  " ",
4270
- /* @__PURE__ */ jsx23(Text23, { bold: true, children: formatResetTime(rateLimitReset) })
4487
+ /* @__PURE__ */ jsx24(Text24, { bold: true, children: formatResetTime(rateLimitReset) })
4271
4488
  ] }),
4272
- /* @__PURE__ */ jsxs22(Text23, { color: "gray", dimColor: true, children: [
4489
+ /* @__PURE__ */ jsxs23(Text24, { color: "gray", dimColor: true, children: [
4273
4490
  "(",
4274
4491
  new Date(rateLimitReset).toLocaleTimeString(),
4275
4492
  ")"
4276
4493
  ] })
4277
4494
  ] }),
4278
- /* @__PURE__ */ jsxs22(Box22, { marginTop: 2, flexDirection: "column", gap: 1, children: [
4279
- /* @__PURE__ */ jsx23(Text23, { bold: true, children: "What would you like to do?" }),
4280
- /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", paddingLeft: 2, children: [
4281
- /* @__PURE__ */ jsxs22(Text23, { children: [
4282
- /* @__PURE__ */ jsx23(Text23, { color: "cyan", bold: true, children: "R" }),
4495
+ /* @__PURE__ */ jsxs23(Box23, { marginTop: 2, flexDirection: "column", gap: 1, children: [
4496
+ /* @__PURE__ */ jsx24(Text24, { bold: true, children: "What would you like to do?" }),
4497
+ /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", paddingLeft: 2, children: [
4498
+ /* @__PURE__ */ jsxs23(Text24, { children: [
4499
+ /* @__PURE__ */ jsx24(Text24, { color: "cyan", bold: true, children: "R" }),
4283
4500
  " - Retry now ",
4284
4501
  rateLimitReset && formatResetTime(rateLimitReset) !== "Now (should be reset)" ? "(likely to fail until reset)" : "(should work now)"
4285
4502
  ] }),
4286
- /* @__PURE__ */ jsxs22(Text23, { children: [
4287
- /* @__PURE__ */ jsx23(Text23, { color: "cyan", bold: true, children: "L" }),
4503
+ /* @__PURE__ */ jsxs23(Text24, { children: [
4504
+ /* @__PURE__ */ jsx24(Text24, { color: "cyan", bold: true, children: "L" }),
4288
4505
  " - Logout and choose authentication method"
4289
4506
  ] }),
4290
- /* @__PURE__ */ jsxs22(Text23, { children: [
4291
- /* @__PURE__ */ jsx23(Text23, { color: "gray", bold: true, children: "Q/Esc" }),
4507
+ /* @__PURE__ */ jsxs23(Text24, { children: [
4508
+ /* @__PURE__ */ jsx24(Text24, { color: "gray", bold: true, children: "Q/Esc" }),
4292
4509
  " - Quit application"
4293
4510
  ] })
4294
4511
  ] })
4295
4512
  ] }),
4296
- /* @__PURE__ */ jsx23(Text23, { color: "gray", dimColor: true, marginTop: 2, children: "Tip: Using multiple tokens or waiting between requests can help avoid rate limits." })
4513
+ /* @__PURE__ */ jsx24(Text24, { color: "gray", dimColor: true, marginTop: 2, children: "Tip: Using multiple tokens or waiting between requests can help avoid rate limits." })
4297
4514
  ] }) })
4298
4515
  ] });
4299
4516
  }
4300
4517
  if (mode === "auth_method_selection") {
4301
- return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4518
+ return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4302
4519
  header,
4303
- /* @__PURE__ */ jsx23(Box22, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", alignItems: "center", children: [
4304
- /* @__PURE__ */ jsx23(AuthMethodSelector, { onSelect: handleAuthMethodSelect }),
4305
- error && /* @__PURE__ */ jsx23(Text23, { color: "red", marginTop: 1, children: error })
4520
+ /* @__PURE__ */ jsx24(Box23, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", alignItems: "center", children: [
4521
+ /* @__PURE__ */ jsx24(AuthMethodSelector, { onSelect: handleAuthMethodSelect }),
4522
+ error && /* @__PURE__ */ jsx24(Text24, { color: "red", marginTop: 1, children: error })
4306
4523
  ] }) })
4307
4524
  ] });
4308
4525
  }
4309
4526
  if (mode === "oauth_flow") {
4310
- return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4527
+ return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4311
4528
  header,
4312
- /* @__PURE__ */ jsx23(Box22, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx23(OAuthProgress, { status: oauthStatus, error: error || void 0, deviceCode: oauthDeviceCode || void 0 }) })
4529
+ /* @__PURE__ */ jsx24(Box23, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx24(OAuthProgress, { status: oauthStatus, error: error || void 0, deviceCode: oauthDeviceCode || void 0 }) })
4313
4530
  ] });
4314
4531
  }
4315
4532
  if (mode === "prompt") {
4316
- return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4533
+ return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4317
4534
  header,
4318
- /* @__PURE__ */ jsx23(Box22, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs22(Box22, { borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, flexDirection: "column", children: [
4319
- /* @__PURE__ */ jsx23(Text23, { bold: true, marginBottom: 1, children: "Authentication Required" }),
4320
- /* @__PURE__ */ jsx23(Text23, { color: "gray", marginBottom: 1, children: "Enter your GitHub Personal Access Token" }),
4321
- /* @__PURE__ */ jsxs22(Box22, { children: [
4322
- /* @__PURE__ */ jsx23(Text23, { children: "Token: " }),
4323
- /* @__PURE__ */ jsx23(
4535
+ /* @__PURE__ */ jsx24(Box23, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs23(Box23, { borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, flexDirection: "column", children: [
4536
+ /* @__PURE__ */ jsx24(Text24, { bold: true, marginBottom: 1, children: "Authentication Required" }),
4537
+ /* @__PURE__ */ jsx24(Text24, { color: "gray", marginBottom: 1, children: "Enter your GitHub Personal Access Token" }),
4538
+ /* @__PURE__ */ jsxs23(Box23, { children: [
4539
+ /* @__PURE__ */ jsx24(Text24, { children: "Token: " }),
4540
+ /* @__PURE__ */ jsx24(
4324
4541
  TextInput6,
4325
4542
  {
4326
4543
  value: input,
@@ -4330,30 +4547,30 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
4330
4547
  }
4331
4548
  )
4332
4549
  ] }),
4333
- error && /* @__PURE__ */ jsx23(Text23, { color: "red", marginTop: 1, children: error }),
4334
- /* @__PURE__ */ jsx23(Text23, { color: "gray", dimColor: true, marginTop: 1, children: "The token will be stored securely in your local config" }),
4335
- /* @__PURE__ */ jsx23(Text23, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to go back" })
4550
+ error && /* @__PURE__ */ jsx24(Text24, { color: "red", marginTop: 1, children: error }),
4551
+ /* @__PURE__ */ jsx24(Text24, { color: "gray", dimColor: true, marginTop: 1, children: "The token will be stored securely in your local config" }),
4552
+ /* @__PURE__ */ jsx24(Text24, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to go back" })
4336
4553
  ] }) })
4337
4554
  ] });
4338
4555
  }
4339
4556
  if (mode === "validating" || mode === "checking") {
4340
- return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4557
+ return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4341
4558
  header,
4342
- /* @__PURE__ */ jsx23(Box22, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", alignItems: "center", children: [
4343
- /* @__PURE__ */ jsx23(Text23, { color: "yellow", children: "Validating token..." }),
4344
- mode === "validating" && /* @__PURE__ */ jsx23(Text23, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to cancel" })
4559
+ /* @__PURE__ */ jsx24(Box23, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", alignItems: "center", children: [
4560
+ /* @__PURE__ */ jsx24(Text24, { color: "yellow", children: "Validating token..." }),
4561
+ mode === "validating" && /* @__PURE__ */ jsx24(Text24, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to cancel" })
4345
4562
  ] }) })
4346
4563
  ] });
4347
4564
  }
4348
4565
  if (mode === "error") {
4349
- return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4566
+ return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4350
4567
  header,
4351
- /* @__PURE__ */ jsx23(Box22, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx23(Text23, { color: "red", children: error ?? "Unexpected error" }) })
4568
+ /* @__PURE__ */ jsx24(Box23, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx24(Text24, { color: "red", children: error ?? "Unexpected error" }) })
4352
4569
  ] });
4353
4570
  }
4354
- return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4571
+ return /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
4355
4572
  header,
4356
- /* @__PURE__ */ jsx23(
4573
+ /* @__PURE__ */ jsx24(
4357
4574
  RepoList,
4358
4575
  {
4359
4576
  token,
@@ -4368,7 +4585,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
4368
4585
  }
4369
4586
 
4370
4587
  // src/index.tsx
4371
- import { jsx as jsx24, jsxs as jsxs23 } from "react/jsx-runtime";
4588
+ import { jsx as jsx25, jsxs as jsxs24 } from "react/jsx-runtime";
4372
4589
  var argv = process.argv.slice(2);
4373
4590
  var getFlagValue = (name) => {
4374
4591
  const idx = argv.findIndex((a) => a === `--${name}` || a.startsWith(`--${name}=`));
@@ -4481,8 +4698,8 @@ var inlineToken = (() => {
4481
4698
  })();
4482
4699
  logger.debug("Rendering UI");
4483
4700
  var { unmount } = render(
4484
- /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", children: [
4485
- /* @__PURE__ */ jsx24(App, { initialOrgSlug, inlineToken, inlineTokenEphemeral: Boolean(inlineToken) }),
4486
- /* @__PURE__ */ jsx24(Text24, { color: "gray" })
4701
+ /* @__PURE__ */ jsxs24(Box24, { flexDirection: "column", children: [
4702
+ /* @__PURE__ */ jsx25(App, { initialOrgSlug, inlineToken, inlineTokenEphemeral: Boolean(inlineToken) }),
4703
+ /* @__PURE__ */ jsx25(Text25, { color: "gray" })
4487
4704
  ] })
4488
4705
  );