Skip to content

Improve dtable customize search input onchange. - #469

Merged
renjie-run merged 2 commits into
masterfrom
improve-DTableCustomizeSearchInput
Sep 1, 2026
Merged

Improve dtable customize search input onchange.#469
renjie-run merged 2 commits into
masterfrom
improve-DTableCustomizeSearchInput

Conversation

@LJHAAAAA

Copy link
Copy Markdown
Contributor

No description provided.

@seafile-dev seafile-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Comment

Warnings:

  • 输入法组合输入与防抖回调的关键路径缺少回归测试(见行内评论)。
    Suggested fix: 使用 fake timers 覆盖组合输入期间不触发回调、compositionend 后仅回调最终 trim 后值,以及清空/卸载取消待执行回调的场景。

onCompositionEnd = (e) => {
this.isInputtingChinese = false;
this.onChange(e);
handleCompositionEnd = (event) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Warning] 缺少组合输入回归测试

Why this matters:
本次重构调整了组合输入结束后重新进入防抖流程的时序,但当前没有测试验证组合期间不会触发回调,以及 compositionend 后只提交最终的 trim 值。该路径回归会直接导致中文等输入法搜索中出现中间词或重复查询。

Suggested fix: 为该组件补充 fake timers 测试,覆盖 compositionstart/change/compositionend、快速连续输入,以及 clear/unmount 取消尚未执行回调的场景。

@seafile-dev seafile-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Approve

本次未发现新的阻断或警告级问题。

此前关于组合输入和防抖取消缺少回归测试的评论已在当前提交中得到处理:新增测试覆盖 compositionstart/change/compositionend、连续输入、防抖取消、受控 value 更新与卸载。

@renjie-run
renjie-run merged commit e5efa6e into master Sep 1, 2026
1 check passed
@renjie-run
renjie-run deleted the improve-DTableCustomizeSearchInput branch September 1, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants