feat(coding-agent/edit): added hashline fallback preview for in-flight edits

- Added edit streaming fallback data to the edit render context and used it when no finalized patch text was available.
- Implemented hashline fallback rendering that strips envelope syntax, sanitizes text, and truncates output to a fixed number of lines with a streaming indicator.
- Updated tool execution to populate the fallback preview from the active edit strategy and added a renderer test for hashline envelope input while the diff is not yet computable.
This commit is contained in:
can1357
2026-05-12 01:00:50 +02:00
parent 530942c0b2
commit 9bcbefb30e
4 changed files with 94 additions and 2 deletions
@@ -665,6 +665,12 @@ export class ToolExecutionComponent extends Container {
context.perFileDiffPreview = previews;
}
}
if (!previews?.some(preview => preview.diff)) {
const editMode = this.#editMode;
const strategy = editMode ? EDIT_MODE_STRATEGIES[editMode] : undefined;
const fallback = strategy?.renderStreamingFallback(this.#args, theme);
if (fallback) context.editStreamingFallback = fallback;
}
context.renderDiff = renderDiff;
}