Skip to content

Revert "feat(download): 折叠前置资源列表"#3082

Closed
lhx077 wants to merge 1 commit into
devfrom
revert-2986-feat/collapse-dependencies
Closed

Revert "feat(download): 折叠前置资源列表"#3082
lhx077 wants to merge 1 commit into
devfrom
revert-2986-feat/collapse-dependencies

Conversation

@lhx077

@lhx077 lhx077 commented Jun 8, 2026

Copy link
Copy Markdown
Member

Reverts #2986

this PR is unnecessary

Summary by Sourcery

还原针对 comp 文件依赖的可折叠依赖栏,并恢复必需和可选依赖列表的直接渲染。

Enhancements:

  • 移除基于 MyCollapseBar 的依赖列表可折叠界面,在 comp 文件卡片中以内联方式渲染必需和可选依赖。
  • 通过内联项目查找、日志记录和条目创建逻辑(不再使用额外的折叠栏控件),简化依赖预加载逻辑。
Original summary in English

Summary by Sourcery

Revert collapsible dependency bars for comp file dependencies and restore direct rendering of required and optional dependency lists.

Enhancements:

  • Remove MyCollapseBar-based collapsible UI for dependency lists and render required and optional dependencies inline in the comp files card.
  • Simplify dependency preload logic by inlining project lookup, logging, and item creation without additional collapse bar controls.

@pcl-ce-automation pcl-ce-automation Bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: L PR 大小评估:大型 labels Jun 8, 2026
@sourcery-ai

sourcery-ai Bot commented Jun 8, 2026

Copy link
Copy Markdown

审阅者指南

回退之前为模组依赖添加的可折叠 dependency-bar 界面,并移除对应的 MyCollapseBar 控件,将 CompFiles 卡片中的依赖列表布局恢复为更简单、始终展开的形式。

文件级更改

更改 详情 文件
回退 CompFiles 卡片中必需/可选依赖的可折叠 dependency bar,并恢复为简单的文本标题加扁平列表项。
  • 更新 CompFilesCardPreload,停止为依赖创建可折叠栏,而是直接在 StackPanel 中渲染必需和可选依赖部分。
  • 在创建项目前,重新引入对依赖 ID 的内联排序和过滤逻辑,以 compProjectCache 进行比对。
  • 恢复必需依赖、可选依赖以及最终版本列表的静态 TextBlock 区段标题,并使用固定的布局属性(字体大小、边距、对齐方式)。
  • 移除构建基于 MyCollapseBar 的依赖区段的私有辅助方法,以及所有相关的切换逻辑。
Plain Craft Launcher 2/Modules/Minecraft/ModComp.cs
移除可复用的 MyCollapseBar 控件,因为折叠式依赖区段已不再使用。
  • 删除 MyCollapseBar 控件实现文件,以及其所有与可折叠面板和动画处理相关的逻辑。
Plain Craft Launcher 2/Controls/MyCollapseBar.cs

提示与命令

与 Sourcery 交互

  • 触发新的审阅: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub issue: 在某条审阅评论下回复,要求 Sourcery 基于该评论创建 issue。你也可以在审阅评论中回复 @sourcery-ai issue 来从该评论创建 issue。
  • 生成拉取请求标题: 在拉取请求标题中的任意位置写上 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文中任意位置写上 @sourcery-ai summary,即可在该位置生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成审阅者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,以标记所有 Sourcery 评论为已解决。如果你已经处理完所有评论且不希望再看到它们,这会非常有用。
  • 撤销所有 Sourcery 审阅: 在拉取请求中评论 @sourcery-ai dismiss,以撤销所有现有的 Sourcery 审阅。尤其适合在你希望从头开始新的审阅时使用——别忘了评论 @sourcery-ai review 来触发新的审阅!

自定义你的体验

前往你的仪表盘

  • 启用或禁用审阅功能,例如由 Sourcery 生成的拉取请求摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、移除或编辑自定义审阅说明。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide

Reverts the previously added collapsible dependency-bar UI for mod dependencies and removes the associated MyCollapseBar control, restoring a simpler, always-expanded dependency list layout for CompFiles cards.

File-Level Changes

Change Details Files
Revert collapsible dependency bar for required/optional dependencies in CompFiles cards and restore simple text headers plus flat item lists.
  • Update CompFilesCardPreload to stop creating collapsible bars for dependencies and instead render required and optional dependency sections directly in the StackPanel.
  • Reintroduce inline sorting and filtering of dependency IDs against compProjectCache before creating items.
  • Restore static TextBlock section headers for required and optional dependencies and a final version-list header, with fixed layout properties (font size, margins, alignment).
  • Remove the private helper method that built MyCollapseBar-based dependency sections and any related toggling logic.
Plain Craft Launcher 2/Modules/Minecraft/ModComp.cs
Remove the reusable MyCollapseBar control now that collapsible dependency sections are no longer used.
  • Delete the MyCollapseBar control implementation file and all of its logic for collapsible panels and animation handling.
Plain Craft Launcher 2/Controls/MyCollapseBar.cs

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

@lhx077 lhx077 closed this Jun 8, 2026
@pcl-ce-automation pcl-ce-automation Bot removed 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: L PR 大小评估:大型 labels Jun 8, 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: d284327f0c

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +3257 to +3260
foreach (var dep in optionalDeps)
{
var item = compProjectCache[dep].ToCompItem(false, false);
stack.Children.Add(item);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep optional dependencies from burying versions

When a project version has many optional dependencies (the previous code explicitly called out library mods/Issue #2873), this loop adds every optional dependency to the visible stack before the actual version list is appended in PageDownloadCompDetail after CompFilesCardPreload. Users opening that version card must now scroll through all optional dependency placeholders/items before reaching the downloadable versions, and the lazy-load behavior will realize them as they enter the viewport; keep optional dependencies collapsed or otherwise hidden until requested.

Useful? React with 👍 / 👎.

@sourcery-ai sourcery-ai 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.

Hey - 我在这里给出一些高层次的反馈:

  • depsoptionalDeps 的过滤逻辑都重复了相同的 Sort + Where + 日志记录模式;可以考虑提取一个小的辅助方法来减少重复代码,并在未来更改时保持行为一致。
  • 在过滤依赖时,你对 compProjectCache.ContainsKey(dep) 调用了两次(一次在 if 语句中,一次在返回语句中);改用 TryGetValue 可以避免重复查找,也能让代码更清晰一些。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- The filtering logic for `deps` and `optionalDeps` repeats the same `Sort` + `Where` + logging pattern; consider extracting a small helper method to reduce duplication and keep behavior consistent for future changes.
- When filtering dependencies you call `compProjectCache.ContainsKey(dep)` twice (once in the `if` and once in the return); switching to `TryGetValue` would avoid redundant lookups and make the code slightly clearer.

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

Hey - I've left some high level feedback:

  • The filtering logic for deps and optionalDeps repeats the same Sort + Where + logging pattern; consider extracting a small helper method to reduce duplication and keep behavior consistent for future changes.
  • When filtering dependencies you call compProjectCache.ContainsKey(dep) twice (once in the if and once in the return); switching to TryGetValue would avoid redundant lookups and make the code slightly clearer.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The filtering logic for `deps` and `optionalDeps` repeats the same `Sort` + `Where` + logging pattern; consider extracting a small helper method to reduce duplication and keep behavior consistent for future changes.
- When filtering dependencies you call `compProjectCache.ContainsKey(dep)` twice (once in the `if` and once in the return); switching to `TryGetValue` would avoid redundant lookups and make the code slightly clearer.

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.

@LuLu-ling LuLu-ling deleted the revert-2986-feat/collapse-dependencies branch June 9, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant