Skip to content

fix: 修复未能遵守 PI 规定的短边尺寸的问题#200

Merged
MistEO merged 1 commit into
MistEO:mainfrom
isHarryh:fix-issue-198
May 3, 2026
Merged

fix: 修复未能遵守 PI 规定的短边尺寸的问题#200
MistEO merged 1 commit into
MistEO:mainfrom
isHarryh:fix-issue-198

Conversation

@isHarryh

@isHarryh isHarryh commented May 3, 2026

Copy link
Copy Markdown
Contributor

概要

此 PR 是为了解决 #198

关联

Fix #198

Summary by Sourcery

通过所有连接路径传播控制器显示短边设置,并在建立控制器连接时应用该设置。

Bug Fixes:

  • 在设置截图时,按照每个控制器配置的 display_short_side 值来处理,而不是始终使用硬编码的短边值。

Enhancements:

  • 为所有控制器配置类型添加可选的 display_short_side 字段,并将其贯通到前端和后端的配置结构中。
Original summary in English

Summary by Sourcery

Propagate the controller display short side setting through all connection paths and apply it when establishing controller connections.

Bug Fixes:

  • Honor the configured display_short_side per controller instead of always using a hardcoded short-side value when setting up screenshots.

Enhancements:

  • Add an optional display_short_side field to all controller configuration types and wire it through the frontend and backend config structures.

Bug 修复:

  • 在通过连接面板、设备选择器、工具栏和设备连接钩子连接控制器时,保留并传递 display_short_side 配置,以修复短边尺寸行为不正确的问题。

增强功能:

  • 扩展控制器配置的 TypeScript 类型,在所有控制器类型(Adb、Win32、PlayCover、Gamepad)中加入可选的 display_short_side 字段。
Original summary in English

Summary by Sourcery

通过所有连接路径传播控制器显示短边设置,并在建立控制器连接时应用该设置。

Bug Fixes:

  • 在设置截图时,按照每个控制器配置的 display_short_side 值来处理,而不是始终使用硬编码的短边值。

Enhancements:

  • 为所有控制器配置类型添加可选的 display_short_side 字段,并将其贯通到前端和后端的配置结构中。
Original summary in English

Summary by Sourcery

Propagate the controller display short side setting through all connection paths and apply it when establishing controller connections.

Bug Fixes:

  • Honor the configured display_short_side per controller instead of always using a hardcoded short-side value when setting up screenshots.

Enhancements:

  • Add an optional display_short_side field to all controller configuration types and wire it through the frontend and backend config structures.

@isHarryh isHarryh force-pushed the fix-issue-198 branch 2 times, most recently from cde2140 to 6df71d9 Compare May 3, 2026 16:10
@isHarryh isHarryh marked this pull request as ready for review May 3, 2026 18:34

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - 我在这里给出了一些整体性的反馈:

  • TypeScript 中的控制器配置类型为 Adb/Win32/PlayCover/Gamepad 添加了 display_short_side 字段,但没有为 WlRoots 添加;而现在 Rust 中的 ControllerConfig 枚举已经包含了这个字段。建议更新 WlRootsControllerConfig 接口,以保持 TS 与 Rust 的配置同步。
  • 当前默认的短边值 720 是在 connect_controller_impl 中硬编码的;建议将其提取为具名常量,以避免“魔法数字”,也方便未来修改默认值。
给 AI Agents 的提示
Please address the comments from this code review:

## Overall Comments
- TypeScript 中的控制器配置类型为 Adb/Win32/PlayCover/Gamepad 添加了 `display_short_side` 字段,但没有为 WlRoots 添加;而现在 Rust 中的 `ControllerConfig` 枚举已经包含了这个字段。建议更新 `WlRootsControllerConfig` 接口,以保持 TS 与 Rust 的配置同步。
- 当前默认的短边值 `720` 是在 `connect_controller_impl` 中硬编码的;建议将其提取为具名常量,以避免“魔法数字”,也方便未来修改默认值。

Sourcery 对开源项目是免费的——如果你觉得我们的评审对你有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English

Hey - I've left some high level feedback:

  • The TypeScript controller config types add display_short_side for Adb/Win32/PlayCover/Gamepad but not for WlRoots, which now has this field in the Rust ControllerConfig enum; consider updating the WlRootsControllerConfig interface to keep the TS and Rust configs in sync.
  • The default short-side value 720 is now hardcoded in connect_controller_impl; consider extracting it to a named constant to avoid magic numbers and make future changes to the default easier.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The TypeScript controller config types add `display_short_side` for Adb/Win32/PlayCover/Gamepad but not for WlRoots, which now has this field in the Rust `ControllerConfig` enum; consider updating the `WlRootsControllerConfig` interface to keep the TS and Rust configs in sync.
- The default short-side value `720` is now hardcoded in `connect_controller_impl`; consider extracting it to a named constant to avoid magic numbers and make future changes to the default easier.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@MistEO MistEO merged commit 91909ca into MistEO:main May 3, 2026
9 checks passed
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.

未能遵守 PI 中规定的截图的短边长度参数

2 participants