fix(mod-main): update visual properties of hints on alignment change#3157
fix(mod-main): update visual properties of hints on alignment change#3157LuLu-ling wants to merge 2 commits into
Conversation
审阅者指南(在小型 PR 中折叠)审阅者指南通过在运行显示动画之前调整边框、对齐和边距属性,使现有提示(hint)UI 元素在对齐方式发生变化时能够立即反映变化。 HintTick 中更新提示对齐处理的时序图sequenceDiagram
participant HintTick
participant ModAnimation
participant doubleStack
participant textBlock
HintTick->>ModAnimation: AniIsRun(Hint_Show_id)
alt [AniIsRun returns false]
HintTick->>ModAnimation: AniStop(Hint_Hide_id)
HintTick->>doubleStack: set CornerRadius (based on alignRight)
HintTick->>doubleStack: set HorizontalAlignment (based on alignRight)
HintTick->>doubleStack: set Margin (based on alignRight)
HintTick->>doubleStack: access Child
alt [Child is TextBlock]
HintTick->>textBlock: set Margin (based on alignRight)
end
HintTick->>ModAnimation: AniStart(animations)
end
文件级变更
提示与命令与 Sourcery 交互
自定义你的使用体验访问你的 控制面板 以:
获取帮助Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates existing hint UI elements to immediately reflect alignment changes by adjusting border, alignment, and margin properties before running the show animation. Sequence diagram for updated hint alignment handling in HintTicksequenceDiagram
participant HintTick
participant ModAnimation
participant doubleStack
participant textBlock
HintTick->>ModAnimation: AniIsRun(Hint_Show_id)
alt [AniIsRun returns false]
HintTick->>ModAnimation: AniStop(Hint_Hide_id)
HintTick->>doubleStack: set CornerRadius (based on alignRight)
HintTick->>doubleStack: set HorizontalAlignment (based on alignRight)
HintTick->>doubleStack: set Margin (based on alignRight)
HintTick->>doubleStack: access Child
alt [Child is TextBlock]
HintTick->>textBlock: set Margin (based on alignRight)
end
HintTick->>ModAnimation: AniStart(animations)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - 我给出了一些整体性的反馈:
- 针对
doubleStack的、依赖对齐方式的视觉设置(圆角、水平对齐、外边距,以及子TextBlock的外边距)现在出现了重复逻辑;建议将这部分提取到一个辅助方法中,这样对齐方式的变更和初始设置就可以共享同一个“单一事实来源”。 - 硬编码的外边距和圆角值(
20d、-70d、33d等)会让布局难以微调;建议将这些值定义为具名常量,或复用已有的样式资源,以更清晰地表达其意图,并简化后续的调整。
给 AI 代理的提示词
Please address the comments from this code review:
## Overall Comments
- The alignment-dependent visual setup for `doubleStack` (corner radius, horizontal alignment, margins, and child `TextBlock` margin) is now duplicated logic; consider extracting this into a helper method so that alignment changes and initial setup share a single source of truth.
- The hardcoded margin and corner radius values (`20d`, `-70d`, `33d`, etc.) make the layout harder to tune; consider defining these as named constants or reusing existing style resources to clarify their intent and simplify future adjustments.帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈来改进之后的评审。
Original comment in English
Hey - I've left some high level feedback:
- The alignment-dependent visual setup for
doubleStack(corner radius, horizontal alignment, margins, and childTextBlockmargin) is now duplicated logic; consider extracting this into a helper method so that alignment changes and initial setup share a single source of truth. - The hardcoded margin and corner radius values (
20d,-70d,33d, etc.) make the layout harder to tune; consider defining these as named constants or reusing existing style resources to clarify their intent and simplify future adjustments.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The alignment-dependent visual setup for `doubleStack` (corner radius, horizontal alignment, margins, and child `TextBlock` margin) is now duplicated logic; consider extracting this into a helper method so that alignment changes and initial setup share a single source of truth.
- The hardcoded margin and corner radius values (`20d`, `-70d`, `33d`, etc.) make the layout harder to tune; consider defining these as named constants or reusing existing style resources to clarify their intent and simplify future adjustments.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: 71dcb5d97c
ℹ️ 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".
|
由于有了 #3160 ,此 PR 已经不再需要 |
Summary by Sourcery
增强:
Original summary in English
Summary by Sourcery
Enhancements: