Skip to content

fix: debounce users page search input - #6474

Merged
Calcium-Ion merged 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/01d676e79
Jul 26, 2026
Merged

fix: debounce users page search input#6474
Calcium-Ion merged 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/01d676e79

Conversation

@feitianbubu

@feitianbubu feitianbubu commented Jul 26, 2026

Copy link
Copy Markdown
Member

⚠️ 提交说明 / PR Notice

用户页搜索框每输入一个字符就发一次 /api/user/search,每页 100 条时明显卡顿。
参考渠道页的防抖逻辑, 这里给用户表同样加上 searchDebounceMs: 500

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

本地实例浏览器手测:用户页连续输入 8888 ,全程只发出一次搜索请求(修复前每个字符一次):

[GET] /api/user/search?keyword=rootuser&group=&p=1&page_size=20 => [200] OK

Summary by CodeRabbit

  • User Experience
    • Improved the users table search experience by applying a brief delay before search results update, reducing unnecessary refreshes while typing.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The users table now configures its global search input to wait 500 milliseconds after typing before triggering a search.

Changes

User search behavior

Layer / File(s) Summary
Configure search debounce
web/src/features/users/components/users-table.tsx
Passes searchDebounceMs: 500 through DataTablePage toolbar properties.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested reviewers: calcium-ion

Poem

I’m a rabbit who types with care,
Five hundred milliseconds in the air.
No frantic hops from key to key,
The search now waits patiently.
thump thump—a smoother query!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change satisfies #6399 by delaying users page search requests with a 500 ms debounce.
Out of Scope Changes check ✅ Passed The diff only adds the debounce setting and stays within the reported search-performance fix.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding debounce to the users page search input.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Calcium-Ion
Calcium-Ion merged commit 3e1e728 into QuantumNous:main Jul 26, 2026
2 checks passed
agogo233 pushed a commit to agogo233/new-api that referenced this pull request Jul 27, 2026
Jaykebc1 added a commit to wrouter/wrouter that referenced this pull request Jul 28, 2026
…bounce)

Bring the aurora theme to parity with two rc.22 upstream web fixes that
aurora reproduces (aurora is a separate implementation, so upstream web/
fixes don't carry over automatically):

- Top-up amount input can now be fully cleared (QuantumNous#6473): preserve an empty
  localAmount instead of resetting to '0', and guard the one-time amount
  initialization with a ref instead of 'topupAmount === 0' so clearing the
  field no longer refills it.
- Users page search is debounced 500ms (QuantumNous#6474) via the existing
  data-table toolbar searchDebounceMs prop.

Other rc.22 web fixes (inline channel-priority edit, unset-price models
tab, JSON editor unify, data-table column toggle) target upstream-specific
components; aurora uses different implementations (e.g. channel cards vs
inline table) or lacks the view, so they don't apply.

aurora build + typecheck clean (6 pre-existing warnings, no new).
IQZZ020501 pushed a commit to IQZZ020501/new-api that referenced this pull request Jul 30, 2026
refeiner pushed a commit to wuqiang44444444/new-api that referenced this pull request Aug 17, 2026
330079598 pushed a commit to 330079598/new-api that referenced this pull request Aug 19, 2026
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.

新版本UI用户页面查询具体用户时很卡(尤其是每页100条时),每输入一个字符就会触发一次查询

2 participants