Skip to content

fix: motion and facial list truncation - #128

Merged
GuangChen2333 merged 1 commit into
Untitled-Story:masterfrom
RoiexLee:fix/motion-facial-list-limit
Sep 4, 2026
Merged

fix: motion and facial list truncation#128
GuangChen2333 merged 1 commit into
Untitled-Story:masterfrom
RoiexLee:fix/motion-facial-list-limit

Conversation

@RoiexLee

@RoiexLee RoiexLee commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Show all available motion and facial options when the searchable combobox has no query.
  • Keep the 60-result limit for non-empty fuzzy searches.
  • Add a frontend regression test using 100 synthetic facial options.
  • Expand the model registry test to cover 100 motion groups and 100 facial groups.

Background

The motion and facial combobox passed a limit of 60 to the fuzzy matching helper. That limit was also applied when the search query was empty, so only the first 60 sorted entries were rendered in the default list.

Models with more than 60 entries could therefore contain valid motions or facial expressions that were absent from the browsable list, even though they could still be found by entering their names in the search field.

Behavior changes

When the search field is empty:

  • All unique motion or facial options are returned.
  • The existing scrollable list can be used to browse entries beyond the 60th item.

When the search field contains a query:

  • Fuzzy matching still evaluates the complete catalog.
  • The displayed search results remain limited to the 60 highest-ranking matches.

Tests

The frontend regression test uses 100 synthetic options and verifies that:

  • The default list contains all 100 options.
  • A broad search remains limited to 60 results.
  • An exact search can find the 100th option.

The backend model registry test now generates:

  • 100 motion groups.
  • 100 facial groups.

It verifies that both catalogs are classified, sorted, and returned without truncation.

Commands run:

  • pnpm test:fuzzy-match
  • pnpm typecheck
  • pnpm lint
  • cargo test
  • cargo check
  • cargo fmt --check

All checks pass.

Related issue

Fixes #123

Summary by CodeRabbit

  • 新功能

    • 优化模糊搜索:空查询时显示全部去重结果,输入查询时按匹配度排序并限制结果数量。
    • 扩展批量分类与排序场景的验证覆盖范围。
  • 测试

    • 新增模糊搜索测试命令,覆盖空查询、宽泛查询和精确查询等场景。

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5f5772cd-044e-4b62-848c-06189b4e4dc1

📥 Commits

Reviewing files that changed from the base of the PR and between fd59773 and de2f1af.

📒 Files selected for processing (4)
  • package.json
  • scripts/test-fuzzy-match.mjs
  • src-tauri/src/commands/project/model_registry.rs
  • src/lib/fuzzyMatch.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

Changes

模糊匹配覆盖

Layer / File(s) Summary
模糊匹配结果规则
src/lib/fuzzyMatch.ts
fuzzyMatchOptionslimit 更名为 searchResultLimit。空查询返回全部去重选项。非空查询继续按限制截取结果。
批量结果验证
scripts/test-fuzzy-match.mjs, package.json, src-tauri/src/commands/project/model_registry.rs
新增 test:fuzzy-match 命令和三组 SSR 断言。动作组与表情组测试扩展为各 100 项。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to de2f1

The change expands empty-query motion and facial lists while preserving the 60-result limit for searches, with regression coverage for both behaviors. No actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant TestScript as test-fuzzy-match.mjs
  participant ViteServer as Vite中间件服务器
  participant FuzzyMatch as fuzzyMatchOptions
  TestScript->>ViteServer: 启动 SSR 模块加载
  ViteServer->>FuzzyMatch: 加载并执行模糊匹配
  FuzzyMatch-->>TestScript: 返回匹配结果
  TestScript->>TestScript: 验证空查询、宽泛查询和精确查询
  TestScript->>ViteServer: finally 中关闭服务器
Loading

Suggested reviewers: guangchen2333

Poem

小兔敲代码,
空搜结果全返回。
百组动作排,
表情也不漏一项。
模糊匹配稳稳亮。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题明确说明修复 motion 和 facial 列表截断问题,与本次 PR 的主要变更一致。
Linked Issues check ✅ Passed PR 修复了空查询时列表结果被截断的问题,使所有唯一的 motion 和 facial 选项都可以显示,并保留非空查询最多返回 60 项的限制。这满足问题 #123 中关于部分表情无法在列表中显示的要求。
Out of Scope Changes check ✅ Passed 新增的 fuzzy-match 测试命令、前端回归测试和后端批量测试都直接支持列表截断修复及问题 #123 的验证。未发现无关代码变更。
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.97.1)

Clippy execution timed out


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.

@coderabbitai
coderabbitai Bot requested a review from GuangChen2333 August 26, 2026 06:10
@GuangChen2333

Copy link
Copy Markdown
Member

Thanks for contributing

@GuangChen2333 GuangChen2333 added the Bug: Incorrect Behavior 行为不符合预期 label Sep 4, 2026
@GuangChen2333 GuangChen2333 self-assigned this Sep 4, 2026
@GuangChen2333
GuangChen2333 merged commit 3a7b3b5 into Untitled-Story:master Sep 4, 2026
2 checks passed
@RoiexLee
RoiexLee deleted the fix/motion-facial-list-limit branch September 4, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug: Incorrect Behavior 行为不符合预期

Projects

None yet

Development

Successfully merging this pull request may close these issues.

加载模组表情时部分表情在列表中无法显示

2 participants