pi-path-bar 0.4.2 → 0.5.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/CHANGELOG.md +8 -0
- package/README.md +56 -38
- package/README.zh-CN.md +64 -46
- package/assets/plugins-preview.png +0 -0
- package/assets/plugins-preview.svg +12 -29
- package/package.json +1 -1
- package/src/config.ts +20 -2
- package/src/index.ts +189 -32
- package/src/minimal.ts +533 -0
- package/src/segments.ts +712 -0
- package/src/settings.ts +95 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0]
|
|
4
|
+
|
|
5
|
+
- **Minimal mode (enabled by default):** Reclaim vertical space by removing the multi-line footer and placing your path, Git status, usage, model, context, and local time cleanly on the editor's top and bottom borders. Built for small screens and narrow splits, with automatic progressive compacting, `+N` overflow folding, and jitter-free running status. Turn it off anytime in `/path-bar` to use the classic multi-line footer or Pi's native footer.
|
|
6
|
+
- **Reorder and hide items:** Open **Footer order** in `/path-bar` to move right-side items (including the clock and other extensions) or press `Space` to hide what you do not need.
|
|
7
|
+
- **Cleaner extension coexistence:** Popular usage and status extensions stay compact on the top border automatically; other extension messages appear below only while active and hide when empty.
|
|
8
|
+
- **Updated preview and docs:** Refreshed the package preview and READMEs around Minimal mode and Reading mode.
|
|
9
|
+
- **Tip:** Want another extension adapted for `pi-path-bar`? Feel free to [open an issue](https://github.com/johnbitcn/pi-path-bar/issues), or ask your AI assistant to add `pi-path-bar` registration to your extension using the [footer segments guide](https://github.com/johnbitcn/pi-path-bar/blob/main/docs/footer-segments.md).
|
|
10
|
+
|
|
3
11
|
## [0.4.2]
|
|
4
12
|
|
|
5
13
|
- Add a Pi Plugins preview image and the `pi.image` metadata for the package listing.
|
package/README.md
CHANGED
|
@@ -2,9 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
English | [简体中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Built for small screens and narrow splits. **pi-path-bar** removes Pi's multi-line footer so your conversation has more room, and adds a one-keystroke reading mode — while keeping your path, Git status, usage, model, and local time in plain sight.
|
|
6
6
|
|
|
7
|
-

|
|
8
|
+
|
|
9
|
+
## Minimal mode
|
|
10
|
+
|
|
11
|
+
Enabled by default. On laptops and split panes, a stacked footer wastes vertical space and breaks awkwardly when the terminal gets narrow. Minimal mode fixes both:
|
|
12
|
+
|
|
13
|
+
- **Zero footer rows:** Everything moves cleanly onto the editor's top and bottom borders, giving your conversation more vertical space.
|
|
14
|
+
- **Smooth on narrow splits:** As the window shrinks, parent folders, Git numbers, model names, and context limits step down automatically, and extra right-side items fold into `+N`. Nothing wraps or jumbles.
|
|
15
|
+
- **Calm, jitter-free status:** Text stays locked in place when Pi starts or finishes running. Rare notices like retries or compaction appear when needed and clear out right after.
|
|
16
|
+
- **Clean with other extensions:** Popular usage and status extensions stay compact on the top border automatically. Any other extension status appears below only while active and hides when empty.
|
|
17
|
+
- **Easy to switch back:** Turn **Minimal mode** off anytime in `/path-bar` to use the classic multi-line footer or Pi's native footer.
|
|
18
|
+
|
|
19
|
+
## Reading mode
|
|
20
|
+
|
|
21
|
+
Long answers and diffs feel cramped on a small screen when the editor sits at the bottom. Reading mode clears the whole frame in one keystroke:
|
|
22
|
+
|
|
23
|
+
- **`Alt+Esc`** (Mac: **`Option+Esc`**) or **`/reading-mode`**: hide the editor and footer so you can scroll through conversation and tool output distraction-free.
|
|
24
|
+
- **`Esc`** or **`Alt+Esc`** again: return to typing immediately with your draft still intact.
|
|
25
|
+
|
|
26
|
+
Requires Pi 1.5 or later in fullscreen mode. Use `/reading-mode` if the shortcut does not respond, and run `/reload` after switching TUI modes.
|
|
8
27
|
|
|
9
28
|
## Installation
|
|
10
29
|
|
|
@@ -18,75 +37,74 @@ Or install from GitHub:
|
|
|
18
37
|
pi install git:github.com/johnbitcn/pi-path-bar
|
|
19
38
|
```
|
|
20
39
|
|
|
21
|
-
In an existing Pi session, run `/reload`, then `/path-bar` to
|
|
40
|
+
In an existing Pi session, run `/reload`, then `/path-bar` to customize settings.
|
|
22
41
|
|
|
23
42
|
Load only one copy of the extension. Folder icons require a Nerd Font, or you can turn them off in settings.
|
|
24
43
|
|
|
25
44
|
## Settings
|
|
26
45
|
|
|
27
|
-
Run `/path-bar`. Use the arrow keys to
|
|
46
|
+
Run `/path-bar`. Use the arrow keys to choose an item, Enter or Space to change it, and Esc to close. Changes apply right away and save automatically. The menu uses English.
|
|
28
47
|
|
|
29
48
|
| Setting | Default | Choices |
|
|
30
49
|
| --- | --- | --- |
|
|
50
|
+
| Minimal mode | On | On, Off |
|
|
31
51
|
| Path display | Short | Short, Auto, Full, Native footer |
|
|
32
52
|
| Folder icon | On | On, Off |
|
|
33
53
|
| Git status | On | On, Off |
|
|
34
54
|
| Session name | On | On, Off |
|
|
35
55
|
| Time format | 24h | 24h, 12h (AM/PM) |
|
|
36
|
-
|
|
|
37
|
-
|
|
|
56
|
+
| Footer order | — | Reorder or hide right-side items and clock |
|
|
57
|
+
| Add folder alias | — | Name any folder for a shorter display |
|
|
58
|
+
| Manage folder aliases | — | Edit or remove aliases |
|
|
38
59
|
|
|
39
|
-
- **Short:** abbreviate
|
|
40
|
-
- **Auto:** show the full path when
|
|
41
|
-
- **Full:**
|
|
60
|
+
- **Short:** abbreviate parent folders and keep the current folder name full.
|
|
61
|
+
- **Auto:** show the full path when there is room; otherwise abbreviate it.
|
|
62
|
+
- **Full:** keep the full path and truncate only at the edge.
|
|
42
63
|
- **Native footer:** restore Pi's built-in footer without losing your settings.
|
|
43
64
|
|
|
44
|
-
|
|
65
|
+
When **Minimal mode** is off, `pi-path-bar` renders a compact multi-line footer with local time on the right:
|
|
45
66
|
|
|
46
|
-
|
|
67
|
+

|
|
47
68
|
|
|
48
|
-
|
|
69
|
+
### Reorder or hide items
|
|
49
70
|
|
|
50
|
-
|
|
71
|
+
Open **Footer order** in `/path-bar` to control what appears on the right side of the bar (including the clock and other extensions). Use `up` / `down` to select, `<` / `>` (or `,` / `.`) to move, and `Space` to show or hide.
|
|
51
72
|
|
|
52
|
-
|
|
73
|
+
Put what matters most on the left — narrow terminals keep leftmost items visible and fold the rest into `+N`.
|
|
53
74
|
|
|
54
|
-
|
|
55
|
-
- Use **Manage folder aliases** to edit or delete them. Leave a field blank to keep its value; Esc cancels.
|
|
56
|
-
- Aliases change only the display name. Deleting an alias does not delete the folder.
|
|
75
|
+
Extension authors: see [footer segments](https://github.com/johnbitcn/pi-path-bar/blob/main/docs/footer-segments.md).
|
|
57
76
|
|
|
58
|
-
##
|
|
77
|
+
## Folder aliases
|
|
59
78
|
|
|
60
|
-
|
|
79
|
+
Replace long paths with short names you recognize at a glance. Choose **Add folder alias** in `/path-bar`, enter a path (or leave blank for the current directory), and give it a name.
|
|
61
80
|
|
|
62
|
-
|
|
63
|
-
| --- | --- |
|
|
64
|
-
| `⇣N` / `⇡N` | N commits behind / ahead of upstream |
|
|
65
|
-
| `*N` | N stash entries |
|
|
66
|
-
| `~N` | N conflicted files |
|
|
67
|
-
| `+N` | N staged entries |
|
|
68
|
-
| `!N` | N unstaged entries |
|
|
69
|
-
| `?N` | N untracked entries |
|
|
81
|
+
For example, naming `~/CloudDrive/Projects/demo-app` **demo** shortens it and all subfolders:
|
|
70
82
|
|
|
71
|
-
|
|
83
|
+

|
|
72
84
|
|
|
73
|
-
|
|
85
|
+
- Aliases apply to the folder and its subfolders (the most specific match wins).
|
|
86
|
+
- Edit or remove aliases anytime in **Manage folder aliases** — your actual folders are never touched.
|
|
74
87
|
|
|
75
|
-
|
|
88
|
+
## Git status
|
|
76
89
|
|
|
77
|
-
|
|
78
|
-
- **A single `Esc`** or **`Alt+Esc`** again: restore the interface and keep your draft.
|
|
79
|
-
- You can also enter with **`/reading-mode`**.
|
|
90
|
+
See branch state and changes without running `git status`. Colors follow your active Pi theme (blue when clean, yellow with changes, red on conflicts or active Git operations) and hide outside a repository.
|
|
80
91
|
|
|
81
|
-
|
|
92
|
+

|
|
82
93
|
|
|
83
|
-
|
|
94
|
+
| Indicator | Meaning |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `⇣N` / `⇡N` | Behind / ahead of upstream |
|
|
97
|
+
| `*N` | Stash entries |
|
|
98
|
+
| `~N` | Conflicted files |
|
|
99
|
+
| `+N` | Staged changes |
|
|
100
|
+
| `!N` | Unstaged changes |
|
|
101
|
+
| `?N` | Untracked files |
|
|
84
102
|
|
|
85
103
|
## Notes
|
|
86
104
|
|
|
87
|
-
- Settings are shared across projects and saved
|
|
88
|
-
- Avoid enabling multiple footer-replacement extensions at
|
|
89
|
-
-
|
|
105
|
+
- Settings are shared across projects and saved in `~/.pi/agent/pi-path-bar.json`.
|
|
106
|
+
- Avoid enabling multiple footer-replacement extensions at the same time.
|
|
107
|
+
- When upgrading from the standalone reading-mode script, remove `-e ./src/reading-mode.ts` from your launch arguments.
|
|
90
108
|
|
|
91
109
|
## License
|
|
92
110
|
|
package/README.zh-CN.md
CHANGED
|
@@ -2,9 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 简体中文
|
|
4
4
|
|
|
5
|
-
Pi
|
|
5
|
+
专为小屏幕与窄分屏优化的 Pi 扩展。移除底栏占行、支持一键全屏阅读,把宝贵的终端空间还给对话,同时让你一眼看清路径、Git 状态、用量、模型与时间。
|
|
6
6
|
|
|
7
|
-

|
|
8
|
+
|
|
9
|
+
## 极简模式(Minimal mode)
|
|
10
|
+
|
|
11
|
+
默认开启。在笔记本小屏或分屏终端里,传统多行底栏既占高度,变窄时又容易折行错乱。极简模式直接解决这两个痛点:
|
|
12
|
+
|
|
13
|
+
- **零底栏占行**:隐藏底部状态行,把关键信息干净地嵌进输入框上下横线,留出更多对话阅读空间。
|
|
14
|
+
- **窄屏自动瘦身**:分屏变窄时自动精简父目录、Git 计数、模型名与上下文上限,放不下的右侧项自动折叠为 `+N`,绝不折行打乱排版。
|
|
15
|
+
- **运行不跳动**:开始与结束运行时,状态文字位置纹丝不动;遇到重试或压缩等提醒时自动浮现,结束后恢复清净。
|
|
16
|
+
- **扩展共存清爽**:常见用量与状态扩展会自动以紧凑样式留在上横线;其他扩展仅在有提示时临时出现一行,空闲时彻底隐藏。
|
|
17
|
+
- **随时切回**:在 `/path-bar` 中关闭 **Minimal mode**,即可随时恢复传统多行底栏或 Pi 原生底栏。
|
|
18
|
+
|
|
19
|
+
## 阅读模式(Reading mode)
|
|
20
|
+
|
|
21
|
+
小屏幕看长回复、长代码或工具输出时,底部的输入框会占掉一大块视野。按一次快捷键即可沉浸阅读:
|
|
22
|
+
|
|
23
|
+
- **`Alt+Esc`**(Mac:**`Option+Esc`**)或执行 **`/reading-mode`**:立即隐藏输入框与底栏,全屏自由滚动浏览对话和输出。
|
|
24
|
+
- **单按 `Esc`** 或再按一次 **`Alt+Esc`**:瞬间回到输入状态,没发出去的草稿完整保留。
|
|
25
|
+
|
|
26
|
+
需要 Pi 1.5 及以上版本的 fullscreen 模式。若快捷键无响应,可直接输入 `/reading-mode`;切换 TUI 模式后请执行 `/reload`。
|
|
8
27
|
|
|
9
28
|
## 安装
|
|
10
29
|
|
|
@@ -18,76 +37,75 @@ pi install npm:pi-path-bar
|
|
|
18
37
|
pi install git:github.com/johnbitcn/pi-path-bar
|
|
19
38
|
```
|
|
20
39
|
|
|
21
|
-
在已运行的 Pi 中执行 `/reload`,再输入 `/path-bar`
|
|
40
|
+
在已运行的 Pi 中执行 `/reload`,再输入 `/path-bar` 即可自定义设置。
|
|
22
41
|
|
|
23
|
-
|
|
42
|
+
请只加载一份扩展。目录图标需要 Nerd Font,也可在设置中关闭。
|
|
24
43
|
|
|
25
44
|
## 设置
|
|
26
45
|
|
|
27
|
-
执行 `/path-bar`。上下键选择,Enter
|
|
46
|
+
执行 `/path-bar`。上下键选择,Enter 或空格切换,Esc 退出。修改立即生效并自动保存。设置菜单使用英文。
|
|
28
47
|
|
|
29
|
-
| 设置项 | 默认值 |
|
|
48
|
+
| 设置项 | 默认值 | 说明 |
|
|
30
49
|
| --- | --- | --- |
|
|
50
|
+
| Minimal mode(极简模式) | On | 开启或关闭极简边框模式 |
|
|
31
51
|
| Path display(路径显示) | Short | Short、Auto、Full、Native footer |
|
|
32
|
-
| Folder icon(目录图标) | On |
|
|
33
|
-
| Git status(Git 状态) | On |
|
|
34
|
-
| Session name(会话名称) | On |
|
|
35
|
-
| Time format(时间格式) | 24h | 24h
|
|
36
|
-
|
|
|
37
|
-
|
|
|
52
|
+
| Folder icon(目录图标) | On | 显示或隐藏目录图标 |
|
|
53
|
+
| Git status(Git 状态) | On | 显示或隐藏 Git 状态 |
|
|
54
|
+
| Session name(会话名称) | On | 显示或隐藏会话名 |
|
|
55
|
+
| Time format(时间格式) | 24h | 24h 或 12h(AM/PM) |
|
|
56
|
+
| Footer order(右侧排序与隐藏) | — | 调整右侧项目顺序,或按空格隐藏任意项与时钟 |
|
|
57
|
+
| Add folder alias(添加目录别名) | — | 给常用目录起一个更短的显示名 |
|
|
58
|
+
| Manage folder aliases(管理目录别名) | — | 修改或删除已有别名 |
|
|
38
59
|
|
|
39
|
-
- **Short
|
|
40
|
-
- **Auto
|
|
41
|
-
- **Full
|
|
42
|
-
- **Native footer
|
|
60
|
+
- **Short**:缩写中间目录,保留当前目录全名。
|
|
61
|
+
- **Auto**:空间够时显示完整路径,不够时自动缩写。
|
|
62
|
+
- **Full**:保持完整路径,仅在超出宽度时截断。
|
|
63
|
+
- **Native footer**:恢复 Pi 原生底栏,保留已有设置。
|
|
43
64
|
|
|
44
|
-
|
|
65
|
+
关闭 **Minimal mode** 后,会恢复为紧凑的多行底栏:
|
|
45
66
|
|
|
46
|
-
|
|
67
|
+

|
|
47
68
|
|
|
48
|
-
|
|
69
|
+
### 调整顺序或隐藏项目
|
|
49
70
|
|
|
50
|
-
|
|
71
|
+
在 `/path-bar` 中进入 **Footer order**,即可自由调整右侧显示内容(包括时钟及其他扩展):上下键选中,`<` / `>`(或 `,` / `.`)左右移动,`Space` 切换显示或隐藏。
|
|
51
72
|
|
|
52
|
-
|
|
73
|
+
把最关心的项目移到左边——分屏变窄时会优先保留左侧项目,其余折叠为 `+N`。
|
|
53
74
|
|
|
54
|
-
-
|
|
55
|
-
- 在 **Manage folder aliases** 中修改或删除。修改时留空表示保留原值,Esc 取消。
|
|
56
|
-
- 别名只改变显示名称。删除别名不会删除文件夹。
|
|
75
|
+
扩展作者请参考[底栏片段文档](https://github.com/johnbitcn/pi-path-bar/blob/main/docs/footer-segments.md)。
|
|
57
76
|
|
|
58
|
-
##
|
|
77
|
+
## 目录别名
|
|
59
78
|
|
|
60
|
-
|
|
79
|
+
给深层目录起一个顺眼的短名字,小屏下辨识更轻松。在 `/path-bar` 中选择 **Add folder alias**,输入目录路径(留空即当前目录)和名称即可。
|
|
61
80
|
|
|
62
|
-
|
|
63
|
-
| --- | --- |
|
|
64
|
-
| `⇣N` / `⇡N` | 落后 / 领先上游 N 个提交 |
|
|
65
|
-
| `*N` | N 条 stash |
|
|
66
|
-
| `~N` | N 个冲突文件 |
|
|
67
|
-
| `+N` | N 个已暂存条目 |
|
|
68
|
-
| `!N` | N 个未暂存条目 |
|
|
69
|
-
| `?N` | N 个未跟踪条目 |
|
|
81
|
+
例如,把 `~/CloudDrive/Projects/demo-app` 命名为 **demo**:
|
|
70
82
|
|
|
71
|
-
|
|
83
|
+

|
|
72
84
|
|
|
73
|
-
|
|
85
|
+
- 别名对该目录及所有子目录生效(多层匹配时优先最具体的路径)。
|
|
86
|
+
- 随时可在 **Manage folder aliases** 中修改或删除,不会影响真实文件夹。
|
|
74
87
|
|
|
75
|
-
|
|
88
|
+
## Git 状态
|
|
76
89
|
|
|
77
|
-
|
|
78
|
-
- **单次 `Esc`** 或再次 **`Alt+Esc`**:恢复界面,输入草稿保留。
|
|
79
|
-
- 也可执行 **`/reading-mode`** 进入。
|
|
90
|
+
不用切出去敲 `git status`,一眼看清分支与改动。颜色自动跟随当前 Pi 主题(默认蓝色表示干净,黄色表示有变更,红色表示冲突或正在进行 Git 操作),不在仓库内时自动隐藏。
|
|
80
91
|
|
|
81
|
-
|
|
92
|
+

|
|
82
93
|
|
|
83
|
-
|
|
94
|
+
| 标记 | 含义 |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `⇣N` / `⇡N` | 落后 / 领先上游提交数 |
|
|
97
|
+
| `*N` | Stash 数量 |
|
|
98
|
+
| `~N` | 冲突文件数 |
|
|
99
|
+
| `+N` | 已暂存更改 |
|
|
100
|
+
| `!N` | 未暂存更改 |
|
|
101
|
+
| `?N` | 未跟踪文件 |
|
|
84
102
|
|
|
85
103
|
## 注意事项
|
|
86
104
|
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
105
|
+
- 设置跨项目共享,自动保存在 `~/.pi/agent/pi-path-bar.json`。
|
|
106
|
+
- 请避免同时启用多个修改底栏的扩展,以免互相覆盖。
|
|
107
|
+
- 从独立版阅读模式升级时,请移除启动参数中的 `-e ./src/reading-mode.ts`。
|
|
90
108
|
|
|
91
109
|
## 许可证
|
|
92
110
|
|
|
93
|
-
[MIT](LICENSE)
|
|
111
|
+
[MIT](LICENSE)。相关项目版权与许可见[第三方声明](THIRD_PARTY_NOTICES.md)。本项目是非官方扩展,与 Pi 或 Tide 无隶属或背书关系。
|
|
Binary file
|