-
-
Notifications
You must be signed in to change notification settings - Fork 607
fix: optimize and fix the implementation of emptyNode shake #1273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough本次更改主要涉及表格组件的样式与尺寸调整逻辑。移除了 Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Table
participant ResizeObserver
participant DOM
User->>DOM: 触发表格尺寸变化(如窗口缩放/横向滚动)
DOM-->>ResizeObserver: 触发 onResize(offsetWidth)
ResizeObserver->>Table: onFullTableResize(offsetWidth)
Table->>Table: 计算 mergedWidth 并更新状态
Table->>DOM: 重新渲染表格宽度
Note over Table: horizonScroll 变化时 useLayoutEffect 触发 onFullTableResize
Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/Table.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🔇 Additional comments (3)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1273 +/- ##
=======================================
Coverage 98.03% 98.03%
=======================================
Files 76 76
Lines 7428 7435 +7
Branches 1144 1147 +3
=======================================
+ Hits 7282 7289 +7
Misses 140 140
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
优化 #1142 的实现,用 useLayoutEffect 获取宽度解决不同步的问题。
用 ResizeObserver 几乎都有这个问题,比如其他地方有用到宽度,需要 useLayoutEffect 获取一下避免闪烁。
Summary by CodeRabbit