refactor(webui): separate gateway mutations and UI state (#6727)

This commit is contained in:
chengyongru authored and GitHub committed 2026-11-19 22:22:51 +08:00
1 parent ce12bfdd0d
commit 5537bdabd3
70 files changed
+4058 -3650

No files matched your search

+2 -12
View File
@@ -1272,18 +1272,9 @@ describe("ThreadViewport", () => {
});
expect(hitTest.mock).toHaveBeenCalled();
const replacement = anchor.cloneNode(true) as HTMLElement;
anchor.replaceWith(replacement);
// Deferred content grows above the existing row wrapper.
anchorDocumentTop += 180;
scrollHeight += 180;
Object.defineProperty(replacement, "getBoundingClientRect", {
configurable: true,
value: () => DOMRect.fromRect({
y: anchorDocumentTop - scroller.scrollTop,
width: 800,
height: 40,
}),
});
const content = screen.getByTestId("thread-message-region").firstElementChild;
const observer = resizeObserver.observers.find((candidate) =>
content ? candidate.elements.includes(content) : false,
@@ -1294,10 +1285,9 @@ describe("ThreadViewport", () => {
});
expect(scroller.scrollTop).toBe(260);
expect(replacement.getBoundingClientRect().top).toBe(120);
expect(anchor.getBoundingClientRect().top).toBe(120);
// ResizeObserver may arrive before the next native scroll event.
hitTarget = replacement;
scroller.scrollTop = 240;
anchorDocumentTop += 60;
scrollHeight += 60;