pi-powerline-footer 0.2.8 → 0.2.9

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/index.ts +34 -1
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.9] - 2026-01-17
4
+
5
+ ### Fixed
6
+ - Welcome overlay/header now dismisses when agent starts streaming (fixes `p "command"` case where welcome would briefly flash)
7
+ - Race condition where dismissal request could be lost due to 100ms setup delay in overlay
8
+
3
9
  ## [0.2.8] - 2026-01-16
4
10
 
5
11
  ### Changed
package/index.ts CHANGED
@@ -89,6 +89,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
89
89
  let tuiRef: any = null; // Store TUI reference for forcing re-renders
90
90
  let dismissWelcomeOverlay: (() => void) | null = null; // Callback to dismiss welcome overlay
91
91
  let welcomeHeaderActive = false; // Track if welcome header should be cleared on first input
92
+ let welcomeOverlayShouldDismiss = false; // Track early dismissal request (before overlay setup completes)
92
93
 
93
94
  // Track session start
94
95
  pi.on("session_start", async (_event, ctx) => {
@@ -154,8 +155,20 @@ export default function powerlineFooter(pi: ExtensionAPI) {
154
155
  });
155
156
 
156
157
  // Track streaming state (footer only shows status during streaming)
157
- pi.on("stream_start", async () => {
158
+ // Also dismiss welcome when agent starts responding (handles `p "command"` case)
159
+ pi.on("stream_start", async (_event, ctx) => {
158
160
  isStreaming = true;
161
+ if (dismissWelcomeOverlay) {
162
+ dismissWelcomeOverlay();
163
+ dismissWelcomeOverlay = null;
164
+ } else {
165
+ // Overlay not set up yet (100ms delay) - mark for immediate dismissal when it does
166
+ welcomeOverlayShouldDismiss = true;
167
+ }
168
+ if (welcomeHeaderActive) {
169
+ welcomeHeaderActive = false;
170
+ ctx.ui.setHeader(undefined);
171
+ }
159
172
  });
160
173
 
161
174
  pi.on("stream_end", async () => {
@@ -167,6 +180,9 @@ export default function powerlineFooter(pi: ExtensionAPI) {
167
180
  if (dismissWelcomeOverlay) {
168
181
  dismissWelcomeOverlay();
169
182
  dismissWelcomeOverlay = null;
183
+ } else {
184
+ // Overlay not set up yet (100ms delay) - mark for immediate dismissal when it does
185
+ welcomeOverlayShouldDismiss = true;
170
186
  }
171
187
  if (welcomeHeaderActive) {
172
188
  welcomeHeaderActive = false;
@@ -293,6 +309,9 @@ export default function powerlineFooter(pi: ExtensionAPI) {
293
309
  const dismiss = dismissWelcomeOverlay;
294
310
  dismissWelcomeOverlay = null;
295
311
  setTimeout(dismiss, 0);
312
+ } else {
313
+ // Overlay not set up yet (100ms delay) - mark for immediate dismissal when it does
314
+ welcomeOverlayShouldDismiss = true;
296
315
  }
297
316
  if (welcomeHeaderActive) {
298
317
  welcomeHeaderActive = false;
@@ -491,6 +510,13 @@ export default function powerlineFooter(pi: ExtensionAPI) {
491
510
 
492
511
  // Small delay to let pi-mono finish initialization
493
512
  setTimeout(() => {
513
+ // Skip overlay entirely if dismissal was requested during the delay
514
+ // (e.g., `p "command"` triggers stream_start before this runs)
515
+ if (welcomeOverlayShouldDismiss) {
516
+ welcomeOverlayShouldDismiss = false;
517
+ return;
518
+ }
519
+
494
520
  ctx.ui.custom(
495
521
  (tui: any, _theme: any, _keybindings: any, done: (result: void) => void) => {
496
522
  const welcome = new WelcomeComponent(
@@ -514,6 +540,13 @@ export default function powerlineFooter(pi: ExtensionAPI) {
514
540
  // Store dismiss callback so user_message/keypress can trigger it
515
541
  dismissWelcomeOverlay = dismiss;
516
542
 
543
+ // Double-check: dismissal might have been requested between the outer check
544
+ // and this callback running
545
+ if (welcomeOverlayShouldDismiss) {
546
+ welcomeOverlayShouldDismiss = false;
547
+ dismiss();
548
+ }
549
+
517
550
  const interval = setInterval(() => {
518
551
  if (dismissed) return;
519
552
  countdown--;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-powerline-footer",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Powerline-style status bar extension for pi coding agent",
5
5
  "type": "module",
6
6
  "bin": {