fix(downloads): remove column reorder flicker

Clear old FLIP transforms before committing the new download grid order. Serialize and coalesce column-order persistence, keep live download snapshots from overwriting local layout state, reassert imported settings after older requests, and block overlapping pointer or arrow moves during settling.
This commit is contained in:
Sucukdeluxe
2026-08-20 08:40:25 +02:00
parent 1f2f10e803
commit 32fc1e7321
6 changed files with 274 additions and 25 deletions
@@ -515,6 +515,7 @@ export interface DownloadsTableHeaderProps {
}
function moveColumnWithPointerActions(column: string, direction: -1 | 1, element: HTMLDivElement, actions: DownloadsTableActions): void {
if (element.closest<HTMLElement>(".downloads-table")?.classList.contains("is-column-drag-settling")) return;
const sibling = direction < 0 ? element.previousElementSibling : element.nextElementSibling;
if (!sibling?.matches(".downloads-column-header")) return;
const currentRect = element.getBoundingClientRect();
@@ -548,6 +549,7 @@ export function DownloadsTableHeader({ actions, columnOrder, gridTemplate, sortC
onPointerCancel={(event) => actions.onColumnPointerCancel(column, event)}
onPointerDown={(event) => {
if (event.button !== 0 || !event.isPrimary) return;
if (event.currentTarget.closest<HTMLElement>(".downloads-table")?.classList.contains("is-column-drag-settling")) return;
event.currentTarget.setPointerCapture(event.pointerId);
actions.onColumnPointerDown(column, event);
}}