feat(coding-agent): add configurable working indicator closes #3413
This commit is contained in:
@@ -735,6 +735,31 @@ ctx.ui.setStatus("my-ext", undefined);
|
||||
|
||||
**Examples:** [status-line.ts](../examples/extensions/status-line.ts), [plan-mode.ts](../examples/extensions/plan-mode.ts), [preset.ts](../examples/extensions/preset.ts)
|
||||
|
||||
### Pattern 4b: Working Indicator Customization
|
||||
|
||||
Customize the inline working indicator shown while pi is streaming a response.
|
||||
|
||||
```typescript
|
||||
// Static indicator
|
||||
ctx.ui.setWorkingIndicator({ frames: ["●"] });
|
||||
|
||||
// Custom animated indicator
|
||||
ctx.ui.setWorkingIndicator({
|
||||
frames: ["·", "•", "●", "•"],
|
||||
intervalMs: 120,
|
||||
});
|
||||
|
||||
// Hide the indicator entirely
|
||||
ctx.ui.setWorkingIndicator({ frames: [] });
|
||||
|
||||
// Restore pi's default spinner
|
||||
ctx.ui.setWorkingIndicator();
|
||||
```
|
||||
|
||||
This only affects the normal streaming working indicator. Compaction and retry loaders keep their built-in styling.
|
||||
|
||||
**Examples:** [working-indicator.ts](../examples/extensions/working-indicator.ts)
|
||||
|
||||
### Pattern 5: Widgets Above/Below Editor
|
||||
|
||||
Show persistent content above or below the input editor. Good for todo lists, progress.
|
||||
@@ -881,6 +906,7 @@ export default function (pi: ExtensionAPI) {
|
||||
- **Async with cancel**: [examples/extensions/qna.ts](../examples/extensions/qna.ts) - BorderedLoader for LLM calls
|
||||
- **Settings toggles**: [examples/extensions/tools.ts](../examples/extensions/tools.ts) - SettingsList for tool enable/disable
|
||||
- **Status indicators**: [examples/extensions/plan-mode.ts](../examples/extensions/plan-mode.ts) - setStatus and setWidget
|
||||
- **Working indicator**: [examples/extensions/working-indicator.ts](../examples/extensions/working-indicator.ts) - setWorkingIndicator
|
||||
- **Custom footer**: [examples/extensions/custom-footer.ts](../examples/extensions/custom-footer.ts) - setFooter with stats
|
||||
- **Custom editor**: [examples/extensions/modal-editor.ts](../examples/extensions/modal-editor.ts) - Vim-like modal editing
|
||||
- **Snake game**: [examples/extensions/snake.ts](../examples/extensions/snake.ts) - Full game with keyboard input, game loop
|
||||
|
||||
Reference in New Issue
Block a user