feat(coding-agent): Add widget placement option (#850)

* Add widget placement for extension widgets

* Remove changelog entry for widget placement

* Keep no-op widget signature

* Move widget render before attach
This commit is contained in:
Marc Krenn 2026-01-19 15:54:24 +01:00 committed by GitHub
parent 6327bfd3dc
commit abb1775ff7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 114 additions and 36 deletions

View file

@ -184,7 +184,7 @@ export default function (pi: ExtensionAPI) {
const ok = await ctx.ui.confirm("Title", "Are you sure?");
ctx.ui.notify("Done!", "success");
ctx.ui.setStatus("my-ext", "Processing..."); // Footer status
ctx.ui.setWidget("my-ext", ["Line 1", "Line 2"]); // Widget above editor
ctx.ui.setWidget("my-ext", ["Line 1", "Line 2"]); // Widget above editor (default)
});
// Register tools, commands, shortcuts, flags
@ -1366,7 +1366,7 @@ Extensions can interact with users via `ctx.ui` methods and customize how messag
- Settings toggles (SettingsList)
- Status indicators (setStatus)
- Working message during streaming (setWorkingMessage)
- Widgets above editor (setWidget)
- Widgets above/below editor (setWidget)
- Custom footers (setFooter)
### Dialogs
@ -1456,8 +1456,10 @@ ctx.ui.setStatus("my-ext", undefined); // Clear
ctx.ui.setWorkingMessage("Thinking deeply...");
ctx.ui.setWorkingMessage(); // Restore default
// Widget above editor (string array or factory function)
// Widget above editor (default)
ctx.ui.setWidget("my-widget", ["Line 1", "Line 2"]);
// Widget below editor
ctx.ui.setWidget("my-widget", ["Line 1", "Line 2"], { placement: "belowEditor" });
ctx.ui.setWidget("my-widget", (tui, theme) => new Text(theme.fg("accent", "Custom"), 0, 0));
ctx.ui.setWidget("my-widget", undefined); // Clear