(o: { blockId: string; path: string })
| 710 | // — regardless of whether they were added at create time or one-by-one. |
| 711 | const groupColIdsBefore = new Set(group.outputs.map((o) => o.columnName)) |
| 712 | const orderKey = (o: { blockId: string; path: string }) => { |
| 713 | const d = distances[o.blockId] |
| 714 | const dist = d === undefined || d < 0 ? Number.POSITIVE_INFINITY : d |
| 715 | const idx = flatIndex.get(`${o.blockId}::${o.path}`) ?? Number.POSITIVE_INFINITY |
| 716 | return [dist, idx] as const |
| 717 | } |
| 718 | const allGroupOutputs = [...group.outputs, newOutput].sort((a, b) => { |
| 719 | const [da, ia] = orderKey(a) |
| 720 | const [db, ib] = orderKey(b) |
no test coverage detected