feat(fight): 支持关卡开放状态及今日提示 - #99
Open
GlennnnnX wants to merge 1 commit into
Open
Conversation
GlennnnnX
marked this pull request as ready for review
July 13, 2026 14:59
There was a problem hiding this comment.
Hey - 我在这里给出了一些整体性的反馈:
- 从
clientChannel推导StageServer的逻辑,以及使用MAAProvider.version的逻辑在多个视图中重复出现(例如FightSettingsView和TodayStageTipView);建议将这些逻辑集中到MAAViewModel上的辅助方法中,以避免逻辑偏移并简化未来的更改。 - 在
StageCatalog.reloadStageCatalog(at:)及相关调用中,resetUnavailableFightStages(now:)会在每次目录重载后无条件调用(包括失败的情况);如果之后需要与任务开始时间严格保持一致,建议从调用方传入同一个now值,而不是在多个位置分别捕获Date()。
面向 AI 代理的提示
请处理本次代码审查中的这些评论:
## 总体评论
- 从 `clientChannel` 推导 `StageServer` 的逻辑,以及使用 `MAAProvider.version` 的逻辑在多个视图中重复出现(例如 `FightSettingsView` 和 `TodayStageTipView`);建议将这些逻辑集中到 `MAAViewModel` 上的辅助方法中,以避免逻辑偏移并简化未来的更改。
- 在 `StageCatalog.reloadStageCatalog(at:)` 及相关调用中,`resetUnavailableFightStages(now:)` 会在每次目录重载后无条件调用(包括失败的情况);如果之后需要与任务开始时间严格保持一致,建议从调用方传入同一个 `now` 值,而不是在多个位置分别捕获 `Date()`。帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English
Hey - I've left some high level feedback:
- The logic to derive
StageServerfromclientChanneland to useMAAProvider.versionis duplicated in multiple views (e.g.,FightSettingsViewandTodayStageTipView); consider centralizing these into helper methods onMAAViewModelto avoid drift and simplify future changes. - In
StageCatalog.reloadStageCatalog(at:)and related calls,resetUnavailableFightStages(now:)is invoked unconditionally after any catalog reload (including failure cases); if this ever needs to be time-consistent with task start, consider passing the samenowvalue through from the caller rather than capturingDate()multiple times.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The logic to derive `StageServer` from `clientChannel` and to use `MAAProvider.version` is duplicated in multiple views (e.g., `FightSettingsView` and `TodayStageTipView`); consider centralizing these into helper methods on `MAAViewModel` to avoid drift and simplify future changes.
- In `StageCatalog.reloadStageCatalog(at:)` and related calls, `resetUnavailableFightStages(now:)` is invoked unconditionally after any catalog reload (including failure cases); if this ever needs to be time-consistent with task start, consider passing the same `now` value through from the caller rather than capturing `Date()` multiple times.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Author
|
Thanks for the review! For the For the time consistency point, the current behavior is intentional:
Given that, I plan to keep the current implementation for this PR, but will revisit the helper extraction if the shared derivation grows. |
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.
修改内容
为刷理智设置增加完整的关卡开放状态,并在任务列表底部增加基础版「今日关卡小提示」。
clientChannel使用对应服务器时区,并以服务器时间04:00作为换日边界PR-A/B/C/D芯片本的每周开放表gui/StageActivityV2.json,展示有效活动关卡,并支持resourceCollection期间资源本全部开放Fight参数追加失败被误报为连接失败的问题,并丢弃部分构造的 task handleRelated to MaaAssistantArknights/MaaAssistantArknights#9973.
本实现参考了 #42 的 SwiftUI 接入位置,但重新实现了日期、服务器时区、04:00 换日、活动数据、fallback 与测试逻辑。
验证
MeoAsstMacTests:12/12 tests passedBUILD SUCCEEDEDswift-format lint --strict(本次新增/实质修改的 Swift 文件)xcstringstool compile Resources/Localizable.xcstringsgit diff --check本 PR 不包含
这些可以在本 PR 的基础上单独迭代,避免扩大当前改动范围。
Summary by Sourcery
在战斗设置和任务列表中支持“按服务器区分的关卡开放状态”和“每日关卡小提示”,同时加强任务启动错误处理并规范化关卡配置。
New Features:
StageActivityV2.json支持的关卡目录,用于根据服务器确定关卡开放状态和每日提示。Bug Fixes:
Enhancements:
Tests:
Original summary in English
Summary by Sourcery
Support server-aware stage availability and daily stage tips in fight settings and task list, while hardening task startup error handling and stage configuration normalization.
New Features:
Bug Fixes:
Enhancements:
Tests:
新功能:
StageActivityV2.json中解析关卡目录,为素材和芯片关卡提供内置日程表,并处理按服务器划分的时间。错误修复:
改进:
测试:
StageCatalog单元测试,覆盖每周日程、4:00 服务器日切换、素材收集覆盖规则、支线故事活动时间窗口和版本门控、规范化行为以及“今日摘要”的生成。Original summary in English
Summary by Sourcery
在战斗设置和任务列表中支持“按服务器区分的关卡开放状态”和“每日关卡小提示”,同时加强任务启动错误处理并规范化关卡配置。
New Features:
StageActivityV2.json支持的关卡目录,用于根据服务器确定关卡开放状态和每日提示。Bug Fixes:
Enhancements:
Tests:
Original summary in English
Summary by Sourcery
Support server-aware stage availability and daily stage tips in fight settings and task list, while hardening task startup error handling and stage configuration normalization.
New Features:
Bug Fixes:
Enhancements:
Tests: