@modelstatus/cli 0.1.28 → 0.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelstatus/cli",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "description": "Track which AI models you use, where, and never get surprised by a retirement. Free offline model-health for any repo (mm status), browser sign-in for cloud inventory + alerts.",
5
5
  "keywords": [
6
6
  "llm",
@@ -50,6 +50,7 @@ export function LocalView({ dir, ui, width = 78, height = 14, active = true, fre
50
50
  const [focus, setFocus] = React.useState("list"); // list | refs
51
51
  const [refIdx, setRefIdx] = React.useState(0);
52
52
  const refIdxRef = React.useRef(0); // synchronous mirror of refIdx for the input handler
53
+ const justReloadedRef = React.useRef(false); // a USER-triggered rescan is in flight
53
54
 
54
55
  const { snapshot, rows, custom, refsBySlug, customRefs, candidateCount, filesScanned, dirsSeen, catalogsSkipped, scannedAt, fromCache, phase } = scan;
55
56
 
@@ -102,6 +103,7 @@ export function LocalView({ dir, ui, width = 78, height = 14, active = true, fre
102
103
  setFocus("list");
103
104
  if (addGlobalIgnore(pat)) {
104
105
  ui?.showToast?.(`excluded "${(pat || "").trim()}" — rescanning`);
106
+ justReloadedRef.current = true;
105
107
  scan.reload();
106
108
  } else {
107
109
  ui?.showToast?.(`couldn't exclude "${(pat || "").trim()}"`, "#dc2626");
@@ -116,6 +118,17 @@ export function LocalView({ dir, ui, width = 78, height = 14, active = true, fre
116
118
  ui?.reportStatus?.({ counts, context: snapshot ? `registry · ${fmtNum(snapshot.models.length)} models` : "scanning…" });
117
119
  }, [rows, custom, snapshot, phase, ui]);
118
120
 
121
+ // Confirm a USER-triggered rescan finished. The live scanning strip can flash by
122
+ // on a fast/cached scan, and the "done" line resembles the prior state — so a
123
+ // toast makes it unmistakable that it actually re-ran, and what it found.
124
+ React.useEffect(() => {
125
+ if (phase === "done" && justReloadedRef.current) {
126
+ justReloadedRef.current = false;
127
+ const att = rows.filter((r) => r.health !== "ok").length;
128
+ ui?.showToast?.(`${GLYPH.check} rescanned · ${fmtNum(candidateCount)} refs · ${att ? `${att} need attention` : "all current"}`);
129
+ }
130
+ }, [phase]); // eslint-disable-line react-hooks/exhaustive-deps
131
+
119
132
  // Tell the shell when backspace should back out *within* this view (drilled
120
133
  // into refs, or an active filter) rather than stepping to the previous tab.
121
134
  const setHandlesBack = ui?.setHandlesBack;
@@ -160,7 +173,7 @@ export function LocalView({ dir, ui, width = 78, height = 14, active = true, fre
160
173
  if (key.upArrow || input === "k") return nav.up();
161
174
  if (input === "e") return excludeRef(drefs[0]); // exclude the highlighted model's location (editable)
162
175
  if (input === "p" && running) return scan.togglePause();
163
- if (input === "g") return scan.reload();
176
+ if (input === "g") { justReloadedRef.current = true; return scan.reload(); }
164
177
  },
165
178
  { isActive: active },
166
179
  );
@@ -181,7 +194,7 @@ export function LocalView({ dir, ui, width = 78, height = 14, active = true, fre
181
194
  Box,
182
195
  {},
183
196
  h(Text, { color: "#16a34a" }, ` ${GLYPH.check} `),
184
- h(Text, { color: C.FG_DIM }, fromCache ? `loaded last scan${scannedAt ? ` (${agoText(Date.now() - scannedAt)})` : ""} · ${fmtNum(candidateCount)} refs · g rescan` : `scanned ${counters}`),
197
+ h(Text, { color: C.FG_DIM }, fromCache ? `loaded last scan${scannedAt ? ` (${agoText(Date.now() - scannedAt)})` : ""} · ${fmtNum(candidateCount)} refs · g rescan` : `scanned just now · ${counters} · g rescan`),
185
198
  attention > 0
186
199
  ? h(Text, { color: "#d97706" }, ` ${GLYPH.warn} ${attention} need attention`)
187
200
  : h(Text, { color: "#16a34a" }, " all current"),