Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): fix thread jumping after reorder #7103

Mergedipanasenko(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/7103/headmerged by maria-rcks View on GitHub

Showing 3 changed files with 37 additions and 0 deletions.

x
0 of 3 viewed, 3 left
28 additions and 0 deletionsapps/web/src/components/Sidebar.logic.test.tsModified
View file
@@ -1,5 +1,7 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test";
+import { defaultAnimateLayoutChanges, type AnimateLayoutChanges } from "@dnd-kit/sortable";
import {
+ animatePinnedLayoutChanges,
archiveSelectedThreadEntries,
buildBulkTitleRegenerationContextMenuItem,
buildMultiSelectThreadContextMenuItems,
@@ -53,6 +55,32 @@
​
const localEnvironmentId = EnvironmentId.make("environment-local");
​
+describe("animatePinnedLayoutChanges", () => {
+ const baseArgs: Parameters<AnimateLayoutChanges>[0] = {
+ active: null,
+ containerId: "pinned-threads",
+ isDragging: false,
+ isSorting: false,
+ id: "thread-a",
+ index: 1,
+ items: ["thread-b", "thread-a"],
+ newIndex: 0,
+ previousItems: ["thread-a", "thread-b"],
+ previousContainerId: "pinned-threads",
+ transition: { duration: 200, easing: "ease" },
+ wasDragging: true,
+ };
+​
+ it("does not replay layout movement after the pointer is released", () => {
+ expect(defaultAnimateLayoutChanges(baseArgs)).toBe(true);