pi-extension-utils 0.7.0 → 0.7.1

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.
@@ -397,8 +397,9 @@ export function paneOverlay(options) {
397
397
  if (event.button === 64 || event.button === 65) {
398
398
  if (event.y > maxRow)
399
399
  return;
400
- const lines = (event.button === 64 ? -1 : 1) * (event.shift ? 5 : 3);
400
+ const direction = event.button === 64 ? -1 : 1;
401
401
  if (inPrimaryColumn || (primaryWidth > 0 && event.x <= primaryWidth + 1)) {
402
+ const lines = direction * (event.shift ? 5 : 3);
402
403
  focus = "primary";
403
404
  applyPrimaryNav(bodyHeight, legendLineCount, (state, rows, viewportHeight) => {
404
405
  if ((options.primary.mode ?? "scroll") === "cursor") {
@@ -418,6 +419,7 @@ export function paneOverlay(options) {
418
419
  });
419
420
  }
420
421
  else {
422
+ const lines = direction * (event.shift ? 5 : 1);
421
423
  focus = "detail";
422
424
  markDetailManual();
423
425
  detailState.scrollOffset = moveScrollOffset({ offset: detailState.scrollOffset, contentLength: detailRows.length, viewportHeight: Math.max(1, bodyHeight) }, lines);
@@ -13,6 +13,7 @@ export interface FullscreenController {
13
13
  export interface TuiModeCapture {
14
14
  noteTui(tui: unknown): void;
15
15
  isFullscreenTui(): boolean;
16
+ isRegularTui(): boolean;
16
17
  }
17
18
  export declare function createTuiModeCapture(): TuiModeCapture;
18
19
  /**
@@ -9,6 +9,9 @@ export function createTuiModeCapture() {
9
9
  isFullscreenTui() {
10
10
  return mode === "fullscreen";
11
11
  },
12
+ isRegularTui() {
13
+ return mode === "regular";
14
+ },
12
15
  };
13
16
  }
14
17
  export function createUiClient(fullscreen, ctx, capture = createTuiModeCapture()) {
@@ -29,12 +32,16 @@ export function createUiClient(fullscreen, ctx, capture = createTuiModeCapture()
29
32
  // clips it while the transcript tail renders above it. Mount it as a
30
33
  // full-screen overlay instead so the component owns the whole screen,
31
34
  // matching the regular-TUI behavior it was designed for.
32
- const options = capture.isFullscreenTui()
33
- ? {
35
+ // Before any wrapped factory has rendered, the mode is unknown. Default
36
+ // that cold-start case to an overlay: it is the only mount that remains
37
+ // fullscreen and receives focus in the alt-screen TUI. Preserve the
38
+ // legacy editor-slot mount only when regular mode was positively seen.
39
+ const options = capture.isRegularTui()
40
+ ? undefined
41
+ : {
34
42
  overlay: true,
35
43
  overlayOptions: { anchor: "top-left", width: "100%", maxHeight: "100%" },
36
- }
37
- : undefined;
44
+ };
38
45
  return await ui.custom(wrapped, options);
39
46
  }
40
47
  finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-extension-utils",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Shared Pi extension utilities for coordinated widgets, fullscreen leases, and logging.",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",