From 6198fd556f536194e1ab24c3b648c8eae9359038 Mon Sep 17 00:00:00 2001 From: Eric Smith <5d@fifthdread.com> Date: Wed, 20 May 2026 14:50:09 -0400 Subject: [PATCH] fix drag: revert empty-cell drop to direct placement instead of list-reflow (insert-index clamping broke corner positioning) --- scripts/dashboard_grid.gd | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/dashboard_grid.gd b/scripts/dashboard_grid.gd index 7e0ddbb..b23a757 100644 --- a/scripts/dashboard_grid.gd +++ b/scripts/dashboard_grid.gd @@ -199,14 +199,9 @@ func _end_drag(mouse_pos: Vector2) -> void: _place_module_in_cell(_drag_module, target_col, target_row) module_placed.emit(_drag_module, target_col, target_row) else: - # INSERT: flatten all modules, insert dragged one at target, reflow - var all_modules := _collect_all_modules() - - var insert_index := target_row * columns + target_col - insert_index = clampi(insert_index, 0, all_modules.size()) - all_modules.insert(insert_index, _drag_module) - - _reflow_modules(all_modules) + # Place in the empty cell directly — you get full control of positioning + _place_module_in_cell(_drag_module, target_col, target_row) + module_placed.emit(_drag_module, target_col, target_row) else: # Dropped outside the grid — return to source if still valid if _is_valid_cell(_drag_source_col, _drag_source_row):