pi-minimal-footer 0.1.0 → 0.1.2

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 CHANGED
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.2] - 2026-09-01
11
+
12
+ ### Changed
13
+
14
+ - Updated the Node.js engine declaration to match current Pi releases (`>=22.19.0`)
15
+ - README polish: remove internal API jargon, fix `e.g.,` comma, tighten config section
16
+
17
+ ### Fixed
18
+
19
+ - Keep merged footer settings non-optional so the extension passes strict TypeScript checks
20
+ - Footer no longer overflows on narrow terminal windows — truncate the path (then the right side) to fit the terminal width using pi-tui's `truncateToWidth`, instead of emitting a line wider than the terminal (which crashed pi)
21
+
22
+ ## [0.1.1] - 2026-06-15
23
+
24
+ ### Added
25
+
26
+ - Preview screenshot (`preview.png`) and `pi.image` gallery metadata for pi.dev/packages
27
+ - README badges: npm version, downloads, and license
28
+ - Screenshot preview rendered directly in README
29
+
30
+ ### Changed
31
+
32
+ - Model and context usage rendered in **bold** for better at-a-glance scanning
33
+ - README tagline tightened to "A clean, compact one-line footer for pi."
34
+
35
+ ### Fixed
36
+
37
+ - Skills segment no longer shows trailing `|` separator when one skill has an empty status value
38
+
10
39
  ## [0.1.0] - 2026-06-15
11
40
 
12
41
  First npm-ready release.
@@ -36,6 +65,8 @@ First npm-ready release.
36
65
 
37
66
  - Project scaffold — `extensions/index.ts` with basic footer structure, `package.json` with pi extension manifest, `README.md`, `LICENSE` (MIT)
38
67
 
39
- [Unreleased]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.1.0...HEAD
68
+ [Unreleased]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.1.2...HEAD
69
+ [0.1.2]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.1.1...v0.1.2
70
+ [0.1.1]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.1.0...v0.1.1
40
71
  [0.1.0]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.0.0...v0.1.0
41
72
  [0.0.0]: https://github.com/Ryu-CZ/pi-minimal-footer/releases/tag/v0.0.0
package/README.md CHANGED
@@ -1,13 +1,32 @@
1
1
  # pi-minimal-footer
2
2
 
3
- A minimal footer extension for [pi](https://github.com/earendil-works/pi-coding-agent) that replaces the default footer with a clean, compact status line:
3
+ <p>
4
+ <a href="https://www.npmjs.com/package/pi-minimal-footer">
5
+ <img src="https://img.shields.io/npm/v/pi-minimal-footer" alt="npm version">
6
+ </a>
7
+ <a href="https://www.npmjs.com/package/pi-minimal-footer">
8
+ <img src="https://img.shields.io/npm/dt/pi-minimal-footer" alt="npm downloads">
9
+ </a>
10
+ <a href="LICENSE">
11
+ <img src="https://img.shields.io/npm/l/pi-minimal-footer" alt="license">
12
+ </a>
13
+ <a href="https://pi.dev/packages/pi-minimal-footer">
14
+ <img src="https://img.shields.io/badge/pi-package-1a1a2e" alt="pi package">
15
+ </a>
16
+ </p>
17
+
18
+ A clean, compact one-line footer for [Pi](https://github.com/earendil-works/pi).
4
19
 
5
20
  ```
6
21
  ~/path/to/dir (skill1 | skill2)  main sonnet 12/128k
7
22
  ```
8
23
 
24
+ ![pi-minimal-footer screenshot](media/github-preview.png)
25
+
9
26
  ## Install
10
27
 
28
+ Available on the [Pi package gallery](https://pi.dev/packages/pi-minimal-footer).
29
+
11
30
  ```bash
12
31
  # From npm (recommended)
13
32
  pi install npm:pi-minimal-footer
@@ -25,10 +44,10 @@ ln -s "$PWD/extensions" ~/.pi/agent/extensions/minimal-footer
25
44
  ## Features
26
45
 
27
46
  - **Working directory** — relative path from home (`~/...`)
28
- - **Active skills** — extension statuses from `ctx.ui.setStatus()`
47
+ - **Active skills** — extensions reporting their current status
29
48
  - **Git branch** — current branch name
30
49
  - **Model** — active model ID
31
- - **Context usage** — tokens used / context window (e.g. `12/128k`)
50
+ - **Context usage** — tokens used / context window (e.g., `12/128k`)
32
51
 
33
52
  ## Commands
34
53
 
@@ -38,11 +57,11 @@ ln -s "$PWD/extensions" ~/.pi/agent/extensions/minimal-footer
38
57
  | `/minfooter on` | Enable |
39
58
  | `/minfooter off` | Disable |
40
59
 
41
- > The `/minfooter` command only controls the `enabled` setting. To tweak individual segments (path, model, etc.), edit `~/.pi/agent/settings.json` directly.
60
+ > The `/minfooter` command only toggles the `enabled` flag. To show or hide individual segments, edit `~/.pi/agent/settings.json` directly.
42
61
 
43
62
  ## Configuration
44
63
 
45
- Settings are persisted in `~/.pi/agent/settings.json` under the `minFooter` key:
64
+ Settings live in `~/.pi/agent/settings.json` under the `minFooter` key:
46
65
 
47
66
  ```json
48
67
  {
@@ -56,5 +75,3 @@ Settings are persisted in `~/.pi/agent/settings.json` under the `minFooter` key:
56
75
  }
57
76
  }
58
77
  ```
59
-
60
- Edit the file directly to show or hide individual segments. The `/minfooter` command is a shortcut that toggles only the `enabled` flag.
@@ -11,7 +11,7 @@
11
11
  */
12
12
 
13
13
  import type { ExtensionAPI, ExtensionContext, ReadonlyFooterDataProvider } from "@earendil-works/pi-coding-agent";
14
- import { visibleWidth } from "@earendil-works/pi-tui";
14
+ import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
15
15
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "node:fs";
16
16
  import { join, dirname } from "node:path";
17
17
  import { homedir } from "node:os";
@@ -29,7 +29,9 @@ interface Settings {
29
29
  };
30
30
  }
31
31
 
32
- const DEFAULT_SETTINGS: Settings["minFooter"] = {
32
+ type FooterSettings = NonNullable<Settings["minFooter"]>;
33
+
34
+ const DEFAULT_SETTINGS: FooterSettings = {
33
35
  enabled: true,
34
36
  showGitBranch: true,
35
37
  showSkills: true,
@@ -67,7 +69,7 @@ function readEnabled(): boolean {
67
69
  return s.minFooter?.enabled !== false; // default to true
68
70
  }
69
71
 
70
- function readConfig(): Settings["minFooter"] {
72
+ function readConfig(): FooterSettings {
71
73
  const s = readSettings();
72
74
  return { ...DEFAULT_SETTINGS, ...s.minFooter };
73
75
  }
@@ -130,13 +132,14 @@ function buildLeft(): string {
130
132
  return state.cwd;
131
133
  }
132
134
 
133
- function buildRight(footerData: ReadonlyFooterDataProvider): string {
135
+ function buildRight(footerData: ReadonlyFooterDataProvider, bold: (s: string) => string): string {
134
136
  const segments: string[] = [];
135
137
 
136
138
  if (config.showSkills) {
137
139
  const statuses = footerData.getExtensionStatuses();
138
- if (statuses.size > 0) {
139
- segments.push("(" + [...statuses.values()].join(" | ") + ")");
140
+ const skillNames = [...statuses.values()].filter(s => s.trim());
141
+ if (skillNames.length > 0) {
142
+ segments.push("(" + skillNames.join(" | ") + ")");
140
143
  }
141
144
  }
142
145
 
@@ -146,11 +149,11 @@ function buildRight(footerData: ReadonlyFooterDataProvider): string {
146
149
  }
147
150
 
148
151
  if (config.showModel) {
149
- segments.push(state.model);
152
+ segments.push(bold(state.model));
150
153
  }
151
154
 
152
155
  if (config.showContext) {
153
- segments.push(state.context);
156
+ segments.push(bold(state.context));
154
157
  }
155
158
 
156
159
  return segments.join(" ");
@@ -174,13 +177,18 @@ export default function (pi: ExtensionAPI) {
174
177
  return {
175
178
  render(width: number): string[] {
176
179
  const left = buildLeft();
177
- const right = buildRight(footerData);
178
- const leftW = visibleWidth(left);
180
+ const right = buildRight(footerData, (s) => theme.bold(s));
179
181
  const rightW = visibleWidth(right);
180
- const gap = Math.max(1, width - leftW - rightW);
181
- const spacer = " ".repeat(gap);
182
- const line = theme.fg("dim", `${left}${spacer}${right}`);
183
- return [line];
182
+
183
+ // If the right side (model + context) alone doesn't fit, drop the path and truncate it.
184
+ if (rightW >= width) {
185
+ return [theme.fg("dim", truncateToWidth(right, width, ""))];
186
+ }
187
+
188
+ // Otherwise keep the right side intact and fit the path into the remaining
189
+ // space (padded to exactly fill it, keeping the right side right-aligned).
190
+ const leftPart = truncateToWidth(left, width - rightW - 1, "...", true);
191
+ return [theme.fg("dim", `${leftPart} ${right}`)];
184
192
  },
185
193
  invalidate(): void {},
186
194
  dispose: unsub,
Binary file
Binary file
package/package.json CHANGED
@@ -1,8 +1,14 @@
1
1
  {
2
2
  "name": "pi-minimal-footer",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "A minimal footer extension for pi — clean status line with path, skills, model, and context usage.",
5
- "keywords": ["pi-package", "pi-extension", "pi", "footer", "minimal"],
5
+ "keywords": [
6
+ "pi-package",
7
+ "pi-extension",
8
+ "pi",
9
+ "footer",
10
+ "minimal"
11
+ ],
6
12
  "homepage": "https://github.com/Ryu-CZ/pi-minimal-footer#readme",
7
13
  "bugs": {
8
14
  "url": "https://github.com/Ryu-CZ/pi-minimal-footer/issues"
@@ -14,10 +20,11 @@
14
20
  "extensions/",
15
21
  "LICENSE",
16
22
  "README.md",
17
- "package.json"
23
+ "package.json",
24
+ "media/"
18
25
  ],
19
26
  "engines": {
20
- "node": ">=18"
27
+ "node": ">=22.19.0"
21
28
  },
22
29
  "repository": {
23
30
  "type": "git",
@@ -28,6 +35,9 @@
28
35
  "@earendil-works/pi-tui": "*"
29
36
  },
30
37
  "pi": {
31
- "extensions": ["./extensions"]
38
+ "extensions": [
39
+ "./extensions"
40
+ ],
41
+ "image": "https://raw.githubusercontent.com/Ryu-CZ/pi-minimal-footer/main/media/preview.png"
32
42
  }
33
43
  }