@oh-my-pi/pi-tui 16.1.12 → 16.1.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.
@@ -82,6 +82,8 @@ export declare class SettingsList implements Component {
82
82
  setMaxVisible(rows: number): void;
83
83
  /** Move the selection one step for a wheel notch. */
84
84
  handleWheel(delta: -1 | 1): void;
85
+ /** Move the selection one step for a wheel notch if the pointer is within the settings pane. */
86
+ handleWheelAt(delta: -1 | 1, _line: number, col: number): boolean;
85
87
  /** Highlight the item under the pointer (null clears). */
86
88
  setHoverItem(id: string | null): void;
87
89
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-tui",
4
- "version": "16.1.12",
4
+ "version": "16.1.14",
5
5
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -37,8 +37,8 @@
37
37
  "fmt": "biome format --write ."
38
38
  },
39
39
  "dependencies": {
40
- "@oh-my-pi/pi-natives": "16.1.12",
41
- "@oh-my-pi/pi-utils": "16.1.12",
40
+ "@oh-my-pi/pi-natives": "16.1.14",
41
+ "@oh-my-pi/pi-utils": "16.1.14",
42
42
  "lru-cache": "11.5.1",
43
43
  "marked": "^18.0.5"
44
44
  },
@@ -195,7 +195,17 @@ export class SettingsList implements Component {
195
195
  if (this.#submenuComponent) return;
196
196
  // Wheel is row-level interaction: it returns focus to the rows.
197
197
  this.#sectionFocus = false;
198
- this.#moveSelection(delta);
198
+ this.#moveSelection(delta, false);
199
+ }
200
+
201
+ /** Move the selection one step for a wheel notch if the pointer is within the settings pane. */
202
+ handleWheelAt(delta: -1 | 1, _line: number, col: number): boolean {
203
+ if (this.#submenuComponent) return false;
204
+ if (this.#sidebarHitCol > 0 && col < this.#sidebarHitCol) {
205
+ return false;
206
+ }
207
+ this.handleWheel(delta);
208
+ return true;
199
209
  }
200
210
 
201
211
  /** Highlight the item under the pointer (null clears). */
@@ -308,13 +318,22 @@ export class SettingsList implements Component {
308
318
  return index >= 0 ? index : 0;
309
319
  }
310
320
 
311
- /** Move selection by one selectable item, wrapping and skipping headings. */
312
- #moveSelection(delta: -1 | 1): void {
321
+ /** Move selection by one selectable item, wrapping or clamping, and skipping headings. */
322
+ #moveSelection(delta: -1 | 1, wrap = true): void {
313
323
  const len = this.#filteredItems.length;
314
324
  if (len === 0) return;
315
325
  let index = this.#selectedIndex;
316
- for (let step = 0; step < len; step++) {
317
- index = (index + delta + len) % len;
326
+ for (let step = 0; step < len * 2; step++) {
327
+ const next = index + delta;
328
+ if (next < 0 || next >= len) {
329
+ if (wrap) {
330
+ index = (next + len) % len;
331
+ } else {
332
+ return;
333
+ }
334
+ } else {
335
+ index = next;
336
+ }
318
337
  if (!this.#filteredItems[index]?.heading) {
319
338
  this.#selectedIndex = index;
320
339
  this.#notifySelection();