pi-hide-jump-to-latest 0.1.0
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/LICENSE +21 -0
- package/README.md +31 -0
- package/extensions/hide-jump-to-latest.ts +69 -0
- package/index.ts +1 -0
- package/package.json +43 -0
- package/pic.jpg +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 theLittleStone
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# pi-hide-jump-to-latest
|
|
2
|
+
|
|
3
|
+
Hide the fullscreen "Jump to latest message" overlay in [Pi](https://pi.dev).
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
In fullscreen mode, Pi shows that banner when the transcript is not scrolled to the bottom. This extension removes the banner. The End key still jumps to the latest message.
|
|
8
|
+
|
|
9
|
+
Requires Pi 0.85.0 or later. This is unofficial: it patches private TUI internals and may stop working after a Pi update.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pi install npm:pi-hide-jump-to-latest
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pi install git:github.com/theLittleStone/pi-hide-jump-to-latest
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then `/reload` or restart Pi.
|
|
24
|
+
|
|
25
|
+
## Uninstall
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pi remove npm:pi-hide-jump-to-latest
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Restart Pi after uninstall. `/reload` does not undo the patch.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
const WIDGET_KEY = "pi-hide-jump-to-latest:sentinel";
|
|
4
|
+
const PATCH_FLAG = "__piHideJumpToLatest";
|
|
5
|
+
|
|
6
|
+
type TuiLike = {
|
|
7
|
+
mode?: unknown;
|
|
8
|
+
scrollToEndIndicator?: unknown;
|
|
9
|
+
scrollToEndIndicatorRect?: unknown;
|
|
10
|
+
compositeScrollToEndIndicator?: unknown;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Pi fullscreen TUI has no public switch for the Jump to latest message overlay.
|
|
15
|
+
* A zero-height widget captures the live TUI proxy, clears the indicator field,
|
|
16
|
+
* and patches the prototype so TUI mode switches do not restore the banner.
|
|
17
|
+
*/
|
|
18
|
+
function hideJumpToLatest(tui: unknown): void {
|
|
19
|
+
if (!tui || typeof tui !== "object") return;
|
|
20
|
+
|
|
21
|
+
const target = tui as TuiLike;
|
|
22
|
+
if (target.mode !== "fullscreen") return;
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
target.scrollToEndIndicator = undefined;
|
|
26
|
+
} catch {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let proto: TuiLike | null;
|
|
31
|
+
try {
|
|
32
|
+
proto = Object.getPrototypeOf(tui) as TuiLike | null;
|
|
33
|
+
} catch {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (!proto || (proto as Record<string, unknown>)[PATCH_FLAG]) return;
|
|
37
|
+
if (typeof proto.compositeScrollToEndIndicator !== "function") return;
|
|
38
|
+
|
|
39
|
+
proto.compositeScrollToEndIndicator = function (screen: unknown) {
|
|
40
|
+
try {
|
|
41
|
+
(this as TuiLike).scrollToEndIndicatorRect = undefined;
|
|
42
|
+
} catch {
|
|
43
|
+
// ignore
|
|
44
|
+
}
|
|
45
|
+
return screen;
|
|
46
|
+
};
|
|
47
|
+
(proto as Record<string, unknown>)[PATCH_FLAG] = true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default function hideJumpToLatestExtension(pi: ExtensionAPI): void {
|
|
51
|
+
pi.on("session_start", async (_event, ctx) => {
|
|
52
|
+
if (ctx.mode !== "tui") return;
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
ctx.ui.setWidget(WIDGET_KEY, (tui) => {
|
|
56
|
+
hideJumpToLatest(tui);
|
|
57
|
+
return {
|
|
58
|
+
invalidate() {},
|
|
59
|
+
render() {
|
|
60
|
+
hideJumpToLatest(tui);
|
|
61
|
+
return [];
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
} catch {
|
|
66
|
+
// Skip if setWidget is missing or the TUI shape changed.
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
package/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./extensions/hide-jump-to-latest";
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-hide-jump-to-latest",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Hide Pi fullscreen Jump to latest message overlay",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "theLittleStone",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/theLittleStone/pi-hide-jump-to-latest.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/theLittleStone/pi-hide-jump-to-latest/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/theLittleStone/pi-hide-jump-to-latest#readme",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"pi-package",
|
|
18
|
+
"pi",
|
|
19
|
+
"pi-extension",
|
|
20
|
+
"pi-coding-agent",
|
|
21
|
+
"tui",
|
|
22
|
+
"fullscreen"
|
|
23
|
+
],
|
|
24
|
+
"files": [
|
|
25
|
+
"extensions",
|
|
26
|
+
"index.ts",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE",
|
|
29
|
+
"pic.jpg"
|
|
30
|
+
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"pi": {
|
|
35
|
+
"extensions": [
|
|
36
|
+
"./extensions/hide-jump-to-latest.ts"
|
|
37
|
+
],
|
|
38
|
+
"image": "./pic.jpg"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@earendil-works/pi-coding-agent": ">=0.85.0"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/pic.jpg
ADDED
|
Binary file
|