feat(macOS): 添加复制版本信息功能并显示 Core 版本 - #90
Open
ColdSpellhere wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Hey - 我在这里给出了一些整体性的反馈:
MAAProvider.coreVersion目前在每次访问时都会调用AsstGetVersion并构造一个String;建议缓存这个结果(例如使用 lazy static),以及/或者对可能为 null 或无效的 C 字符串做处理,以避免重复的 FFI 调用,以及在指针异常时可能发生的崩溃。- 版本文案的格式现在在
MaaVersionInfo.text中构造了一次,而在日志消息中又单独构造了一次(MaaCore 版本vsCore Version);建议将这部分格式化逻辑(以及术语)统一起来,这样可以在 UI 文案和日志之间长期保持一致性。
给 AI 代理的提示
Please address the comments from this code review:
## Overall Comments
- `MAAProvider.coreVersion` currently calls `AsstGetVersion` and constructs a `String` every time it's accessed; consider caching the result (e.g., a lazy static) and/or handling a potential null/invalid C string to avoid repeated FFI calls and possible crashes if the pointer is unexpected.
- The version text format is now constructed in `MaaVersionInfo.text` and separately in the log message (`MaaCore 版本` vs `Core Version`); consider centralizing the formatting (and terminology) so that the UI copy and logs stay consistent over time.帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据这些反馈来改进以后的代码审查。
Original comment in English
Hey - I've left some high level feedback:
MAAProvider.coreVersioncurrently callsAsstGetVersionand constructs aStringevery time it's accessed; consider caching the result (e.g., a lazy static) and/or handling a potential null/invalid C string to avoid repeated FFI calls and possible crashes if the pointer is unexpected.- The version text format is now constructed in
MaaVersionInfo.textand separately in the log message (MaaCore 版本vsCore Version); consider centralizing the formatting (and terminology) so that the UI copy and logs stay consistent over time.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- `MAAProvider.coreVersion` currently calls `AsstGetVersion` and constructs a `String` every time it's accessed; consider caching the result (e.g., a lazy static) and/or handling a potential null/invalid C string to avoid repeated FFI calls and possible crashes if the pointer is unexpected.
- The version text format is now constructed in `MaaVersionInfo.text` and separately in the log message (`MaaCore 版本` vs `Core Version`); consider centralizing the formatting (and terminology) so that the UI copy and logs stay consistent over time.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
Author
已根据建议调整 |
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.
变更内容
实现说明
CFBundleShortVersionStringAsstGetVersion()获取resourceChannel.version()结果@_silgen_name("AsstGetVersion")绑定 Core 符号本地测试
Debug 构建下复制版本信息结果示例:
GUI 资源版本日志示例:
Debug 构建下 UI Version 来自
Version.xcconfig中的MARKETING_VERSION = 1.0,Core Version 来自 Debug Core 的MAA_VERSION,因此显示为v1.0和DEBUG_VERSION。展示视频
Recording.at.2026-05-25.15.19.48.mp4
由 Sourcery 提供的摘要
为 macOS UI 添加复制详细版本信息的支持,并在应用中暴露 Core 版本数据。
新功能:
增强内容:
Original summary in English
Summary by Sourcery
Add macOS UI support for copying detailed version information and expose Core version data in the app.
New Features:
Enhancements: