Repository navigation
feat(pet): 动画可声明 facing,朝右画的拖动与探头不再方向相反 - #258
Merged
Merged
Conversation
桌宠假定拖动、探头动画都朝左画,向右移动或贴左边缘时镜像。朝右画的 形象因此方向相反。动画新增可选的 facing(left 默认、right):姿势只说明 要朝哪边,绘制时与动画的 facing 比较,不一致才镜像;其他动画不受影响, 已有形象的规范化结果不变。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
JunieXD
reviewed
Oct 31, 2026
JunieXD
left a comment
Contributor
There was a problem hiding this comment.
在 packages/dsh-desktop-pet 下执行 npm ci && npm run check(Node 26.12.0、24.18.0):构建通过,17/17 测试通过。核对了以下几点:已有形象拖动和探头的镜像结果与改之前一致;4 款内置形象规范化后的结果不变;缺少 drag/peek 时回退到 idle,取的是 idle 的 facing,和实际显示的画面一致;react、greet 等插入动作不带方向,不受影响。
建议修改:
test/page-facing.test.mjs:35可能偶发失败:init处理函数是async(lib/page/pet.js:266),这里调用时没有await,后面推进的几轮事件循环不能保证真实的 manifest 读取已经完成。模拟读取变慢时,第一条断言会得到undefined。建议改成await handlers.init(...)。另外,左边缘那条断言scale === 1在仍处于 idle 时也成立,建议同时断言当前画的是peek。page-clock.test.mjs也是同样写法。- CHANGELOG 有两个未发布分区:新增的
## 未发布 / Unreleased下面已有## 0.1.1 — 未发布 / Unreleased,包版本仍是 0.1.1,新条目可以并进 0.1.1。
可选,不影响合并:
按评审意见:init 处理函数是 async,测试改为 await,避免读取变慢时断言落空;左右边缘都断言当前画的是 peek, 不只看镜像比例。page-clock 测试同样 await。facing 条目并入 0.1.1 未发布分区。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
桌宠默认拖动、探头动画朝左画,向右移动或贴左边缘时镜像,朝右画的形象因此方向相反。动画新增可选的
facing(left默认、right):姿势只说明要朝哪边,绘制时与动画的facing比较,不一致才镜像;其他动画和已有形象的结果不变。新增test/page-facing.test.mjs,桌宠测试 15 项通过;源码收据已刷新(保留 createdAt),审计无错误。🤖 Generated with Claude Code