mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 08:02:17 +00:00
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:
parent
6327bfd3dc
commit
abb1775ff7
11 changed files with 114 additions and 36 deletions
|
|
@ -0,0 +1,17 @@
|
|||
import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
const applyWidgets = (ctx: ExtensionContext) => {
|
||||
if (!ctx.hasUI) return;
|
||||
ctx.ui.setWidget("widget-above", ["Above editor widget"]);
|
||||
ctx.ui.setWidget("widget-below", ["Below editor widget"], { placement: "belowEditor" });
|
||||
};
|
||||
|
||||
export default function widgetPlacementExtension(pi: ExtensionAPI) {
|
||||
pi.on("session_start", (_event, ctx) => {
|
||||
applyWidgets(ctx);
|
||||
});
|
||||
|
||||
pi.on("session_switch", (_event, ctx) => {
|
||||
applyWidgets(ctx);
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue