Commit Graph
4 Commits
Author SHA1 Message Date
Lauri Ojansivu c0e71705f6 All Boards: a live drop gap that follows the drag, in place, not just at the end.
Replaces the fixed "drop at the end" placeholder with the standard sortable feel:
while a board is dragged, an empty dashed gap opens up before or after the tile
under the cursor, showing exactly where the board will land - anywhere in the
current view (Starred / Templates / Remaining / a workspace), not only at the
end.

How it works:
  * `dragover .js-board` computes which side of the tile the cursor is on
    (inline-centre, RTL-aware) and inserts a placeholder `<li>` there. The
    placeholder is a plain DOM node, inserted next to the Blaze-managed tiles and
    removed on dragend, so it never fights Blaze's reactive list.
  * `drop .js-board` reads that side and reorders with the pure
    computeReorderedIds(..., after), which now inserts on the target's leading OR
    trailing side and returns null for a no-op (including a drop back into the
    board's own slot). Dropping past the last tile reaches the end, so the
    separate end target is gone.

The placeholder is a real grid cell, so the surrounding tiles flow around the gap
as it moves. Unit tests cover the new before/after side and the own-slot no-ops.

Still mouse-only: HTML5 drag-and-drop does not fire from touch (the jQuery-UI-
sortable + touch-punch move noted before is what would add finger dragging).

Thanks to xet7 !
2026-07-24 08:06:14 +03:00
Lauri Ojansivu da64c8a0f1 All Boards: add a trailing drop placeholder to move a board to the end.
Dropping one board onto another can only place it BEFORE that board, so the last
slot in the order was unreachable by drag. A dashed "drop here to move to the
end" tile now sits after the last board (only in the manual "custom" sort mode,
where drag-reorder applies) and accepts a drop that moves the dragged board to
the end.

The move-to-end order math is the pure computeReorderedSortIndexToEnd in
models/lib/boardSortReorder.js (a no-op when the board is already last); the
dragover/drop handlers mirror the board-tile ones and light the placeholder with
the same `.board-reorder-over` highlight.

Thanks to xet7 !
2026-07-24 07:57:42 +03:00
Lauri Ojansivu 8d1fae4f7d Convert client-reachable models/lib helpers from CommonJS to ES modules (1/2).
The rspack client build treats a `module.exports` file imported into the
client bundle as an ES module and throws
"ES Modules may not assign module.exports" at evaluation time, aborting
the whole client module chain (No such template: swimlane / notifications
/ boardButtons, blank board, missing top bar). This is not an rspack
version regression (the lockfile has pinned ~1.7.x since v8.40); it is
that WeKan added CommonJS helpers to the client bundle.

Convert the 42 client-reachable pure-logic models/lib helpers from
`module.exports = { ... }` to `export { ... }`, and calendarFilter's
internal require('./swimlaneFilter') to an import with a .js extension
(node ESM needs it; rspack/reify tolerate it). Server-only helpers that
use node built-ins (fs/path/child_process) stay CommonJS. The plain-Node
.cjs unit tests for these helpers now use `await import(...js)` (wrapped
in an async IIFE); a source-guard in importVirtualMembers was updated
from module.exports to export. Verified: the full tests/*.test.cjs suite
has the SAME 7 pre-existing failures as before this change and no new
ones.
2026-07-23 18:55:30 +03:00
Lauri Ojansivu f8e31745d8 Fix #6439: Custom (drag order) sort on All Boards page now reorders via drag-and-drop
Thanks to jullbo and xet7.
2026-07-06 13:49:44 +03:00