Improve dtable customize search input onchange. - #469
Merged
Conversation
seafile-dev
reviewed
Sep 1, 2026
seafile-dev
left a comment
There was a problem hiding this comment.
Verdict: Comment
Warnings:
- 输入法组合输入与防抖回调的关键路径缺少回归测试(见行内评论)。
Suggested fix: 使用 fake timers 覆盖组合输入期间不触发回调、compositionend 后仅回调最终 trim 后值,以及清空/卸载取消待执行回调的场景。
| onCompositionEnd = (e) => { | ||
| this.isInputtingChinese = false; | ||
| this.onChange(e); | ||
| handleCompositionEnd = (event) => { |
There was a problem hiding this comment.
[Warning] 缺少组合输入回归测试
Why this matters:
本次重构调整了组合输入结束后重新进入防抖流程的时序,但当前没有测试验证组合期间不会触发回调,以及 compositionend 后只提交最终的 trim 值。该路径回归会直接导致中文等输入法搜索中出现中间词或重复查询。
Suggested fix: 为该组件补充 fake timers 测试,覆盖 compositionstart/change/compositionend、快速连续输入,以及 clear/unmount 取消尚未执行回调的场景。
seafile-dev
approved these changes
Sep 1, 2026
seafile-dev
left a comment
There was a problem hiding this comment.
Verdict: Approve
本次未发现新的阻断或警告级问题。
此前关于组合输入和防抖取消缺少回归测试的评论已在当前提交中得到处理:新增测试覆盖 compositionstart/change/compositionend、连续输入、防抖取消、受控 value 更新与卸载。
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.
No description provided.