Repository navigation
fix(animation): carousel fails to scroll to bottom with fractional row heights - #5333
dajiaohuang wants to merge 3 commits into
Conversation
…ctional row/col heights - Run post-animation scroll correction for both integer and fractional scroll targets - Add post-animation correction for scrollToCol (consistent with scrollToRow) - Use Math.round instead of Math.floor in animation onUpdate to reduce pixel drift - Add explicit boundary check in carousel plugin to reliably reset at end of scroll range - Fixes TableCarouselAnimationPlugin failing to reach bottom when defaultRowHeight is a decimal value
|
有 3 处阻塞性问题需要修正后再合并:
|
|
已在 67fa198 修正三处问题:分数行和分数列保持原动画目标,仅整数目标做结束纠正;列纠正保存句柄,在新滚动和 release 时取消,并在回调检查 isReleased。真实 ListTable 的 6 个 API 测试及 TypeScript 检查通过;三个新增/扩展回归在前一版本全部失败。PR 正文已更正分数行高与分数行索引的区别,补齐 patch changelog。完整视觉验收及上游 CI 待确认。 |
|
补充交付状态:67fa198 当前仍为本地提交,首次推送被仓库 pre-push 的全工作区测试阻止(部分工作区未安装 Jest)。正在补齐要求的工作区依赖;上条评论的修订与定向验证结果有效,但远端尚未收到该提交。 |
There was a problem hiding this comment.
Latest reviewed commit: affa603
No confirmed new issues found.
| this.animationManager.scrollTo({ col }, animationOption); | ||
| setTimeout(() => { | ||
| this.scrollToCell({ col: Math.floor(col) }); | ||
| this.render(); |
There was a problem hiding this comment.
[P2] Avoid a second synchronous table render after column correction
When an animated scrollToCol reaches its correction timeout, scrollToCell({ col: Math.floor(col) }) already calls this.render(). The additional call here synchronously renders the scenegraph a second time with no intervening state change. For a large visible table using column carousel (e.g. colCount: 1 with short animation duration/delay), every column transition therefore incurs an unnecessary full canvas render, adding avoidable work and frame latency. Remove this call and let scrollToCell perform the single final render. This is separate from the fractional-target and timer-lifecycle regressions in the existing PR discussion; verified by tracing the frozen source, not by a full-project benchmark.
Confirmed fixed (affa603): For the original animated integer-column correction on a large visible table, the current timeout calls scrollToCell({ col }) once and does not call render separately; scrollToCell itself performs the final render. The extracted current scrollToCol method was run against a minimal mocked table, confirming one correction call and no extra render; its fractional-target branch schedules no correction. The new regression assertion also expects a single render. Thus the second synchronous render reported previously is absent on the original trigger path.
|
已正常推送 67fa198 和 affa603(当前远端 head:affa6032056153ecc4e39f40b29c7bd879cf8f2e):修复此前三项分数目标/列纠正定时器问题,并移除列纠正后重复 render,加入单次 render 回归断言。 此前 pre-push 停滞的启动原因已复现:宿主继承的 ELECTRON_RUN_AS_NODE=1 使 Electron 作为 Node 启动,jest-electron 主入口因 app 未定义退出,runner 仍等待 readiness;仅对本次测试/普通 push 子进程取消该环境变量后,真实 ProcReady/ProcInitialWinEnd 握手通过。未绕过或修改 hook/测试。 普通 pre-push |
Background and solution
Fixes #4812. The carousel can miss its restart boundary when scrolling with a non-integer row height. Keep the explicit last-row/last-column restart and round intermediate animation offsets.
Preserve fractional row and column animation targets: only integer targets receive a final position correction. Track the column correction timer, cancel it on replacement and release, and guard callbacks against a released table. Fractional row height and fractional row index are different; the latter must retain its half-row offset.
Validation
Six real-table API tests pass, including fractional row/column targets and column-timer replacement/release. All three new/expanded regressions fail on the preceding PR head. TypeScript checking passes. Editor declarations were generated locally to satisfy the test compiler; no dependency manifest changed. Full carousel visual acceptance and upstream CI remain pending.
Changelog
Patch entries cover carousel boundary handling and fractional scroll/timer lifecycle preservation.