Commit 9eca620
committed
fix(datagrid): undo replay paths now mark affected rows as changed
Phase B regression: undoRowDeletion / undoRowInsertion / undoBatchRowInsertion
and the replay helpers (reapplyRowDeletion, reapplyCellChange, revertUpdateCell,
updateInsertedCellDirectly, reinsertRow, reinsertBatch) lost the
changedRowIndices.insert that the original DataChangeManager called at the end
of every undo path.
Without it, consumeChangedRowIndices returned empty after undo. The data grid's
reloadAndSyncSelection then fell through to the !hasChanges fallback, doing a
full reloadData over all rows. With 1000 rows this was 33ms per undo. With
larger datasets it gets worse.
Trace before this fix (cellEdit undo to clean state):
applyDataUndo END mutate=0.08ms callback=0.06ms total=0.19ms
reloadAndSync VERSION_CHANGED no changes -> full reload
reloadAndSync total=33.2ms
updateNSView reloadVersion=8 elapsed=33.5ms
After: changedRows is non-empty, partial reload of just the affected row fires.
Six new regression tests cover each replay method.1 parent 86dfe47 commit 9eca620
2 files changed
Lines changed: 75 additions & 0 deletions
File tree
- TableProTests/Core/ChangeTracking
- TablePro/Core/ChangeTracking
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| |||
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
| 162 | + | |
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
| |||
185 | 188 | | |
186 | 189 | | |
187 | 190 | | |
| 191 | + | |
188 | 192 | | |
189 | 193 | | |
190 | 194 | | |
| |||
206 | 210 | | |
207 | 211 | | |
208 | 212 | | |
| 213 | + | |
209 | 214 | | |
210 | 215 | | |
211 | 216 | | |
| |||
221 | 226 | | |
222 | 227 | | |
223 | 228 | | |
| 229 | + | |
224 | 230 | | |
225 | 231 | | |
226 | 232 | | |
| |||
232 | 238 | | |
233 | 239 | | |
234 | 240 | | |
| 241 | + | |
235 | 242 | | |
236 | 243 | | |
237 | 244 | | |
| |||
264 | 271 | | |
265 | 272 | | |
266 | 273 | | |
| 274 | + | |
267 | 275 | | |
268 | 276 | | |
269 | 277 | | |
| |||
280 | 288 | | |
281 | 289 | | |
282 | 290 | | |
| 291 | + | |
283 | 292 | | |
284 | 293 | | |
285 | 294 | | |
| |||
302 | 311 | | |
303 | 312 | | |
304 | 313 | | |
| 314 | + | |
305 | 315 | | |
306 | 316 | | |
307 | 317 | | |
| |||
Lines changed: 65 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
210 | 275 | | |
211 | 276 | | |
212 | 277 | | |
| |||
0 commit comments