feat(ui-test): 增加测试页面用于测试 UI,仅 Debug 模式编译 - #3505
Conversation
审阅者指南(Reviewer's Guide)在调试模式下新增一个仅用于调试的顶层 Test 页面(带左右双栏和标题栏按钮),将其接入页面导航和全局页面实例管理,并确保在调试模式下控制台输出使用 UTF-8;同时为新页面增加本地化条目并完成项目接线。 导航到新调试 Test 页面的时序图sequenceDiagram
actor User
participant FormMain
participant ModMain
participant PageTestLeft
participant PageTestRight
User->>FormMain: BtnTitleSelect_Click(btnTitleTest, args)
FormMain->>FormMain: PageChangeActual(stack, PageType.Test)
FormMain->>ModMain: access frmTestLeft
alt frmTestLeft is null
FormMain->>ModMain: create new PageTestLeft()
ModMain-->>PageTestLeft: store instance in frmTestLeft
end
FormMain->>ModMain: access frmTestRight
alt frmTestRight is null
FormMain->>ModMain: create new PageTestRight()
ModMain-->>PageTestRight: store instance in frmTestRight
end
FormMain->>FormMain: PageChangeAnim(frmTestLeft, frmTestRight)
Test 页面中新 Toast 测试操作的时序图sequenceDiagram
actor User
participant PageTestRight
participant HintService
User->>PageTestRight: BtnToastTest_Click(sender, MouseButtonEventArgs)
PageTestRight->>HintService: Hint("测试 Toast:新弹窗系统工作正常", HintType.Info)
文件级变更
提示与命令与 Sourcery 交互
自定义你的使用体验打开你的 控制面板 可以:
获取帮助Original review guide in EnglishReviewer's GuideAdds a debug-only top-level Test page with left/right panes and a title bar button, wires it into the page navigation and global page instances, and ensures console output uses UTF-8 in debug mode; also introduces localization entries and project wiring for the new page. Sequence diagram for navigation to the new debug Test pagesequenceDiagram
actor User
participant FormMain
participant ModMain
participant PageTestLeft
participant PageTestRight
User->>FormMain: BtnTitleSelect_Click(btnTitleTest, args)
FormMain->>FormMain: PageChangeActual(stack, PageType.Test)
FormMain->>ModMain: access frmTestLeft
alt frmTestLeft is null
FormMain->>ModMain: create new PageTestLeft()
ModMain-->>PageTestLeft: store instance in frmTestLeft
end
FormMain->>ModMain: access frmTestRight
alt frmTestRight is null
FormMain->>ModMain: create new PageTestRight()
ModMain-->>PageTestRight: store instance in frmTestRight
end
FormMain->>FormMain: PageChangeAnim(frmTestLeft, frmTestRight)
Sequence diagram for the new toast test action on Test pagesequenceDiagram
actor User
participant PageTestRight
participant HintService
User->>PageTestRight: BtnToastTest_Click(sender, MouseButtonEventArgs)
PageTestRight->>HintService: Hint("测试 Toast:新弹窗系统工作正常", HintType.Info)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - 我在下面给出了一些整体性的反馈:
- 建议将新测试按钮中硬编码的 Tag 值 "4" 替换为从枚举中派生出来的值(例如 ((int)PageType.Test).ToString()),以避免在 PageType 的取值发生变化时,Tag 与之不同步。
- PageType.Test 的取值被包裹在 #if DEBUG 中,因此将来在枚举中新增成员时需要特别注意顺序;你可能会希望为后续的枚举成员显式指定整数值,以避免在 Debug 和 Release 构建之间出现不易察觉的编号变化。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- Consider replacing the hardcoded Tag value "4" for the new test button with something derived from the enum (e.g., ((int)PageType.Test).ToString()) to avoid the Tag getting out of sync if PageType values change.
- The PageType.Test value is wrapped in #if DEBUG, so any future additions to the enum should be carefully ordered; you might want to explicitly assign integer values to later enum members to avoid subtle numbering changes between Debug and Release builds.帮我变得更有用!请对每条评论点击 👍 或 👎,我会根据你的反馈不断改进评审质量。
Original comment in English
Hey - I've left some high level feedback:
- Consider replacing the hardcoded Tag value "4" for the new test button with something derived from the enum (e.g., ((int)PageType.Test).ToString()) to avoid the Tag getting out of sync if PageType values change.
- The PageType.Test value is wrapped in #if DEBUG, so any future additions to the enum should be carefully ordered; you might want to explicitly assign integer values to later enum members to avoid subtle numbering changes between Debug and Release builds.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider replacing the hardcoded Tag value "4" for the new test button with something derived from the enum (e.g., ((int)PageType.Test).ToString()) to avoid the Tag getting out of sync if PageType values change.
- The PageType.Test value is wrapped in #if DEBUG, so any future additions to the enum should be carefully ordered; you might want to explicitly assign integer values to later enum members to avoid subtle numbering changes between Debug and Release builds.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 489a913b5d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
喵喵喵
Summary by Sourcery
添加仅用于调试的 UI 测试页面和导航入口,用于新 UI 的内部测试。
新功能:
增强:
Original summary in English
Summary by Sourcery
Add a debug-only UI test page and navigation entry for internal testing of the new UI.
New Features:
Enhancements: