Conversation
There was a problem hiding this comment.
审查冻结版本的多选区合并实现及选择状态调用链;发现表头仅选 body 模式下由表头交互产生的范围被误当普通 body 范围合并。既有讨论为空。
验证:阅读冻结 diff、选区状态、表头选择投影、场景图重建及公开配置契约;Node 标准库最小复现验证相邻表头投影两范围均被判为可合并,且连通并铺满外接矩形;未运行工程测试。
限制:冻结源码未安装依赖;未运行 Jest/Electron、完整工程测试或浏览器视觉回归。;仅运行 Node 标准库的源码条件简化复现,确认表头投影范围符合资格与矩形合并条件;未在真实 ListTable 环境执行该交互。;当前任务无 Checks/Actions/commit statuses 权限,未独立核验 PR 文本提及的 CI 状态。
状态:completed
| range, | ||
| normalizedRange: normalizeRange(range) | ||
| })); | ||
| const eligibleRanges = indexedRanges.filter(range => isMainBodyRange(range.normalizedRange, table)); |
There was a problem hiding this comment.
[P2] 排除由表头交互投影出的 body 选区
当 select: { headerSelectMode: 'body', autoMergeRanges: true } 且没有额外冻结分区时,按 Ctrl 依次点击相邻两列表头,updateSelectPosition 会把每次表头选择投影成 { start: { col, row: columnHeaderLevelCount }, end: { col, row: rowCount - 1 }, skipBodyMerge: true }。这里仅根据投影后的坐标判断资格,两段范围均被当作普通 body 区域,并且恰好拼成矩形,于是合为一个选区;getSelectedCellRanges()、边框和后续选区事件都丢失了两次表头选择各自的范围。PR 声明表头选区不参与归并,但只检查 getCellLocation 无法区分由表头触发的 body 投影与普通 body 选择;需要保留选区来源再过滤。
🤔 This is a ...
🔗 Related issue link
None.
💡 Background and solution
Add opt-in
select.autoMergeRanges(defaultfalse) to merge adjacent or overlapping ordinary body selections when their connected union fills a rectangle. L-shaped, holed and disconnected selections retain their separate ranges. Header, row-series and frozen-partition selections are excluded.selectCellsevaluates the complete batch after per-range normalization and deduplication, including when the final input range is a duplicate. Ctrl selection and drag selection use the same merge routine. Selection borders andselected_cellpayloads reflect the final ranges.📝 Changelog
Validation
Regression coverage includes disabled behavior, adjacent/overlapping rectangles, L-shapes, holes, disconnected ranges, duplicate final ranges, Ctrl/event behavior, drag selection and frozen boundaries. Host validation details are recorded below. Product Electron tests must run in CI before review/merge; this remains a Draft PR.
☑️ Self-Check before Merge
🚀 Summary
copilot:summary
🔍 Walkthrough
copilot:walkthrough
Supersedes #5319 with the same implementation commit, submitted from a branch in this repository so repository CI secrets are available.
Runner validation
Upstream CI verification