Merge pull request #104 from ibs0d/claude/add-fit-to-screen-mode-XvHoV

Debug: add console.log to handleFitDragStop for drag coordinate inspe…
This commit is contained in:
ibs0d 2026-03-22 17:17:39 +11:00 committed by GitHub
commit be97838a76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -487,6 +487,23 @@ export default function DraggableGridLayout({
const colsPerRow = fitGridParams.colsPerRow; const colsPerRow = fitGridParams.colsPerRow;
const draggedId = newItem.i; const draggedId = newItem.i;
console.log("[FitDrag]", {
draggedId,
"newItem.x": newItem.x,
"newItem.y": newItem.y,
w,
colsPerRow,
targetCol: Math.max(0, Math.min(Math.round(newItem.x / w), colsPerRow - 1)),
targetRow: Math.max(0, Math.round(newItem.y / w)),
sourceIndex: [...(fitLayoutOverride ?? fitLayout ?? [])]
.sort((a, b) => (a.y !== b.y ? a.y - b.y : a.x - b.x))
.map((item) => item.i)
.indexOf(newItem.i),
orderedNames: [...(fitLayoutOverride ?? fitLayout ?? [])]
.sort((a, b) => (a.y !== b.y ? a.y - b.y : a.x - b.x))
.map((item) => item.i),
});
const currentOrder = fitLayoutOverride ?? fitLayout ?? []; const currentOrder = fitLayoutOverride ?? fitLayout ?? [];
const orderedNames = [...currentOrder] const orderedNames = [...currentOrder]
.sort((a, b) => { .sort((a, b) => {