fix(webui): show latest button for hidden content (#6605)

* fix(webui): show latest button for hidden content

* fix(webui): preserve latest navigation after focus scroll
This commit is contained in:
chengyongru authored and GitHub committed 2026-11-09 10:56:26 +08:00
1 parent c5f2ce5089
commit f62dfe0ee8
7 files changed
+243 -23

No files matched your search

+28
View File
@@ -587,6 +587,34 @@ describe("ThreadMotionCoordinator", () => {
expect(coordinator.snapshot().mode).toBe("browsing-history");
});
it("settles camera navigation without relying on a scroll event", () => {
const { coordinator } = motionHarness();
coordinator.takeUserControl();
coordinator.navigateLatestTo(1_400);
coordinator.cameraSettled();
expect(coordinator.snapshot().mode).toBe("follow-latest");
coordinator.navigateHistoryTo(200);
coordinator.cameraSettled();
expect(coordinator.snapshot().mode).toBe("navigating-history");
});
it("keeps explicit latest navigation in control when already following the tail", () => {
const { camera, coordinator, advanceFrame, setCameraFollowing } = motionHarness();
coordinator.resumeAutoFollow();
advanceFrame();
expect(coordinator.snapshot().mode).toBe("follow-latest");
expect(coordinator.navigateLatestTo(1_400)).toBe("started");
expect(coordinator.snapshot().mode).toBe("navigating-latest");
expect(coordinator.observeScroll(true)).toBe("navigation");
expect(camera.isFollowing()).toBe(true);
setCameraFollowing(false);
coordinator.cameraSettled();
expect(coordinator.snapshot().mode).toBe("follow-latest");
});
it("retargets smooth latest navigation before resuming automatic follow", () => {
const {
camera,