fix(table):修复调整列宽时偶尔页面元素上列宽无值的问题 - #8326
Open
Tony-ST0754 wants to merge 2 commits into
Open
Conversation
fix:修复调整列宽时偶尔页面元素上列宽无值的问题
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideStops recalculating/applying column minimum widths on window resize to avoid race conditions when user-adjusted widths are being dragged, and performs a minor formatting cleanup in autoFitColumnWidth. Sequence diagram for window resize and table column width handlingsequenceDiagram
participant Window
participant ResizeObserver
participant TableElement as Table
Window->>ResizeObserver: resize event on body
ResizeObserver->>TableElement: set table.minWidthRaf = requestAnimationFrame
Note over TableElement: Previously: applyColumnMinWidth(table) called here
TableElement-->>TableElement: table.minWidthRaf = null
Note over TableElement: Now: applyColumnMinWidth(table) is skipped
TableElement-->>Window: User drag column widths handled independently
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Thanks for your PR, @Tony-ST0754. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Instead of fully commenting out
applyColumnMinWidth(table)in the resize observer, consider guarding it with a condition (e.g., a flag indicating an active drag) so that normal resize behavior is preserved while still avoiding the drag-related race condition. - The long in-line comment explaining the root cause around
applyColumnMinWidthis quite verbose; consider shortening it to the essential behavioral contract and moving deeper analysis to a separate design note or issue reference to keep the JS file easier to scan. - There appears to be a purely whitespace-only change around
autoFitColumnWidth(line nearmaxWidth); consider dropping this to avoid noisy diffs if it’s not intentional.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Instead of fully commenting out `applyColumnMinWidth(table)` in the resize observer, consider guarding it with a condition (e.g., a flag indicating an active drag) so that normal resize behavior is preserved while still avoiding the drag-related race condition.
- The long in-line comment explaining the root cause around `applyColumnMinWidth` is quite verbose; consider shortening it to the essential behavioral contract and moving deeper analysis to a separate design note or issue reference to keep the JS file easier to scan.
- There appears to be a purely whitespace-only change around `autoFitColumnWidth` (line near `maxWidth`); consider dropping this to avoid noisy diffs if it’s not intentional.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8326 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 771 771
Lines 34535 34535
=========================================
Hits 34535 34535
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fix:更改浏览器窗口大小时,不应该将已由用户设置过的列宽重置为自动计算的列宽,应保存用户设置过的列宽
Collaborator
Author
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.



fix:修复调整列宽时偶尔页面元素上列宽无值的问题
Link issues
fixes #8323
根本原因 / Root Cause
由于组件内部有使用
Responsive组件,感觉应该注释掉比较合适Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Bug Fixes: