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

Problem

Pinned sidebar rows already reach their destination while dragging, but dnd-kit's default layout-change behavior animates the committed DOM order again after release. That produces a redundant whole-list shift after a single manual reorder.

Fix

Use a pinned-thread-specific layout animation predicate that preserves dnd-kit's guarded behavior during pointer and keyboard sorting, while disabling only the post-drop layout replay. Add focused coverage that pins the intentional difference from dnd-kit's default.

Before After

https://github.com/user-attachments/assets/2c03d984-d0f2-4ee6-8cd4-dae8e4b33e47

https://github.com/user-attachments/assets/3f5c2358-750e-44a9-b726-986bfd83463e

Built with GPT-5.6 Codex in T3 Code.

Note

Stop pinned threads animating after a drag-and-drop is released

After dropping a pinned thread, dnd-kit replays layout animations to reconcile the committed DOM order, causing threads to visually jump. A new animatePinnedLayoutChanges function is introduced in Sidebar.logic.ts and passed as animateLayoutChanges to the useSortable hook in SortablePinnedThreadRow. It returns false when not actively sorting, suppressing the post-release animation, and delegates to defaultAnimateLayoutChanges while sorting is in progress.

Macroscope summarized bc3e4ab.

Note

Low Risk UI-only dnd-kit animation tweak for pinned rows with tests; no data, auth, or reorder persistence changes.

Overview Fixes a visual jump after reordering pinned sidebar threads: rows already move via dnd-kit transforms while dragging, but the library’s default post-release layout animation replayed the same shift on the committed DOM order.

Adds animatePinnedLayoutChanges in Sidebar.logic.ts—it keeps defaultAnimateLayoutChanges while isSorting is true and returns false afterward so only the redundant replay is skipped. SortablePinnedThreadRow passes it as animateLayoutChanges on useSortable. Unit tests assert the difference from dnd-kit’s default on drop vs during sort.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit bc3e4abfa947ddeade83b2d7552e538cd01a05c7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 6a4bee33-503f-4f8e-9bc3-eed1bf258ef5

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. Approvability

      Verdict: Approved bc3e4ab

      Straightforward UI animation bug fix that prevents visual jumping after drag-and-drop reorder. The change is self-contained to animation timing logic, includes test coverage, and has no runtime behavior impact beyond visual polish.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. maria-rcks merged this1afe554

    5. maria-rcks closed this

Sign in to join this conversation.