mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 04:01:56 +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
|
|
@ -704,14 +704,17 @@ 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 5: Widget Above Editor
|
||||
### Pattern 5: Widgets Above/Below Editor
|
||||
|
||||
Show persistent content above the input editor. Good for todo lists, progress.
|
||||
Show persistent content above or below the input editor. Good for todo lists, progress.
|
||||
|
||||
```typescript
|
||||
// Simple string array
|
||||
// Simple string array (above editor by default)
|
||||
ctx.ui.setWidget("my-widget", ["Line 1", "Line 2"]);
|
||||
|
||||
// Render below the editor
|
||||
ctx.ui.setWidget("my-widget", ["Line 1", "Line 2"], { placement: "belowEditor" });
|
||||
|
||||
// Or with theme
|
||||
ctx.ui.setWidget("my-widget", (_tui, theme) => {
|
||||
const lines = items.map((item, i) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue