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
+5 -4
View File
@@ -111,10 +111,11 @@ export async function renderGalleryState(
const tool = fakeToolFor(name, fixture);
const streamingArgs = state === "streaming" ? (fixture.streamingArgs ?? fixture.args) : fixture.args;
// The component only calls `requestRender` during a static render;
// `imageBudget` is consulted solely when images render, which the gallery
// disables. A cast avoids constructing a real terminal.
const ui = { requestRender() {} } as unknown as TUI;
// The component only calls `requestRender`/`requestComponentRender` (via
// its loader) during a static render; `imageBudget` is consulted solely
// when images render, which the gallery disables. A cast avoids
// constructing a real terminal.
const ui = { requestRender() {}, requestComponentRender() {} } as unknown as TUI;
const component = new ToolExecutionComponent(name, streamingArgs, { showImages: false }, tool, ui, getProjectDir());
component.setExpanded(expanded);