Repository navigation
feat(reference): 引用弹窗技能库收藏置顶,并支持按中文展示名搜索 - #89
Merged
Merged
Conversation
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.
问题
原因
写作 Skill 条目的
title是机器名(如battle-scene,也是 token 路由用的名字),列表上显示的是displayTitle(中文展示名「战斗描写」)。弹窗的过滤只比对item.title,所以按看得见的中文名搜索永远匹配不上。修复
title与displayTitle(展示名被截断成...时先去掉省略号)。useFavoriteSkillStore),在技能库各子 tab 中把已收藏的技能(writing:<skillId>/de-ai:<skillId>,与技能库页的收藏键一致)稳定置顶;收藏与非收藏内部保持原顺序。文风、角色灵魂没有收藏入口,不受影响。测试
ReferencePickerDialog.spec.tsx新增 4 条:中文展示名搜索、收藏置顶渲染顺序、pinFavoriteSkills稳定排序与按库区分、截断展示名匹配。回退实现后 3 条用例会失败,确认它们能抓到问题。npx vitest run src/components/reference src/lib/reference:7 个文件 69 条全部通过。npm run typecheck:只有 main 上原本就有的 1 个错误(src/lib/novel/outline-context-index.ts:221),与本改动无关。