doc(Tutorials): add pro website screenshot - #8357
Conversation
…hile resizing (dotnetcore#8323) * fix: 拖动调整列宽期间暂停列宽测试,防止 ResizeObserver 恢复拖动前宽度导致 colgroup > col 宽度值闪烁 * fix: 拖动结束或双击自适应后将该列移出自动测量集合,用户显式设定的列宽不再被后续列宽测试覆盖 * fix: 未实际拖动的点击不再触发列宽回调,避免误触 resizer 导致全表列宽被冻结 * fix: 拖动过程中表格重置或销毁时丢弃过期回调,防止写入无效列宽状态 close dotnetcore#8323
|
Thanks for your PR, @h2ls. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/BootstrapBlazor/Components/Table/Table.razor.js" line_range="506-509" />
<code_context>
originalX = e.clientX ?? e.touches[0].clientX
},
e => {
+ resized = true;
const eventX = e.clientX ?? e.changedTouches[0].clientX
const marginX = eventX - originalX
</code_context>
<issue_to_address>
**issue (bug_risk):** `resized` becomes true for every `mousemove`/`touchmove` event, even when `eventX - originalX` is zero, so moving the pointer without changing the column width still persists column state and invokes `resizeColumnCallback`, freezing a column that was not actually resized.
**Triggers:** When a pointer move event is delivered over the resizer without horizontal displacement, such as vertical pointer movement or duplicate events with the same clientX.
**Suggested fix:** Set `resized` only when the computed horizontal margin is nonzero and the resulting width differs from the starting width.
```suggestion
const eventX = e.clientX ?? e.changedTouches[0].clientX
const marginX = eventX - originalX
let calcColWidth = colWidth + marginX;
if (calcColWidth < 5) {
calcColWidth = 5;
}
resized = marginX !== 0 && calcColWidth !== colWidth;
table.tables.forEach(t => {
const group = [...t.children].find(i => i.nodeName === 'COLGROUP')
```
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and if the resizing logic is wrong, the table can save an incorrect column width to local storage and invoke the resize callback with that state, so the bad width can persist after the code is reverted. The impact is bounded to affected table users and can be repaired by resetting or clearing the saved column state; otherwise this is an ordinary UI behavior bug.
Blocking findings: src/BootstrapBlazor/Components/Table/Table.razor.js:509
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull request overview
This PR fixes a regression in the Table fixed-header resizing experience where the auto column-width measurement (ResizeObserver-driven applyColumnMinWidth) can interfere with manual drag resizing / auto-fit, causing colgroup > col widths to flicker and stale widths to be persisted.
Changes:
- Add a
table.resizingguard soapplyColumnMinWidthwon’t run during drag resizing. - On drag end / auto-fit, remove the affected column from
autoColumnsand syncoptions.columnStates.widthso later re-measures/resets don’t restore stale widths. - Avoid calling the resize callback when the user clicks a resizer but doesn’t actually move it.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8357 +/- ##
========================================
Coverage 99.99% 100.00%
========================================
Files 771 771
Lines 34624 34624
========================================
+ Hits 34621 34624 +3
+ Misses 3 0 -3
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:
|
… width while resizing (dotnetcore#8323)" This reverts commit cedf23a.
Link issues
fixes #8389
Summary By Copilot
wwwroot/images/tutorials/pro.jpg, which is referenced by the Tutorials Admin page.Regression?
The referenced image asset was removed while the Tutorials Admin page continued to use it.
Risk
The change only restores a static JPEG asset already referenced by the documentation site.
Verification
Confirmed that
Admin.razorreferences the restored asset and that the JPEG opens successfully at 2002 × 1448.Packaging changes reviewed?
☑️ Self Check before Merge