Commit 2f1af8f
fix: don't collapse emptied columns when moving blocks
Moves are rearrangements rather than deletions, so columns that a move
empties out are deliberately left as-is instead of being collapsed. This
keeps moves free of side effects (and reversible by moving back), matches
dragging a block out of a column, and fixes the original error: collapsing
a transiently-empty column mid-move broke the re-insertion.
Also simplifies `removeAndInsertBlocks` (plain `fixColumns` opt-out, no
`affectedColumnLists` return) and removes the columnList reference
anchoring workaround in `moveBlocks`, which guarded against mid-move
collapsing that can no longer happen.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent d0ea3cc commit 2f1af8f
3 files changed
Lines changed: 398 additions & 272 deletions
File tree
- packages
- core/src/api/blockManipulation/commands
- moveBlocks
- replaceBlocks
- xl-multi-column/src/test/commands/__snapshots__
Lines changed: 9 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
172 | 160 | | |
173 | 161 | | |
174 | 162 | | |
175 | 163 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
181 | 167 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | 168 | | |
190 | 169 | | |
191 | 170 | | |
| |||
Lines changed: 4 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
130 | 121 | | |
131 | 122 | | |
132 | 123 | | |
| |||
136 | 127 | | |
137 | 128 | | |
138 | 129 | | |
139 | | - | |
| 130 | + | |
140 | 131 | | |
0 commit comments