@d3lm/pr-stats 0.2.11 → 0.2.12

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/tui-app.mjs +18 -18
  2. package/package.json +1 -1
package/dist/tui-app.mjs CHANGED
@@ -558,11 +558,11 @@ function Footer({
558
558
  views,
559
559
  copyLinks: copyLinks2,
560
560
  openError,
561
- copyNotice,
561
+ successNotice,
562
562
  stale
563
563
  }) {
564
- const notice = openError ?? copyNotice ?? (stale ? "options changed \xB7 press r to reload" : "");
565
- const check = openError === null && copyNotice !== null;
564
+ const notice = openError ?? successNotice ?? (stale ? "options changed \xB7 press r to reload" : "");
565
+ const check = openError === null && successNotice !== null;
566
566
  const noticeWidth = notice === "" ? 0 : notice.length + (check ? 2 : 0) + 2;
567
567
  const hints = truncated(hintsFor(modal, editing, tab, authoredTab, views, copyLinks2), width - 2 - noticeWidth);
568
568
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -580,7 +580,7 @@ function Footer({
580
580
  /* @__PURE__ */ jsx("text", { wrapMode: "none", fg: theme.dim, children: hints }),
581
581
  /* @__PURE__ */ jsxs("text", { wrapMode: "none", children: [
582
582
  check && /* @__PURE__ */ jsx("span", { fg: theme.success, children: "\u2714 " }),
583
- /* @__PURE__ */ jsx("span", { fg: openError !== null ? theme.error : copyNotice !== null ? theme.muted : theme.warn, children: notice })
583
+ /* @__PURE__ */ jsx("span", { fg: openError !== null ? theme.error : successNotice !== null ? theme.muted : theme.warn, children: notice })
584
584
  ] })
585
585
  ]
586
586
  }
@@ -6230,7 +6230,7 @@ var initialUiState = {
6230
6230
  themeColorError: null,
6231
6231
  cacheAction: null,
6232
6232
  openError: null,
6233
- copyNotice: null
6233
+ successNotice: null
6234
6234
  };
6235
6235
  function cycled2(previous, delta, count2) {
6236
6236
  return (previous + count2 + delta) % count2;
@@ -6238,19 +6238,19 @@ function cycled2(previous, delta, count2) {
6238
6238
  function uiReducer(state, action) {
6239
6239
  switch (action.type) {
6240
6240
  case "noticesDismissed": {
6241
- if (state.openError === null && state.copyNotice === null) {
6241
+ if (state.openError === null && state.successNotice === null) {
6242
6242
  return state;
6243
6243
  }
6244
- return { ...state, openError: null, copyNotice: null };
6244
+ return { ...state, openError: null, successNotice: null };
6245
6245
  }
6246
6246
  case "openErrorReported": {
6247
6247
  return { ...state, openError: action.message };
6248
6248
  }
6249
6249
  case "copyReported": {
6250
- return { ...state, openError: null, copyNotice: { text: action.message } };
6250
+ return { ...state, openError: null, successNotice: { text: action.message } };
6251
6251
  }
6252
- case "copyNoticeExpired": {
6253
- return { ...state, copyNotice: null };
6252
+ case "successNoticeExpired": {
6253
+ return { ...state, successNotice: null };
6254
6254
  }
6255
6255
  case "modalOpened": {
6256
6256
  return { ...state, modal: action.modal, fieldError: null, themeColorError: null, cacheAction: null };
@@ -6298,10 +6298,10 @@ function uiReducer(state, action) {
6298
6298
  return { ...state, fieldError: action.message };
6299
6299
  }
6300
6300
  case "optionsSaveReported": {
6301
- return {
6302
- ...state,
6303
- fieldError: action.saved ? null : "the cache is disabled for this session \xB7 options not saved"
6304
- };
6301
+ if (action.saved) {
6302
+ return { ...state, fieldError: null, successNotice: { text: "options saved" } };
6303
+ }
6304
+ return { ...state, fieldError: "the cache is disabled for this session \xB7 options not saved" };
6305
6305
  }
6306
6306
  case "themeColorCommitted": {
6307
6307
  return { ...state, editing: false, themeColorError: null, cacheAction: action.action };
@@ -6404,16 +6404,16 @@ function App({
6404
6404
  dispatchUi({ type: "copyReported", message: `copied ${row.ref} to the clipboard` });
6405
6405
  };
6406
6406
  useEffect6(() => {
6407
- if (ui.copyNotice === null) {
6407
+ if (ui.successNotice === null) {
6408
6408
  return void 0;
6409
6409
  }
6410
6410
  const timer = setTimeout(() => {
6411
- dispatchUi({ type: "copyNoticeExpired" });
6411
+ dispatchUi({ type: "successNoticeExpired" });
6412
6412
  }, 2500);
6413
6413
  return () => {
6414
6414
  clearTimeout(timer);
6415
6415
  };
6416
- }, [ui.copyNotice]);
6416
+ }, [ui.successNotice]);
6417
6417
  const reviewScrollRef = useRef5(null);
6418
6418
  const sizeScrollRef = useRef5(null);
6419
6419
  const commentScrollRef = useRef5(null);
@@ -6530,7 +6530,7 @@ function App({
6530
6530
  views,
6531
6531
  copyLinks: copyLinks2,
6532
6532
  openError: ui.openError,
6533
- copyNotice: ui.copyNotice === null ? null : ui.copyNotice.text,
6533
+ successNotice: ui.successNotice === null ? null : ui.successNotice.text,
6534
6534
  stale
6535
6535
  }
6536
6536
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d3lm/pr-stats",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "GitHub PR stats in an interactive terminal UI, via the gh CLI or an access token",
5
5
  "type": "module",
6
6
  "author": "Dominic Elm",