feat(app): store assistant image previews as assets
This commit is contained in:
@@ -55,4 +55,15 @@ describe("assistant image metadata", () => {
|
||||
),
|
||||
).toBeGreaterThan(220);
|
||||
});
|
||||
|
||||
it("estimates image-only data-image markdown without caching the full payload as text", () => {
|
||||
const source = `data:image/png;base64,${"a".repeat(512)}`;
|
||||
setAssistantImageMetadata({ source }, { width: 1200, height: 800 });
|
||||
|
||||
const imageOnlyHeight = estimateAssistantMessageHeightFromCache(``);
|
||||
const mixedHeight = estimateAssistantMessageHeightFromCache(`Text\n\n`);
|
||||
|
||||
expect(imageOnlyHeight).toBeGreaterThan(220);
|
||||
expect(mixedHeight).toBeGreaterThan(imageOnlyHeight ?? 0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user