pi-minimal-footer 0.5.2 → 0.5.3
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 -1
- package/README.md +2 -0
- package/VISION.md +1 -1
- package/extensions/index.ts +21 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.5.3] - 2026-10-07
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Refresh local Git divergence while Pi is idle every 91 seconds by default, configurable through `minFooter.gitRefreshSeconds`; stop polling when the footer is disposed and never fetch remote refs
|
|
15
|
+
|
|
10
16
|
## [0.5.2] - 2026-10-07
|
|
11
17
|
|
|
12
18
|
### Added
|
|
@@ -210,7 +216,8 @@ First npm-ready release.
|
|
|
210
216
|
|
|
211
217
|
- Project scaffold — `extensions/index.ts` with basic footer structure, `package.json` with pi extension manifest, `README.md`, `LICENSE` (MIT)
|
|
212
218
|
|
|
213
|
-
[Unreleased]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.5.
|
|
219
|
+
[Unreleased]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.5.3...HEAD
|
|
220
|
+
[0.5.3]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.5.2...v0.5.3
|
|
214
221
|
[0.5.2]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.5.1...v0.5.2
|
|
215
222
|
[0.5.1]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.5.0...v0.5.1
|
|
216
223
|
[0.5.0]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.4.2...v0.5.0
|
package/README.md
CHANGED
|
@@ -62,6 +62,7 @@ Edit `minFooter` in Pi's agent `settings.json` (normally `~/.pi/agent/settings.j
|
|
|
62
62
|
"showModel": true,
|
|
63
63
|
"showContext": true,
|
|
64
64
|
"powerlineSeparator": true,
|
|
65
|
+
"gitRefreshSeconds": 91,
|
|
65
66
|
"maxUsageBarCells": 10
|
|
66
67
|
}
|
|
67
68
|
}
|
|
@@ -69,6 +70,7 @@ Edit `minFooter` in Pi's agent `settings.json` (normally `~/.pi/agent/settings.j
|
|
|
69
70
|
|
|
70
71
|
- `showSkills` shows **extension status text**, not installed skills. The footer does not add the example statuses itself.
|
|
71
72
|
- Set `powerlineSeparator` to `false` for plain spaces instead of `` / `` if your font lacks those glyphs. The git icon `` and sync arrows also need compatible glyphs; hide Git data with `showGitBranch: false` if needed.
|
|
73
|
+
- `gitRefreshSeconds`: local Git refresh interval; positive integer seconds; default/fallback `91`; no remote fetch.
|
|
72
74
|
- `maxUsageBarCells` caps the Braille bar length (excluding brackets and reset time). Use a positive integer, e.g. `4` for a compact bar; invalid values fall back to `10`.
|
|
73
75
|
|
|
74
76
|
## Reading the footer
|
package/VISION.md
CHANGED
|
@@ -40,7 +40,7 @@ The bar and reset label have no intervening space. Reset formatting uses local c
|
|
|
40
40
|
|
|
41
41
|
- Pi supplies the branch name. Query `git rev-list --left-right --count HEAD...@{upstream}` for `↑N` local-only and `↓N` upstream-only commits. Use local refs; never fetch automatically.
|
|
42
42
|
- Query outside rendering with a one-second timeout so Git cannot block the TUI. Missing upstreams and command failures omit counts.
|
|
43
|
-
- Refresh on branch-change signals and footer state updates. Ignore older query results to prevent stale counts from restarting highlights.
|
|
43
|
+
- Refresh on branch-change signals and footer state updates, plus every 91 seconds while the footer is active so external commits are noticed even when Pi is idle. `minFooter.gitRefreshSeconds` accepts positive integer seconds; invalid values fall back to 91. Local-only queries permit a shorter interval than subscription usage polling without network traffic. Stop the timer on footer disposal. Ignore older query results to prevent stale counts from restarting highlights.
|
|
44
44
|
- Use the theme's normal text foreground while unsynced, otherwise dim. A count change bolds the arrows/counts until two subsequent user submissions; further changes restart the window. Tool turns and extension prompts do not consume it.
|
|
45
45
|
- Initial loading and working-directory changes establish an unhighlighted baseline. Zero counts hide the arrows entirely.
|
|
46
46
|
|
package/extensions/index.ts
CHANGED
|
@@ -32,6 +32,7 @@ interface Settings {
|
|
|
32
32
|
showModel?: boolean;
|
|
33
33
|
showContext?: boolean;
|
|
34
34
|
powerlineSeparator?: boolean;
|
|
35
|
+
gitRefreshSeconds?: number;
|
|
35
36
|
maxUsageBarCells?: number;
|
|
36
37
|
};
|
|
37
38
|
}
|
|
@@ -48,6 +49,7 @@ const DEFAULT_SETTINGS: FooterSettings = {
|
|
|
48
49
|
showModel: true,
|
|
49
50
|
showContext: true,
|
|
50
51
|
powerlineSeparator: true,
|
|
52
|
+
gitRefreshSeconds: 91,
|
|
51
53
|
maxUsageBarCells: MAX_BAR_CELLS,
|
|
52
54
|
};
|
|
53
55
|
|
|
@@ -81,6 +83,9 @@ function writeSettings(patch: Partial<Settings>): void {
|
|
|
81
83
|
function readConfig(): FooterSettings {
|
|
82
84
|
const s = readSettings();
|
|
83
85
|
const config = { ...DEFAULT_SETTINGS, ...s.minFooter };
|
|
86
|
+
if (typeof config.gitRefreshSeconds !== "number" || !Number.isSafeInteger(config.gitRefreshSeconds) || config.gitRefreshSeconds < 1) {
|
|
87
|
+
config.gitRefreshSeconds = 91;
|
|
88
|
+
}
|
|
84
89
|
if (typeof config.maxUsageBarCells !== "number" || !Number.isSafeInteger(config.maxUsageBarCells) || config.maxUsageBarCells < 1) {
|
|
85
90
|
config.maxUsageBarCells = MAX_BAR_CELLS;
|
|
86
91
|
}
|
|
@@ -282,10 +287,26 @@ export default function (pi: ExtensionAPI) {
|
|
|
282
287
|
const request = () => tui.requestRender();
|
|
283
288
|
requestRender = request;
|
|
284
289
|
let disposed = false;
|
|
290
|
+
// External commits need to become visible even when Pi is idle. Local-only
|
|
291
|
+
// queries allow a shorter interval than usage polling without network traffic.
|
|
292
|
+
const gitRefreshMs = (config.gitRefreshSeconds ?? 91) * 1000;
|
|
293
|
+
let gitTimer: ReturnType<typeof setTimeout> | null = null;
|
|
294
|
+
const scheduleGitRefresh = () => {
|
|
295
|
+
if (disposed) return;
|
|
296
|
+
gitTimer = setTimeout(() => {
|
|
297
|
+
gitTimer = null;
|
|
298
|
+
void updateGitSync(state).then(() => tui.requestRender()).finally(scheduleGitRefresh);
|
|
299
|
+
}, gitRefreshMs);
|
|
300
|
+
// Do not keep a non-interactive process alive solely for footer refresh.
|
|
301
|
+
gitTimer.unref?.();
|
|
302
|
+
};
|
|
303
|
+
scheduleGitRefresh();
|
|
285
304
|
const dispose = () => {
|
|
286
305
|
if (disposed) return;
|
|
287
306
|
disposed = true;
|
|
288
307
|
unsub();
|
|
308
|
+
if (gitTimer) clearTimeout(gitTimer);
|
|
309
|
+
gitTimer = null;
|
|
289
310
|
// A superseded renderer must not stop its replacement's usage polling.
|
|
290
311
|
if (requestRender === request) {
|
|
291
312
|
requestRender = null;
|
package/package.json
CHANGED