Repository navigation
feat(grid): support hiding identical value columns (#10820) - #11146
Merged
Merged
Conversation
t8y2
reviewed
Oct 7, 2026
t8y2
left a comment
Owner
There was a problem hiding this comment.
维护者补丁(79092d0e,基于 6bed236),修掉审阅中发现的正确性问题:
- 索引空间错位(阻断项):
getComparisonRows()原先从visibleDisplayItems取行,其data已被visibleRowData()按可见位置重排,而identicalValueColumnIndexes的候选索引是原始列索引。只要有列被隐藏/重排,比较就会读错单元格(超出可见数量的原始索引每行都读到undefined,被误判为相同列而隐藏)。现改为从displayItems.value取全宽item.data,与回退分支的props.result.rows语义一致,并加注释说明该约束。 - pt-BR 拼写:
idénticos→idênticos(两处;西语尖音符改为葡语扬抑符,与文件内既有idênticos用法一致)。 - 回归锁:新增两个测试——纯函数层用例锁「候选为原始索引时行须全宽」契约(dataGridColumnVisibility.test.ts);源码断言锁
getComparisonRows必须用displayItems且不得再引用visibleDisplayItems(dataGridContextMenu.test.ts,沿用该文件既有源码断言风格)。
核验:dataGridColumnVisibility.test.ts、dataGridContextMenu.test.ts、dataGridContextMenu.spec.ts 共 46 用例全部通过;DataGrid.vue 与 pt-BR.ts 通过 oxfmt 检查(app-tests 文件不在格式门禁内,保持与 PR 原有风格一致)。CI 跑完后即可合并。
Owner
|
Thanks for the contribution! Merged in 09c47b1, will be released in the next version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #10820
Adds the ability to hide columns with identical values from the data grid context menu, allowing users to quickly hide uniform columns and inspect differing columns when comparing data across multiple rows.
Changes
identicalValueColumnIndexesandareCellValuesEqualutilities indataGridColumnVisibility.tsto identify columns that have identical values across comparison rows.hideIdenticalColumnsaction and label support tocreateDataGridColumnContextMenuItemsindataGridContextMenu.ts.hideIdenticalColumnsintoDataGrid.vuecontext menu, displaying the count of columns to be hidden when applicable and disabling the option when no identical columns exist.dataGridColumnVisibility.test.tsanddataGridContextMenu.spec.ts.