lazyreview 1.0.39 → 1.0.41

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.
Files changed (2) hide show
  1. package/dist/cli.js +963 -559
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -9601,14 +9601,14 @@ var require_react_reconciler_production = __commonJS({
9601
9601
  }
9602
9602
  var exports2 = {};
9603
9603
  "use strict";
9604
- var React63 = require_react(), Scheduler2 = require_scheduler(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element"), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
9604
+ var React65 = require_react(), Scheduler2 = require_scheduler(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element"), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
9605
9605
  /* @__PURE__ */ Symbol.for("react.scope");
9606
9606
  var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
9607
9607
  /* @__PURE__ */ Symbol.for("react.legacy_hidden");
9608
9608
  /* @__PURE__ */ Symbol.for("react.tracing_marker");
9609
9609
  var REACT_MEMO_CACHE_SENTINEL = /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel");
9610
9610
  /* @__PURE__ */ Symbol.for("react.view_transition");
9611
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals = React63.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, rendererVersion = $$$config.rendererVersion, rendererPackageName = $$$config.rendererPackageName, extraDevToolsConfig = $$$config.extraDevToolsConfig, getPublicInstance = $$$config.getPublicInstance, getRootHostContext = $$$config.getRootHostContext, getChildHostContext = $$$config.getChildHostContext, prepareForCommit = $$$config.prepareForCommit, resetAfterCommit = $$$config.resetAfterCommit, createInstance = $$$config.createInstance;
9611
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals = React65.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, rendererVersion = $$$config.rendererVersion, rendererPackageName = $$$config.rendererPackageName, extraDevToolsConfig = $$$config.extraDevToolsConfig, getPublicInstance = $$$config.getPublicInstance, getRootHostContext = $$$config.getRootHostContext, getChildHostContext = $$$config.getChildHostContext, prepareForCommit = $$$config.prepareForCommit, resetAfterCommit = $$$config.resetAfterCommit, createInstance = $$$config.createInstance;
9612
9612
  $$$config.cloneMutableInstance;
9613
9613
  var appendInitialChild = $$$config.appendInitialChild, finalizeInitialChildren = $$$config.finalizeInitialChildren, shouldSetTextContent = $$$config.shouldSetTextContent, createTextInstance = $$$config.createTextInstance;
9614
9614
  $$$config.cloneMutableTextInstance;
@@ -22201,14 +22201,14 @@ var require_react_reconciler_development = __commonJS({
22201
22201
  }
22202
22202
  var exports2 = {};
22203
22203
  "use strict";
22204
- var React63 = require_react(), Scheduler2 = require_scheduler(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element"), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
22204
+ var React65 = require_react(), Scheduler2 = require_scheduler(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element"), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
22205
22205
  /* @__PURE__ */ Symbol.for("react.scope");
22206
22206
  var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
22207
22207
  /* @__PURE__ */ Symbol.for("react.legacy_hidden");
22208
22208
  /* @__PURE__ */ Symbol.for("react.tracing_marker");
22209
22209
  var REACT_MEMO_CACHE_SENTINEL = /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel");
22210
22210
  /* @__PURE__ */ Symbol.for("react.view_transition");
22211
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals = React63.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, rendererVersion = $$$config.rendererVersion, rendererPackageName = $$$config.rendererPackageName, extraDevToolsConfig = $$$config.extraDevToolsConfig, getPublicInstance = $$$config.getPublicInstance, getRootHostContext = $$$config.getRootHostContext, getChildHostContext = $$$config.getChildHostContext, prepareForCommit = $$$config.prepareForCommit, resetAfterCommit = $$$config.resetAfterCommit, createInstance = $$$config.createInstance;
22211
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals = React65.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, rendererVersion = $$$config.rendererVersion, rendererPackageName = $$$config.rendererPackageName, extraDevToolsConfig = $$$config.extraDevToolsConfig, getPublicInstance = $$$config.getPublicInstance, getRootHostContext = $$$config.getRootHostContext, getChildHostContext = $$$config.getChildHostContext, prepareForCommit = $$$config.prepareForCommit, resetAfterCommit = $$$config.resetAfterCommit, createInstance = $$$config.createInstance;
22212
22212
  $$$config.cloneMutableInstance;
22213
22213
  var appendInitialChild = $$$config.appendInitialChild, finalizeInitialChildren = $$$config.finalizeInitialChildren, shouldSetTextContent = $$$config.shouldSetTextContent, createTextInstance = $$$config.createTextInstance;
22214
22214
  $$$config.cloneMutableTextInstance;
@@ -24835,18 +24835,18 @@ var require_react_jsx_runtime_development = __commonJS({
24835
24835
  function isValidElement2(object2) {
24836
24836
  return "object" === typeof object2 && null !== object2 && object2.$$typeof === REACT_ELEMENT_TYPE;
24837
24837
  }
24838
- var React63 = require_react(), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = React63.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
24838
+ var React65 = require_react(), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = React65.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
24839
24839
  return null;
24840
24840
  };
24841
- React63 = {
24841
+ React65 = {
24842
24842
  react_stack_bottom_frame: function(callStackForError) {
24843
24843
  return callStackForError();
24844
24844
  }
24845
24845
  };
24846
24846
  var specialPropKeyWarningShown;
24847
24847
  var didWarnAboutElementRef = {};
24848
- var unknownOwnerDebugStack = React63.react_stack_bottom_frame.bind(
24849
- React63,
24848
+ var unknownOwnerDebugStack = React65.react_stack_bottom_frame.bind(
24849
+ React65,
24850
24850
  UnknownOwner
24851
24851
  )();
24852
24852
  var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
@@ -83064,7 +83064,7 @@ var measureElement = (node) => ({
83064
83064
  var measure_element_default = measureElement;
83065
83065
 
83066
83066
  // src/app.tsx
83067
- var import_react106 = __toESM(require_react(), 1);
83067
+ var import_react108 = __toESM(require_react(), 1);
83068
83068
 
83069
83069
  // node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/subscribable.js
83070
83070
  var Subscribable = class {
@@ -86641,6 +86641,7 @@ var shortcutGroups = [
86641
86641
  { key: "E", description: "Request re-review" },
86642
86642
  { key: "m", description: "Merge PR" },
86643
86643
  { key: "T", description: "Edit PR title" },
86644
+ { key: "W", description: "Toggle draft / ready for review" },
86644
86645
  { key: "X", description: "Close / Reopen PR" },
86645
86646
  { key: "G", description: "Checkout PR branch locally" },
86646
86647
  { key: "] / [", description: "Next / Previous PR" }
@@ -86683,7 +86684,9 @@ var shortcutGroups = [
86683
86684
  {
86684
86685
  title: "Commits Tab",
86685
86686
  items: [
86686
- { key: "y", description: "Copy commit SHA" }
86687
+ { key: "Enter", description: "View commit diff" },
86688
+ { key: "y", description: "Copy commit SHA" },
86689
+ { key: "q / Esc", description: "Back to commit list (in diff view)" }
86687
86690
  ]
86688
86691
  },
86689
86692
  {
@@ -117513,7 +117516,7 @@ var ErrorBoundary2 = class extends import_react69.default.Component {
117513
117516
  };
117514
117517
 
117515
117518
  // src/screens/PRDetailScreen.tsx
117516
- var import_react87 = __toESM(require_react(), 1);
117519
+ var import_react89 = __toESM(require_react(), 1);
117517
117520
 
117518
117521
  // src/services/GitHubApiTypes.ts
117519
117522
  var GitHubApi = class extends Context_exports.Tag("GitHubApi")() {
@@ -117539,6 +117542,7 @@ var BranchRef = class extends Schema_exports.Class("BranchRef")({
117539
117542
  };
117540
117543
  var PullRequest = class extends Schema_exports.Class("PullRequest")({
117541
117544
  id: Schema_exports.Number,
117545
+ node_id: Schema_exports.optionalWith(Schema_exports.String, { default: () => "" }),
117542
117546
  number: Schema_exports.Number,
117543
117547
  title: Schema_exports.String,
117544
117548
  body: Schema_exports.optionalWith(Schema_exports.NullOr(Schema_exports.String), { default: () => null }),
@@ -118431,6 +118435,45 @@ var GitHubApiLive = Layer_exports.effect(
118431
118435
  { title }
118432
118436
  );
118433
118437
  }),
118438
+ getCommitDiff: (owner, repo, sha) => Effect_exports.gen(function* () {
118439
+ validateOwner(owner);
118440
+ validateRepo(repo);
118441
+ validateRef(sha);
118442
+ const token = yield* auth.getToken();
118443
+ const CommitDetailSchema = Schema_exports.Struct({
118444
+ files: Schema_exports.optionalWith(Schema_exports.Array(FileChange), { default: () => [] })
118445
+ });
118446
+ const result = yield* fetchGitHub(
118447
+ `/repos/${owner}/${repo}/commits/${sha}`,
118448
+ token,
118449
+ CommitDetailSchema
118450
+ );
118451
+ return result.files;
118452
+ }),
118453
+ convertToDraft: (nodeId) => Effect_exports.gen(function* () {
118454
+ const token = yield* auth.getToken();
118455
+ yield* graphqlGitHub(
118456
+ token,
118457
+ `mutation($pullRequestId: ID!) {
118458
+ convertPullRequestToDraft(input: { pullRequestId: $pullRequestId }) {
118459
+ pullRequest { isDraft }
118460
+ }
118461
+ }`,
118462
+ { pullRequestId: nodeId }
118463
+ );
118464
+ }),
118465
+ markReadyForReview: (nodeId) => Effect_exports.gen(function* () {
118466
+ const token = yield* auth.getToken();
118467
+ yield* graphqlGitHub(
118468
+ token,
118469
+ `mutation($pullRequestId: ID!) {
118470
+ markPullRequestAsReady(input: { pullRequestId: $pullRequestId }) {
118471
+ pullRequest { isDraft }
118472
+ }
118473
+ }`,
118474
+ { pullRequestId: nodeId }
118475
+ );
118476
+ }),
118434
118477
  getCurrentUser: () => Effect_exports.gen(function* () {
118435
118478
  const token = yield* auth.getToken();
118436
118479
  return yield* fetchGitHub(
@@ -118745,6 +118788,20 @@ var useEditReviewComment = createGitHubMutation({
118745
118788
  effect: (api, p) => api.editReviewComment(p.owner, p.repo, p.commentId, p.body),
118746
118789
  invalidateKeys: (p) => invalidatePRThreads(p.owner, p.repo, p.prNumber)
118747
118790
  });
118791
+ var useConvertToDraft = createGitHubMutation({
118792
+ effect: (api, p) => api.convertToDraft(p.nodeId),
118793
+ invalidateKeys: (p) => [
118794
+ ["pr", p.owner, p.repo, p.prNumber],
118795
+ ...invalidatePRLists()
118796
+ ]
118797
+ });
118798
+ var useMarkReadyForReview = createGitHubMutation({
118799
+ effect: (api, p) => api.markReadyForReview(p.nodeId),
118800
+ invalidateKeys: (p) => [
118801
+ ["pr", p.owner, p.repo, p.prNumber],
118802
+ ...invalidatePRLists()
118803
+ ]
118804
+ });
118748
118805
 
118749
118806
  // src/hooks/useGitHub.ts
118750
118807
  function usePullRequests(owner, repo, options) {
@@ -118919,6 +118976,19 @@ function useCheckRuns(owner, repo, ref, options) {
118919
118976
  refetchInterval
118920
118977
  });
118921
118978
  }
118979
+ function useCommitDiff(owner, repo, sha, options) {
118980
+ const enabledFlag = options?.enabled ?? true;
118981
+ return useQuery({
118982
+ queryKey: ["commit-diff", owner, repo, sha],
118983
+ queryFn: () => runEffect(
118984
+ Effect_exports.gen(function* () {
118985
+ const api = yield* CodeReviewApi;
118986
+ return yield* api.getCommitDiff(owner, repo, sha);
118987
+ })
118988
+ ),
118989
+ enabled: enabledFlag && !!owner && !!repo && !!sha
118990
+ });
118991
+ }
118922
118992
  function useCurrentUser() {
118923
118993
  return useQuery({
118924
118994
  queryKey: ["current-user"],
@@ -123375,6 +123445,9 @@ function ConversationsTab({
123375
123445
  ] });
123376
123446
  }
123377
123447
 
123448
+ // src/components/pr/CommitsTab.tsx
123449
+ var import_react81 = __toESM(require_react(), 1);
123450
+
123378
123451
  // src/utils/terminal.ts
123379
123452
  import { execFile as execFile2, execFileSync as execFileSync2 } from "child_process";
123380
123453
  import { platform as platform2 } from "os";
@@ -123418,8 +123491,298 @@ function copyToClipboard(text) {
123418
123491
  }
123419
123492
  }
123420
123493
 
123421
- // src/components/pr/CommitsTab.tsx
123494
+ // src/components/pr/CommitDiffView.tsx
123495
+ var import_react80 = __toESM(require_react(), 1);
123496
+
123497
+ // src/components/common/LoadingIndicator.tsx
123422
123498
  var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
123499
+ function LoadingIndicator({
123500
+ message = "Loading..."
123501
+ }) {
123502
+ const theme14 = useTheme();
123503
+ const { stdout } = use_stdout_default();
123504
+ const height = stdout?.rows ?? 24;
123505
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
123506
+ Box_default,
123507
+ {
123508
+ flexDirection: "column",
123509
+ justifyContent: "center",
123510
+ alignItems: "center",
123511
+ height: height - 4,
123512
+ flexGrow: 1,
123513
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { gap: 1, children: [
123514
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Spinner, {}),
123515
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme14.colors.accent, children: message })
123516
+ ] })
123517
+ }
123518
+ );
123519
+ }
123520
+
123521
+ // src/components/pr/CommitDiffView.tsx
123522
+ var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
123523
+ function CommitDiffView({
123524
+ files,
123525
+ commitSha,
123526
+ commitMessage,
123527
+ isActive: isActive2,
123528
+ isLoading,
123529
+ onBack
123530
+ }) {
123531
+ const { stdout } = use_stdout_default();
123532
+ const theme14 = useTheme();
123533
+ const terminalWidth = stdout?.columns ?? 120;
123534
+ const viewportHeight = Math.max(1, (stdout?.rows ?? 24) - 13);
123535
+ const treeViewportMaxHeight = Math.max(1, (stdout?.rows ?? 24) - 18);
123536
+ const [focusPanel, setFocusPanel] = (0, import_react80.useState)("tree");
123537
+ const [selectedFileIndex, setSelectedFileIndex] = (0, import_react80.useState)(0);
123538
+ const [diffMode, setDiffMode] = (0, import_react80.useState)("unified");
123539
+ const [diffScrollOffsetX, setDiffScrollOffsetX] = (0, import_react80.useState)(0);
123540
+ const effectiveDiffMode = diffMode === "side-by-side" && terminalWidth < SIDE_BY_SIDE_MIN_WIDTH ? "unified" : diffMode;
123541
+ const treePanelWidth = Math.max(32, Math.floor(terminalWidth * 0.3));
123542
+ const diffContentWidth = Math.max(10, terminalWidth - treePanelWidth - 8);
123543
+ const fileTree = (0, import_react80.useMemo)(() => buildFileTree(files), [files]);
123544
+ const fileOrder = (0, import_react80.useMemo)(() => flattenTreeToFiles(fileTree), [fileTree]);
123545
+ const displayRows = (0, import_react80.useMemo)(
123546
+ () => buildDisplayRows(fileTree, 0, { current: 0 }),
123547
+ [fileTree]
123548
+ );
123549
+ const treeViewportHeight = Math.min(viewportHeight - 2, treeViewportMaxHeight);
123550
+ const { selectedIndex: treeSelectedIndex } = useListNavigation({
123551
+ itemCount: fileOrder.length,
123552
+ viewportHeight: treeViewportHeight,
123553
+ isActive: isActive2 && focusPanel === "tree"
123554
+ });
123555
+ const selectedRowIndex = displayRows.findIndex(
123556
+ (r) => r.type === "file" && r.fileIndex === treeSelectedIndex
123557
+ );
123558
+ const effectiveRowIndex = selectedRowIndex >= 0 ? selectedRowIndex : 0;
123559
+ const treeScrollOffset = deriveScrollOffset(
123560
+ effectiveRowIndex,
123561
+ treeViewportHeight,
123562
+ displayRows.length
123563
+ );
123564
+ const visibleRows = displayRows.slice(
123565
+ treeScrollOffset,
123566
+ treeScrollOffset + treeViewportHeight
123567
+ );
123568
+ import_react80.default.useEffect(() => {
123569
+ if (focusPanel === "tree") {
123570
+ setSelectedFileIndex(treeSelectedIndex);
123571
+ }
123572
+ }, [treeSelectedIndex, focusPanel]);
123573
+ import_react80.default.useEffect(() => {
123574
+ setDiffScrollOffsetX(0);
123575
+ }, [selectedFileIndex]);
123576
+ const selectedFile = fileOrder[selectedFileIndex] ?? fileOrder[0] ?? null;
123577
+ const selectedPatch = selectedFile?.patch ?? null;
123578
+ const hunks = (0, import_react80.useMemo)(
123579
+ () => selectedPatch ? parseDiffPatch(selectedPatch) : [],
123580
+ [selectedPatch]
123581
+ );
123582
+ const allRows = (0, import_react80.useMemo)(
123583
+ () => buildDiffRows(hunks, void 0),
123584
+ [hunks]
123585
+ );
123586
+ const sideBySideRows = (0, import_react80.useMemo)(
123587
+ () => effectiveDiffMode === "side-by-side" ? buildSideBySideRows(hunks, void 0) : [],
123588
+ [hunks, effectiveDiffMode]
123589
+ );
123590
+ const totalDiffLines = effectiveDiffMode === "side-by-side" ? sideBySideRows.length : allRows.length;
123591
+ const maxDiffLineLength = (0, import_react80.useMemo)(
123592
+ () => computeMaxDiffLineLength(allRows),
123593
+ [allRows]
123594
+ );
123595
+ const diffContentWidthSbs = Math.max(
123596
+ 10,
123597
+ Math.floor((diffContentWidth - 1) / 2)
123598
+ );
123599
+ const maxDiffLineLengthSbs = (0, import_react80.useMemo)(
123600
+ () => computeMaxSbsLineLength(sideBySideRows),
123601
+ [sideBySideRows]
123602
+ );
123603
+ const maxDiffScrollXUnified = Math.max(0, maxDiffLineLength - diffContentWidth);
123604
+ const maxDiffScrollXSbs = Math.max(0, maxDiffLineLengthSbs - diffContentWidthSbs);
123605
+ const maxDiffScrollX = effectiveDiffMode === "side-by-side" ? maxDiffScrollXSbs : maxDiffScrollXUnified;
123606
+ const {
123607
+ selectedIndex: diffSelectedLine,
123608
+ scrollOffset: diffScrollOffset
123609
+ } = useListNavigation({
123610
+ itemCount: totalDiffLines,
123611
+ viewportHeight,
123612
+ isActive: isActive2 && focusPanel === "diff"
123613
+ });
123614
+ use_input_default(
123615
+ (input, key) => {
123616
+ if (input === "q" || key.escape) {
123617
+ onBack();
123618
+ } else if (input === "h") {
123619
+ setFocusPanel("tree");
123620
+ } else if (input === "l" || key.return && focusPanel === "tree") {
123621
+ setFocusPanel("diff");
123622
+ } else if (input === "d") {
123623
+ setDiffMode(
123624
+ (prev) => prev === "unified" ? "side-by-side" : "unified"
123625
+ );
123626
+ } else if (key.tab) {
123627
+ setFocusPanel((prev) => prev === "tree" ? "diff" : "tree");
123628
+ } else if (input === "H" && focusPanel === "diff") {
123629
+ setDiffScrollOffsetX((prev) => Math.max(0, prev - 8));
123630
+ } else if (input === "L" && focusPanel === "diff") {
123631
+ setDiffScrollOffsetX((prev) => Math.min(maxDiffScrollX, prev + 8));
123632
+ }
123633
+ },
123634
+ { isActive: isActive2 }
123635
+ );
123636
+ if (isLoading) {
123637
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(LoadingIndicator, { message: "Loading commit diff..." });
123638
+ }
123639
+ if (files.length === 0) {
123640
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(EmptyState, { message: "No files changed in this commit" });
123641
+ }
123642
+ const shortSha = commitSha.slice(0, 7);
123643
+ const shortMessage = commitMessage.split("\n")[0] ?? "";
123644
+ const isPanelFocused = focusPanel === "tree" && isActive2;
123645
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, children: [
123646
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box_default, { paddingX: 1, paddingY: 0, gap: 1, marginBottom: 0, children: [
123647
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: theme14.colors.warning, bold: true, children: shortSha }),
123648
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: theme14.colors.text, bold: true, wrap: "truncate", children: shortMessage }),
123649
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme14.colors.muted, children: [
123650
+ "(",
123651
+ files.length,
123652
+ " file",
123653
+ files.length !== 1 ? "s" : "",
123654
+ ")"
123655
+ ] })
123656
+ ] }),
123657
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box_default, { flexDirection: "row", flexGrow: 1, children: [
123658
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
123659
+ Box_default,
123660
+ {
123661
+ flexDirection: "column",
123662
+ width: "30%",
123663
+ minWidth: 32,
123664
+ minHeight: 0,
123665
+ overflow: "hidden",
123666
+ borderStyle: "single",
123667
+ borderColor: focusPanel === "tree" && isActive2 ? theme14.colors.accent : theme14.colors.border,
123668
+ children: [
123669
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box_default, { paddingX: 1, paddingY: 0, gap: 1, children: [
123670
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Files" }),
123671
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme14.colors.muted, children: [
123672
+ "(",
123673
+ files.length,
123674
+ ")"
123675
+ ] })
123676
+ ] }),
123677
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
123678
+ Box_default,
123679
+ {
123680
+ flexDirection: "column",
123681
+ width: "100%",
123682
+ minWidth: 0,
123683
+ paddingX: 1,
123684
+ overflow: "hidden",
123685
+ height: treeViewportHeight,
123686
+ minHeight: 0,
123687
+ flexShrink: 1,
123688
+ children: visibleRows.map((row, i) => {
123689
+ const rowIndex = treeScrollOffset + i;
123690
+ return row.type === "dir" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
123691
+ Box_default,
123692
+ {
123693
+ width: "100%",
123694
+ minWidth: 0,
123695
+ overflow: "hidden",
123696
+ paddingLeft: row.indent * 2,
123697
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { wrap: "truncate-end", color: theme14.colors.muted, children: [
123698
+ row.name,
123699
+ "/"
123700
+ ] })
123701
+ },
123702
+ `row-${rowIndex}`
123703
+ ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
123704
+ Box_default,
123705
+ {
123706
+ width: "100%",
123707
+ minWidth: 0,
123708
+ overflow: "hidden",
123709
+ paddingLeft: row.indent * 2,
123710
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
123711
+ FileItem,
123712
+ {
123713
+ item: row.file,
123714
+ isFocus: isPanelFocused && row.fileIndex === treeSelectedIndex,
123715
+ isSelected: row.fileIndex === selectedFileIndex
123716
+ }
123717
+ )
123718
+ },
123719
+ `row-${rowIndex}`
123720
+ );
123721
+ })
123722
+ }
123723
+ )
123724
+ ]
123725
+ }
123726
+ ),
123727
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
123728
+ Box_default,
123729
+ {
123730
+ flexDirection: "column",
123731
+ flexGrow: 1,
123732
+ minWidth: 0,
123733
+ overflow: "hidden",
123734
+ borderStyle: "single",
123735
+ borderColor: focusPanel === "diff" && isActive2 ? theme14.colors.accent : theme14.colors.border,
123736
+ children: [
123737
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box_default, { paddingX: 1, paddingY: 0, gap: 2, overflow: "hidden", children: [
123738
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { wrap: "truncate-end", color: theme14.colors.accent, bold: true, children: selectedFile?.filename ?? "No file selected" }),
123739
+ selectedFile && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box_default, { gap: 1, children: [
123740
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme14.colors.diffAdd, children: [
123741
+ "+",
123742
+ selectedFile.additions
123743
+ ] }),
123744
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme14.colors.diffDel, children: [
123745
+ "-",
123746
+ selectedFile.deletions
123747
+ ] })
123748
+ ] }),
123749
+ effectiveDiffMode === "side-by-side" && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: theme14.colors.info, children: "[split]" })
123750
+ ] }),
123751
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { flexDirection: "column", flexGrow: 1, minWidth: 0, overflow: "hidden", children: effectiveDiffMode === "side-by-side" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
123752
+ SideBySideDiffView,
123753
+ {
123754
+ rows: sideBySideRows,
123755
+ selectedLine: diffSelectedLine,
123756
+ scrollOffset: diffScrollOffset,
123757
+ viewportHeight: viewportHeight - 2,
123758
+ isActive: isActive2 && focusPanel === "diff",
123759
+ filename: selectedFile?.filename,
123760
+ contentWidth: diffContentWidthSbs,
123761
+ scrollOffsetX: Math.min(diffScrollOffsetX, maxDiffScrollXSbs)
123762
+ }
123763
+ ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
123764
+ DiffView,
123765
+ {
123766
+ allRows,
123767
+ selectedLine: diffSelectedLine,
123768
+ scrollOffset: diffScrollOffset,
123769
+ viewportHeight: viewportHeight - 2,
123770
+ isActive: isActive2 && focusPanel === "diff",
123771
+ filename: selectedFile?.filename,
123772
+ visualStart: null,
123773
+ contentWidth: diffContentWidth,
123774
+ scrollOffsetX: Math.min(diffScrollOffsetX, maxDiffScrollXUnified)
123775
+ }
123776
+ ) })
123777
+ ]
123778
+ }
123779
+ )
123780
+ ] })
123781
+ ] });
123782
+ }
123783
+
123784
+ // src/components/pr/CommitsTab.tsx
123785
+ var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
123423
123786
  function CommitItem({
123424
123787
  commit,
123425
123788
  isFocus
@@ -123429,7 +123792,7 @@ function CommitItem({
123429
123792
  const message = stripAnsi2(commit.commit.message.split("\n")[0] ?? "");
123430
123793
  const author = commit.author?.login ?? commit.commit.author.name;
123431
123794
  const date4 = commit.commit.author.date;
123432
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
123795
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
123433
123796
  Box_default,
123434
123797
  {
123435
123798
  paddingX: 1,
@@ -123437,8 +123800,8 @@ function CommitItem({
123437
123800
  gap: 1,
123438
123801
  backgroundColor: isFocus ? theme14.colors.selection : void 0,
123439
123802
  children: [
123440
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { width: 10, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme14.colors.warning, bold: isFocus, children: shortSha }) }),
123441
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { flexGrow: 1, flexShrink: 1, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
123803
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { width: 10, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: theme14.colors.warning, bold: isFocus, children: shortSha }) }),
123804
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { flexGrow: 1, flexShrink: 1, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
123442
123805
  Text,
123443
123806
  {
123444
123807
  color: isFocus ? theme14.colors.listSelectedFg : theme14.colors.text,
@@ -123447,28 +123810,39 @@ function CommitItem({
123447
123810
  children: message
123448
123811
  }
123449
123812
  ) }),
123450
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { width: 16, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme14.colors.secondary, children: author }) }),
123451
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme14.colors.muted, children: timeAgo(date4) }) })
123813
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { width: 16, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: theme14.colors.secondary, children: author }) }),
123814
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: theme14.colors.muted, children: timeAgo(date4) }) })
123452
123815
  ]
123453
123816
  }
123454
123817
  );
123455
123818
  }
123456
123819
  function CommitsTab({
123457
123820
  commits,
123458
- isActive: isActive2
123821
+ isActive: isActive2,
123822
+ owner,
123823
+ repo
123459
123824
  }) {
123460
123825
  const { stdout } = use_stdout_default();
123461
123826
  const theme14 = useTheme();
123462
123827
  const { setStatusMessage } = useStatusMessage();
123463
123828
  const viewportHeight = Math.max(1, (stdout?.rows ?? 24) - 10);
123829
+ const [selectedCommitSha, setSelectedCommitSha] = (0, import_react81.useState)(null);
123464
123830
  const { selectedIndex } = useListNavigation({
123465
123831
  itemCount: commits.length,
123466
123832
  viewportHeight,
123467
- isActive: isActive2
123833
+ isActive: isActive2 && selectedCommitSha === null
123468
123834
  });
123835
+ const { data: commitFiles = [], isLoading: commitDiffLoading } = useCommitDiff(
123836
+ owner,
123837
+ repo,
123838
+ selectedCommitSha ?? "",
123839
+ { enabled: selectedCommitSha !== null }
123840
+ );
123469
123841
  use_input_default(
123470
- (input) => {
123471
- if (input === "y" && commits[selectedIndex]) {
123842
+ (input, key) => {
123843
+ if (key.return && commits[selectedIndex]) {
123844
+ setSelectedCommitSha(commits[selectedIndex].sha);
123845
+ } else if (input === "y" && commits[selectedIndex]) {
123472
123846
  const sha = commits[selectedIndex].sha;
123473
123847
  if (copyToClipboard(sha)) {
123474
123848
  setStatusMessage(`Copied SHA ${sha.slice(0, 7)} to clipboard`);
@@ -123477,23 +123851,37 @@ function CommitsTab({
123477
123851
  }
123478
123852
  }
123479
123853
  },
123480
- { isActive: isActive2 }
123854
+ { isActive: isActive2 && selectedCommitSha === null }
123481
123855
  );
123482
123856
  const scrollOffset = deriveScrollOffset(selectedIndex, viewportHeight, commits.length);
123483
123857
  const visibleCommits = commits.slice(scrollOffset, scrollOffset + viewportHeight);
123484
123858
  if (commits.length === 0) {
123485
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(EmptyState, { message: "No commits found" });
123859
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(EmptyState, { message: "No commits found" });
123486
123860
  }
123487
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, children: [
123488
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { paddingX: 1, paddingY: 1, gap: 1, children: [
123489
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Commits" }),
123490
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { color: theme14.colors.muted, children: [
123861
+ if (selectedCommitSha !== null) {
123862
+ const commit = commits.find((c) => c.sha === selectedCommitSha);
123863
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
123864
+ CommitDiffView,
123865
+ {
123866
+ files: commitFiles,
123867
+ commitSha: selectedCommitSha,
123868
+ commitMessage: commit?.commit.message ?? "",
123869
+ isActive: isActive2,
123870
+ isLoading: commitDiffLoading,
123871
+ onBack: () => setSelectedCommitSha(null)
123872
+ }
123873
+ );
123874
+ }
123875
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, children: [
123876
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { paddingX: 1, paddingY: 1, gap: 1, children: [
123877
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Commits" }),
123878
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: theme14.colors.muted, children: [
123491
123879
  "(",
123492
123880
  commits.length,
123493
123881
  ")"
123494
123882
  ] })
123495
123883
  ] }),
123496
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
123884
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
123497
123885
  Box_default,
123498
123886
  {
123499
123887
  paddingX: 1,
@@ -123505,14 +123893,14 @@ function CommitsTab({
123505
123893
  borderLeft: false,
123506
123894
  borderRight: false,
123507
123895
  children: [
123508
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { width: 10, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme14.colors.muted, bold: true, children: "SHA" }) }),
123509
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme14.colors.muted, bold: true, children: "Message" }) }),
123510
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { width: 16, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme14.colors.muted, bold: true, children: "Author" }) }),
123511
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme14.colors.muted, bold: true, children: "Date" }) })
123896
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { width: 10, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: theme14.colors.muted, bold: true, children: "SHA" }) }),
123897
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: theme14.colors.muted, bold: true, children: "Message" }) }),
123898
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { width: 16, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: theme14.colors.muted, bold: true, children: "Author" }) }),
123899
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: theme14.colors.muted, bold: true, children: "Date" }) })
123512
123900
  ]
123513
123901
  }
123514
123902
  ),
123515
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { flexDirection: "column", overflow: "hidden", height: viewportHeight, children: visibleCommits.map((commit, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
123903
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { flexDirection: "column", overflow: "hidden", height: viewportHeight, children: visibleCommits.map((commit, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
123516
123904
  CommitItem,
123517
123905
  {
123518
123906
  commit,
@@ -123523,32 +123911,8 @@ function CommitsTab({
123523
123911
  ] });
123524
123912
  }
123525
123913
 
123526
- // src/components/common/LoadingIndicator.tsx
123527
- var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
123528
- function LoadingIndicator({
123529
- message = "Loading..."
123530
- }) {
123531
- const theme14 = useTheme();
123532
- const { stdout } = use_stdout_default();
123533
- const height = stdout?.rows ?? 24;
123534
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
123535
- Box_default,
123536
- {
123537
- flexDirection: "column",
123538
- justifyContent: "center",
123539
- alignItems: "center",
123540
- height: height - 4,
123541
- flexGrow: 1,
123542
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box_default, { gap: 1, children: [
123543
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Spinner, {}),
123544
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: theme14.colors.accent, children: message })
123545
- ] })
123546
- }
123547
- );
123548
- }
123549
-
123550
123914
  // src/components/pr/ChecksTab.tsx
123551
- var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
123915
+ var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
123552
123916
  function CheckRunRow({
123553
123917
  run,
123554
123918
  isFocus
@@ -123556,15 +123920,15 @@ function CheckRunRow({
123556
123920
  const theme14 = useTheme();
123557
123921
  const icon = run.status !== "completed" ? "\u25CF" : run.conclusion === "success" || run.conclusion === "neutral" || run.conclusion === "skipped" ? "\u2713" : "\u2717";
123558
123922
  const color = run.status !== "completed" ? theme14.colors.warning : run.conclusion === "success" || run.conclusion === "neutral" || run.conclusion === "skipped" ? theme14.colors.success : theme14.colors.error;
123559
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
123923
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
123560
123924
  Box_default,
123561
123925
  {
123562
123926
  paddingX: 1,
123563
123927
  gap: 1,
123564
123928
  backgroundColor: isFocus ? theme14.colors.selection : void 0,
123565
123929
  children: [
123566
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color, children: icon }),
123567
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
123930
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color, children: icon }),
123931
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
123568
123932
  Text,
123569
123933
  {
123570
123934
  color: isFocus ? theme14.colors.listSelectedFg : theme14.colors.text,
@@ -123572,12 +123936,12 @@ function CheckRunRow({
123572
123936
  children: run.name
123573
123937
  }
123574
123938
  ),
123575
- run.status !== "completed" && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: theme14.colors.muted, children: [
123939
+ run.status !== "completed" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: theme14.colors.muted, children: [
123576
123940
  "(",
123577
123941
  run.status,
123578
123942
  ")"
123579
123943
  ] }),
123580
- run.status === "completed" && run.conclusion && run.conclusion !== "success" && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: theme14.colors.muted, children: [
123944
+ run.status === "completed" && run.conclusion && run.conclusion !== "success" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: theme14.colors.muted, children: [
123581
123945
  "(",
123582
123946
  run.conclusion,
123583
123947
  ")"
@@ -123630,34 +123994,34 @@ function ChecksTab({
123630
123994
  const scrollOffset = deriveScrollOffset(selectedIndex, viewportHeight, checkRuns.length);
123631
123995
  const visibleRuns = checkRuns.slice(scrollOffset, scrollOffset + viewportHeight);
123632
123996
  if (isLoading) {
123633
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(LoadingIndicator, { message: "Loading checks..." });
123997
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LoadingIndicator, { message: "Loading checks..." });
123634
123998
  }
123635
123999
  if (!data || data.total_count === 0) {
123636
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(EmptyState, { message: "No CI/CD checks found" });
124000
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(EmptyState, { message: "No CI/CD checks found" });
123637
124001
  }
123638
124002
  const summary5 = summarizeChecks(checkRuns);
123639
124003
  const summaryColor = summary5.conclusion === "success" ? theme14.colors.success : summary5.conclusion === "failure" ? theme14.colors.error : theme14.colors.warning;
123640
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, minHeight: 0, overflow: "hidden", children: [
123641
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { paddingX: 1, paddingY: 0, marginBottom: 1, gap: 2, children: [
123642
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "CI/CD Checks" }),
123643
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: summaryColor, bold: true, children: [
124004
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, minHeight: 0, overflow: "hidden", children: [
124005
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box_default, { paddingX: 1, paddingY: 0, marginBottom: 1, gap: 2, children: [
124006
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "CI/CD Checks" }),
124007
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: summaryColor, bold: true, children: [
123644
124008
  summary5.passed,
123645
124009
  "/",
123646
124010
  summary5.total,
123647
124011
  " passed"
123648
124012
  ] }),
123649
- summary5.failed > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: theme14.colors.error, children: [
124013
+ summary5.failed > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: theme14.colors.error, children: [
123650
124014
  "(",
123651
124015
  summary5.failed,
123652
124016
  " failed)"
123653
124017
  ] }),
123654
- summary5.pending > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Text, { color: theme14.colors.warning, children: [
124018
+ summary5.pending > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: theme14.colors.warning, children: [
123655
124019
  "(",
123656
124020
  summary5.pending,
123657
124021
  " pending)"
123658
124022
  ] })
123659
124023
  ] }),
123660
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box_default, { flexDirection: "column", overflow: "hidden", height: viewportHeight, children: visibleRuns.map((run, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
124024
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { flexDirection: "column", overflow: "hidden", height: viewportHeight, children: visibleRuns.map((run, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
123661
124025
  CheckRunRow,
123662
124026
  {
123663
124027
  run,
@@ -123669,11 +124033,11 @@ function ChecksTab({
123669
124033
  }
123670
124034
 
123671
124035
  // src/components/pr/ReviewModal.tsx
123672
- var import_react81 = __toESM(require_react(), 1);
124036
+ var import_react83 = __toESM(require_react(), 1);
123673
124037
 
123674
124038
  // src/components/common/MultiLineInput.tsx
123675
- var import_react80 = __toESM(require_react(), 1);
123676
- var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
124039
+ var import_react82 = __toESM(require_react(), 1);
124040
+ var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
123677
124041
  function MultiLineInput({
123678
124042
  placeholder,
123679
124043
  defaultValue,
@@ -123682,12 +124046,12 @@ function MultiLineInput({
123682
124046
  minHeight = 3
123683
124047
  }) {
123684
124048
  const theme14 = useTheme();
123685
- const [lines, setLines] = (0, import_react80.useState)(
124049
+ const [lines, setLines] = (0, import_react82.useState)(
123686
124050
  defaultValue ? defaultValue.split("\n") : [""]
123687
124051
  );
123688
- const [cursorRow, setCursorRow] = (0, import_react80.useState)(0);
123689
- const [cursorCol, setCursorCol] = (0, import_react80.useState)(0);
123690
- const updateLines = (0, import_react80.useCallback)(
124052
+ const [cursorRow, setCursorRow] = (0, import_react82.useState)(0);
124053
+ const [cursorCol, setCursorCol] = (0, import_react82.useState)(0);
124054
+ const updateLines = (0, import_react82.useCallback)(
123691
124055
  (newLines) => {
123692
124056
  setLines(newLines);
123693
124057
  onChange(newLines.join("\n"));
@@ -123793,23 +124157,23 @@ function MultiLineInput({
123793
124157
  );
123794
124158
  const isEmpty9 = lines.length === 1 && lines[0] === "";
123795
124159
  const displayHeight = Math.max(minHeight, lines.length);
123796
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box_default, { flexDirection: "column", minHeight: displayHeight, children: isEmpty9 && !isActive2 && placeholder ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: placeholder }) : lines.map((line, rowIndex) => {
124160
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { flexDirection: "column", minHeight: displayHeight, children: isEmpty9 && !isActive2 && placeholder ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: placeholder }) : lines.map((line, rowIndex) => {
123797
124161
  if (rowIndex === cursorRow && isActive2) {
123798
124162
  const before2 = line.slice(0, cursorCol);
123799
124163
  const cursorChar = line[cursorCol] ?? " ";
123800
124164
  const after3 = line.slice(cursorCol + 1);
123801
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: theme14.colors.text, children: [
124165
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text, { color: theme14.colors.text, children: [
123802
124166
  before2,
123803
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { inverse: true, children: cursorChar }),
124167
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { inverse: true, children: cursorChar }),
123804
124168
  after3
123805
124169
  ] }, rowIndex);
123806
124170
  }
123807
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { color: theme14.colors.text, children: line || " " }, rowIndex);
124171
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: theme14.colors.text, children: line || " " }, rowIndex);
123808
124172
  }) });
123809
124173
  }
123810
124174
 
123811
124175
  // src/components/pr/ReviewModal.tsx
123812
- var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
124176
+ var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
123813
124177
  var REVIEW_TYPES = [
123814
124178
  { event: "APPROVE", label: "Approve", color: "success" },
123815
124179
  { event: "REQUEST_CHANGES", label: "Request Changes", color: "error" },
@@ -123823,17 +124187,17 @@ function ReviewModal({
123823
124187
  }) {
123824
124188
  const theme14 = useTheme();
123825
124189
  const { setInputActive } = useInputFocus();
123826
- const [step4, setStep] = (0, import_react81.useState)("select_type");
123827
- const [selectedType, setSelectedType] = (0, import_react81.useState)(0);
123828
- const [reviewEvent, setReviewEvent] = (0, import_react81.useState)("APPROVE");
123829
- const [body, setBody] = (0, import_react81.useState)("");
123830
- (0, import_react81.useEffect)(() => {
124190
+ const [step4, setStep] = (0, import_react83.useState)("select_type");
124191
+ const [selectedType, setSelectedType] = (0, import_react83.useState)(0);
124192
+ const [reviewEvent, setReviewEvent] = (0, import_react83.useState)("APPROVE");
124193
+ const [body, setBody] = (0, import_react83.useState)("");
124194
+ (0, import_react83.useEffect)(() => {
123831
124195
  if (step4 === "enter_body") {
123832
124196
  setInputActive(true);
123833
124197
  }
123834
124198
  return () => setInputActive(false);
123835
124199
  }, [step4, setInputActive]);
123836
- const handleSubmit = (0, import_react81.useCallback)(() => {
124200
+ const handleSubmit = (0, import_react83.useCallback)(() => {
123837
124201
  if (reviewEvent === "REQUEST_CHANGES" && !body.trim()) {
123838
124202
  return;
123839
124203
  }
@@ -123869,7 +124233,7 @@ function ReviewModal({
123869
124233
  { isActive: true }
123870
124234
  );
123871
124235
  if (step4 === "select_type") {
123872
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
124236
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
123873
124237
  Box_default,
123874
124238
  {
123875
124239
  flexDirection: "column",
@@ -123881,11 +124245,11 @@ function ReviewModal({
123881
124245
  gap: 1,
123882
124246
  width: 50,
123883
124247
  children: [
123884
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Submit Review" }),
123885
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: theme14.colors.muted, children: "Select review type:" }),
123886
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box_default, { flexDirection: "column", children: REVIEW_TYPES.map((type3, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { gap: 1, children: [
123887
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: index === selectedType ? theme14.colors.accent : theme14.colors.muted, children: index === selectedType ? ">" : " " }),
123888
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
124248
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Submit Review" }),
124249
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.muted, children: "Select review type:" }),
124250
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { flexDirection: "column", children: REVIEW_TYPES.map((type3, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { gap: 1, children: [
124251
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: index === selectedType ? theme14.colors.accent : theme14.colors.muted, children: index === selectedType ? ">" : " " }),
124252
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
123889
124253
  Text,
123890
124254
  {
123891
124255
  color: theme14.colors[type3.color],
@@ -123895,14 +124259,14 @@ function ReviewModal({
123895
124259
  }
123896
124260
  )
123897
124261
  ] }, type3.event)) }),
123898
- error && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: theme14.colors.error, children: error }),
123899
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "j/k: navigate | Enter: select | Esc: cancel" })
124262
+ error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.error, children: error }),
124263
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "j/k: navigate | Enter: select | Esc: cancel" })
123900
124264
  ]
123901
124265
  }
123902
124266
  ) });
123903
124267
  }
123904
124268
  const selectedReviewType = REVIEW_TYPES.find((t) => t.event === reviewEvent);
123905
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
124269
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
123906
124270
  Box_default,
123907
124271
  {
123908
124272
  flexDirection: "column",
@@ -123914,13 +124278,13 @@ function ReviewModal({
123914
124278
  gap: 1,
123915
124279
  width: 60,
123916
124280
  children: [
123917
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { gap: 1, children: [
123918
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Submit Review" }),
123919
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: theme14.colors.muted, children: "-" }),
123920
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: selectedReviewType ? theme14.colors[selectedReviewType.color] : theme14.colors.text, children: selectedReviewType?.label })
124281
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { gap: 1, children: [
124282
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Submit Review" }),
124283
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.muted, children: "-" }),
124284
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: selectedReviewType ? theme14.colors[selectedReviewType.color] : theme14.colors.text, children: selectedReviewType?.label })
123921
124285
  ] }),
123922
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: theme14.colors.muted, children: reviewEvent === "APPROVE" ? "Add an optional message:" : "Enter your review message:" }),
123923
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
124286
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.muted, children: reviewEvent === "APPROVE" ? "Add an optional message:" : "Enter your review message:" }),
124287
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
123924
124288
  Box_default,
123925
124289
  {
123926
124290
  borderStyle: "single",
@@ -123928,7 +124292,7 @@ function ReviewModal({
123928
124292
  paddingX: 1,
123929
124293
  paddingY: 0,
123930
124294
  flexDirection: "column",
123931
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
124295
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
123932
124296
  MultiLineInput,
123933
124297
  {
123934
124298
  placeholder: "Review message... (Markdown supported)",
@@ -123939,17 +124303,17 @@ function ReviewModal({
123939
124303
  )
123940
124304
  }
123941
124305
  ),
123942
- isSubmitting && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: theme14.colors.info, children: "Submitting review..." }),
123943
- error && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: theme14.colors.error, children: error }),
123944
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Enter: new line | Ctrl+S: submit | Esc: back" })
124306
+ isSubmitting && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.info, children: "Submitting review..." }),
124307
+ error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.error, children: error }),
124308
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Enter: new line | Ctrl+S: submit | Esc: back" })
123945
124309
  ]
123946
124310
  }
123947
124311
  ) });
123948
124312
  }
123949
124313
 
123950
124314
  // src/components/pr/CommentModal.tsx
123951
- var import_react82 = __toESM(require_react(), 1);
123952
- var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
124315
+ var import_react84 = __toESM(require_react(), 1);
124316
+ var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
123953
124317
  function CommentModal({
123954
124318
  title,
123955
124319
  context: context6,
@@ -123961,12 +124325,12 @@ function CommentModal({
123961
124325
  }) {
123962
124326
  const theme14 = useTheme();
123963
124327
  const { setInputActive } = useInputFocus();
123964
- const [body, setBody] = (0, import_react82.useState)(defaultValue ?? "");
123965
- (0, import_react82.useEffect)(() => {
124328
+ const [body, setBody] = (0, import_react84.useState)(defaultValue ?? "");
124329
+ (0, import_react84.useEffect)(() => {
123966
124330
  setInputActive(true);
123967
124331
  return () => setInputActive(false);
123968
124332
  }, [setInputActive]);
123969
- const handleSubmit = (0, import_react82.useCallback)(() => {
124333
+ const handleSubmit = (0, import_react84.useCallback)(() => {
123970
124334
  const trimmed2 = body.trim();
123971
124335
  if (trimmed2 && !isSubmitting) {
123972
124336
  onSubmit(trimmed2);
@@ -123986,7 +124350,7 @@ function CommentModal({
123986
124350
  { isActive: true }
123987
124351
  );
123988
124352
  const isInline = title === "Add Inline Comment";
123989
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
124353
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
123990
124354
  Box_default,
123991
124355
  {
123992
124356
  flexDirection: "column",
@@ -123998,9 +124362,9 @@ function CommentModal({
123998
124362
  gap: 1,
123999
124363
  width: 70,
124000
124364
  children: [
124001
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.accent, bold: true, children: title }),
124002
- context6 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.muted, children: context6 }),
124003
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
124365
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.accent, bold: true, children: title }),
124366
+ context6 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.muted, children: context6 }),
124367
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
124004
124368
  Box_default,
124005
124369
  {
124006
124370
  borderStyle: "single",
@@ -124008,7 +124372,7 @@ function CommentModal({
124008
124372
  paddingX: 1,
124009
124373
  paddingY: 0,
124010
124374
  flexDirection: "column",
124011
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
124375
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
124012
124376
  MultiLineInput,
124013
124377
  {
124014
124378
  placeholder: "Write your comment... (Markdown supported)",
@@ -124020,27 +124384,27 @@ function CommentModal({
124020
124384
  )
124021
124385
  }
124022
124386
  ),
124023
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box_default, { flexDirection: "column", gap: 0, children: [
124024
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Markdown: **bold** *italic* `code` ```lang code block```" }),
124025
- isInline && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: theme14.colors.muted, dimColor: true, children: [
124387
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { flexDirection: "column", gap: 0, children: [
124388
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Markdown: **bold** *italic* `code` ```lang code block```" }),
124389
+ isInline && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { color: theme14.colors.muted, dimColor: true, children: [
124026
124390
  "Suggestion: ```suggestion",
124027
124391
  "\n",
124028
124392
  "replacement code",
124029
124393
  "\n",
124030
124394
  "```"
124031
124395
  ] }),
124032
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Tab: indent | Enter: new line | Ctrl+S: submit | Esc: cancel" })
124396
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Tab: indent | Enter: new line | Ctrl+S: submit | Esc: cancel" })
124033
124397
  ] }),
124034
- isSubmitting && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.info, children: "Posting comment..." }),
124035
- error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme14.colors.error, children: error })
124398
+ isSubmitting && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.info, children: "Posting comment..." }),
124399
+ error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.error, children: error })
124036
124400
  ]
124037
124401
  }
124038
124402
  ) });
124039
124403
  }
124040
124404
 
124041
124405
  // src/components/pr/MergeModal.tsx
124042
- var import_react83 = __toESM(require_react(), 1);
124043
- var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
124406
+ var import_react85 = __toESM(require_react(), 1);
124407
+ var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
124044
124408
  var MERGE_METHODS = [
124045
124409
  { method: "merge", label: "Merge Commit", description: "All commits preserved" },
124046
124410
  { method: "squash", label: "Squash and Merge", description: "Combine into one commit" },
@@ -124073,12 +124437,12 @@ function MergeModal({
124073
124437
  }) {
124074
124438
  const theme14 = useTheme();
124075
124439
  const { setInputActive } = useInputFocus();
124076
- const [step4, setStep] = (0, import_react83.useState)("select_method");
124077
- const [selectedMethod, setSelectedMethod] = (0, import_react83.useState)(0);
124078
- const [commitTitle, setCommitTitle] = (0, import_react83.useState)(`${pr.title} (#${pr.number})`);
124440
+ const [step4, setStep] = (0, import_react85.useState)("select_method");
124441
+ const [selectedMethod, setSelectedMethod] = (0, import_react85.useState)(0);
124442
+ const [commitTitle, setCommitTitle] = (0, import_react85.useState)(`${pr.title} (#${pr.number})`);
124079
124443
  const mergeBlockReason = getMergeabilityMessage(pr);
124080
124444
  const canMerge = mergeBlockReason === null;
124081
- (0, import_react83.useEffect)(() => {
124445
+ (0, import_react85.useEffect)(() => {
124082
124446
  if (step4 === "edit_title") {
124083
124447
  setInputActive(true);
124084
124448
  }
@@ -124125,7 +124489,7 @@ function MergeModal({
124125
124489
  );
124126
124490
  if (step4 === "confirm") {
124127
124491
  const method = MERGE_METHODS[selectedMethod];
124128
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
124492
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
124129
124493
  Box_default,
124130
124494
  {
124131
124495
  flexDirection: "column",
@@ -124136,40 +124500,40 @@ function MergeModal({
124136
124500
  gap: 1,
124137
124501
  width: 60,
124138
124502
  children: [
124139
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.warning, bold: true, children: "Confirm Merge" }),
124140
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { flexDirection: "column", gap: 0, children: [
124141
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { gap: 1, children: [
124142
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.muted, children: "PR:" }),
124143
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { color: theme14.colors.text, children: [
124503
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.warning, bold: true, children: "Confirm Merge" }),
124504
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { flexDirection: "column", gap: 0, children: [
124505
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { gap: 1, children: [
124506
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.muted, children: "PR:" }),
124507
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: theme14.colors.text, children: [
124144
124508
  "#",
124145
124509
  pr.number,
124146
124510
  " ",
124147
124511
  pr.title
124148
124512
  ] })
124149
124513
  ] }),
124150
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { gap: 1, children: [
124151
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.muted, children: "Method:" }),
124152
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.accent, children: method.label })
124514
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { gap: 1, children: [
124515
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.muted, children: "Method:" }),
124516
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.accent, children: method.label })
124153
124517
  ] }),
124154
- method.method === "squash" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { gap: 1, children: [
124155
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.muted, children: "Title:" }),
124156
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.text, children: commitTitle })
124518
+ method.method === "squash" && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { gap: 1, children: [
124519
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.muted, children: "Title:" }),
124520
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.text, children: commitTitle })
124157
124521
  ] }),
124158
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { gap: 1, children: [
124159
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.muted, children: "Into:" }),
124160
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.text, children: pr.base.ref })
124522
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { gap: 1, children: [
124523
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.muted, children: "Into:" }),
124524
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.text, children: pr.base.ref })
124161
124525
  ] })
124162
124526
  ] }),
124163
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.error, bold: true, children: "This action cannot be undone." }),
124164
- isSubmitting && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.info, children: "Merging..." }),
124165
- error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.error, children: error }),
124166
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "y: confirm merge | Esc: back" })
124527
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.error, bold: true, children: "This action cannot be undone." }),
124528
+ isSubmitting && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.info, children: "Merging..." }),
124529
+ error && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.error, children: error }),
124530
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "y: confirm merge | Esc: back" })
124167
124531
  ]
124168
124532
  }
124169
124533
  ) });
124170
124534
  }
124171
124535
  if (step4 === "edit_title") {
124172
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
124536
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
124173
124537
  Box_default,
124174
124538
  {
124175
124539
  flexDirection: "column",
@@ -124180,8 +124544,8 @@ function MergeModal({
124180
124544
  gap: 1,
124181
124545
  width: 60,
124182
124546
  children: [
124183
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Squash Commit Title" }),
124184
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box_default, { borderStyle: "single", borderColor: theme14.colors.border, paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
124547
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Squash Commit Title" }),
124548
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box_default, { borderStyle: "single", borderColor: theme14.colors.border, paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
124185
124549
  TextInput,
124186
124550
  {
124187
124551
  defaultValue: commitTitle,
@@ -124189,12 +124553,12 @@ function MergeModal({
124189
124553
  placeholder: "Commit title..."
124190
124554
  }
124191
124555
  ) }),
124192
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Enter: continue | Esc: back" })
124556
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Enter: continue | Esc: back" })
124193
124557
  ]
124194
124558
  }
124195
124559
  ) });
124196
124560
  }
124197
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
124561
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
124198
124562
  Box_default,
124199
124563
  {
124200
124564
  flexDirection: "column",
@@ -124205,16 +124569,16 @@ function MergeModal({
124205
124569
  gap: 1,
124206
124570
  width: 55,
124207
124571
  children: [
124208
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { color: theme14.colors.accent, bold: true, children: [
124572
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: theme14.colors.accent, bold: true, children: [
124209
124573
  "Merge Pull Request #",
124210
124574
  pr.number
124211
124575
  ] }),
124212
- !canMerge && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box_default, { borderStyle: "single", borderColor: theme14.colors.error, paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.error, children: mergeBlockReason }) }),
124213
- pr.mergeable === null && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.warning, children: "Mergeability is being checked..." }),
124214
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.muted, children: canMerge ? "Select merge method:" : "Merge is not available:" }),
124215
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box_default, { flexDirection: "column", children: MERGE_METHODS.map((m, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box_default, { gap: 1, children: [
124216
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: index === selectedMethod ? theme14.colors.accent : theme14.colors.muted, children: index === selectedMethod ? ">" : " " }),
124217
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
124576
+ !canMerge && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box_default, { borderStyle: "single", borderColor: theme14.colors.error, paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.error, children: mergeBlockReason }) }),
124577
+ pr.mergeable === null && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.warning, children: "Mergeability is being checked..." }),
124578
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.muted, children: canMerge ? "Select merge method:" : "Merge is not available:" }),
124579
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box_default, { flexDirection: "column", children: MERGE_METHODS.map((m, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { gap: 1, children: [
124580
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: index === selectedMethod ? theme14.colors.accent : theme14.colors.muted, children: index === selectedMethod ? ">" : " " }),
124581
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
124218
124582
  Text,
124219
124583
  {
124220
124584
  bold: index === selectedMethod,
@@ -124223,21 +124587,21 @@ function MergeModal({
124223
124587
  children: m.label
124224
124588
  }
124225
124589
  ),
124226
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Text, { color: theme14.colors.muted, dimColor: true, children: [
124590
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: theme14.colors.muted, dimColor: true, children: [
124227
124591
  "- ",
124228
124592
  m.description
124229
124593
  ] })
124230
124594
  ] }, m.method)) }),
124231
- error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.error, children: error }),
124232
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: canMerge ? "j/k: navigate | Enter: select | Esc: cancel" : "Esc: cancel" })
124595
+ error && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.error, children: error }),
124596
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: canMerge ? "j/k: navigate | Enter: select | Esc: cancel" : "Esc: cancel" })
124233
124597
  ]
124234
124598
  }
124235
124599
  ) });
124236
124600
  }
124237
124601
 
124238
124602
  // src/components/pr/ReReviewModal.tsx
124239
- var import_react84 = __toESM(require_react(), 1);
124240
- var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
124603
+ var import_react86 = __toESM(require_react(), 1);
124604
+ var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
124241
124605
  function getStatusColor(status, theme14) {
124242
124606
  switch (status) {
124243
124607
  case "APPROVED":
@@ -124294,8 +124658,8 @@ function ReReviewModal({
124294
124658
  error
124295
124659
  }) {
124296
124660
  const theme14 = useTheme();
124297
- const [selectedIndex, setSelectedIndex] = (0, import_react84.useState)(0);
124298
- const [selected, setSelected] = (0, import_react84.useState)(/* @__PURE__ */ new Set());
124661
+ const [selectedIndex, setSelectedIndex] = (0, import_react86.useState)(0);
124662
+ const [selected, setSelected] = (0, import_react86.useState)(/* @__PURE__ */ new Set());
124299
124663
  use_input_default(
124300
124664
  (_input, key) => {
124301
124665
  if (isSubmitting) return;
@@ -124327,7 +124691,7 @@ function ReReviewModal({
124327
124691
  },
124328
124692
  { isActive: true }
124329
124693
  );
124330
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
124694
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
124331
124695
  Box_default,
124332
124696
  {
124333
124697
  flexDirection: "column",
@@ -124339,20 +124703,20 @@ function ReReviewModal({
124339
124703
  gap: 1,
124340
124704
  width: 50,
124341
124705
  children: [
124342
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Request Re-Review" }),
124343
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.muted, children: "Select reviewers:" }),
124344
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box_default, { flexDirection: "column", children: reviewers.map((reviewer, index) => {
124706
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Request Re-Review" }),
124707
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: theme14.colors.muted, children: "Select reviewers:" }),
124708
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { flexDirection: "column", children: reviewers.map((reviewer, index) => {
124345
124709
  const isSelected = selected.has(reviewer.login);
124346
124710
  const isFocused = index === selectedIndex;
124347
124711
  const statusColor = getStatusColor(reviewer.status, theme14);
124348
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box_default, { gap: 1, children: [
124349
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: isFocused ? theme14.colors.accent : theme14.colors.muted, children: isFocused ? ">" : " " }),
124350
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: isSelected ? theme14.colors.accent : theme14.colors.muted, children: [
124712
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { gap: 1, children: [
124713
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: isFocused ? theme14.colors.accent : theme14.colors.muted, children: isFocused ? ">" : " " }),
124714
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: isSelected ? theme14.colors.accent : theme14.colors.muted, children: [
124351
124715
  "[",
124352
124716
  isSelected ? "x" : " ",
124353
124717
  "]"
124354
124718
  ] }),
124355
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
124719
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
124356
124720
  Text,
124357
124721
  {
124358
124722
  color: isFocused ? theme14.colors.text : theme14.colors.secondary,
@@ -124360,22 +124724,22 @@ function ReReviewModal({
124360
124724
  children: reviewer.login
124361
124725
  }
124362
124726
  ),
124363
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: statusColor, children: [
124727
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: statusColor, children: [
124364
124728
  "(",
124365
124729
  getStatusLabel(reviewer.status),
124366
124730
  ")"
124367
124731
  ] })
124368
124732
  ] }, reviewer.login);
124369
124733
  }) }),
124370
- selected.size > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Text, { color: theme14.colors.info, children: [
124734
+ selected.size > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: theme14.colors.info, children: [
124371
124735
  selected.size,
124372
124736
  " reviewer",
124373
124737
  selected.size > 1 ? "s" : "",
124374
124738
  " selected"
124375
124739
  ] }),
124376
- isSubmitting && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.info, children: "Requesting re-review..." }),
124377
- error && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.error, children: error }),
124378
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "j/k: navigate | Enter: toggle | Ctrl+S: submit | Esc: cancel" })
124740
+ isSubmitting && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: theme14.colors.info, children: "Requesting re-review..." }),
124741
+ error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: theme14.colors.error, children: error }),
124742
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "j/k: navigate | Enter: toggle | Ctrl+S: submit | Esc: cancel" })
124379
124743
  ]
124380
124744
  }
124381
124745
  ) });
@@ -124488,7 +124852,7 @@ function parseGitHubUrl(url2) {
124488
124852
  }
124489
124853
 
124490
124854
  // src/hooks/useReadState.ts
124491
- var import_react85 = __toESM(require_react(), 1);
124855
+ var import_react87 = __toESM(require_react(), 1);
124492
124856
  import { readFileSync as readFileSync3 } from "fs";
124493
124857
  import { join as join6 } from "path";
124494
124858
  import { homedir as homedir4 } from "os";
@@ -124563,18 +124927,18 @@ function createReadStateStore() {
124563
124927
  }
124564
124928
  var store5 = createReadStateStore();
124565
124929
  function useReadState() {
124566
- const readState = (0, import_react85.useSyncExternalStore)(
124930
+ const readState = (0, import_react87.useSyncExternalStore)(
124567
124931
  store5.subscribe,
124568
124932
  store5.getSnapshot,
124569
124933
  () => ({})
124570
124934
  );
124571
- const markAsRead = (0, import_react85.useCallback)(
124935
+ const markAsRead = (0, import_react87.useCallback)(
124572
124936
  (htmlUrl, prUpdatedAt) => {
124573
124937
  store5.markAsRead(htmlUrl, prUpdatedAt);
124574
124938
  },
124575
124939
  []
124576
124940
  );
124577
- const isUnread = (0, import_react85.useCallback)(
124941
+ const isUnread = (0, import_react87.useCallback)(
124578
124942
  (htmlUrl, prUpdatedAt) => {
124579
124943
  return store5.isUnread(htmlUrl, prUpdatedAt);
124580
124944
  },
@@ -124586,14 +124950,14 @@ function useReadState() {
124586
124950
  }
124587
124951
 
124588
124952
  // src/hooks/useManualRefresh.ts
124589
- var import_react86 = __toESM(require_react(), 1);
124953
+ var import_react88 = __toESM(require_react(), 1);
124590
124954
  function useManualRefresh({
124591
124955
  isActive: isActive2 = true,
124592
124956
  queryKeys
124593
124957
  } = {}) {
124594
124958
  const queryClient2 = useQueryClient();
124595
124959
  const { setStatusMessage } = useStatusMessage();
124596
- const refresh = (0, import_react86.useCallback)(() => {
124960
+ const refresh = (0, import_react88.useCallback)(() => {
124597
124961
  if (queryKeys && queryKeys.length > 0) {
124598
124962
  queryKeys.forEach((key) => {
124599
124963
  queryClient2.invalidateQueries({ queryKey: key });
@@ -124615,7 +124979,7 @@ function useManualRefresh({
124615
124979
  }
124616
124980
 
124617
124981
  // src/screens/PRDetailScreen.tsx
124618
- var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
124982
+ var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
124619
124983
  var PR_DETAIL_RESERVED_LINES = 12;
124620
124984
  function PRDetailScreen({
124621
124985
  pr,
@@ -124630,14 +124994,15 @@ function PRDetailScreen({
124630
124994
  const { setStatusMessage } = useStatusMessage();
124631
124995
  const { markAsRead } = useReadState();
124632
124996
  const theme14 = useTheme();
124633
- const [currentTab, setCurrentTab] = (0, import_react87.useState)(0);
124634
- const [showDiscardConfirm, setShowDiscardConfirm] = (0, import_react87.useState)(false);
124635
- const [initialFile, setInitialFile] = (0, import_react87.useState)(void 0);
124997
+ const [currentTab, setCurrentTab] = (0, import_react89.useState)(0);
124998
+ const [showDiscardConfirm, setShowDiscardConfirm] = (0, import_react89.useState)(false);
124999
+ const [showDraftConfirm, setShowDraftConfirm] = (0, import_react89.useState)(false);
125000
+ const [initialFile, setInitialFile] = (0, import_react89.useState)(void 0);
124636
125001
  const contentHeight = Math.max(1, (stdout?.rows ?? 24) - PR_DETAIL_RESERVED_LINES);
124637
- import_react87.default.useEffect(() => {
125002
+ import_react89.default.useEffect(() => {
124638
125003
  markAsRead(pr.html_url, pr.updated_at);
124639
125004
  }, [pr.html_url, pr.updated_at, markAsRead]);
124640
- import_react87.default.useEffect(() => {
125005
+ import_react89.default.useEffect(() => {
124641
125006
  const tabContexts = [
124642
125007
  "pr-detail-description",
124643
125008
  "pr-detail-conversations",
@@ -124647,8 +125012,8 @@ function PRDetailScreen({
124647
125012
  ];
124648
125013
  setScreenContext(tabContexts[currentTab] ?? "pr-detail-description");
124649
125014
  }, [currentTab]);
124650
- const visitedTabsRef = (0, import_react87.useRef)(/* @__PURE__ */ new Set([0]));
124651
- import_react87.default.useEffect(() => {
125015
+ const visitedTabsRef = (0, import_react89.useRef)(/* @__PURE__ */ new Set([0]));
125016
+ import_react89.default.useEffect(() => {
124652
125017
  if (!visitedTabsRef.current.has(currentTab)) {
124653
125018
  visitedTabsRef.current = /* @__PURE__ */ new Set([...visitedTabsRef.current, currentTab]);
124654
125019
  }
@@ -124691,7 +125056,9 @@ function PRDetailScreen({
124691
125056
  prNumber: pr.number,
124692
125057
  setStatusMessage
124693
125058
  });
124694
- const handleReviewSubmit = (0, import_react87.useCallback)(
125059
+ const convertToDraft = useConvertToDraft();
125060
+ const markReady = useMarkReadyForReview();
125061
+ const handleReviewSubmit = (0, import_react89.useCallback)(
124695
125062
  (body, event) => {
124696
125063
  if (pendingReview.isActive) {
124697
125064
  pendingReview.submitReview(body, event);
@@ -124702,7 +125069,7 @@ function PRDetailScreen({
124702
125069
  },
124703
125070
  [pendingReview, modals]
124704
125071
  );
124705
- const handleCommentSubmit = (0, import_react87.useCallback)(
125072
+ const handleCommentSubmit = (0, import_react89.useCallback)(
124706
125073
  (body) => {
124707
125074
  if (pendingReview.isActive && modals.inlineContext) {
124708
125075
  pendingReview.addPendingComment(
@@ -124723,7 +125090,7 @@ function PRDetailScreen({
124723
125090
  },
124724
125091
  [pendingReview, modals]
124725
125092
  );
124726
- const handleGoToFile = (0, import_react87.useCallback)((path) => {
125093
+ const handleGoToFile = (0, import_react89.useCallback)((path) => {
124727
125094
  setInitialFile(path);
124728
125095
  setCurrentTab(3);
124729
125096
  setStatusMessage(`Jumped to ${path}`);
@@ -124742,6 +125109,36 @@ function PRDetailScreen({
124742
125109
  }
124743
125110
  return;
124744
125111
  }
125112
+ if (showDraftConfirm) {
125113
+ if (input === "y" || input === "Y") {
125114
+ setShowDraftConfirm(false);
125115
+ const nodeId = activePR.node_id;
125116
+ if (!nodeId) {
125117
+ setStatusMessage("Cannot toggle draft: missing node_id");
125118
+ return;
125119
+ }
125120
+ if (activePR.draft) {
125121
+ markReady.mutate(
125122
+ { owner, repo, prNumber: pr.number, nodeId },
125123
+ {
125124
+ onSuccess: () => setStatusMessage("PR marked as ready for review"),
125125
+ onError: (err) => setStatusMessage(`Error: ${String(err)}`)
125126
+ }
125127
+ );
125128
+ } else {
125129
+ convertToDraft.mutate(
125130
+ { owner, repo, prNumber: pr.number, nodeId },
125131
+ {
125132
+ onSuccess: () => setStatusMessage("PR converted to draft"),
125133
+ onError: (err) => setStatusMessage(`Error: ${String(err)}`)
125134
+ }
125135
+ );
125136
+ }
125137
+ } else {
125138
+ setShowDraftConfirm(false);
125139
+ }
125140
+ return;
125141
+ }
124745
125142
  if (modals.showCloseConfirm) {
124746
125143
  if (input === "y" || input === "Y") {
124747
125144
  modals.handleClosePR();
@@ -124790,6 +125187,12 @@ function PRDetailScreen({
124790
125187
  onNavigate("next");
124791
125188
  } else if (input === "[" && onNavigate) {
124792
125189
  onNavigate("prev");
125190
+ } else if (input === "W") {
125191
+ if (activePR.state === "open") {
125192
+ setShowDraftConfirm(true);
125193
+ } else {
125194
+ setStatusMessage("Can only toggle draft on open PRs");
125195
+ }
124793
125196
  } else if (input === "T") {
124794
125197
  modals.handleOpenEditTitle({ title: activePR.title });
124795
125198
  } else if (input === "G") {
@@ -124817,10 +125220,10 @@ function PRDetailScreen({
124817
125220
  );
124818
125221
  const renderTabContent = () => {
124819
125222
  if (isLoading) {
124820
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(LoadingIndicator, { message: "Loading PR details..." });
125223
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LoadingIndicator, { message: "Loading PR details..." });
124821
125224
  }
124822
125225
  return Match_exports.value(currentTab).pipe(
124823
- Match_exports.when(0, () => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
125226
+ Match_exports.when(0, () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
124824
125227
  DescriptionTab,
124825
125228
  {
124826
125229
  pr: activePR,
@@ -124829,7 +125232,7 @@ function PRDetailScreen({
124829
125232
  onEditDescription: modals.handleOpenEditDescription
124830
125233
  }
124831
125234
  )),
124832
- Match_exports.when(1, () => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
125235
+ Match_exports.when(1, () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
124833
125236
  ConversationsTab,
124834
125237
  {
124835
125238
  pr: activePR,
@@ -124849,8 +125252,8 @@ function PRDetailScreen({
124849
125252
  onGoToFile: handleGoToFile
124850
125253
  }
124851
125254
  )),
124852
- Match_exports.when(2, () => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CommitsTab, { commits, isActive: !modals.hasModal })),
124853
- Match_exports.when(3, () => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
125255
+ Match_exports.when(2, () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CommitsTab, { commits, isActive: !modals.hasModal, owner, repo })),
125256
+ Match_exports.when(3, () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
124854
125257
  FilesTab,
124855
125258
  {
124856
125259
  files,
@@ -124867,7 +125270,7 @@ function PRDetailScreen({
124867
125270
  onInitialFileConsumed: () => setInitialFile(void 0)
124868
125271
  }
124869
125272
  )),
124870
- Match_exports.when(4, () => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
125273
+ Match_exports.when(4, () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
124871
125274
  ChecksTab,
124872
125275
  {
124873
125276
  owner,
@@ -124876,7 +125279,7 @@ function PRDetailScreen({
124876
125279
  isActive: !modals.hasModal
124877
125280
  }
124878
125281
  )),
124879
- Match_exports.orElse(() => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
125282
+ Match_exports.orElse(() => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
124880
125283
  DescriptionTab,
124881
125284
  {
124882
125285
  pr: activePR,
@@ -124887,12 +125290,12 @@ function PRDetailScreen({
124887
125290
  ))
124888
125291
  );
124889
125292
  };
124890
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, minHeight: 0, children: [
124891
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { flexShrink: 0, flexDirection: "column", children: [
124892
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PRHeader, { pr: activePR, prIndex, prTotal }),
124893
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PRTabs, { activeIndex: currentTab, onChange: setCurrentTab })
125293
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, minHeight: 0, children: [
125294
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { flexShrink: 0, flexDirection: "column", children: [
125295
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PRHeader, { pr: activePR, prIndex, prTotal }),
125296
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PRTabs, { activeIndex: currentTab, onChange: setCurrentTab })
124894
125297
  ] }),
124895
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
125298
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
124896
125299
  Box_default,
124897
125300
  {
124898
125301
  flexShrink: 0,
@@ -124906,31 +125309,31 @@ function PRDetailScreen({
124906
125309
  children: renderTabContent()
124907
125310
  }
124908
125311
  ),
124909
- pendingReview.isActive && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { paddingX: 1, children: [
124910
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: theme14.colors.warning, bold: true, children: [
125312
+ pendingReview.isActive && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { paddingX: 1, children: [
125313
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: theme14.colors.warning, bold: true, children: [
124911
125314
  "Review in progress (",
124912
125315
  pendingReview.pendingCount,
124913
125316
  " pending comment",
124914
125317
  pendingReview.pendingCount !== 1 ? "s" : "",
124915
125318
  ")"
124916
125319
  ] }),
124917
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text, { color: theme14.colors.muted, children: " | R: submit | q: discard" })
125320
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: theme14.colors.muted, children: " | R: submit | q: discard" })
124918
125321
  ] }),
124919
- showDiscardConfirm && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Box_default, { paddingX: 1, flexDirection: "column", children: [
124920
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: theme14.colors.warning, bold: true, children: [
125322
+ showDiscardConfirm && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Box_default, { paddingX: 1, flexDirection: "column", children: [
125323
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: theme14.colors.warning, bold: true, children: [
124921
125324
  "Discard pending review with ",
124922
125325
  pendingReview.pendingCount,
124923
125326
  " comment",
124924
125327
  pendingReview.pendingCount !== 1 ? "s" : "",
124925
125328
  "? (y/n)"
124926
125329
  ] }),
124927
- pendingReview.pendingComments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { flexDirection: "column", paddingLeft: 2, children: pendingReview.pendingComments.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: theme14.colors.muted, children: [
125330
+ pendingReview.pendingComments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { flexDirection: "column", paddingLeft: 2, children: pendingReview.pendingComments.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: theme14.colors.muted, children: [
124928
125331
  c.path,
124929
125332
  ":",
124930
125333
  c.line
124931
125334
  ] }, `${c.path}-${c.line}-${i}`)) })
124932
125335
  ] }),
124933
- modals.showReviewModal && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
125336
+ modals.showReviewModal && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
124934
125337
  ReviewModal,
124935
125338
  {
124936
125339
  onSubmit: handleReviewSubmit,
@@ -124939,7 +125342,7 @@ function PRDetailScreen({
124939
125342
  error: pendingReview.isActive ? pendingReview.error : modals.reviewError
124940
125343
  }
124941
125344
  ),
124942
- modals.showCommentModal && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
125345
+ modals.showCommentModal && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
124943
125346
  CommentModal,
124944
125347
  {
124945
125348
  title: pendingReview.isActive && modals.inlineContext ? "Add Pending Comment" : modals.commentModalTitle,
@@ -124951,12 +125354,13 @@ function PRDetailScreen({
124951
125354
  error: pendingReview.isActive ? pendingReview.error : modals.commentError
124952
125355
  }
124953
125356
  ),
124954
- modals.showCloseConfirm && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { color: theme14.colors.warning, bold: true, children: [
125357
+ showDraftConfirm && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: theme14.colors.warning, bold: true, children: activePR.draft ? `Mark PR #${pr.number} as ready for review? (y/n)` : `Convert PR #${pr.number} to draft? (y/n)` }) }),
125358
+ modals.showCloseConfirm && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { color: theme14.colors.warning, bold: true, children: [
124955
125359
  "Close PR #",
124956
125360
  pr.number,
124957
125361
  "? This will not delete the branch. (y/n)"
124958
125362
  ] }) }),
124959
- modals.showMergeModal && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
125363
+ modals.showMergeModal && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
124960
125364
  MergeModal,
124961
125365
  {
124962
125366
  pr: activePR,
@@ -124966,7 +125370,7 @@ function PRDetailScreen({
124966
125370
  error: modals.mergeError
124967
125371
  }
124968
125372
  ),
124969
- modals.showReReviewModal && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
125373
+ modals.showReReviewModal && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
124970
125374
  ReReviewModal,
124971
125375
  {
124972
125376
  reviewers: buildReviewerList(reviews, activePR.requested_reviewers),
@@ -124980,22 +125384,22 @@ function PRDetailScreen({
124980
125384
  }
124981
125385
 
124982
125386
  // src/screens/MyPRsScreen.tsx
124983
- var import_react95 = __toESM(require_react(), 1);
125387
+ var import_react97 = __toESM(require_react(), 1);
124984
125388
 
124985
125389
  // src/screens/PRListScreen.tsx
124986
- var import_react94 = __toESM(require_react(), 1);
125390
+ var import_react96 = __toESM(require_react(), 1);
124987
125391
 
124988
125392
  // src/hooks/usePagination.ts
124989
- var import_react88 = __toESM(require_react(), 1);
125393
+ var import_react90 = __toESM(require_react(), 1);
124990
125394
  function usePagination(items, options = {}) {
124991
125395
  const pageSize = options.pageSize ?? 18;
124992
- const [currentPage, setCurrentPage] = (0, import_react88.useState)(1);
124993
- const prevItemsLengthRef = (0, import_react88.useRef)(items.length);
124994
- const totalPages = (0, import_react88.useMemo)(
125396
+ const [currentPage, setCurrentPage] = (0, import_react90.useState)(1);
125397
+ const prevItemsLengthRef = (0, import_react90.useRef)(items.length);
125398
+ const totalPages = (0, import_react90.useMemo)(
124995
125399
  () => Math.max(1, Math.ceil(items.length / pageSize)),
124996
125400
  [items.length, pageSize]
124997
125401
  );
124998
- (0, import_react88.useEffect)(() => {
125402
+ (0, import_react90.useEffect)(() => {
124999
125403
  if (items.length !== prevItemsLengthRef.current) {
125000
125404
  setCurrentPage(1);
125001
125405
  prevItemsLengthRef.current = items.length;
@@ -125004,23 +125408,23 @@ function usePagination(items, options = {}) {
125004
125408
  const safePage = Math.min(currentPage, totalPages);
125005
125409
  const startIndex = (safePage - 1) * pageSize;
125006
125410
  const endIndex = Math.min(startIndex + pageSize, items.length);
125007
- const pageItems = (0, import_react88.useMemo)(
125411
+ const pageItems = (0, import_react90.useMemo)(
125008
125412
  () => items.slice(startIndex, endIndex),
125009
125413
  [items, startIndex, endIndex]
125010
125414
  );
125011
125415
  const hasNextPage = safePage < totalPages;
125012
125416
  const hasPrevPage = safePage > 1;
125013
- const nextPage = (0, import_react88.useCallback)(() => {
125417
+ const nextPage = (0, import_react90.useCallback)(() => {
125014
125418
  if (hasNextPage) {
125015
125419
  setCurrentPage((p) => p + 1);
125016
125420
  }
125017
125421
  }, [hasNextPage]);
125018
- const prevPage = (0, import_react88.useCallback)(() => {
125422
+ const prevPage = (0, import_react90.useCallback)(() => {
125019
125423
  if (hasPrevPage) {
125020
125424
  setCurrentPage((p) => p - 1);
125021
125425
  }
125022
125426
  }, [hasPrevPage]);
125023
- const goToPage = (0, import_react88.useCallback)(
125427
+ const goToPage = (0, import_react90.useCallback)(
125024
125428
  (page) => {
125025
125429
  const clampedPage = Math.max(1, Math.min(page, totalPages));
125026
125430
  setCurrentPage(clampedPage);
@@ -125042,7 +125446,7 @@ function usePagination(items, options = {}) {
125042
125446
  }
125043
125447
 
125044
125448
  // src/hooks/useFilter.ts
125045
- var import_react89 = __toESM(require_react(), 1);
125449
+ var import_react91 = __toESM(require_react(), 1);
125046
125450
  var defaultFilter = {
125047
125451
  search: "",
125048
125452
  repo: null,
@@ -125099,8 +125503,8 @@ function comparePRs(a, b, sortBy, sortDirection) {
125099
125503
  return sortDirection === "asc" ? -comparison : comparison;
125100
125504
  }
125101
125505
  function useFilter(items) {
125102
- const [filter9, setFilter] = (0, import_react89.useState)(defaultFilter);
125103
- const availableRepos = (0, import_react89.useMemo)(() => {
125506
+ const [filter9, setFilter] = (0, import_react91.useState)(defaultFilter);
125507
+ const availableRepos = (0, import_react91.useMemo)(() => {
125104
125508
  const repos = /* @__PURE__ */ new Set();
125105
125509
  items.forEach((pr) => {
125106
125510
  const repo = extractRepoFromUrl(pr.html_url);
@@ -125108,17 +125512,17 @@ function useFilter(items) {
125108
125512
  });
125109
125513
  return Array.from(repos).sort();
125110
125514
  }, [items]);
125111
- const availableAuthors = (0, import_react89.useMemo)(() => {
125515
+ const availableAuthors = (0, import_react91.useMemo)(() => {
125112
125516
  const authors = /* @__PURE__ */ new Set();
125113
125517
  items.forEach((pr) => authors.add(pr.user.login));
125114
125518
  return Array.from(authors).sort();
125115
125519
  }, [items]);
125116
- const availableLabels = (0, import_react89.useMemo)(() => {
125520
+ const availableLabels = (0, import_react91.useMemo)(() => {
125117
125521
  const labels = /* @__PURE__ */ new Set();
125118
125522
  items.forEach((pr) => pr.labels.forEach((l) => labels.add(l.name)));
125119
125523
  return Array.from(labels).sort();
125120
125524
  }, [items]);
125121
- const repoFacets = (0, import_react89.useMemo)(() => {
125525
+ const repoFacets = (0, import_react91.useMemo)(() => {
125122
125526
  const counts = /* @__PURE__ */ new Map();
125123
125527
  items.forEach((pr) => {
125124
125528
  const repo = extractRepoFromUrl(pr.html_url);
@@ -125126,14 +125530,14 @@ function useFilter(items) {
125126
125530
  });
125127
125531
  return Array.from(counts.entries()).map(([value5, count]) => ({ value: value5, count })).sort((a, b) => b.count - a.count);
125128
125532
  }, [items]);
125129
- const authorFacets = (0, import_react89.useMemo)(() => {
125533
+ const authorFacets = (0, import_react91.useMemo)(() => {
125130
125534
  const counts = /* @__PURE__ */ new Map();
125131
125535
  items.forEach((pr) => {
125132
125536
  counts.set(pr.user.login, (counts.get(pr.user.login) ?? 0) + 1);
125133
125537
  });
125134
125538
  return Array.from(counts.entries()).map(([value5, count]) => ({ value: value5, count })).sort((a, b) => b.count - a.count);
125135
125539
  }, [items]);
125136
- const labelFacets = (0, import_react89.useMemo)(() => {
125540
+ const labelFacets = (0, import_react91.useMemo)(() => {
125137
125541
  const counts = /* @__PURE__ */ new Map();
125138
125542
  items.forEach(
125139
125543
  (pr) => pr.labels.forEach((l) => {
@@ -125142,31 +125546,31 @@ function useFilter(items) {
125142
125546
  );
125143
125547
  return Array.from(counts.entries()).map(([value5, count]) => ({ value: value5, count })).sort((a, b) => b.count - a.count);
125144
125548
  }, [items]);
125145
- const filteredItems = (0, import_react89.useMemo)(() => {
125549
+ const filteredItems = (0, import_react91.useMemo)(() => {
125146
125550
  return items.filter((pr) => matchesSearch(pr, filter9.search)).filter((pr) => matchesRepo(pr, filter9.repo)).filter((pr) => matchesAuthor(pr, filter9.author)).filter((pr) => matchesLabel(pr, filter9.label)).sort((a, b) => comparePRs(a, b, filter9.sortBy, filter9.sortDirection));
125147
125551
  }, [items, filter9]);
125148
- const setSearch = (0, import_react89.useCallback)((search) => {
125552
+ const setSearch = (0, import_react91.useCallback)((search) => {
125149
125553
  setFilter((prev) => ({ ...prev, search }));
125150
125554
  }, []);
125151
- const setRepo = (0, import_react89.useCallback)((repo) => {
125555
+ const setRepo = (0, import_react91.useCallback)((repo) => {
125152
125556
  setFilter((prev) => ({ ...prev, repo }));
125153
125557
  }, []);
125154
- const setAuthor = (0, import_react89.useCallback)((author) => {
125558
+ const setAuthor = (0, import_react91.useCallback)((author) => {
125155
125559
  setFilter((prev) => ({ ...prev, author }));
125156
125560
  }, []);
125157
- const setLabel = (0, import_react89.useCallback)((label) => {
125561
+ const setLabel = (0, import_react91.useCallback)((label) => {
125158
125562
  setFilter((prev) => ({ ...prev, label }));
125159
125563
  }, []);
125160
- const setSortBy = (0, import_react89.useCallback)((sortBy) => {
125564
+ const setSortBy = (0, import_react91.useCallback)((sortBy) => {
125161
125565
  setFilter((prev) => ({ ...prev, sortBy }));
125162
125566
  }, []);
125163
- const toggleSortDirection = (0, import_react89.useCallback)(() => {
125567
+ const toggleSortDirection = (0, import_react91.useCallback)(() => {
125164
125568
  setFilter((prev) => ({
125165
125569
  ...prev,
125166
125570
  sortDirection: prev.sortDirection === "asc" ? "desc" : "asc"
125167
125571
  }));
125168
125572
  }, []);
125169
- const clearFilters = (0, import_react89.useCallback)(() => {
125573
+ const clearFilters = (0, import_react91.useCallback)(() => {
125170
125574
  setFilter(defaultFilter);
125171
125575
  }, []);
125172
125576
  const hasActiveFilters = filter9.search !== "" || filter9.repo !== null || filter9.author !== null || filter9.label !== null;
@@ -125191,7 +125595,7 @@ function useFilter(items) {
125191
125595
  }
125192
125596
 
125193
125597
  // src/components/pr/CheckStatusIcon.tsx
125194
- var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
125598
+ var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
125195
125599
  function CheckStatusIcon({
125196
125600
  owner,
125197
125601
  repo,
@@ -125201,23 +125605,23 @@ function CheckStatusIcon({
125201
125605
  const theme14 = useTheme();
125202
125606
  const { data } = useCheckRuns(owner, repo, sha, { enabled: enabled2 });
125203
125607
  if (!data || data.total_count === 0) {
125204
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: theme14.colors.muted, children: enabled2 ? "" : "\xB7" });
125608
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: theme14.colors.muted, children: enabled2 ? "" : "\xB7" });
125205
125609
  }
125206
125610
  const summary5 = summarizeChecks(data.check_runs);
125207
125611
  if (summary5.conclusion === "success") {
125208
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: theme14.colors.success, children: "\u2713" });
125612
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: theme14.colors.success, children: "\u2713" });
125209
125613
  }
125210
125614
  if (summary5.conclusion === "failure") {
125211
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: theme14.colors.error, children: "\u2717" });
125615
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: theme14.colors.error, children: "\u2717" });
125212
125616
  }
125213
125617
  if (summary5.conclusion === "pending") {
125214
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: theme14.colors.warning, children: "\u25CF" });
125618
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: theme14.colors.warning, children: "\u25CF" });
125215
125619
  }
125216
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { color: theme14.colors.muted, children: "\xB7" });
125620
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: theme14.colors.muted, children: "\xB7" });
125217
125621
  }
125218
125622
 
125219
125623
  // src/components/pr/ReviewStatusIcon.tsx
125220
- var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
125624
+ var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
125221
125625
  function getReviewDecision(reviews) {
125222
125626
  if (reviews.length === 0) return "none";
125223
125627
  const latestByUser = /* @__PURE__ */ new Map();
@@ -125241,23 +125645,23 @@ function ReviewStatusIcon({
125241
125645
  const theme14 = useTheme();
125242
125646
  const { data: reviews } = usePRReviews(owner, repo, prNumber, { enabled: enabled2 });
125243
125647
  if (!reviews || reviews.length === 0) {
125244
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: theme14.colors.muted, children: enabled2 ? "" : "\xB7" });
125648
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.muted, children: enabled2 ? "" : "\xB7" });
125245
125649
  }
125246
125650
  const decision = getReviewDecision(reviews);
125247
125651
  if (decision === "approved") {
125248
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: theme14.colors.success, children: "A" });
125652
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.success, children: "A" });
125249
125653
  }
125250
125654
  if (decision === "changes_requested") {
125251
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: theme14.colors.error, children: "!" });
125655
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.error, children: "!" });
125252
125656
  }
125253
125657
  if (decision === "pending") {
125254
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: theme14.colors.warning, children: "R" });
125658
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.warning, children: "R" });
125255
125659
  }
125256
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: theme14.colors.muted, children: "\xB7" });
125660
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.muted, children: "\xB7" });
125257
125661
  }
125258
125662
 
125259
125663
  // src/components/pr/PRListItem.tsx
125260
- var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
125664
+ var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
125261
125665
  function extractRepoFromUrl2(url2) {
125262
125666
  const match15 = url2.match(/github\.com\/([^/]+\/[^/]+)\/pull/);
125263
125667
  return match15?.[1] ?? null;
@@ -125279,13 +125683,13 @@ function PRListItem({
125279
125683
  const repoName = extractRepoFromUrl2(item.html_url);
125280
125684
  const ownerRepo = extractOwnerRepo(item.html_url);
125281
125685
  const headSha = item.head.sha;
125282
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
125283
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box_default, { gap: 1, children: [
125284
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: stateColor, bold: true, children: stateIcon }),
125285
- ownerRepo && headSha && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CheckStatusIcon, { owner: ownerRepo.owner, repo: ownerRepo.repo, sha: headSha, enabled: isFocus }),
125286
- ownerRepo && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ReviewStatusIcon, { owner: ownerRepo.owner, repo: ownerRepo.repo, prNumber: item.number, enabled: isFocus }),
125287
- unread && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "*" }),
125288
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
125686
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
125687
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { gap: 1, children: [
125688
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: stateColor, bold: true, children: stateIcon }),
125689
+ ownerRepo && headSha && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CheckStatusIcon, { owner: ownerRepo.owner, repo: ownerRepo.repo, sha: headSha, enabled: isFocus }),
125690
+ ownerRepo && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ReviewStatusIcon, { owner: ownerRepo.owner, repo: ownerRepo.repo, prNumber: item.number, enabled: isFocus }),
125691
+ unread && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "*" }),
125692
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
125289
125693
  Text,
125290
125694
  {
125291
125695
  color: isFocus ? theme14.colors.listSelectedFg : unread ? theme14.colors.accent : theme14.colors.text,
@@ -125297,7 +125701,7 @@ function PRListItem({
125297
125701
  ]
125298
125702
  }
125299
125703
  ),
125300
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
125704
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
125301
125705
  Text,
125302
125706
  {
125303
125707
  color: isFocus ? theme14.colors.listSelectedFg : unread ? theme14.colors.accent : theme14.colors.text,
@@ -125306,11 +125710,11 @@ function PRListItem({
125306
125710
  children: item.title
125307
125711
  }
125308
125712
  ),
125309
- item.labels.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box_default, { gap: 0, children: item.labels.map(
125713
+ item.labels.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Box_default, { gap: 0, children: item.labels.map(
125310
125714
  (label) => {
125311
125715
  const bgColor = label.color ? normalizeHexColor(label.color) : void 0;
125312
125716
  const fgColor = label.color ? contrastForeground(label.color) : theme14.colors.muted;
125313
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
125717
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
125314
125718
  Text,
125315
125719
  {
125316
125720
  color: fgColor,
@@ -125323,28 +125727,28 @@ function PRListItem({
125323
125727
  }
125324
125728
  ) })
125325
125729
  ] }),
125326
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box_default, { gap: 1, paddingLeft: 3, children: [
125327
- repoName && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
125328
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.secondary, children: repoName }),
125329
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.muted, children: "|" })
125730
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { gap: 1, paddingLeft: 3, children: [
125731
+ repoName && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
125732
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: theme14.colors.secondary, children: repoName }),
125733
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: theme14.colors.muted, children: "|" })
125330
125734
  ] }),
125331
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.muted, children: item.user.login }),
125332
- item.assignees && item.assignees.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
125333
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.muted, children: "|" }),
125334
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { color: theme14.colors.warning, children: [
125735
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: theme14.colors.muted, children: item.user.login }),
125736
+ item.assignees && item.assignees.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
125737
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: theme14.colors.muted, children: "|" }),
125738
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { color: theme14.colors.warning, children: [
125335
125739
  "@",
125336
125740
  item.assignees.map((a) => a.login).join(" @")
125337
125741
  ] })
125338
125742
  ] }),
125339
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.muted, children: "|" }),
125340
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.muted, children: timeAgo(item.created_at) }),
125341
- item.requested_reviewers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
125342
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.muted, children: "|" }),
125343
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.info, children: item.requested_reviewers.map((r) => r.login).join(", ") })
125743
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: theme14.colors.muted, children: "|" }),
125744
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: theme14.colors.muted, children: timeAgo(item.created_at) }),
125745
+ item.requested_reviewers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
125746
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: theme14.colors.muted, children: "|" }),
125747
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: theme14.colors.info, children: item.requested_reviewers.map((r) => r.login).join(", ") })
125344
125748
  ] }),
125345
- item.comments > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
125346
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { color: theme14.colors.muted, children: "|" }),
125347
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { color: theme14.colors.muted, children: [
125749
+ item.comments > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
125750
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: theme14.colors.muted, children: "|" }),
125751
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { color: theme14.colors.muted, children: [
125348
125752
  item.comments,
125349
125753
  " comments"
125350
125754
  ] })
@@ -125354,7 +125758,7 @@ function PRListItem({
125354
125758
  }
125355
125759
 
125356
125760
  // src/components/common/ErrorWithRetry.tsx
125357
- var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
125761
+ var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
125358
125762
  function ErrorWithRetry({
125359
125763
  message,
125360
125764
  onRetry,
@@ -125369,21 +125773,21 @@ function ErrorWithRetry({
125369
125773
  },
125370
125774
  { isActive: isActive2 }
125371
125775
  );
125372
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { flexDirection: "column", padding: 1, gap: 1, children: [
125373
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { color: theme14.colors.error, children: [
125776
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "column", padding: 1, gap: 1, children: [
125777
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { color: theme14.colors.error, children: [
125374
125778
  "Error: ",
125375
125779
  message
125376
125780
  ] }),
125377
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { color: theme14.colors.muted, children: [
125781
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { color: theme14.colors.muted, children: [
125378
125782
  "Press ",
125379
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "r" }),
125783
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "r" }),
125380
125784
  " to retry"
125381
125785
  ] })
125382
125786
  ] });
125383
125787
  }
125384
125788
 
125385
125789
  // src/components/common/PaginationBar.tsx
125386
- var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
125790
+ var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
125387
125791
  function PaginationBar({
125388
125792
  currentPage,
125389
125793
  totalPages,
@@ -125395,38 +125799,38 @@ function PaginationBar({
125395
125799
  }) {
125396
125800
  const theme14 = useTheme();
125397
125801
  if (totalPages <= 1) {
125398
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { color: theme14.colors.muted, children: [
125802
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: theme14.colors.muted, children: [
125399
125803
  totalItems,
125400
125804
  " item",
125401
125805
  totalItems !== 1 ? "s" : ""
125402
125806
  ] }) });
125403
125807
  }
125404
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { paddingX: 1, gap: 2, children: [
125405
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { color: theme14.colors.muted, children: [
125808
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { paddingX: 1, gap: 2, children: [
125809
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: theme14.colors.muted, children: [
125406
125810
  startIndex + 1,
125407
125811
  "-",
125408
125812
  endIndex,
125409
125813
  " of ",
125410
125814
  totalItems
125411
125815
  ] }),
125412
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { gap: 1, children: [
125413
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: hasPrevPage ? theme14.colors.accent : theme14.colors.muted, children: hasPrevPage ? "\u2190 [p]rev" : "\u2190 prev" }),
125414
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme14.colors.muted, children: "\u2502" }),
125415
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { color: theme14.colors.text, children: [
125816
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { gap: 1, children: [
125817
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: hasPrevPage ? theme14.colors.accent : theme14.colors.muted, children: hasPrevPage ? "\u2190 [p]rev" : "\u2190 prev" }),
125818
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme14.colors.muted, children: "\u2502" }),
125819
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: theme14.colors.text, children: [
125416
125820
  "Page ",
125417
125821
  currentPage,
125418
125822
  "/",
125419
125823
  totalPages
125420
125824
  ] }),
125421
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme14.colors.muted, children: "\u2502" }),
125422
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: hasNextPage ? theme14.colors.accent : theme14.colors.muted, children: hasNextPage ? "[n]ext \u2192" : "next \u2192" })
125825
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme14.colors.muted, children: "\u2502" }),
125826
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: hasNextPage ? theme14.colors.accent : theme14.colors.muted, children: hasNextPage ? "[n]ext \u2192" : "next \u2192" })
125423
125827
  ] })
125424
125828
  ] });
125425
125829
  }
125426
125830
 
125427
125831
  // src/components/common/FilterModal.tsx
125428
- var import_react90 = __toESM(require_react(), 1);
125429
- var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
125832
+ var import_react92 = __toESM(require_react(), 1);
125833
+ var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
125430
125834
  var FILTER_FIELDS = ["search", "repo", "author", "label"];
125431
125835
  function FacetSection({
125432
125836
  title,
@@ -125440,21 +125844,21 @@ function FacetSection({
125440
125844
  selectionColor,
125441
125845
  warningColor
125442
125846
  }) {
125443
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "column", children: [
125444
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { gap: 1, children: [
125445
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: isFocused ? accentColor : mutedColor, bold: isFocused, children: title }),
125446
- selectedValue && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: warningColor, children: [
125847
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box_default, { flexDirection: "column", children: [
125848
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box_default, { gap: 1, children: [
125849
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: isFocused ? accentColor : mutedColor, bold: isFocused, children: title }),
125850
+ selectedValue && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Text, { color: warningColor, children: [
125447
125851
  "[",
125448
125852
  selectedValue,
125449
125853
  "]"
125450
125854
  ] })
125451
125855
  ] }),
125452
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 1, children: [
125453
- options.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: mutedColor, children: " (none)" }) : options.slice(0, 8).map((opt, idx) => {
125856
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 1, children: [
125857
+ options.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: mutedColor, children: " (none)" }) : options.slice(0, 8).map((opt, idx) => {
125454
125858
  const isHighlighted = isFocused && idx === highlightIndex;
125455
125859
  const isSelected = selectedValue === opt.value;
125456
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { gap: 1, children: [
125457
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
125860
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box_default, { gap: 1, children: [
125861
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
125458
125862
  Text,
125459
125863
  {
125460
125864
  color: isSelected ? warningColor : isHighlighted ? accentColor : textColor,
@@ -125469,14 +125873,14 @@ function FacetSection({
125469
125873
  ]
125470
125874
  }
125471
125875
  ),
125472
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: mutedColor, children: [
125876
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Text, { color: mutedColor, children: [
125473
125877
  "(",
125474
125878
  opt.count,
125475
125879
  ")"
125476
125880
  ] })
125477
125881
  ] }, opt.value);
125478
125882
  }),
125479
- options.length > 8 && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: mutedColor, children: [
125883
+ options.length > 8 && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Text, { color: mutedColor, children: [
125480
125884
  " +",
125481
125885
  options.length - 8,
125482
125886
  " more"
@@ -125498,17 +125902,17 @@ function FilterModal({
125498
125902
  }) {
125499
125903
  const theme14 = useTheme();
125500
125904
  const { setInputActive } = useInputFocus();
125501
- const [activeField, setActiveField] = (0, import_react90.useState)("search");
125502
- const [searchValue, setSearchValue] = (0, import_react90.useState)(filter9.search);
125503
- const [repoIndex, setRepoIndex] = (0, import_react90.useState)(0);
125504
- const [authorIndex, setAuthorIndex] = (0, import_react90.useState)(0);
125505
- const [labelIndex, setLabelIndex] = (0, import_react90.useState)(0);
125905
+ const [activeField, setActiveField] = (0, import_react92.useState)("search");
125906
+ const [searchValue, setSearchValue] = (0, import_react92.useState)(filter9.search);
125907
+ const [repoIndex, setRepoIndex] = (0, import_react92.useState)(0);
125908
+ const [authorIndex, setAuthorIndex] = (0, import_react92.useState)(0);
125909
+ const [labelIndex, setLabelIndex] = (0, import_react92.useState)(0);
125506
125910
  const isSearchField = activeField === "search";
125507
- (0, import_react90.useEffect)(() => {
125911
+ (0, import_react92.useEffect)(() => {
125508
125912
  setInputActive(isSearchField);
125509
125913
  return () => setInputActive(false);
125510
125914
  }, [setInputActive, isSearchField]);
125511
- (0, import_react90.useEffect)(() => {
125915
+ (0, import_react92.useEffect)(() => {
125512
125916
  onSearchChange(searchValue);
125513
125917
  }, [searchValue, onSearchChange]);
125514
125918
  const getMaxIndex = (field) => {
@@ -125569,7 +125973,7 @@ function FilterModal({
125569
125973
  }
125570
125974
  });
125571
125975
  const hasAnyFilter = filter9.search !== "" || filter9.repo !== null || filter9.author !== null || filter9.label !== null;
125572
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
125976
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
125573
125977
  Box_default,
125574
125978
  {
125575
125979
  flexDirection: "column",
@@ -125580,29 +125984,29 @@ function FilterModal({
125580
125984
  paddingY: 1,
125581
125985
  gap: 1,
125582
125986
  children: [
125583
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Filter PRs" }),
125584
- hasAnyFilter && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { gap: 1, flexWrap: "wrap", children: [
125585
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme14.colors.muted, children: "Active:" }),
125586
- filter9.search && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: theme14.colors.warning, children: [
125987
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Filter PRs" }),
125988
+ hasAnyFilter && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box_default, { gap: 1, flexWrap: "wrap", children: [
125989
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: theme14.colors.muted, children: "Active:" }),
125990
+ filter9.search && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Text, { color: theme14.colors.warning, children: [
125587
125991
  'search:"',
125588
125992
  filter9.search,
125589
125993
  '"'
125590
125994
  ] }),
125591
- filter9.repo && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: theme14.colors.warning, children: [
125995
+ filter9.repo && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Text, { color: theme14.colors.warning, children: [
125592
125996
  "repo:",
125593
125997
  filter9.repo
125594
125998
  ] }),
125595
- filter9.author && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: theme14.colors.warning, children: [
125999
+ filter9.author && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Text, { color: theme14.colors.warning, children: [
125596
126000
  "author:",
125597
126001
  filter9.author
125598
126002
  ] }),
125599
- filter9.label && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: theme14.colors.warning, children: [
126003
+ filter9.label && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Text, { color: theme14.colors.warning, children: [
125600
126004
  "label:",
125601
126005
  filter9.label
125602
126006
  ] })
125603
126007
  ] }),
125604
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "column", children: [
125605
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { gap: 1, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
126008
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box_default, { flexDirection: "column", children: [
126009
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Box_default, { gap: 1, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
125606
126010
  Text,
125607
126011
  {
125608
126012
  color: isSearchField ? theme14.colors.accent : theme14.colors.muted,
@@ -125610,16 +126014,16 @@ function FilterModal({
125610
126014
  children: "Search"
125611
126015
  }
125612
126016
  ) }),
125613
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { paddingLeft: 1, children: isSearchField ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
126017
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Box_default, { paddingLeft: 1, children: isSearchField ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
125614
126018
  TextInput,
125615
126019
  {
125616
126020
  defaultValue: searchValue,
125617
126021
  onChange: setSearchValue,
125618
126022
  placeholder: "Type to search..."
125619
126023
  }
125620
- ) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: searchValue ? theme14.colors.text : theme14.colors.muted, children: searchValue || "(none)" }) })
126024
+ ) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: searchValue ? theme14.colors.text : theme14.colors.muted, children: searchValue || "(none)" }) })
125621
126025
  ] }),
125622
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
126026
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
125623
126027
  FacetSection,
125624
126028
  {
125625
126029
  title: "Repository",
@@ -125634,7 +126038,7 @@ function FilterModal({
125634
126038
  warningColor: theme14.colors.warning
125635
126039
  }
125636
126040
  ),
125637
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
126041
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
125638
126042
  FacetSection,
125639
126043
  {
125640
126044
  title: "Author",
@@ -125649,7 +126053,7 @@ function FilterModal({
125649
126053
  warningColor: theme14.colors.warning
125650
126054
  }
125651
126055
  ),
125652
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
126056
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
125653
126057
  FacetSection,
125654
126058
  {
125655
126059
  title: "Label",
@@ -125664,31 +126068,31 @@ function FilterModal({
125664
126068
  warningColor: theme14.colors.warning
125665
126069
  }
125666
126070
  ),
125667
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Tab: switch field | j/k: navigate | Enter: toggle | d: clear field | C: clear all | Esc: close" })
126071
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Tab: switch field | j/k: navigate | Enter: toggle | d: clear field | C: clear all | Esc: close" })
125668
126072
  ]
125669
126073
  }
125670
126074
  ) });
125671
126075
  }
125672
126076
 
125673
126077
  // src/components/common/SortModal.tsx
125674
- var import_react93 = __toESM(require_react(), 1);
126078
+ var import_react95 = __toESM(require_react(), 1);
125675
126079
 
125676
126080
  // node_modules/.pnpm/ink-select-input@6.2.0_ink@6.7.0_@types+react@19.2.13_react@19.2.4__react@19.2.4/node_modules/ink-select-input/build/Indicator.js
125677
- var import_react91 = __toESM(require_react(), 1);
126081
+ var import_react93 = __toESM(require_react(), 1);
125678
126082
  function Indicator({ isSelected = false }) {
125679
- return import_react91.default.createElement(Box_default, { marginRight: 1 }, isSelected ? import_react91.default.createElement(Text, { color: "blue" }, figures_default.pointer) : import_react91.default.createElement(Text, null, " "));
126083
+ return import_react93.default.createElement(Box_default, { marginRight: 1 }, isSelected ? import_react93.default.createElement(Text, { color: "blue" }, figures_default.pointer) : import_react93.default.createElement(Text, null, " "));
125680
126084
  }
125681
126085
  var Indicator_default = Indicator;
125682
126086
 
125683
126087
  // node_modules/.pnpm/ink-select-input@6.2.0_ink@6.7.0_@types+react@19.2.13_react@19.2.4__react@19.2.4/node_modules/ink-select-input/build/Item.js
125684
- var React51 = __toESM(require_react(), 1);
126088
+ var React53 = __toESM(require_react(), 1);
125685
126089
  function Item({ isSelected = false, label }) {
125686
- return React51.createElement(Text, { color: isSelected ? "blue" : void 0 }, label);
126090
+ return React53.createElement(Text, { color: isSelected ? "blue" : void 0 }, label);
125687
126091
  }
125688
126092
  var Item_default = Item;
125689
126093
 
125690
126094
  // node_modules/.pnpm/ink-select-input@6.2.0_ink@6.7.0_@types+react@19.2.13_react@19.2.4__react@19.2.4/node_modules/ink-select-input/build/SelectInput.js
125691
- var import_react92 = __toESM(require_react(), 1);
126095
+ var import_react94 = __toESM(require_react(), 1);
125692
126096
  import { isDeepStrictEqual as isDeepStrictEqual3 } from "util";
125693
126097
 
125694
126098
  // node_modules/.pnpm/to-rotated@1.0.0/node_modules/to-rotated/index.js
@@ -125718,17 +126122,17 @@ function SelectInput({ items = [], isFocused = true, initialIndex = 0, indicator
125718
126122
  const hasLimit = typeof customLimit === "number" && items.length > customLimit;
125719
126123
  const limit = hasLimit ? Math.min(customLimit, items.length) : items.length;
125720
126124
  const lastIndex = limit - 1;
125721
- const [rotateIndex, setRotateIndex] = (0, import_react92.useState)(initialIndex > lastIndex ? lastIndex - initialIndex : 0);
125722
- const [selectedIndex, setSelectedIndex] = (0, import_react92.useState)(initialIndex ? initialIndex > lastIndex ? lastIndex : initialIndex : 0);
125723
- const previousItems = (0, import_react92.useRef)(items);
125724
- (0, import_react92.useEffect)(() => {
126125
+ const [rotateIndex, setRotateIndex] = (0, import_react94.useState)(initialIndex > lastIndex ? lastIndex - initialIndex : 0);
126126
+ const [selectedIndex, setSelectedIndex] = (0, import_react94.useState)(initialIndex ? initialIndex > lastIndex ? lastIndex : initialIndex : 0);
126127
+ const previousItems = (0, import_react94.useRef)(items);
126128
+ (0, import_react94.useEffect)(() => {
125725
126129
  if (!isDeepStrictEqual3(previousItems.current.map((item) => item.value), items.map((item) => item.value))) {
125726
126130
  setRotateIndex(0);
125727
126131
  setSelectedIndex(0);
125728
126132
  }
125729
126133
  previousItems.current = items;
125730
126134
  }, [items]);
125731
- use_input_default((0, import_react92.useCallback)((input, key) => {
126135
+ use_input_default((0, import_react94.useCallback)((input, key) => {
125732
126136
  if (input === "k" || key.upArrow) {
125733
126137
  const lastIndex2 = (hasLimit ? limit : items.length) - 1;
125734
126138
  const atFirstIndex = selectedIndex === 0;
@@ -125780,15 +126184,15 @@ function SelectInput({ items = [], isFocused = true, initialIndex = 0, indicator
125780
126184
  onHighlight
125781
126185
  ]), { isActive: isFocused });
125782
126186
  const slicedItems = hasLimit ? toRotated(items, rotateIndex).slice(0, limit) : items;
125783
- return import_react92.default.createElement(Box_default, { flexDirection: "column" }, slicedItems.map((item, index) => {
126187
+ return import_react94.default.createElement(Box_default, { flexDirection: "column" }, slicedItems.map((item, index) => {
125784
126188
  const isSelected = index === selectedIndex;
125785
126189
  return (
125786
126190
  // @ts-expect-error - `key` can't be optional but `item.value` is generic T
125787
- import_react92.default.createElement(
126191
+ import_react94.default.createElement(
125788
126192
  Box_default,
125789
126193
  { key: item.key ?? item.value },
125790
- import_react92.default.createElement(indicatorComponent, { isSelected }),
125791
- import_react92.default.createElement(itemComponent, { ...item, isSelected })
126194
+ import_react94.default.createElement(indicatorComponent, { isSelected }),
126195
+ import_react94.default.createElement(itemComponent, { ...item, isSelected })
125792
126196
  )
125793
126197
  );
125794
126198
  }));
@@ -125796,7 +126200,7 @@ function SelectInput({ items = [], isFocused = true, initialIndex = 0, indicator
125796
126200
  var SelectInput_default = SelectInput;
125797
126201
 
125798
126202
  // src/components/common/SortModal.tsx
125799
- var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
126203
+ var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
125800
126204
  var SORT_OPTIONS = [
125801
126205
  { key: "updated", label: "Last Updated" },
125802
126206
  { key: "created", label: "Created Date" },
@@ -125817,7 +126221,7 @@ function SortModal({
125817
126221
  onClose();
125818
126222
  }
125819
126223
  });
125820
- const items = (0, import_react93.useMemo)(
126224
+ const items = (0, import_react95.useMemo)(
125821
126225
  () => SORT_OPTIONS.map((option7) => ({
125822
126226
  label: `${option7.label}${option7.key === currentSort ? sortDirection === "desc" ? " \u2193" : " \u2191" : ""}`,
125823
126227
  value: option7.key
@@ -125836,7 +126240,7 @@ function SortModal({
125836
126240
  }
125837
126241
  onClose();
125838
126242
  };
125839
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
126243
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
125840
126244
  Box_default,
125841
126245
  {
125842
126246
  flexDirection: "column",
@@ -125847,8 +126251,8 @@ function SortModal({
125847
126251
  paddingY: 1,
125848
126252
  gap: 1,
125849
126253
  children: [
125850
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Sort by" }),
125851
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
126254
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Sort by" }),
126255
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
125852
126256
  SelectInput_default,
125853
126257
  {
125854
126258
  items,
@@ -125857,14 +126261,14 @@ function SortModal({
125857
126261
  isFocused: true
125858
126262
  }
125859
126263
  ),
125860
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "j/k: move | Enter: select | Esc: close" })
126264
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "j/k: move | Enter: select | Esc: close" })
125861
126265
  ]
125862
126266
  }
125863
126267
  ) });
125864
126268
  }
125865
126269
 
125866
126270
  // src/screens/PRListScreen.tsx
125867
- var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
126271
+ var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
125868
126272
  var STATE_LABELS = {
125869
126273
  open: "Open",
125870
126274
  closed: "Closed",
@@ -125886,9 +126290,9 @@ function PRListScreen({
125886
126290
  const theme14 = useTheme();
125887
126291
  const { setStatusMessage } = useStatusMessage();
125888
126292
  const { isUnread } = useReadState();
125889
- const [showFilter, setShowFilter] = (0, import_react94.useState)(false);
125890
- const [showSort, setShowSort] = (0, import_react94.useState)(false);
125891
- const [showUnreadOnly, setShowUnreadOnly] = (0, import_react94.useState)(false);
126293
+ const [showFilter, setShowFilter] = (0, import_react96.useState)(false);
126294
+ const [showSort, setShowSort] = (0, import_react96.useState)(false);
126295
+ const [showUnreadOnly, setShowUnreadOnly] = (0, import_react96.useState)(false);
125892
126296
  const { refresh } = useManualRefresh({
125893
126297
  isActive: !showFilter && !showSort,
125894
126298
  queryKeys
@@ -125911,7 +126315,7 @@ function PRListScreen({
125911
126315
  authorFacets,
125912
126316
  labelFacets
125913
126317
  } = useFilter(prs);
125914
- const displayItems = (0, import_react94.useMemo)(
126318
+ const displayItems = (0, import_react96.useMemo)(
125915
126319
  () => showUnreadOnly ? filteredItems.filter((pr) => isUnread(pr.html_url, pr.updated_at)) : filteredItems,
125916
126320
  [filteredItems, showUnreadOnly, isUnread]
125917
126321
  );
@@ -125966,31 +126370,31 @@ function PRListScreen({
125966
126370
  { isActive: !showFilter && !showSort }
125967
126371
  );
125968
126372
  if (isLoading && prs.length === 0) {
125969
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(LoadingIndicator, { message: loadingMessage });
126373
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(LoadingIndicator, { message: loadingMessage });
125970
126374
  }
125971
126375
  if (error) {
125972
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ErrorWithRetry, { message: String(error), onRetry: refresh });
126376
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ErrorWithRetry, { message: String(error), onRetry: refresh });
125973
126377
  }
125974
126378
  if (prs.length === 0) {
125975
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(EmptyState, { message: emptyMessage });
126379
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(EmptyState, { message: emptyMessage });
125976
126380
  }
125977
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, children: [
125978
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Box_default, { paddingX: 1, justifyContent: "space-between", children: [
125979
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Box_default, { gap: 2, children: [
125980
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { color: theme14.colors.accent, bold: true, children: title }),
125981
- onStateChange && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Text, { color: stateFilter === "open" ? theme14.colors.success : stateFilter === "closed" ? theme14.colors.error : theme14.colors.info, children: [
126381
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, children: [
126382
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Box_default, { paddingX: 1, justifyContent: "space-between", children: [
126383
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Box_default, { gap: 2, children: [
126384
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text, { color: theme14.colors.accent, bold: true, children: title }),
126385
+ onStateChange && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Text, { color: stateFilter === "open" ? theme14.colors.success : stateFilter === "closed" ? theme14.colors.error : theme14.colors.info, children: [
125982
126386
  "[",
125983
126387
  STATE_LABELS[stateFilter],
125984
126388
  "]"
125985
126389
  ] }),
125986
- showUnreadOnly && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { color: theme14.colors.accent, children: "[Unread]" }),
125987
- hasActiveFilters && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { color: theme14.colors.warning, children: "(filtered)" }),
125988
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Text, { color: theme14.colors.muted, children: [
126390
+ showUnreadOnly && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text, { color: theme14.colors.accent, children: "[Unread]" }),
126391
+ hasActiveFilters && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text, { color: theme14.colors.warning, children: "(filtered)" }),
126392
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Text, { color: theme14.colors.muted, children: [
125989
126393
  "/ filter s sort",
125990
126394
  onStateChange ? " t state" : ""
125991
126395
  ] })
125992
126396
  ] }),
125993
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
126397
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
125994
126398
  PaginationBar,
125995
126399
  {
125996
126400
  currentPage,
@@ -126003,7 +126407,7 @@ function PRListScreen({
126003
126407
  }
126004
126408
  )
126005
126409
  ] }),
126006
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Box_default, { flexDirection: "column", children: pageItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Box_default, { padding: 1, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { color: theme14.colors.muted, children: "No PRs match the current filters" }) }) : pageItems.map((pr, index) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
126410
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Box_default, { flexDirection: "column", children: pageItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Box_default, { padding: 1, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text, { color: theme14.colors.muted, children: "No PRs match the current filters" }) }) : pageItems.map((pr, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
126007
126411
  PRListItem,
126008
126412
  {
126009
126413
  item: pr,
@@ -126011,7 +126415,7 @@ function PRListScreen({
126011
126415
  },
126012
126416
  pr.id
126013
126417
  )) }),
126014
- showFilter && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
126418
+ showFilter && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
126015
126419
  FilterModal,
126016
126420
  {
126017
126421
  filter: filter9,
@@ -126031,7 +126435,7 @@ function PRListScreen({
126031
126435
  onClose: () => setShowFilter(false)
126032
126436
  }
126033
126437
  ),
126034
- showSort && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
126438
+ showSort && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
126035
126439
  SortModal,
126036
126440
  {
126037
126441
  currentSort: filter9.sortBy,
@@ -126045,11 +126449,11 @@ function PRListScreen({
126045
126449
  }
126046
126450
 
126047
126451
  // src/screens/MyPRsScreen.tsx
126048
- var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
126452
+ var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
126049
126453
  function MyPRsScreen({ onSelect }) {
126050
- const [stateFilter, setStateFilter] = (0, import_react95.useState)("open");
126454
+ const [stateFilter, setStateFilter] = (0, import_react97.useState)("open");
126051
126455
  const { data: prs = [], isLoading, error } = useMyPRs(stateFilter);
126052
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
126456
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
126053
126457
  PRListScreen,
126054
126458
  {
126055
126459
  title: "My Pull Requests",
@@ -126067,12 +126471,12 @@ function MyPRsScreen({ onSelect }) {
126067
126471
  }
126068
126472
 
126069
126473
  // src/screens/ReviewRequestsScreen.tsx
126070
- var import_react96 = __toESM(require_react(), 1);
126071
- var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
126474
+ var import_react98 = __toESM(require_react(), 1);
126475
+ var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
126072
126476
  function ReviewRequestsScreen({ onSelect }) {
126073
- const [stateFilter, setStateFilter] = (0, import_react96.useState)("open");
126477
+ const [stateFilter, setStateFilter] = (0, import_react98.useState)("open");
126074
126478
  const { data: prs = [], isLoading, error } = useReviewRequests(stateFilter);
126075
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
126479
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
126076
126480
  PRListScreen,
126077
126481
  {
126078
126482
  title: "For Review",
@@ -126090,7 +126494,7 @@ function ReviewRequestsScreen({ onSelect }) {
126090
126494
  }
126091
126495
 
126092
126496
  // src/screens/SettingsScreen.tsx
126093
- var import_react98 = __toESM(require_react(), 1);
126497
+ var import_react100 = __toESM(require_react(), 1);
126094
126498
 
126095
126499
  // src/hooks/useAuth.ts
126096
126500
  function useAuth() {
@@ -126195,7 +126599,7 @@ function useAuth() {
126195
126599
  }
126196
126600
 
126197
126601
  // src/hooks/useBookmarkedRepos.ts
126198
- var import_react97 = __toESM(require_react(), 1);
126602
+ var import_react99 = __toESM(require_react(), 1);
126199
126603
  function validateBookmarkInput(input) {
126200
126604
  const trimmed2 = input.trim();
126201
126605
  if (!trimmed2.includes("/")) {
@@ -126219,11 +126623,11 @@ function removeBookmarkFromList(repos, owner, repo) {
126219
126623
  }
126220
126624
  function useBookmarkedRepos() {
126221
126625
  const { config: config2, updateConfig } = useConfig();
126222
- const bookmarkedRepos = (0, import_react97.useMemo)(
126626
+ const bookmarkedRepos = (0, import_react99.useMemo)(
126223
126627
  () => config2?.bookmarkedRepos ?? [],
126224
126628
  [config2?.bookmarkedRepos]
126225
126629
  );
126226
- const addBookmark = (0, import_react97.useCallback)(
126630
+ const addBookmark = (0, import_react99.useCallback)(
126227
126631
  (owner, repo) => {
126228
126632
  const current2 = config2?.bookmarkedRepos ?? [];
126229
126633
  const updated = addBookmarkToList(current2, owner, repo);
@@ -126233,7 +126637,7 @@ function useBookmarkedRepos() {
126233
126637
  },
126234
126638
  [config2?.bookmarkedRepos, updateConfig]
126235
126639
  );
126236
- const removeBookmark = (0, import_react97.useCallback)(
126640
+ const removeBookmark = (0, import_react99.useCallback)(
126237
126641
  (owner, repo) => {
126238
126642
  const current2 = config2?.bookmarkedRepos ?? [];
126239
126643
  const updated = removeBookmarkFromList(current2, owner, repo);
@@ -126245,7 +126649,7 @@ function useBookmarkedRepos() {
126245
126649
  }
126246
126650
 
126247
126651
  // src/components/settings/SettingRow.tsx
126248
- var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
126652
+ var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
126249
126653
  function SettingRow({
126250
126654
  label,
126251
126655
  value: value5,
@@ -126255,8 +126659,8 @@ function SettingRow({
126255
126659
  children
126256
126660
  }) {
126257
126661
  const theme14 = useTheme();
126258
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Box_default, { gap: 2, paddingX: 2, children: [
126259
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
126662
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Box_default, { gap: 2, paddingX: 2, children: [
126663
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
126260
126664
  Text,
126261
126665
  {
126262
126666
  color: isSelected ? theme14.colors.accent : theme14.colors.muted,
@@ -126267,7 +126671,7 @@ function SettingRow({
126267
126671
  ]
126268
126672
  }
126269
126673
  ) }),
126270
- children ?? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
126674
+ children ?? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
126271
126675
  Text,
126272
126676
  {
126273
126677
  color: isEditing ? theme14.colors.accent : theme14.colors.text,
@@ -126275,7 +126679,7 @@ function SettingRow({
126275
126679
  children: value5
126276
126680
  }
126277
126681
  ),
126278
- hint && isSelected && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Text, { color: theme14.colors.muted, dimColor: true, children: [
126682
+ hint && isSelected && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Text, { color: theme14.colors.muted, dimColor: true, children: [
126279
126683
  "(",
126280
126684
  hint,
126281
126685
  ")"
@@ -126291,11 +126695,11 @@ function TokenSourceLabel({ source }) {
126291
126695
  none: { text: "Not configured", color: theme14.colors.error }
126292
126696
  };
126293
126697
  const { text, color } = labels[source];
126294
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Text, { color, children: text });
126698
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color, children: text });
126295
126699
  }
126296
126700
 
126297
126701
  // src/screens/SettingsScreen.tsx
126298
- var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
126702
+ var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
126299
126703
  var THEME_ORDER = ["tokyo-night", "dracula", "catppuccin-mocha", "gruvbox"];
126300
126704
  var SETTINGS_ITEMS = [
126301
126705
  "token_source",
@@ -126320,12 +126724,12 @@ function SettingsScreen() {
126320
126724
  const { setStatusMessage } = useStatusMessage();
126321
126725
  const { setInputActive } = useInputFocus();
126322
126726
  const { bookmarkedRepos, addBookmark, removeBookmark } = useBookmarkedRepos();
126323
- const [selectedItem, setSelectedItem] = (0, import_react98.useState)("token_source");
126324
- const [editingField, setEditingField] = (0, import_react98.useState)(null);
126325
- const [editValue, setEditValue] = (0, import_react98.useState)("");
126326
- const [tokenMessage, setTokenMessage] = (0, import_react98.useState)(null);
126327
- const [bookmarkSelectedIndex, setBookmarkSelectedIndex] = (0, import_react98.useState)(0);
126328
- const [bookmarkError, setBookmarkError] = (0, import_react98.useState)(null);
126727
+ const [selectedItem, setSelectedItem] = (0, import_react100.useState)("token_source");
126728
+ const [editingField, setEditingField] = (0, import_react100.useState)(null);
126729
+ const [editValue, setEditValue] = (0, import_react100.useState)("");
126730
+ const [tokenMessage, setTokenMessage] = (0, import_react100.useState)(null);
126731
+ const [bookmarkSelectedIndex, setBookmarkSelectedIndex] = (0, import_react100.useState)(0);
126732
+ const [bookmarkError, setBookmarkError] = (0, import_react100.useState)(null);
126329
126733
  const isEditing = editingField !== null;
126330
126734
  const isBookmarkSection = selectedItem === "bookmarked_repos";
126331
126735
  const cycleTheme = () => {
@@ -126470,23 +126874,23 @@ function SettingsScreen() {
126470
126874
  { isActive: isBookmarkSection && !isEditing && bookmarkedRepos.length > 0 }
126471
126875
  );
126472
126876
  if (configLoading || authLoading) {
126473
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(LoadingIndicator, { message: "Loading settings..." });
126877
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(LoadingIndicator, { message: "Loading settings..." });
126474
126878
  }
126475
126879
  if (configError) {
126476
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { padding: 1, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Text, { color: theme14.colors.error, children: [
126880
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { padding: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Text, { color: theme14.colors.error, children: [
126477
126881
  "Error: ",
126478
126882
  configError
126479
126883
  ] }) });
126480
126884
  }
126481
126885
  const renderEditableField = (field, placeholder) => {
126482
126886
  if (editingField === field) {
126483
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { borderStyle: "single", borderColor: theme14.colors.accent, paddingX: 1, width: 40, children: field === "new_token" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
126887
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { borderStyle: "single", borderColor: theme14.colors.accent, paddingX: 1, width: 40, children: field === "new_token" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
126484
126888
  PasswordInput,
126485
126889
  {
126486
126890
  onChange: setEditValue,
126487
126891
  placeholder
126488
126892
  }
126489
- ) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
126893
+ ) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
126490
126894
  TextInput,
126491
126895
  {
126492
126896
  defaultValue: editValue,
@@ -126495,15 +126899,15 @@ function SettingsScreen() {
126495
126899
  }
126496
126900
  ) });
126497
126901
  }
126498
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, {});
126902
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, {});
126499
126903
  };
126500
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, children: [
126501
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { paddingX: 1, paddingY: 1, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Settings" }) }),
126502
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Divider, {}) }),
126503
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { flexDirection: "column", paddingX: 1, marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.secondary, bold: true, children: "Authentication" }) }),
126504
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Box_default, { flexDirection: "column", gap: 0, children: [
126505
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Box_default, { gap: 2, paddingX: 2, children: [
126506
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
126904
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, children: [
126905
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { paddingX: 1, paddingY: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Settings" }) }),
126906
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Divider, {}) }),
126907
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { flexDirection: "column", paddingX: 1, marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.secondary, bold: true, children: "Authentication" }) }),
126908
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Box_default, { flexDirection: "column", gap: 0, children: [
126909
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Box_default, { gap: 2, paddingX: 2, children: [
126910
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
126507
126911
  Text,
126508
126912
  {
126509
126913
  color: selectedItem === "token_source" ? theme14.colors.accent : theme14.colors.muted,
@@ -126514,19 +126918,19 @@ function SettingsScreen() {
126514
126918
  ]
126515
126919
  }
126516
126920
  ) }),
126517
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TokenSourceLabel, { source: tokenInfo?.source ?? "none" }),
126518
- availableSources.length > 1 && selectedItem === "token_source" && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "(Enter to switch)" })
126921
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TokenSourceLabel, { source: tokenInfo?.source ?? "none" }),
126922
+ availableSources.length > 1 && selectedItem === "token_source" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "(Enter to switch)" })
126519
126923
  ] }),
126520
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Box_default, { gap: 2, paddingX: 2, children: [
126521
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.muted, children: " Token" }) }),
126522
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.text, children: tokenInfo?.maskedToken ?? "(none)" })
126924
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Box_default, { gap: 2, paddingX: 2, children: [
126925
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.muted, children: " Token" }) }),
126926
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.text, children: tokenInfo?.maskedToken ?? "(none)" })
126523
126927
  ] }),
126524
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Box_default, { gap: 2, paddingX: 2, children: [
126525
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.muted, children: " Available" }) }),
126526
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.muted, children: availableSources.length > 0 ? availableSources.join(", ") : "none" })
126928
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Box_default, { gap: 2, paddingX: 2, children: [
126929
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.muted, children: " Available" }) }),
126930
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.muted, children: availableSources.length > 0 ? availableSources.join(", ") : "none" })
126527
126931
  ] }),
126528
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Box_default, { gap: 2, paddingX: 2, marginTop: 1, children: [
126529
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
126932
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Box_default, { gap: 2, paddingX: 2, marginTop: 1, children: [
126933
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
126530
126934
  Text,
126531
126935
  {
126532
126936
  color: selectedItem === "new_token" ? theme14.colors.accent : theme14.colors.muted,
@@ -126537,9 +126941,9 @@ function SettingsScreen() {
126537
126941
  ]
126538
126942
  }
126539
126943
  ) }),
126540
- editingField === "new_token" ? renderEditableField("new_token", "ghp_xxxx...") : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "(Enter to add)" })
126944
+ editingField === "new_token" ? renderEditableField("new_token", "ghp_xxxx...") : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "(Enter to add)" })
126541
126945
  ] }),
126542
- tokenMessage && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { paddingX: 4, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
126946
+ tokenMessage && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { paddingX: 4, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
126543
126947
  Text,
126544
126948
  {
126545
126949
  color: tokenMessage.startsWith("Error") ? theme14.colors.error : theme14.colors.success,
@@ -126547,10 +126951,10 @@ function SettingsScreen() {
126547
126951
  }
126548
126952
  ) })
126549
126953
  ] }),
126550
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { paddingX: 1, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Divider, { title: "Configuration" }) }),
126551
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { flexDirection: "column", paddingX: 1, marginTop: 0, marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.secondary, bold: true, children: "Configuration" }) }),
126552
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Box_default, { flexDirection: "column", gap: 0, children: [
126553
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
126954
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { paddingX: 1, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Divider, { title: "Configuration" }) }),
126955
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { flexDirection: "column", paddingX: 1, marginTop: 0, marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.secondary, bold: true, children: "Configuration" }) }),
126956
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Box_default, { flexDirection: "column", gap: 0, children: [
126957
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
126554
126958
  SettingRow,
126555
126959
  {
126556
126960
  label: "Theme",
@@ -126559,7 +126963,7 @@ function SettingsScreen() {
126559
126963
  hint: "Enter to cycle"
126560
126964
  }
126561
126965
  ),
126562
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
126966
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
126563
126967
  SettingRow,
126564
126968
  {
126565
126969
  label: "Page Size",
@@ -126570,7 +126974,7 @@ function SettingsScreen() {
126570
126974
  children: editingField === "page_size" ? renderEditableField("page_size", "1-100") : void 0
126571
126975
  }
126572
126976
  ),
126573
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
126977
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
126574
126978
  SettingRow,
126575
126979
  {
126576
126980
  label: "Refresh Interval",
@@ -126581,7 +126985,7 @@ function SettingsScreen() {
126581
126985
  children: editingField === "refresh_interval" ? renderEditableField("refresh_interval", "10-600") : void 0
126582
126986
  }
126583
126987
  ),
126584
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
126988
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
126585
126989
  SettingRow,
126586
126990
  {
126587
126991
  label: "Provider",
@@ -126589,7 +126993,7 @@ function SettingsScreen() {
126589
126993
  hint: config2?.provider === "gitlab" ? "(gitlab support coming soon)" : void 0
126590
126994
  }
126591
126995
  ),
126592
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
126996
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
126593
126997
  SettingRow,
126594
126998
  {
126595
126999
  label: "Default Owner",
@@ -126600,7 +127004,7 @@ function SettingsScreen() {
126600
127004
  children: editingField === "default_owner" ? renderEditableField("default_owner", "owner") : void 0
126601
127005
  }
126602
127006
  ),
126603
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
127007
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
126604
127008
  SettingRow,
126605
127009
  {
126606
127010
  label: "Default Repo",
@@ -126612,9 +127016,9 @@ function SettingsScreen() {
126612
127016
  }
126613
127017
  )
126614
127018
  ] }),
126615
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { paddingX: 1, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Divider, { title: "Bookmarked Repos" }) }),
126616
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { flexDirection: "column", paddingX: 1, marginTop: 0, marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Box_default, { gap: 2, children: [
126617
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
127019
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { paddingX: 1, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Divider, { title: "Bookmarked Repos" }) }),
127020
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { flexDirection: "column", paddingX: 1, marginTop: 0, marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Box_default, { gap: 2, children: [
127021
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
126618
127022
  Text,
126619
127023
  {
126620
127024
  color: isBookmarkSection ? theme14.colors.accent : theme14.colors.secondary,
@@ -126625,21 +127029,21 @@ function SettingsScreen() {
126625
127029
  ]
126626
127030
  }
126627
127031
  ),
126628
- isBookmarkSection && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "a:add x:remove J/K:select" })
127032
+ isBookmarkSection && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "a:add x:remove J/K:select" })
126629
127033
  ] }) }),
126630
- editingField === "bookmark_add" && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Box_default, { paddingX: 2, flexDirection: "column", children: [
126631
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Box_default, { gap: 1, children: [
126632
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.secondary, children: "owner/repo:" }),
127034
+ editingField === "bookmark_add" && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Box_default, { paddingX: 2, flexDirection: "column", children: [
127035
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Box_default, { gap: 1, children: [
127036
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.secondary, children: "owner/repo:" }),
126633
127037
  renderEditableField("bookmark_add", "e.g. facebook/react")
126634
127038
  ] }),
126635
- bookmarkError && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.error, children: bookmarkError }) })
127039
+ bookmarkError && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.error, children: bookmarkError }) })
126636
127040
  ] }),
126637
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { flexDirection: "column", paddingX: 2, children: bookmarkedRepos.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Text, { color: theme14.colors.muted, dimColor: true, children: [
127041
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { flexDirection: "column", paddingX: 2, children: bookmarkedRepos.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Text, { color: theme14.colors.muted, dimColor: true, children: [
126638
127042
  "No bookmarked repos. ",
126639
127043
  isBookmarkSection ? "Press a to add." : ""
126640
127044
  ] }) }) : bookmarkedRepos.map((bookmark, index) => {
126641
127045
  const isBmSelected = isBookmarkSection && index === bookmarkSelectedIndex;
126642
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
127046
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
126643
127047
  Text,
126644
127048
  {
126645
127049
  color: isBmSelected ? theme14.colors.accent : theme14.colors.text,
@@ -126654,21 +127058,21 @@ function SettingsScreen() {
126654
127058
  }
126655
127059
  ) }, `${bookmark.owner}/${bookmark.repo}`);
126656
127060
  }) }),
126657
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Box_default, { paddingX: 1, paddingTop: 2, flexDirection: "column", children: [
126658
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Config: ~/.config/lazyreview/config.yaml" }),
126659
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Token: ~/.config/lazyreview/.token" })
127061
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Box_default, { paddingX: 1, paddingTop: 2, flexDirection: "column", children: [
127062
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Config: ~/.config/lazyreview/config.yaml" }),
127063
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "Token: ~/.config/lazyreview/.token" })
126660
127064
  ] }),
126661
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Box_default, { paddingX: 1, paddingTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "j/k: navigate | Enter: select/toggle | Esc: cancel" }) })
127065
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box_default, { paddingX: 1, paddingTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: "j/k: navigate | Enter: select/toggle | Esc: cancel" }) })
126662
127066
  ] });
126663
127067
  }
126664
127068
 
126665
127069
  // src/screens/InvolvedScreen.tsx
126666
- var import_react99 = __toESM(require_react(), 1);
126667
- var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
127070
+ var import_react101 = __toESM(require_react(), 1);
127071
+ var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
126668
127072
  function InvolvedScreen({ onSelect }) {
126669
- const [stateFilter, setStateFilter] = (0, import_react99.useState)("open");
127073
+ const [stateFilter, setStateFilter] = (0, import_react101.useState)("open");
126670
127074
  const { data: prs = [], isLoading, error } = useInvolvedPRs(stateFilter);
126671
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
127075
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
126672
127076
  PRListScreen,
126673
127077
  {
126674
127078
  title: "Involved Pull Requests",
@@ -126686,19 +127090,19 @@ function InvolvedScreen({ onSelect }) {
126686
127090
  }
126687
127091
 
126688
127092
  // src/screens/ThisRepoScreen.tsx
126689
- var import_react100 = __toESM(require_react(), 1);
126690
- var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
127093
+ var import_react102 = __toESM(require_react(), 1);
127094
+ var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1);
126691
127095
  function ThisRepoScreen({ owner, repo, onSelect }) {
126692
- const [stateFilter, setStateFilter] = (0, import_react100.useState)("open");
127096
+ const [stateFilter, setStateFilter] = (0, import_react102.useState)("open");
126693
127097
  const { data: prs = [], isLoading, error } = usePullRequests(
126694
127098
  owner ?? "",
126695
127099
  repo ?? "",
126696
127100
  { state: stateFilter === "all" ? "all" : stateFilter === "closed" ? "closed" : "open" }
126697
127101
  );
126698
127102
  if (!owner || !repo) {
126699
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(EmptyState, { message: "Not in a git repository or remote not detected" });
127103
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(EmptyState, { message: "Not in a git repository or remote not detected" });
126700
127104
  }
126701
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
127105
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
126702
127106
  PRListScreen,
126703
127107
  {
126704
127108
  title: `${owner}/${repo}`,
@@ -126716,11 +127120,11 @@ function ThisRepoScreen({ owner, repo, onSelect }) {
126716
127120
  }
126717
127121
 
126718
127122
  // src/screens/BrowseRepoScreen.tsx
126719
- var import_react103 = __toESM(require_react(), 1);
127123
+ var import_react105 = __toESM(require_react(), 1);
126720
127124
 
126721
127125
  // src/hooks/useRepoContext.tsx
126722
- var import_react101 = __toESM(require_react(), 1);
126723
- var RepoContext = (0, import_react101.createContext)({
127126
+ var import_react103 = __toESM(require_react(), 1);
127127
+ var RepoContext = (0, import_react103.createContext)({
126724
127128
  localRepo: null,
126725
127129
  browseRepo: null,
126726
127130
  setBrowseRepo: () => {
@@ -126732,14 +127136,14 @@ function RepoContextProvider({
126732
127136
  localRepo,
126733
127137
  children
126734
127138
  }) {
126735
- const [browseRepo, setBrowseRepoState] = (0, import_react101.useState)(null);
126736
- const setBrowseRepo = (0, import_react101.useCallback)((owner, repo) => {
127139
+ const [browseRepo, setBrowseRepoState] = (0, import_react103.useState)(null);
127140
+ const setBrowseRepo = (0, import_react103.useCallback)((owner, repo) => {
126737
127141
  setBrowseRepoState({ owner, repo });
126738
127142
  }, []);
126739
- const clearBrowseRepo = (0, import_react101.useCallback)(() => {
127143
+ const clearBrowseRepo = (0, import_react103.useCallback)(() => {
126740
127144
  setBrowseRepoState(null);
126741
127145
  }, []);
126742
- return import_react101.default.createElement(
127146
+ return import_react103.default.createElement(
126743
127147
  RepoContext.Provider,
126744
127148
  {
126745
127149
  value: {
@@ -126753,11 +127157,11 @@ function RepoContextProvider({
126753
127157
  );
126754
127158
  }
126755
127159
  function useRepoContext() {
126756
- return (0, import_react101.useContext)(RepoContext);
127160
+ return (0, import_react103.useContext)(RepoContext);
126757
127161
  }
126758
127162
 
126759
127163
  // src/hooks/useRecentRepos.ts
126760
- var import_react102 = __toESM(require_react(), 1);
127164
+ var import_react104 = __toESM(require_react(), 1);
126761
127165
  var MAX_RECENT_REPOS = 10;
126762
127166
  function addRecentRepoToList(repos, owner, repo, now2) {
126763
127167
  const filtered = repos.filter(
@@ -126780,8 +127184,8 @@ function sortByMostRecent(repos) {
126780
127184
  function useRecentRepos() {
126781
127185
  const { config: config2, updateConfig } = useConfig();
126782
127186
  const rawRepos = config2?.recentRepos ?? [];
126783
- const recentRepos = (0, import_react102.useMemo)(() => sortByMostRecent(rawRepos), [rawRepos]);
126784
- const addRecentRepo = (0, import_react102.useCallback)(
127187
+ const recentRepos = (0, import_react104.useMemo)(() => sortByMostRecent(rawRepos), [rawRepos]);
127188
+ const addRecentRepo = (0, import_react104.useCallback)(
126785
127189
  (owner, repo) => {
126786
127190
  const current2 = config2?.recentRepos ?? [];
126787
127191
  const now2 = (/* @__PURE__ */ new Date()).toISOString();
@@ -126790,7 +127194,7 @@ function useRecentRepos() {
126790
127194
  },
126791
127195
  [config2?.recentRepos, updateConfig]
126792
127196
  );
126793
- const removeRecentRepo = (0, import_react102.useCallback)(
127197
+ const removeRecentRepo = (0, import_react104.useCallback)(
126794
127198
  (owner, repo) => {
126795
127199
  const current2 = config2?.recentRepos ?? [];
126796
127200
  const updated = removeRecentRepoFromList(current2, owner, repo);
@@ -126802,7 +127206,7 @@ function useRecentRepos() {
126802
127206
  }
126803
127207
 
126804
127208
  // src/screens/BrowseRepoScreen.tsx
126805
- var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1);
127209
+ var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1);
126806
127210
  function validateRepoInput(input) {
126807
127211
  const trimmed2 = input.trim();
126808
127212
  if (!trimmed2.includes("/")) {
@@ -126830,28 +127234,28 @@ function BrowsePicker({ onSelectRepo, isActive: isActive2 }) {
126830
127234
  const { setInputActive } = useInputFocus();
126831
127235
  const { recentRepos, removeRecentRepo } = useRecentRepos();
126832
127236
  const { bookmarkedRepos } = useBookmarkedRepos();
126833
- const [inputValue, setInputValue] = (0, import_react103.useState)("");
126834
- const [inputError, setInputError] = (0, import_react103.useState)(null);
126835
- const [isInputFocused, setIsInputFocused] = (0, import_react103.useState)(false);
126836
- const [selectedIndex, setSelectedIndex] = (0, import_react103.useState)(0);
127237
+ const [inputValue, setInputValue] = (0, import_react105.useState)("");
127238
+ const [inputError, setInputError] = (0, import_react105.useState)(null);
127239
+ const [isInputFocused, setIsInputFocused] = (0, import_react105.useState)(false);
127240
+ const [selectedIndex, setSelectedIndex] = (0, import_react105.useState)(0);
126837
127241
  const bookmarkSet = new Set(bookmarkedRepos.map((b) => `${b.owner}/${b.repo}`));
126838
127242
  const filteredRecent = recentRepos.filter((r) => !bookmarkSet.has(`${r.owner}/${r.repo}`));
126839
127243
  const totalListItems = bookmarkedRepos.length + filteredRecent.length;
126840
- (0, import_react103.useEffect)(() => {
127244
+ (0, import_react105.useEffect)(() => {
126841
127245
  if (isActive2) {
126842
127246
  setIsInputFocused(true);
126843
127247
  } else {
126844
127248
  setIsInputFocused(false);
126845
127249
  }
126846
127250
  }, [isActive2]);
126847
- (0, import_react103.useEffect)(() => {
127251
+ (0, import_react105.useEffect)(() => {
126848
127252
  setInputActive(isInputFocused);
126849
127253
  return () => setInputActive(false);
126850
127254
  }, [isInputFocused, setInputActive]);
126851
- (0, import_react103.useEffect)(() => {
127255
+ (0, import_react105.useEffect)(() => {
126852
127256
  setScreenContext("browse-picker");
126853
127257
  }, []);
126854
- const handleSubmitInput = (0, import_react103.useCallback)(() => {
127258
+ const handleSubmitInput = (0, import_react105.useCallback)(() => {
126855
127259
  const result = validateRepoInput(inputValue);
126856
127260
  if (!result.valid) {
126857
127261
  setInputError(result.error);
@@ -126860,7 +127264,7 @@ function BrowsePicker({ onSelectRepo, isActive: isActive2 }) {
126860
127264
  setInputError(null);
126861
127265
  onSelectRepo(result.owner, result.repo);
126862
127266
  }, [inputValue, onSelectRepo]);
126863
- const handleSelectFromList = (0, import_react103.useCallback)(() => {
127267
+ const handleSelectFromList = (0, import_react105.useCallback)(() => {
126864
127268
  if (totalListItems === 0) return;
126865
127269
  if (selectedIndex < bookmarkedRepos.length) {
126866
127270
  const bookmark = bookmarkedRepos[selectedIndex];
@@ -126875,7 +127279,7 @@ function BrowsePicker({ onSelectRepo, isActive: isActive2 }) {
126875
127279
  }
126876
127280
  }
126877
127281
  }, [selectedIndex, bookmarkedRepos, filteredRecent, totalListItems, onSelectRepo]);
126878
- const handleRemoveFromList = (0, import_react103.useCallback)(() => {
127282
+ const handleRemoveFromList = (0, import_react105.useCallback)(() => {
126879
127283
  if (selectedIndex >= bookmarkedRepos.length) {
126880
127284
  const recentIdx = selectedIndex - bookmarkedRepos.length;
126881
127285
  const recent = filteredRecent[recentIdx];
@@ -126913,19 +127317,19 @@ function BrowsePicker({ onSelectRepo, isActive: isActive2 }) {
126913
127317
  },
126914
127318
  { isActive: isActive2 }
126915
127319
  );
126916
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, padding: 1, children: [
126917
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Browse Repository" }),
126918
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
126919
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Box_default, { gap: 1, children: [
126920
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { color: theme14.colors.secondary, children: "owner/repo:" }),
126921
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
127320
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, padding: 1, children: [
127321
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { color: theme14.colors.accent, bold: true, children: "Browse Repository" }),
127322
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
127323
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Box_default, { gap: 1, children: [
127324
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { color: theme14.colors.secondary, children: "owner/repo:" }),
127325
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
126922
127326
  Box_default,
126923
127327
  {
126924
127328
  borderStyle: "single",
126925
127329
  borderColor: isInputFocused ? theme14.colors.accent : theme14.colors.border,
126926
127330
  paddingX: 1,
126927
127331
  width: 40,
126928
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
127332
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
126929
127333
  TextInput,
126930
127334
  {
126931
127335
  defaultValue: inputValue,
@@ -126939,14 +127343,14 @@ function BrowsePicker({ onSelectRepo, isActive: isActive2 }) {
126939
127343
  }
126940
127344
  )
126941
127345
  ] }),
126942
- inputError && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Box_default, { paddingLeft: 2, marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { color: theme14.colors.error, children: inputError }) })
127346
+ inputError && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Box_default, { paddingLeft: 2, marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { color: theme14.colors.error, children: inputError }) })
126943
127347
  ] }),
126944
- bookmarkedRepos.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
126945
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { color: theme14.colors.secondary, bold: true, children: "Bookmarks" }),
126946
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Divider, {}),
127348
+ bookmarkedRepos.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
127349
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { color: theme14.colors.secondary, bold: true, children: "Bookmarks" }),
127350
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Divider, {}),
126947
127351
  bookmarkedRepos.map((bookmark, index) => {
126948
127352
  const isSelected = !isInputFocused && selectedIndex === index;
126949
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
127353
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
126950
127354
  Text,
126951
127355
  {
126952
127356
  color: isSelected ? theme14.colors.accent : theme14.colors.text,
@@ -126962,14 +127366,14 @@ function BrowsePicker({ onSelectRepo, isActive: isActive2 }) {
126962
127366
  ) }, `${bookmark.owner}/${bookmark.repo}`);
126963
127367
  })
126964
127368
  ] }),
126965
- filteredRecent.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
126966
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { color: theme14.colors.secondary, bold: true, children: "Recent" }),
126967
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Divider, {}),
127369
+ filteredRecent.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
127370
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { color: theme14.colors.secondary, bold: true, children: "Recent" }),
127371
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Divider, {}),
126968
127372
  filteredRecent.map((repo, index) => {
126969
127373
  const listIdx = bookmarkedRepos.length + index;
126970
127374
  const isSelected = !isInputFocused && selectedIndex === listIdx;
126971
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Box_default, { paddingX: 1, gap: 2, children: [
126972
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
127375
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Box_default, { paddingX: 1, gap: 2, children: [
127376
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
126973
127377
  Text,
126974
127378
  {
126975
127379
  color: isSelected ? theme14.colors.accent : theme14.colors.text,
@@ -126983,20 +127387,20 @@ function BrowsePicker({ onSelectRepo, isActive: isActive2 }) {
126983
127387
  ]
126984
127388
  }
126985
127389
  ),
126986
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: new Date(repo.lastUsed).toLocaleDateString() })
127390
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: new Date(repo.lastUsed).toLocaleDateString() })
126987
127391
  ] }, `${repo.owner}/${repo.repo}`);
126988
127392
  })
126989
127393
  ] }),
126990
- totalListItems === 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Box_default, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { color: theme14.colors.muted, children: "No recent or bookmarked repos. Enter owner/repo above to get started." }) }),
126991
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Box_default, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: isInputFocused ? "Enter:search Esc:list" : "j/k:nav Enter:select x:remove /:search" }) })
127394
+ totalListItems === 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Box_default, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { color: theme14.colors.muted, children: "No recent or bookmarked repos. Enter owner/repo above to get started." }) }),
127395
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Box_default, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { color: theme14.colors.muted, dimColor: true, children: isInputFocused ? "Enter:search Esc:list" : "j/k:nav Enter:select x:remove /:search" }) })
126992
127396
  ] });
126993
127397
  }
126994
127398
  function BrowseList({ owner, repo, onBack, onSelect }) {
126995
- const [stateFilter, setStateFilter] = (0, import_react103.useState)("open");
127399
+ const [stateFilter, setStateFilter] = (0, import_react105.useState)("open");
126996
127400
  const { data: prs = [], isLoading, error } = usePullRequests(owner, repo, {
126997
127401
  state: stateFilter === "all" ? "all" : stateFilter === "closed" ? "closed" : "open"
126998
127402
  });
126999
- (0, import_react103.useEffect)(() => {
127403
+ (0, import_react105.useEffect)(() => {
127000
127404
  setScreenContext("browse-list");
127001
127405
  }, []);
127002
127406
  use_input_default(
@@ -127007,7 +127411,7 @@ function BrowseList({ owner, repo, onBack, onSelect }) {
127007
127411
  },
127008
127412
  { isActive: true }
127009
127413
  );
127010
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
127414
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
127011
127415
  PRListScreen,
127012
127416
  {
127013
127417
  title: `${owner}/${repo}`,
@@ -127026,8 +127430,8 @@ function BrowseList({ owner, repo, onBack, onSelect }) {
127026
127430
  function BrowseRepoScreen({ onSelect, isActive: isActive2 = true }) {
127027
127431
  const { setBrowseRepo, clearBrowseRepo } = useRepoContext();
127028
127432
  const { addRecentRepo } = useRecentRepos();
127029
- const [selectedRepo, setSelectedRepo] = (0, import_react103.useState)(null);
127030
- const handleSelectRepo = (0, import_react103.useCallback)(
127433
+ const [selectedRepo, setSelectedRepo] = (0, import_react105.useState)(null);
127434
+ const handleSelectRepo = (0, import_react105.useCallback)(
127031
127435
  (owner, repo) => {
127032
127436
  setSelectedRepo({ owner, repo });
127033
127437
  setBrowseRepo(owner, repo);
@@ -127035,12 +127439,12 @@ function BrowseRepoScreen({ onSelect, isActive: isActive2 = true }) {
127035
127439
  },
127036
127440
  [setBrowseRepo, addRecentRepo]
127037
127441
  );
127038
- const handleBack = (0, import_react103.useCallback)(() => {
127442
+ const handleBack = (0, import_react105.useCallback)(() => {
127039
127443
  setSelectedRepo(null);
127040
127444
  clearBrowseRepo();
127041
127445
  }, [clearBrowseRepo]);
127042
127446
  if (selectedRepo) {
127043
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
127447
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
127044
127448
  BrowseList,
127045
127449
  {
127046
127450
  owner: selectedRepo.owner,
@@ -127050,29 +127454,29 @@ function BrowseRepoScreen({ onSelect, isActive: isActive2 = true }) {
127050
127454
  }
127051
127455
  );
127052
127456
  }
127053
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(BrowsePicker, { onSelectRepo: handleSelectRepo, isActive: isActive2 });
127457
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(BrowsePicker, { onSelectRepo: handleSelectRepo, isActive: isActive2 });
127054
127458
  }
127055
127459
 
127056
127460
  // src/hooks/useActivePanel.ts
127057
- var import_react104 = __toESM(require_react(), 1);
127461
+ var import_react106 = __toESM(require_react(), 1);
127058
127462
  function useActivePanel({
127059
127463
  hasSelection,
127060
127464
  isInputActive = false
127061
127465
  }) {
127062
- const [activePanel, setActivePanel] = (0, import_react104.useState)("sidebar");
127063
- (0, import_react104.useEffect)(() => {
127466
+ const [activePanel, setActivePanel] = (0, import_react106.useState)("sidebar");
127467
+ (0, import_react106.useEffect)(() => {
127064
127468
  if (!hasSelection && activePanel === "detail") {
127065
127469
  setActivePanel("list");
127066
127470
  }
127067
127471
  }, [hasSelection, activePanel]);
127068
- const handleEscape = (0, import_react104.useCallback)(() => {
127472
+ const handleEscape = (0, import_react106.useCallback)(() => {
127069
127473
  if (activePanel === "detail") {
127070
127474
  setActivePanel("list");
127071
127475
  } else if (activePanel === "list") {
127072
127476
  setActivePanel("sidebar");
127073
127477
  }
127074
127478
  }, [activePanel]);
127075
- const handleTab = (0, import_react104.useCallback)(() => {
127479
+ const handleTab = (0, import_react106.useCallback)(() => {
127076
127480
  if (activePanel === "sidebar") {
127077
127481
  setActivePanel("list");
127078
127482
  } else if (activePanel === "list" && hasSelection) {
@@ -127095,7 +127499,7 @@ function useActivePanel({
127095
127499
  }
127096
127500
 
127097
127501
  // src/hooks/useSidebarCounts.ts
127098
- var import_react105 = __toESM(require_react(), 1);
127502
+ var import_react107 = __toESM(require_react(), 1);
127099
127503
  var EMPTY_COUNTS = {
127100
127504
  involved: null,
127101
127505
  myPrs: null,
@@ -127130,8 +127534,8 @@ function extractThisRepoCount(queryClient2) {
127130
127534
  }
127131
127535
  function useSidebarCounts(isUnread) {
127132
127536
  const queryClient2 = useQueryClient();
127133
- const countsRef = (0, import_react105.useRef)(EMPTY_COUNTS);
127134
- const computeCounts = (0, import_react105.useCallback)(() => {
127537
+ const countsRef = (0, import_react107.useRef)(EMPTY_COUNTS);
127538
+ const computeCounts = (0, import_react107.useCallback)(() => {
127135
127539
  const involved = extractCount(queryClient2, "involved-prs");
127136
127540
  const myPrs = extractCount(queryClient2, "my-prs");
127137
127541
  const forReview = extractCount(queryClient2, "review-requests");
@@ -127158,7 +127562,7 @@ function useSidebarCounts(isUnread) {
127158
127562
  const browse = extractCount(queryClient2, "browse-prs");
127159
127563
  return { involved, myPrs, forReview, forReviewUnread, thisRepo, browse };
127160
127564
  }, [queryClient2, isUnread]);
127161
- const subscribe2 = (0, import_react105.useCallback)(
127565
+ const subscribe2 = (0, import_react107.useCallback)(
127162
127566
  (onStoreChange) => {
127163
127567
  const unsubscribe = queryClient2.getQueryCache().subscribe(() => {
127164
127568
  const next = computeCounts();
@@ -127172,17 +127576,17 @@ function useSidebarCounts(isUnread) {
127172
127576
  },
127173
127577
  [queryClient2, computeCounts]
127174
127578
  );
127175
- const getSnapshot2 = (0, import_react105.useCallback)(() => {
127579
+ const getSnapshot2 = (0, import_react107.useCallback)(() => {
127176
127580
  return countsRef.current;
127177
127581
  }, []);
127178
- (0, import_react105.useEffect)(() => {
127582
+ (0, import_react107.useEffect)(() => {
127179
127583
  countsRef.current = computeCounts();
127180
127584
  }, [computeCounts]);
127181
- return (0, import_react105.useSyncExternalStore)(subscribe2, getSnapshot2, () => EMPTY_COUNTS);
127585
+ return (0, import_react107.useSyncExternalStore)(subscribe2, getSnapshot2, () => EMPTY_COUNTS);
127182
127586
  }
127183
127587
 
127184
127588
  // src/app.tsx
127185
- var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1);
127589
+ var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1);
127186
127590
  function AppContent({
127187
127591
  repoOwner,
127188
127592
  repoName
@@ -127190,13 +127594,13 @@ function AppContent({
127190
127594
  const { exit: exit4 } = use_app_default();
127191
127595
  const { stdout } = use_stdout_default();
127192
127596
  const { user, isAuthenticated, loading, saveToken, error } = useAuth();
127193
- const [sidebarVisible, setSidebarVisible] = (0, import_react106.useState)(true);
127194
- const [currentScreen, setCurrentScreen] = (0, import_react106.useState)({
127597
+ const [sidebarVisible, setSidebarVisible] = (0, import_react108.useState)(true);
127598
+ const [currentScreen, setCurrentScreen] = (0, import_react108.useState)({
127195
127599
  type: "list"
127196
127600
  });
127197
- const [tokenError, setTokenError] = (0, import_react106.useState)(null);
127198
- const [showHelp, setShowHelp] = (0, import_react106.useState)(false);
127199
- const [showTokenInput, setShowTokenInput] = (0, import_react106.useState)(false);
127601
+ const [tokenError, setTokenError] = (0, import_react108.useState)(null);
127602
+ const [showHelp, setShowHelp] = (0, import_react108.useState)(false);
127603
+ const [showTokenInput, setShowTokenInput] = (0, import_react108.useState)(false);
127200
127604
  const { isInputActive } = useInputFocus();
127201
127605
  const { activePanel, setActivePanel } = useActivePanel({
127202
127606
  hasSelection: currentScreen.type === "detail",
@@ -127212,14 +127616,14 @@ function AppContent({
127212
127616
  const sidebarIndex = currentEntry ? getItemIndex(currentEntry) ?? 0 : 0;
127213
127617
  const { isUnread } = useReadState();
127214
127618
  const sidebarCounts = useSidebarCounts(isUnread);
127215
- import_react106.default.useEffect(() => {
127619
+ import_react108.default.useEffect(() => {
127216
127620
  if (!loading && !isAuthenticated && !showTokenInput) {
127217
127621
  setShowTokenInput(true);
127218
127622
  } else if (isAuthenticated && showTokenInput) {
127219
127623
  setShowTokenInput(false);
127220
127624
  }
127221
127625
  }, [loading, isAuthenticated, showTokenInput]);
127222
- const handleTokenSubmit = (0, import_react106.useCallback)(
127626
+ const handleTokenSubmit = (0, import_react108.useCallback)(
127223
127627
  async (token) => {
127224
127628
  try {
127225
127629
  setTokenError(null);
@@ -127258,7 +127662,7 @@ function AppContent({
127258
127662
  },
127259
127663
  { isActive: !showTokenInput && !isInputActive }
127260
127664
  );
127261
- const handleSelectPR = (0, import_react106.useCallback)(
127665
+ const handleSelectPR = (0, import_react108.useCallback)(
127262
127666
  (pr, list, index) => {
127263
127667
  setCurrentScreen({
127264
127668
  type: "detail",
@@ -127269,10 +127673,10 @@ function AppContent({
127269
127673
  },
127270
127674
  []
127271
127675
  );
127272
- const handleBackToList = (0, import_react106.useCallback)(() => {
127676
+ const handleBackToList = (0, import_react108.useCallback)(() => {
127273
127677
  setCurrentScreen({ type: "list" });
127274
127678
  }, []);
127275
- const handleNavigatePR = (0, import_react106.useCallback)(
127679
+ const handleNavigatePR = (0, import_react108.useCallback)(
127276
127680
  (direction) => {
127277
127681
  if (currentScreen.type !== "detail") return;
127278
127682
  const { prList, prIndex } = currentScreen;
@@ -127296,7 +127700,7 @@ function AppContent({
127296
127700
  const match15 = prUrl.match(/github\.com\/([^/]+)\/([^/]+)\/pull/);
127297
127701
  const prOwner = match15?.[1] ?? repoOwner ?? "";
127298
127702
  const prRepo = match15?.[2] ?? repoName ?? "";
127299
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
127703
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
127300
127704
  PRDetailScreen,
127301
127705
  {
127302
127706
  pr: currentScreen.pr,
@@ -127310,10 +127714,10 @@ function AppContent({
127310
127714
  );
127311
127715
  }
127312
127716
  return Match_exports.value(sidebarIndex).pipe(
127313
- Match_exports.when(0, () => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(InvolvedScreen, { onSelect: handleSelectPR })),
127314
- Match_exports.when(1, () => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(MyPRsScreen, { onSelect: handleSelectPR })),
127315
- Match_exports.when(2, () => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ReviewRequestsScreen, { onSelect: handleSelectPR })),
127316
- Match_exports.when(3, () => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
127717
+ Match_exports.when(0, () => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(InvolvedScreen, { onSelect: handleSelectPR })),
127718
+ Match_exports.when(1, () => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(MyPRsScreen, { onSelect: handleSelectPR })),
127719
+ Match_exports.when(2, () => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ReviewRequestsScreen, { onSelect: handleSelectPR })),
127720
+ Match_exports.when(3, () => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
127317
127721
  ThisRepoScreen,
127318
127722
  {
127319
127723
  owner: repoOwner,
@@ -127321,16 +127725,16 @@ function AppContent({
127321
127725
  onSelect: handleSelectPR
127322
127726
  }
127323
127727
  )),
127324
- Match_exports.when(4, () => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(BrowseRepoScreen, { onSelect: handleSelectPR, isActive: activePanel !== "sidebar" })),
127325
- Match_exports.when(5, () => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SettingsScreen, {})),
127326
- Match_exports.orElse(() => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(InvolvedScreen, { onSelect: handleSelectPR }))
127728
+ Match_exports.when(4, () => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(BrowseRepoScreen, { onSelect: handleSelectPR, isActive: activePanel !== "sidebar" })),
127729
+ Match_exports.when(5, () => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SettingsScreen, {})),
127730
+ Match_exports.orElse(() => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(InvolvedScreen, { onSelect: handleSelectPR }))
127327
127731
  );
127328
127732
  }
127329
127733
  const terminalHeight = stdout?.rows ?? 24;
127330
127734
  const { browseRepo } = useRepoContext();
127331
127735
  const repoPath = repoOwner && repoName ? `${repoOwner}/${repoName}` : void 0;
127332
127736
  const browseRepoPath = browseRepo ? `${browseRepo.owner}/${browseRepo.repo}` : void 0;
127333
- import_react106.default.useEffect(() => {
127737
+ import_react108.default.useEffect(() => {
127334
127738
  if (currentScreen.type !== "detail") {
127335
127739
  if (sidebarIndex === 5) {
127336
127740
  setScreenContext("settings");
@@ -127355,8 +127759,8 @@ function AppContent({
127355
127759
  const currentScreenName = currentScreen.type === "list" ? screenNames[sidebarIndex] : screenNames[sidebarIndex];
127356
127760
  const prTitle = currentScreen.type === "detail" ? currentScreen.pr.title : void 0;
127357
127761
  const prNumber = currentScreen.type === "detail" ? currentScreen.pr.number : void 0;
127358
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Box_default, { flexDirection: "column", height: terminalHeight, children: [
127359
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
127762
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Box_default, { flexDirection: "column", height: terminalHeight, children: [
127763
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
127360
127764
  TopBar,
127361
127765
  {
127362
127766
  username: user?.login ?? "anonymous",
@@ -127369,8 +127773,8 @@ function AppContent({
127369
127773
  connectionStatus
127370
127774
  }
127371
127775
  ),
127372
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Box_default, { flexDirection: "row", flexGrow: 1, children: [
127373
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
127776
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Box_default, { flexDirection: "row", flexGrow: 1, children: [
127777
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
127374
127778
  Sidebar,
127375
127779
  {
127376
127780
  selectedIndex: sidebarIndex,
@@ -127382,11 +127786,11 @@ function AppContent({
127382
127786
  navIndex
127383
127787
  }
127384
127788
  ),
127385
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(MainPanel, { isActive: activePanel === "list", children: renderScreen() })
127789
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(MainPanel, { isActive: activePanel === "list", children: renderScreen() })
127386
127790
  ] }),
127387
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(StatusBar, { activePanel, screenContext }),
127388
- showHelp && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(HelpModal, { onClose: () => setShowHelp(false) }),
127389
- showTokenInput && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
127791
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(StatusBar, { activePanel, screenContext }),
127792
+ showHelp && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(HelpModal, { onClose: () => setShowHelp(false) }),
127793
+ showTokenInput && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
127390
127794
  TokenInputModal,
127391
127795
  {
127392
127796
  onSubmit: handleTokenSubmit,
@@ -127406,9 +127810,9 @@ var queryClient = new QueryClient({
127406
127810
  }
127407
127811
  });
127408
127812
  function GitLabUnsupportedScreen() {
127409
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Box_default, { flexDirection: "column", padding: 2, children: [
127410
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { color: "red", bold: true, children: "GitLab provider not yet supported" }),
127411
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { children: 'Your config (~/.config/lazyreview/config.yaml) has provider set to "gitlab". Please change it to "github" or remove the provider field to use the default.' })
127813
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Box_default, { flexDirection: "column", padding: 2, children: [
127814
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Text, { color: "red", bold: true, children: "GitLab provider not yet supported" }),
127815
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Text, { children: 'Your config (~/.config/lazyreview/config.yaml) has provider set to "gitlab". Please change it to "github" or remove the provider field to use the default.' })
127412
127816
  ] });
127413
127817
  }
127414
127818
  function AppWithTheme({
@@ -127419,17 +127823,17 @@ function AppWithTheme({
127419
127823
  const themeName = config2?.theme ?? "tokyo-night";
127420
127824
  const theme14 = getThemeByName(themeName);
127421
127825
  if (config2?.provider === "gitlab") {
127422
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ThemeProvider, { theme: theme14, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(GitLabUnsupportedScreen, {}) });
127826
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ThemeProvider, { theme: theme14, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(GitLabUnsupportedScreen, {}) });
127423
127827
  }
127424
127828
  const localRepo = repoOwner && repoName ? { owner: repoOwner, repo: repoName } : null;
127425
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ThemeProvider, { theme: theme14, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(RepoContextProvider, { localRepo, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ErrorBoundary2, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(AppContent, { repoOwner, repoName }) }) }) });
127829
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ThemeProvider, { theme: theme14, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(RepoContextProvider, { localRepo, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ErrorBoundary2, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(AppContent, { repoOwner, repoName }) }) }) });
127426
127830
  }
127427
127831
  function App2({ repoOwner, repoName }) {
127428
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(InputFocusProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(AppWithTheme, { repoOwner, repoName }) }) });
127832
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(InputFocusProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(AppWithTheme, { repoOwner, repoName }) }) });
127429
127833
  }
127430
127834
 
127431
127835
  // src/cli.tsx
127432
- var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1);
127836
+ var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1);
127433
127837
  var ENTER_ALT_SCREEN = "\x1B[?1049h";
127434
127838
  var EXIT_ALT_SCREEN = "\x1B[?1049l";
127435
127839
  var CLEAR_SCREEN = "\x1B[2J";
@@ -127523,7 +127927,7 @@ async function main() {
127523
127927
  repoName = gitInfo.repo;
127524
127928
  }
127525
127929
  }
127526
- render_default(/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(App2, { repoOwner, repoName }));
127930
+ render_default(/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(App2, { repoOwner, repoName }));
127527
127931
  }
127528
127932
  main().catch((error) => {
127529
127933
  cleanup();