Commit 0166416
fix(template-builder): fix drag regression in template builder (#35277)
## Summary
- Reverts the `identify` track function — removes the method entirely
and uses `row.id` / `box.id` directly in `@for` track expressions. The
previous `${id}-${index}` approach caused Angular to treat widgets by
position rather than identity, desyncing GridStack's DOM during
column-between-row drags and leaving the source row empty.
- Bumps gridstack `8.1.1` → `8.4.0`
- Guards against `undefined` `oldChild` in `updateOldRows` when a column
has moved to a new X position after a drag
## Related
Closes #33073
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes how Angular tracks grid items and updates GridStack
dependency, which can affect drag/drop rendering and layout state
synchronization.
>
> **Overview**
> Fixes a template-builder drag regression by switching `@for` tracking
to stable `row.id`/`box.id` (and removing the custom `identify()` key
generator) so GridStack DOM/widget identity stays consistent during
cross-row column drags.
>
> Hardens `updateOldRows` merging to avoid crashing/losing state when a
column’s previous X position can’t be found (`oldChild?.id ??
newChild.id`), and bumps `gridstack` from `8.1.1` to `8.4.0`.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
ab89c85. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude Sonnet 4.6 <[email protected]>1 parent f57f4c9 commit 0166416
5 files changed
Lines changed: 11 additions & 56 deletions
File tree
- core-web
- libs/template-builder/src/lib/components/template-builder
- store
core-web/libs/template-builder/src/lib/components/template-builder/store/template-builder.store.ts
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| |||
core-web/libs/template-builder/src/lib/components/template-builder/template-builder.component.html
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
Lines changed: 0 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | 387 | | |
408 | 388 | | |
409 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13696 | 13696 | | |
13697 | 13697 | | |
13698 | 13698 | | |
13699 | | - | |
13700 | | - | |
13701 | | - | |
13702 | | - | |
| 13699 | + | |
| 13700 | + | |
| 13701 | + | |
| 13702 | + | |
13703 | 13703 | | |
13704 | 13704 | | |
13705 | 13705 | | |
| |||
20336 | 20336 | | |
20337 | 20337 | | |
20338 | 20338 | | |
20339 | | - | |
20340 | | - | |
20341 | | - | |
20342 | | - | |
20343 | | - | |
20344 | | - | |
20345 | | - | |
20346 | | - | |
20347 | | - | |
20348 | | - | |
| 20339 | + | |
20349 | 20340 | | |
20350 | 20341 | | |
20351 | 20342 | | |
| |||
20462 | 20453 | | |
20463 | 20454 | | |
20464 | 20455 | | |
20465 | | - | |
20466 | | - | |
20467 | | - | |
20468 | | - | |
20469 | | - | |
20470 | | - | |
20471 | | - | |
20472 | | - | |
| 20456 | + | |
20473 | 20457 | | |
20474 | 20458 | | |
20475 | 20459 | | |
| |||
22140 | 22124 | | |
22141 | 22125 | | |
22142 | 22126 | | |
22143 | | - | |
| 22127 | + | |
22144 | 22128 | | |
22145 | 22129 | | |
22146 | 22130 | | |
| |||
22158 | 22142 | | |
22159 | 22143 | | |
22160 | 22144 | | |
22161 | | - | |
22162 | | - | |
22163 | | - | |
22164 | | - | |
22165 | | - | |
22166 | | - | |
22167 | | - | |
22168 | | - | |
22169 | | - | |
22170 | 22145 | | |
22171 | 22146 | | |
22172 | 22147 | | |
| |||
0 commit comments