@bismawy/pi-vision-watcher 1.0.12 → 1.0.14

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": "@bismawy/pi-vision-watcher",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Give text-only pi models vision — describe images with a vision model you pick via an interactive picker, then hand off the text description to non-vision models",
5
5
  "type": "module",
6
6
  "author": "bismawy",
@@ -41,6 +41,7 @@ export const MAX_FALLBACKS = 3;
41
41
  * it), `alt+f` is pi's editor word-right, and `ctrl+f` is pi's find-text. */
42
42
  const FALLBACK_KEY = Key.ctrl("q");
43
43
  const FALLBACK_KEY_HINT = "ctrl+q";
44
+ const RESET_FALLBACKS_KEY = Key.ctrlShift("q");
44
45
 
45
46
  /** Provider ids that don't title-case cleanly. Everything else falls back to
46
47
  * word-capitalisation (`custom-openrouter-ai` → "Custom Openrouter AI"). */
@@ -170,7 +171,6 @@ export class VisionModelSelectorComponent implements Component {
170
171
  render(width: number): string[] {
171
172
  const lines: string[] = [];
172
173
  lines.push(...new DynamicBorder((s) => this.theme.fg("accent", s)).render(width));
173
- lines.push("");
174
174
  lines.push(
175
175
  truncateToWidth(
176
176
  this.theme.fg("accent", this.theme.bold("Vision Watcher")),
@@ -255,6 +255,11 @@ export class VisionModelSelectorComponent implements Component {
255
255
  // chosen together. Intercepted before the search input (like the other ctrl
256
256
  // shortcuts) so the key never lands in the filter text. See
257
257
  // {@link FALLBACK_KEY} for why it isn't ctrl+f.
258
+ if (matchesKey(data, RESET_FALLBACKS_KEY)) {
259
+ this.clearFallbacks();
260
+ return;
261
+ }
262
+
258
263
  if (matchesKey(data, FALLBACK_KEY)) {
259
264
  const item = this.filteredItems[this.selectedIndex];
260
265
  if (item?.ref) this.toggleFallback(item.ref);
@@ -332,23 +337,32 @@ export class VisionModelSelectorComponent implements Component {
332
337
 
333
338
  private getFooterText(): string {
334
339
  const totalCount = this.allItems.length - 1; // exclude the None row
335
- const matches = this.searchInput.getValue()
340
+ const count = this.searchInput.getValue()
336
341
  ? `${this.filteredItems.length - 1} matches`
337
- : `total ${totalCount} vision-capable models`;
338
-
339
- // The current selection lives in the detail pane above, so the footer only
340
- // carries keys + the model count.
341
- const parts: string[] = [
342
- `${keyText("tui.select.confirm")} = done`,
343
- "space = select vision models (👀)",
344
- `${FALLBACK_KEY_HINT} = fallback models (🔁)`,
345
- "ctrl+t = thinking",
346
- "ctrl+a = async fallback",
347
- "esc = cancel",
348
- matches,
349
- ];
342
+ : `${totalCount} models`;
343
+
344
+ // One legend line: the count carries the accent colour so it is the first
345
+ // thing the eye lands on, while the keys stay dim so they do not compete
346
+ // with the picker itself. ctrl+a toggles the async clipboard handoff; it
347
+ // is deliberately left out so this line stays readable at 80 columns.
348
+ const confirm = keyText("tui.select.confirm");
349
+ const legend = [
350
+ `[${confirm.charAt(0).toUpperCase()}${confirm.slice(1)}] Done`,
351
+ "[Space] Vision",
352
+ "[Ctrl+q] Fallback",
353
+ "[Ctrl+Shift+q] Reset",
354
+ "[Ctrl+t] Think",
355
+ "[Esc] Cancel",
356
+ ].join(" ");
357
+
358
+ return `${this.theme.fg("dim", " ")}${this.theme.fg("accent", count)}${this.theme.fg("dim", ` · ${legend}`)}`;
359
+ }
350
360
 
351
- return this.theme.fg("dim", ` ${parts.join(" · ")} `);
361
+ private clearFallbacks(): void {
362
+ if (this.fallbacks.size === 0) return;
363
+ this.fallbacks.clear();
364
+ this.notice = null;
365
+ this.updateList();
352
366
  }
353
367
 
354
368
  /** Toggle a model's membership in the fallback chain, preserving list order