feat(tui): added component-scoped rendering with partial compose reuse

- Added `TUI.requestComponentRender`, enabling component-scoped render requests.
- Implemented partial compose reuse by resolving and memoizing affected root segments.
- Fixed component-scoped updates to keep frame-seam rows continuous across partial renders.
- Added component-render and loader tests for reuse, downgrade, and call-count coverage.
This commit is contained in:
can1357
2026-06-11 16:13:18 +02:00
parent cbecab2be2
commit b1338b8f57
10 changed files with 503 additions and 49 deletions
@@ -73,7 +73,11 @@ export class BtwPanelComponent extends Container {
this.addChild(new Text(this.#footerLine(), 1, 0));
this.addChild(new Spacer(1));
this.addChild(new DynamicBorder(str => theme.fg("dim", str)));
this.#tui.requestRender();
// Component-scoped: a rebuild replaces only this panel's own children
// (streaming deltas arrive per token, and a full compose would re-walk
// the whole transcript each time). Before the panel is mounted the TUI
// cannot resolve it and falls back to a full compose on its own.
this.#tui.requestComponentRender(this);
}
#footerLine(): string {