* perf(app): bound large diff row mounting Keep the existing vertical and horizontal scroll owners so virtualization does not change gesture or scrolling behavior. Reserve exact offscreen row heights while mounting only the visible window, and retain the full renderer when wrapping or editing reviews requires dynamic geometry. * perf(app): keep large diff reviews responsive Opening an inline editor changed the whole review action object, reconciled large syntax-token trees, and disabled row virtualization. Keep the expensive token subtree stable and preserve deterministic row geometry while the editor is open.\n\nBound server-side highlighting for pathological single lines and remove the unused client highlighter so the actual diff pipeline owns the limit. * test(app): check mounted diff typography Row virtualization can unmount a fixed diff row after scrolling. Assert the configured font size against a currently mounted row so the test continues to verify rendered typography without depending on window position. * test(app): stabilize Mermaid streaming coverage
71 lines
2.1 KiB
TypeScript
71 lines
2.1 KiB
TypeScript
import { test } from "../support/fixtures";
|
|
import {
|
|
expectCompletedDiagram,
|
|
expectDiagramRemainsRenderedWhileStreaming,
|
|
expectDiagramWithLabels,
|
|
reloadConversation,
|
|
requestDiagram,
|
|
waitForDiagramTurnToComplete,
|
|
} from "../support/helpers/diagram";
|
|
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
|
|
|
|
const STREAMED_MERMAID = [
|
|
"```mermaid",
|
|
"flowchart LR",
|
|
" Start --> Middle",
|
|
' Middle --> Done["<i>Done</i>"]',
|
|
" Middle --> Review",
|
|
" Review --> Verify",
|
|
" Verify --> Ship",
|
|
" Ship --> Package",
|
|
" Package --> Sign",
|
|
" Sign --> Upload",
|
|
" Upload --> Publish",
|
|
" Publish --> Deploy",
|
|
" Deploy --> Observe",
|
|
" Observe --> Validate",
|
|
" Validate --> Announce",
|
|
" Announce --> Document",
|
|
" Document --> Archive",
|
|
" Archive --> Release",
|
|
"```",
|
|
].join("\n");
|
|
|
|
test("keeps a Mermaid diagram rendered while its message streams, completes, and reloads", async ({
|
|
page,
|
|
}) => {
|
|
test.setTimeout(90_000);
|
|
|
|
const agent = await seedMockAgentWorkspace({
|
|
repoPrefix: "mermaid-streaming-",
|
|
title: "Streaming Mermaid",
|
|
featureValues: {
|
|
mockStreamingAssistantResponse: STREAMED_MERMAID,
|
|
mockStreamingAssistantIntervalMs: 150,
|
|
},
|
|
});
|
|
try {
|
|
await test.step("Open the conversation and request a diagram", async () => {
|
|
await openAgentRoute(page, agent);
|
|
await requestDiagram(agent);
|
|
});
|
|
|
|
await test.step("The diagram renders and stays rendered while tokens arrive", async () => {
|
|
await expectDiagramWithLabels(page, ["Start", "Middle"]);
|
|
await expectDiagramRemainsRenderedWhileStreaming(page);
|
|
});
|
|
|
|
await test.step("The completed diagram shows the final streamed content", async () => {
|
|
await waitForDiagramTurnToComplete(agent);
|
|
await expectCompletedDiagram(page, ["Start", "Done", "Release"]);
|
|
});
|
|
|
|
await test.step("The completed diagram remains rendered after reload", async () => {
|
|
await reloadConversation(page);
|
|
await expectCompletedDiagram(page, ["Start", "Done", "Release"]);
|
|
});
|
|
} finally {
|
|
await agent.cleanup();
|
|
}
|
|
});
|