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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user