Revert the timeline optimistic and pagination rework (#2596)
* Add npm release track invariant and beta dist-tag procedure * Revert "Keep older chat history and image previews stable (#2490)" The timeline optimistic/pagination rework needs more work than main releases can wait for. Reverted together with #2484; both are reapplied on integration/timeline-optimistic-rework. * Revert "Stop completed turns from appearing stuck (#2484)" See the #2490 revert. #2490 built on this submission-authority change, so the two revert and reapply as a pair.
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
clearAssistantImageMetadataCache,
|
||||
estimateAssistantMessageHeightFromCache,
|
||||
extractAssistantImageSources,
|
||||
getAssistantImageLoadStateFromMetadata,
|
||||
getAssistantImageMetadata,
|
||||
setAssistantImageMetadata,
|
||||
} from "./assistant-image-metadata";
|
||||
@@ -41,6 +42,23 @@ describe("assistant image metadata", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("maps missing metadata to the image loading state", () => {
|
||||
expect(getAssistantImageLoadStateFromMetadata(null)).toEqual({ status: "loading" });
|
||||
});
|
||||
|
||||
it("maps cached metadata to the image ready state", () => {
|
||||
expect(
|
||||
getAssistantImageLoadStateFromMetadata({
|
||||
width: 900,
|
||||
height: 1600,
|
||||
aspectRatio: 9 / 16,
|
||||
}),
|
||||
).toEqual({
|
||||
status: "ready",
|
||||
aspectRatio: 9 / 16,
|
||||
});
|
||||
});
|
||||
|
||||
it("estimates assistant message height from cached image metadata", () => {
|
||||
setAssistantImageMetadata(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user