fix(app): keep timeline history and previews stable

Treat persisted timeline replicas as display-only so authoritative pagination always comes from the daemon. Require renewed user intent between older-history pages unless the viewport genuinely remains at the history edge.

Model assistant image acquisition as loading, loaded, or failed so recreating a preview URL cannot be rendered as an error.
This commit is contained in:
Mohamed Boudra
2026-07-28 16:45:39 +02:00
parent 963d4f9240
commit 7709c42b13
29 changed files with 2135 additions and 656 deletions
@@ -36,6 +36,8 @@ export const MOCK_LOAD_TEST_DEFAULT_MODEL_ID = "five-minute-stream";
const MOCK_LOAD_TEST_MODE_ID = "load-test";
const MOCK_LOAD_TEST_DURATION_MS = 5 * 60 * 1000;
const MOCK_LOAD_TEST_INTERVAL_MS = 40;
const ONE_PIXEL_PNG_BASE64 =
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAusB9Wl4Kj8AAAAASUVORK5CYII=";
const CAPABILITIES: AgentCapabilityFlags = {
supportsStreaming: true,
@@ -1117,9 +1119,14 @@ export class MockLoadTestAgentSession implements AgentSession {
}),
);
} else {
const imageBytes = Buffer.from(ONE_PIXEL_PNG_BASE64, "base64");
const imagePayload = Buffer.concat([
imageBytes,
Buffer.alloc(Math.max(0, largePayload.bytes - imageBytes.length)),
]).toString("base64");
this.emitTimeline(turn.turnId, {
type: "assistant_message",
text: `data:image/png;base64,${payload}`,
text: `![Synthetic image](data:image/png;base64,${imagePayload})`,
messageId: turn.assistantMessageId,
});
}