perf: migrate chat rendering to virtua (#1651)

* refactor: migrate chat history virtualization to virtua

* refactor: render loaded chat history directly

* refactor: finish virtua migration

* perf: defer tool body rendering

* perf: queue deferred tool body mounts

* perf: quiet and defer markdown file probes

* perf: defer markdown code highlighting

* perf: stabilize markdown plugin lists

* perf: defer mermaid markdown rendering

* perf: delay markdown file reference annotation

* perf: attach markdown table listeners on demand

* perf: trim markdown render overhead
This commit is contained in:
Bohdan Triapitsyn
2026-06-15 03:29:40 +03:00
committed by GitHub
parent e372c8d8cb
commit a45376d585
24 changed files with 621 additions and 671 deletions
@@ -65,8 +65,19 @@ export const tryHandleLocalFsProxy = async (method: string, requestPath: string)
}
const targetPath = parsed.searchParams.get('path') || '';
const optional = parsed.searchParams.get('optional') === 'true';
const resolution: FsReadPathResolution = await resolveFileReadPath(targetPath);
if (!resolution.ok) {
if (fsProxyPath === '/api/fs/stat' && optional && resolution.status === 404) {
return {
status: 200,
headers: {
'content-type': 'application/json',
'cache-control': 'no-store',
},
bodyBase64: base64EncodeUtf8(JSON.stringify({ path: targetPath, exists: false })),
};
}
return buildProxyJsonError(resolution.status, resolution.error);
}
@@ -116,6 +127,16 @@ export const tryHandleLocalFsProxy = async (method: string, requestPath: string)
} catch (error) {
const err = error as NodeJS.ErrnoException;
if (err?.code === 'ENOENT') {
if (fsProxyPath === '/api/fs/stat' && optional) {
return {
status: 200,
headers: {
'content-type': 'application/json',
'cache-control': 'no-store',
},
bodyBase64: base64EncodeUtf8(JSON.stringify({ path: targetPath, exists: false })),
};
}
return buildProxyJsonError(404, 'File not found');
}
if (fsProxyPath === '/api/fs/stat') {