Add todo hook companion to todo custom tool

- /todos command displays all todos on current branch with custom UI
- Update hooks.md to clarify components must not be wrapped in Box/Container
- Cross-reference tool and hook in example READMEs
This commit is contained in:
Mario Zechner 2026-01-02 22:58:45 +01:00
parent a3772d2fd7
commit 74dc5e7c49
6 changed files with 148 additions and 2 deletions

View file

@ -465,10 +465,12 @@ const result = await ctx.ui.custom((tui, theme, done) => {
doWork(loader.signal).then(done).catch(() => done(null));
return loader;
return loader; // Return the component directly, do NOT wrap in Box/Container
});
```
**Important:** Return your component directly from the callback. Do not wrap it in a `Box` or `Container`, as this breaks input handling.
Your component can:
- Implement `handleInput(data: string)` to receive keyboard input
- Implement `render(width: number): string[]` to render lines