Skip to content

fix(setup-java): 修复 Java 选择页面刷新无效 - #3609

Merged
Chiloven945 merged 1 commit into
devfrom
fix/3562
Sep 16, 2026
Merged

Chiloven945 merged 1 commit into
devfrom
fix/3562

Conversation

@LuLu-ling

@LuLu-ling LuLu-ling commented Sep 11, 2026

Copy link
Copy Markdown
Member

close #3562

Sourcery 总结

修复 Java 设置页面的刷新和选择回退行为。

错误修复:

  • 修复 Java 选择刷新问题,确保在强制刷新列表时能够检测到新扫描到的 Java 安装,并重新检查其可用性。
  • 当配置的 Java 选择不再匹配任何可用安装时,清除无效的配置选择,并回退到自动选择。
Original summary in English

Summary by Sourcery

Fix the Java setup page refresh and selection fallback behavior.

Bug Fixes:

  • Fix Java selection refresh so newly scanned Java installations are detected and availability is rechecked when the list is forcibly refreshed.
  • Clear an invalid configured Java selection and fall back to automatic selection when it no longer matches an available installation.
Original summary in English

@LuLu-ling
LuLu-ling requested a review from a team September 11, 2026 15:43
@pcl-ce-automation pcl-ce-automation Bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: XS PR 大小评估:微型 labels Sep 11, 2026
@sourcery-ai

sourcery-ai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor
审查者指南(小型 PR 中折叠显示)

审查者指南

更新 Java 列表加载逻辑,使强制刷新页面时执行强制 Java 重新扫描、重新验证可用性,然后返回排序后的条目,从而修复 Java 选择页面刷新无效的问题。

强制刷新 Java 页面时的时序图

sequenceDiagram
    participant PageSetupJava
    participant Loader
    participant JavaManager
    participant ModJava

    PageSetupJava->>Loader: Load_GetJavaList(loader)
    alt loader.input or loader.isForceRestarting
        Loader->>JavaManager: ScanJavaAsync(force: true)
        JavaManager-->>Loader: Java scan complete
        Loader->>JavaManager: CheckAllAvailability()
    end
    Loader->>ModJava: GetSortedJavaList()
    ModJava-->>Loader: sorted Java entries
Loading

文件级变更

变更 详情 文件
确保刷新 Java 选择页面时执行强制重新扫描,并刷新 Java 可用性数据。
  • 除了正常的输入触发加载外,在加载器被强制重启时也触发 Java 扫描。
  • 将强制标志传递给 Java 扫描操作。
  • 在生成排序后的列表之前,重新检查所有已发现的 Java 安装的可用性。
Plain Craft Launcher 2/Pages/PageSetup/PageSetupJava.xaml.cs

针对关联 issue 的评估

Issue 目标 已解决 说明
#3562 确保刷新 Java 选择页面时重新扫描系统,并移除或更新因删除操作或目录变更而失效的 Java 条目。

可能关联的 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

Updates Java list loading so a forced page refresh performs a forced Java rescan, revalidates availability, and then returns the sorted entries, fixing ineffective refreshes on the Java selection page.

Sequence diagram for forced Java page refresh

sequenceDiagram
    participant PageSetupJava
    participant Loader
    participant JavaManager
    participant ModJava

    PageSetupJava->>Loader: Load_GetJavaList(loader)
    alt loader.input or loader.isForceRestarting
        Loader->>JavaManager: ScanJavaAsync(force: true)
        JavaManager-->>Loader: Java scan complete
        Loader->>JavaManager: CheckAllAvailability()
    end
    Loader->>ModJava: GetSortedJavaList()
    ModJava-->>Loader: sorted Java entries
Loading

File-Level Changes

Change Details Files
Ensure refreshing the Java selection page performs a forced rescan and refreshes Java availability data.
  • Trigger Java scanning when the loader is force-restarted, in addition to normal input-triggered loads.
  • Pass the force flag to the Java scan operation.
  • Recheck availability for all discovered Java installations before producing the sorted list.
Plain Craft Launcher 2/Pages/PageSetup/PageSetupJava.xaml.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#3562 Ensure refreshing the Java selection page rescans the system and removes or updates Java entries that became invalid after deletion or directory changes.

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

你好——我已经审阅了你的更改,看起来很棒!


Sourcery 对开源项目免费——如果你喜欢我们的评审,请考虑分享它们 ✨
Original comment in English

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c06fcd5359

ℹ️ 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".

Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupJava.xaml.cs
@pcl-ce-automation pcl-ce-automation Bot added size: S PR 大小评估:小型 and removed size: XS PR 大小评估:微型 labels Sep 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0614fbec4d

ℹ️ 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".

Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupJava.xaml.cs Outdated
@pcl-ce-automation pcl-ce-automation Bot added size: XS PR 大小评估:微型 and removed size: S PR 大小评估:小型 labels Sep 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c06fcd5359

ℹ️ 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".

Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupJava.xaml.cs
@pcl-ce-automation pcl-ce-automation Bot added 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 and removed 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 labels Sep 16, 2026
@Chiloven945
Chiloven945 merged commit ab6e2f1 into dev Sep 16, 2026
5 checks passed
@pcl-ce-automation pcl-ce-automation Bot added 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线 and removed 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 labels Sep 16, 2026
@Chiloven945
Chiloven945 deleted the fix/3562 branch September 16, 2026 07:53
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.

[C#]: Java选择页面刷新无效

3 participants