Commit Graph
1 Commits
Author SHA1 Message Date
yetone a2bba792d5 gui: a dragged row lands where it is let go when what is above its list moves
yuancjun on Discord: dragging a group member's handle on the Routing page
jittered, and the member landed two or more places from where it was let
go, so the group's priority changed to an order nobody chose. dragRows
measured every row once, at the press, and moved the held row by the
pointer's travel. The Routing page's live stage above the groups grows and
shrinks as requests come in, so mid-drag the rows moved under the
pointer while the slots were reckoned from where they had been.

dragRows (app.js, shared by the agents, providers, accounts, groups,
members and rules) now places the rows each frame from the list's own
top and the rows' offsetTop, the held row at the pointer less where it
was grabbed, and keeps drawing frames while the drag lasts. A row taken
out from under a drag cancels it. Routing's member and rule drags join
the group drag's guard: a redraw of the groups waits until the drag is
let go (the shared `arranged` idle in client.js), and a second press
during one is ignored.

drag-rows-shift.test.cjs: a group's members dragged in its editor while
a 90px block is put in above the groups (and, the other way, taken
out) mid-drag. The held row stays under the pointer (within 2px) and
the saved order is the slot it was let go in. Chromium and WebKit,
1100 and 560px, en/zh/zh-TW/ja/de.

Run on mote (mote-run):
- drag-rows-shift.test.cjs: 10 of 10 ok; on the old app.js and
  client.js 0 of 10 (the row 90px off the pointer, the order a slot off).
- every GUI file that presses the mouse (grep mouse.down), plus
  grip-inset, fold-show-grip, click-scroll, agent-disconnect and
  plugin-actions: 620 tests, 600 ok. The 20 reds are
  routing-rule-drag (chromium en/zh/zh-TW/de, its hover check before any
  drag; #3789, #4585) and segs-press-redraw (16, searchAllRow; #4566).
  Both files run alone at origin/main 8819beeb0 are red the same way
  (21: rule-drag chromium all 5, segs-press-redraw 16).

Not tried: a real Routing page with live traffic moving the stage, on
the Windows app the reporter uses; the drag was driven by Playwright
with the shift made by hand.
2026-11-03 11:57:57 +08:00