pi-powerline-footer 0.2.13 → 0.2.16
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 +20 -0
- package/README.md +2 -2
- package/index.ts +37 -4
- package/package.json +1 -1
- package/segments.ts +6 -3
- package/theme.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.2.16] - 2026-01-28
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **Model and path colors restored** — Fixed color regression from v0.2.13 theme refactor:
|
|
9
|
+
- Model segment now uses original pink (`#d787af`) instead of white/gray (`text`)
|
|
10
|
+
- Path segment now uses original cyan (`#00afaf`) instead of muted gray
|
|
11
|
+
|
|
12
|
+
## [0.2.15] - 2026-01-27
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- **Status notifications above editor** — Extension status messages that look like notifications (e.g., `[pi-annotate] Received: CANCEL`) now appear on a separate line above the editor input
|
|
16
|
+
- Notification-style statuses (starting with `[`) appear above editor
|
|
17
|
+
- Compact statuses (e.g., `MCP: 6 servers`) remain in the powerline bar
|
|
18
|
+
|
|
19
|
+
## [0.2.14] - 2026-01-26
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- **Theme type mismatch crash** — Fixed `TypeError: theme.fg is not a function` caused by passing `EditorTheme` (from pi-tui) instead of `Theme` (from pi-coding-agent) to segment rendering
|
|
23
|
+
- **Invalid theme color** — Changed `"primary"` to `"text"` in default colors since `"primary"` is not a valid `ThemeColor`
|
|
24
|
+
|
|
5
25
|
## [0.2.13] - 2026-01-27
|
|
6
26
|
|
|
7
27
|
### Added
|
package/README.md
CHANGED
|
@@ -23,10 +23,10 @@ A powerline-style status bar and welcome header extension for [pi](https://githu
|
|
|
23
23
|
## Installation
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
|
|
26
|
+
pi install npm:pi-powerline-footer
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Restart pi to activate.
|
|
30
30
|
|
|
31
31
|
## Usage
|
|
32
32
|
|
package/index.ts
CHANGED
|
@@ -301,6 +301,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
301
301
|
ctx.ui.setFooter(undefined);
|
|
302
302
|
ctx.ui.setHeader(undefined);
|
|
303
303
|
ctx.ui.setWidget("powerline-secondary", undefined);
|
|
304
|
+
ctx.ui.setWidget("powerline-status", undefined);
|
|
304
305
|
footerDataRef = null;
|
|
305
306
|
tuiRef = null;
|
|
306
307
|
// Clear layout cache
|
|
@@ -420,9 +421,9 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
420
421
|
function setupCustomEditor(ctx: any) {
|
|
421
422
|
// Import CustomEditor dynamically and create wrapper
|
|
422
423
|
import("@mariozechner/pi-coding-agent").then(({ CustomEditor }) => {
|
|
423
|
-
ctx.ui.setEditorComponent((tui: any,
|
|
424
|
+
ctx.ui.setEditorComponent((tui: any, editorTheme: any, keybindings: any) => {
|
|
424
425
|
// Create custom editor that overrides render for status in top border
|
|
425
|
-
const editor = new CustomEditor(tui,
|
|
426
|
+
const editor = new CustomEditor(tui, editorTheme, keybindings);
|
|
426
427
|
|
|
427
428
|
// Override handleInput to dismiss welcome on first keypress
|
|
428
429
|
const originalHandleInput = editor.handleInput.bind(editor);
|
|
@@ -477,7 +478,8 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
477
478
|
|
|
478
479
|
// Top border: ╭─ status ────────────╮
|
|
479
480
|
// Use responsive layout - overflow goes to secondary row
|
|
480
|
-
|
|
481
|
+
// Note: ctx.ui.theme is the pi Theme with fg(), editorTheme is the pi-tui EditorTheme for styling
|
|
482
|
+
const layout = getResponsiveLayout(width, ctx.ui.theme);
|
|
481
483
|
const statusContent = layout.topContent;
|
|
482
484
|
const statusWidth = visibleWidth(statusContent);
|
|
483
485
|
const topFillWidth = width - 4; // Reserve 4 for corners (╭─ and ─╮)
|
|
@@ -577,7 +579,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
577
579
|
|
|
578
580
|
// Set up secondary row as a widget below editor (above sub bar)
|
|
579
581
|
// Shows overflow segments when top bar is too narrow
|
|
580
|
-
ctx.ui.setWidget("powerline-secondary", (
|
|
582
|
+
ctx.ui.setWidget("powerline-secondary", (_tui: any, theme: Theme) => {
|
|
581
583
|
return {
|
|
582
584
|
dispose() {},
|
|
583
585
|
invalidate() {},
|
|
@@ -600,6 +602,37 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
600
602
|
},
|
|
601
603
|
};
|
|
602
604
|
}, { placement: "belowEditor" });
|
|
605
|
+
|
|
606
|
+
// Set up status notifications widget above editor
|
|
607
|
+
// Shows extension status messages that look like notifications (e.g., "[pi-annotate] Received: CANCEL")
|
|
608
|
+
// Compact statuses (e.g., "MCP: 6 servers") stay in the powerline bar via extension_statuses segment
|
|
609
|
+
ctx.ui.setWidget("powerline-status", () => {
|
|
610
|
+
return {
|
|
611
|
+
dispose() {},
|
|
612
|
+
invalidate() {},
|
|
613
|
+
render(width: number): string[] {
|
|
614
|
+
if (!currentCtx || !footerDataRef) return [];
|
|
615
|
+
|
|
616
|
+
const statuses = footerDataRef.getExtensionStatuses();
|
|
617
|
+
if (!statuses || statuses.size === 0) return [];
|
|
618
|
+
|
|
619
|
+
// Collect notification-style statuses (those starting with "[extensionName]")
|
|
620
|
+
const notifications: string[] = [];
|
|
621
|
+
for (const value of statuses.values()) {
|
|
622
|
+
if (value && value.trimStart().startsWith('[')) {
|
|
623
|
+
// Account for leading space when checking width
|
|
624
|
+
const lineContent = ` ${value}`;
|
|
625
|
+
const contentWidth = visibleWidth(lineContent);
|
|
626
|
+
if (contentWidth <= width) {
|
|
627
|
+
notifications.push(lineContent);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
return notifications;
|
|
633
|
+
},
|
|
634
|
+
};
|
|
635
|
+
}, { placement: "aboveEditor" });
|
|
603
636
|
});
|
|
604
637
|
}
|
|
605
638
|
|
package/package.json
CHANGED
package/segments.ts
CHANGED
|
@@ -389,10 +389,13 @@ const extensionStatusesSegment: StatusLineSegment = {
|
|
|
389
389
|
const statuses = ctx.extensionStatuses;
|
|
390
390
|
if (!statuses || statuses.size === 0) return { content: "", visible: false };
|
|
391
391
|
|
|
392
|
-
// Join
|
|
392
|
+
// Join compact statuses with a separator
|
|
393
|
+
// Notification-style statuses (starting with "[") are shown above the editor instead
|
|
393
394
|
const parts: string[] = [];
|
|
394
|
-
for (const
|
|
395
|
-
if (value
|
|
395
|
+
for (const value of statuses.values()) {
|
|
396
|
+
if (value && !value.trimStart().startsWith('[')) {
|
|
397
|
+
parts.push(value);
|
|
398
|
+
}
|
|
396
399
|
}
|
|
397
400
|
|
|
398
401
|
if (parts.length === 0) return { content: "", visible: false };
|
package/theme.ts
CHANGED
|
@@ -16,8 +16,8 @@ import type { ColorScheme, ColorValue, SemanticColor } from "./types.js";
|
|
|
16
16
|
// Default color scheme (uses pi theme colors)
|
|
17
17
|
const DEFAULT_COLORS: Required<ColorScheme> = {
|
|
18
18
|
pi: "accent",
|
|
19
|
-
model: "
|
|
20
|
-
path: "
|
|
19
|
+
model: "#d787af", // Pink/mauve (matching original colors.ts)
|
|
20
|
+
path: "#00afaf", // Teal/cyan (matching original colors.ts)
|
|
21
21
|
git: "success",
|
|
22
22
|
gitDirty: "warning",
|
|
23
23
|
gitClean: "success",
|
|
@@ -26,7 +26,7 @@ const DEFAULT_COLORS: Required<ColorScheme> = {
|
|
|
26
26
|
context: "dim",
|
|
27
27
|
contextWarn: "warning",
|
|
28
28
|
contextError: "error",
|
|
29
|
-
cost: "
|
|
29
|
+
cost: "text",
|
|
30
30
|
tokens: "muted",
|
|
31
31
|
separator: "dim",
|
|
32
32
|
border: "borderMuted",
|