mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
Inline `ctx.ui.custom()` components never report pi as blocked through
OSC 7501 program status. This is on purpose, because the same API hosts
loaders. As a result, a custom dialog that waits for the user (an
approval prompt, the `question.ts` example) shows up as `working`, and
the terminal cannot tell that pi needs input.
The extension dialog stack already stores a blocked status for each
dialog and reports the visible one. This change adds an optional
`blocked` option to `ctx.ui.custom()`:
```ts
ctx.ui.custom(factory, { blocked: { kind: "question", message: "Pick a color" } });
```
The inline branch of `showExtensionCustom()` passes it to
`pushExtensionDialog()`. Components without the option behave as before.
Overlays ignore the option because they are not part of the dialog
stack. `docs/tui.md` documents the option.
Testing:
- Added a test to `test/interactive-mode-extension-dialogs.test.ts`:
- A custom component that opts in reports `blocked`.
- A plain custom component stacked on top of it clears the blocked
status.
- Closing the plain component restores the blocked status.
- Closing the opted-in component clears it.
- The test fails without the change to `interactive-mode.ts` and passes
with it.
- `npm run check`: biome and lint pass, and there are no type errors in
coding-agent. The only errors are existing type errors in
`packages/ai/test` from locally generated model data. They are not
related to this change.
Fixes #11428
Requested by @badlogic
Co-authored-by: triagent <triagent@localhost>
|
||
|---|---|---|
| .. | ||
| images | ||
| cli-integration.md | ||
| cli.md | ||
| codemode.md | ||
| compaction.md | ||
| configuration.md | ||
| containerization.md | ||
| custom-provider.md | ||
| docs.json | ||
| environment-variables.md | ||
| extensions.md | ||
| how-pi-works.md | ||
| index.md | ||
| json.md | ||
| keybindings.md | ||
| llama-cpp.md | ||
| mcp.md | ||
| message-types.md | ||
| models-configuration.md | ||
| models.md | ||
| nvidia-rtx-llama-cpp.md | ||
| packages.md | ||
| prompt-templates.md | ||
| providers.md | ||
| quickstart.md | ||
| rpc-commands.md | ||
| rpc-extension-ui.md | ||
| rpc.md | ||
| sdk.md | ||
| security.md | ||
| session-format.md | ||
| sessions.md | ||
| settings.md | ||
| shell-aliases.md | ||
| skills.md | ||
| slash-commands.md | ||
| terminal-setup.md | ||
| termux.md | ||
| themes.md | ||
| tmux.md | ||
| tui.md | ||
| usage.md | ||
| virtual-models.md | ||
| windows.md | ||