Skip to content

fix: 部分愚人节版本无法安装 Fabric#2676

Merged
xrlzu merged 1 commit intodevfrom
fix/2670
Apr 5, 2026
Merged

fix: 部分愚人节版本无法安装 Fabric#2676
xrlzu merged 1 commit intodevfrom
fix/2670

Conversation

@xrlzu
Copy link
Copy Markdown
Member

@xrlzu xrlzu commented Apr 5, 2026

close #2670

Summary by Sourcery

Bug Fixes:

  • 防止在未选择有效的 Vanilla 版本时错误地显示 Fabric 下载卡片。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Prevent Fabric download card from incorrectly showing when no valid Vanilla version is selected.

@pcl-ce-automation pcl-ce-automation bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: XS PR 大小评估:微型 labels Apr 5, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 5, 2026

审阅者指南(在小型 PR 上折叠)

审阅者指南

调整 Fabric 下载卡片的可见性条件,使其与愚人节逻辑保持一致:仅当选择了有效的 VanillaDrop 且其值 <= 130 时才折叠 Fabric,而不是在所有 VanillaDrop <= 130(包括未初始化/为 0)的情况下都折叠。

更新后的 Fabric 卡片可见性逻辑流程图

flowchart TD
    Start([Start]) --> CheckDrop[Check VanillaDrop value]

    CheckDrop --> IsPositive{VanillaDrop > 0?}
    IsPositive -- No --> ShowFabricDefault[Set CardFabric.Visibility = Visible]
    ShowFabricDefault --> End([End])

    IsPositive -- Yes --> IsOldVersion{VanillaDrop <= 130?}
    IsOldVersion -- Yes --> HideFabric[Set CardFabric.Visibility = Collapsed]
    IsOldVersion -- No --> ShowFabric[Set CardFabric.Visibility = Visible]

    HideFabric --> End
    ShowFabric --> End
Loading

文件级改动

变更 详情 文件
在下载/安装页面中细化 Fabric 卡片的可见性条件,要求 VanillaDrop 为正且处于阈值范围内。
  • 在 Fabric 可见性条件中添加下界检查(VanillaDrop > 0)
  • 确保在 VanillaDrop 为 0 或未设置时保持 Fabric 卡片可见,同时仍然对版本 <= 130 进行隐藏
  • 在通用下载安装页面和实例安装页面中一致地应用相同的条件逻辑
Plain Craft Launcher 2/Pages/PageDownload/PageDownloadInstall.xaml.vb
Plain Craft Launcher 2/Pages/PageInstance/PageInstanceInstall.xaml.vb

针对关联 issue 的评估

Issue 目标 是否解决 说明
#2670 允许为愚人节 Minecraft 版本选择/下载 Fabric,而不是只显示 Legacy Fabric。

可能关联的 issue


提示与命令

与 Sourcery 交互

  • 触发新的审阅: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub Issue: 通过回复审阅评论来请求 Sourcery 从该评论创建 issue。你也可以直接回复审阅评论并写上 @sourcery-ai issue 来创建对应的 issue。
  • 生成 pull request 标题: 在 pull request 标题的任意位置写上 @sourcery-ai,即可在任意时间生成标题。你也可以在 pull request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文任意位置写上 @sourcery-ai summary,即可在你想要的位置生成 PR 摘要。你也可以在 pull request 中评论 @sourcery-ai summary 来在任意时间(重新)生成摘要。
  • 生成审阅者指南: 在 pull request 中评论 @sourcery-ai guide,即可在任意时间(重新)生成审阅者指南。
  • 一次性解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve 来解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,这会很有用。
  • 关闭所有 Sourcery 审阅: 在 pull request 中评论 @sourcery-ai dismiss 以关闭所有现有的 Sourcery 审阅。如果你想从一个全新的审阅开始,这尤其有用——别忘了再评论 @sourcery-ai review 来触发新的审阅!

自定义你的体验

访问你的 控制面板 以:

  • 启用或禁用诸如 Sourcery 生成的 pull request 摘要、审阅者指南等审阅功能。
  • 更改审阅语言。
  • 添加、移除或编辑自定义审阅指令。
  • 调整其他审阅设置。

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the visibility condition for the Fabric download card so it matches the April Fools logic by only collapsing Fabric when a valid VanillaDrop is selected and is <= 130, instead of collapsing for all instances where VanillaDrop <= 130 (including uninitialized/zero).

Flow diagram for updated Fabric card visibility logic

flowchart TD
    Start([Start]) --> CheckDrop[Check VanillaDrop value]

    CheckDrop --> IsPositive{VanillaDrop > 0?}
    IsPositive -- No --> ShowFabricDefault[Set CardFabric.Visibility = Visible]
    ShowFabricDefault --> End([End])

    IsPositive -- Yes --> IsOldVersion{VanillaDrop <= 130?}
    IsOldVersion -- Yes --> HideFabric[Set CardFabric.Visibility = Collapsed]
    IsOldVersion -- No --> ShowFabric[Set CardFabric.Visibility = Visible]

    HideFabric --> End
    ShowFabric --> End
Loading

File-Level Changes

Change Details Files
Refine Fabric card visibility condition in download/install pages to require a positive VanillaDrop value within the threshold.
  • Add a lower-bound check (VanillaDrop > 0) to the Fabric visibility condition
  • Ensure Fabric card remains visible when VanillaDrop is zero or unset, while still hiding it for versions <= 130
  • Apply the same conditional logic consistently across both the general download install page and the instance install page
Plain Craft Launcher 2/Pages/PageDownload/PageDownloadInstall.xaml.vb
Plain Craft Launcher 2/Pages/PageInstance/PageInstanceInstall.xaml.vb

Assessment against linked issues

Issue Objective Addressed Explanation
#2670 Allow selecting/downloading Fabric for the April Fools (愚人节) Minecraft version instead of only showing Legacy Fabric.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

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

  • VanillaDrop > 0 AndAlso VanillaDrop <= 130 这个条件在两个安装页面中都被重复使用;建议将其提取到一个共享的辅助方法或常量中,这样可以让与 Fabric 相关的可见性逻辑集中管理,更易于维护。
  • 边界值 130 是一个“魔法数字”;添加一个具名常量,或在代码中增加一条行内注释来解释为什么在 VanillaDrop <= 130 时需要隐藏 Fabric,会让这个条件背后的意图在未来修改时更加清晰。
给 AI 代理的提示词
Please address the comments from this code review:

## Overall Comments
- The `VanillaDrop > 0 AndAlso VanillaDrop <= 130` condition is duplicated in both install pages; consider extracting this into a shared helper or constant to keep the visibility logic for Fabric centralized and easier to maintain.
- The boundary value `130` is a magic number; adding a named constant or an inline comment explaining why Fabric is hidden for `VanillaDrop <= 130` would make the intent of this condition clearer for future changes.

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

Hey - I've left some high level feedback:

  • The VanillaDrop > 0 AndAlso VanillaDrop <= 130 condition is duplicated in both install pages; consider extracting this into a shared helper or constant to keep the visibility logic for Fabric centralized and easier to maintain.
  • The boundary value 130 is a magic number; adding a named constant or an inline comment explaining why Fabric is hidden for VanillaDrop <= 130 would make the intent of this condition clearer for future changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `VanillaDrop > 0 AndAlso VanillaDrop <= 130` condition is duplicated in both install pages; consider extracting this into a shared helper or constant to keep the visibility logic for Fabric centralized and easier to maintain.
- The boundary value `130` is a magic number; adding a named constant or an inline comment explaining why Fabric is hidden for `VanillaDrop <= 130` would make the intent of this condition clearer for future changes.

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.

@xrlzu xrlzu requested a review from a team April 5, 2026 08:24
@Pigeon0v0 Pigeon0v0 changed the title feat: 使 Fabric 下载卡片显示逻辑匹配愚人节版本 fix: 部分愚人节版本无法安装 Fabric Apr 5, 2026
@pcl-ce-automation pcl-ce-automation bot added 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 and removed 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 labels Apr 5, 2026
@xrlzu xrlzu merged commit 6741a0a into dev Apr 5, 2026
3 checks passed
@xrlzu xrlzu deleted the fix/2670 branch April 5, 2026 08:33
@pcl-ce-automation pcl-ce-automation bot added 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线 and removed 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 labels Apr 5, 2026
xrlzu added a commit to PCL-Community/PCL-CSharpE that referenced this pull request Apr 5, 2026
@xrlzu xrlzu mentioned this pull request Apr 5, 2026
75 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS PR 大小评估:微型 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线

Projects

None yet

Development

Successfully merging this pull request may close these issues.

愚人节版本不能选择下载Fabric,只有Legacy Fabric

3 participants