Skip to content

feat: 桌宠形象选择改进 - #375

Merged
freedomkk-qfeng merged 9 commits into
ECNU:mainfrom
FeletexGee:feat/pet-selection-improvement
Nov 30, 2026
Merged

freedomkk-qfeng merged 9 commits into
ECNU:mainfrom
FeletexGee:feat/pet-selection-improvement

Conversation

@FeletexGee

@FeletexGee FeletexGee commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

问题与修改

桌宠形象增多后,设置页平铺的静态卡片难以浏览,也无法预览每款形象的实际动作。因此急需实现桌宠选择器这一feature。本 PR 实现 #363 讨论中的方案 B「自适应选择器」。

  • 设置页展示当前形象和「更换形象」入口。宽窗口并排展示形象列表和动作预览,窄窗口在两者之间切换,返回时保留列表滚动位置。
  • 预览按需加载当前动作的内置素材,与悬浮桌宠共用绘制和帧时序。画面随预览区等比缩放,常规动作和更多动作各占一行,播放与暂停共用一个居中的按钮。
    • 播放/暂停设计成形象预览区右上角的圆形图标按钮。
    • 动作选择按钮为居中圆角矩形。减小了圆角以兼顾在宽屏和窄屏下的显示效果。
    • 动态动作循环播放,以便于预览。
  • 只有点击「使用此形象」才保存。保存成功后更新「当前使用」标记,选择器保持打开,并保留当前预览动作,以便比较和更换不同动作。保存失败可在原处重试。

参见Issue #363

验证

我已在Linux环境下,在Web浏览器中完成了初步功能验证。同时完成了真人测试和Codex多模态自动化测试。

  • node scripts/packages/manage.mjs check dsh-desktop-pet 通过,覆盖插件编译和桌宠包测试。
  • node --test dsh-electron/tests/desktop-pet-core.test.mjs 通过。
  • node scripts/check-source-docs.mjs 和 git diff --check main...HEAD 通过。
  • 在本地 Edge 中使用真实内置素材和测试配置存储验证 320–1040px 窗口、2 倍像素密度、播放与暂停、取消与 Esc、保存失败重试,以及保存后窗口保持打开。
  • 待验证 Windows 和 macOS 桌面包中的实际换装与悬浮窗行为。

宽屏和窄屏下的截图分别如下,供参考。

127 0 0 1_4173_ 

兼容性与后续事项

兼容性与后续事项

  • 新增只读的形象目录和动作预览接口。已有 status 接口及 skin 配置继续兼容,无需迁移。
  • 已更新中英文使用说明,并在桌宠插件 Changelog 中补记 0.1.6 未发布条目。产品仍使用锁定的 0.1.5 npm 包,插件发布和产品锁更新另行处理。

@M1chaelee

Copy link
Copy Markdown
Contributor

个人审美认为播放/暂停按钮可以放到右上角~

@FeletexGee FeletexGee left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

个人审美认为播放/暂停按钮可以放到右上角~

好的,在改了。我觉得这样确实更漂亮些。

@FeletexGee
FeletexGee marked this pull request as ready for review November 28, 2026 17:07

@FeletexGee FeletexGee left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(写了一些Review)
已完成可使用的初版选择器,支持动作实时预览所有动作展示。

@freedomkk-qfeng
freedomkk-qfeng merged commit 0847b99 into ECNU:main Nov 30, 2026
9 checks passed
@FeletexGee
FeletexGee deleted the feat/pet-selection-improvement branch November 30, 2026 09:26
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