Dragging a widget into place does nothing, and the test that covers it cannot tell #174
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Postulo/postulo#174
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Arranging the dashboard by dragging (#125) does not work. The arrows do.
The tests pass, and they would pass either way
tests/e2e/test_widget_drag.pydrives the gesture like this:Four synthetic
DragEvents dispatched frompage.evaluate. That exercises the fourlisteners in
app.jsand proves the placement arithmetic, the form post and the redirectare right — which they are. It proves nothing about whether a real pointer drag ever
reaches those listeners, because no part of the browser's own drag machinery runs. A green
suite here is consistent with the feature being completely dead in a real browser, which is
what is being reported.
Leading suspect: no
dragenterhandlerapp.jscancelsdragoverand nothing else:For an element to become a valid drop target, the specification has both
dragenteranddragovercancelled. Chromium is forgiving about the missingdragenter; Firefox is not,and refuses the drop — the row never accepts, and the drag springs back with nothing
posted. The board drag (
test_board_drag.py) fires synthetic events the same way, so if itshares the pattern it may share the fault.
Worth knowing before fixing: the browser suite runs
--browser chromiumonly. If thisis the cause, no amount of running the existing suite would ever have shown it.
Also worth checking while in here
dropreturns early unlessevent.target.closest("[data-widget-row]")matches, so the gap between rows, and thespace below the last one, swallow the gesture. Dropping past the end is the natural way
to say last, and
widgets.place()already clamps for exactly that — the client nevergives it the chance.
widgetRows(list).indexOf(row), counted while the dragged row is still in the list;widgets.place()then removes the widget before inserting. Dragging upward puts itbefore the row it was dropped on, dragging downward puts it after. Both are defensible
and the pair is not; the existing test asserts the downward case and so pins half of it.
readyWidgetDragging()runs onDOMContentLoadedand never again.readyColumnWidthsimmediately above it also listens for
htmx:afterSwap. A drop reloads the page today sonothing is lost, but the asymmetry is a trap for whoever makes this list swap.
What closing this needs
A test that fails now. Synthetic
DragEvents cannot produce one, so it wants either a realmouse.down/mouse.move/mouse.updrag, or the suite running against Firefox as well —and the second is worth having regardless, given the extension ships for Firefox too.
Landed on
0.3.0as2d6097c4c.The board drag had the same fault, so both are fixed here — neither cancelled
dragenter, which Chromium forgives and Firefox does not. Both test helpers now senddragenteras a browser does, and each file gained a test that asks the handlers the question a browser asks. Those fail without the fix in Chromium, so no second browser is needed in CI to keep watch.