Skip to content

feat: 添加实例列表右键编辑功能 (#6000) - #6038

Merged
Glavo merged 4 commits into
HMCL-dev:mainfrom
NWMA-FYWF:main
Sep 11, 2026
Merged

Glavo merged 4 commits into
HMCL-dev:mainfrom
NWMA-FYWF:main

Conversation

@NWMA-FYWF

Copy link
Copy Markdown
Contributor
  • 实例列表项支持右键编辑
  • 编辑页面名称唯一性验证排除自身
  • 路径变化后不再自动修改名称

@NWMA-FYWF

Copy link
Copy Markdown
Contributor Author
截图 2026-05-02 11-10-20

@NWMA-FYWF NWMA-FYWF changed the title feat: 添加实例列表右键编辑功能 (#6000) feat: 添加实例列表右键编辑功能 #6000 May 2, 2026
@NWMA-FYWF NWMA-FYWF changed the title feat: 添加实例列表右键编辑功能 #6000 feat: 添加实例列表右键编辑功能 (#6000) May 3, 2026
@NWMA-FYWF NWMA-FYWF closed this May 4, 2026
@NWMA-FYWF NWMA-FYWF reopened this May 4, 2026

@Glavo Glavo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

本审查建议由 GPT-5 生成


已将具体审查建议标注在对应代码行。

Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/profile/ProfilePage.java Outdated
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/profile/ProfilePage.java Outdated
@NWMA-FYWF

Copy link
Copy Markdown
Contributor Author

本审查建议由 GPT-5 生成

已将具体审查建议标注在对应代码行。

相关问题已在 提交 9cf13c7 中解决

Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/profile/ProfileListItem.java Outdated
@Glavo

Glavo commented May 11, 2026

Copy link
Copy Markdown
Member

/gemini review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a context menu for profile list items and improves the profile editing page. Key changes include adding weak listeners to ProfileListItem for reactive UI updates, implementing the ProfileListPopupMenu class, and refining validation logic and listener lifecycle management in ProfilePage. Feedback suggests refactoring ProfileListPopupMenu into a utility class to eliminate redundant inheritance and using FXUtils to dynamically calculate popup positions to prevent the menu from being cut off by screen edges.

Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/profile/ProfileListPopupMenu.java Outdated
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/profile/ProfileListPopupMenu.java Outdated
@Glavo

Glavo commented May 15, 2026

Copy link
Copy Markdown
Member

/gemini review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request enhances the profile management UI by adding a context menu for editing profiles and implementing weak listeners to keep the profile list synchronized with data changes. It also updates the ProfilePage to improve name validation and directory-based name suggestions. Review feedback recommends restricting the registration and removal of name-suggestion listeners to the new profile creation flow to avoid unnecessary overhead during profile edits.

Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/profile/ProfilePage.java Outdated
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/profile/ProfilePage.java Outdated
@Glavo

Glavo commented May 18, 2026

Copy link
Copy Markdown
Member

/gemini review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a popup menu for profile items and enhances the profile list with reactive updates for name and directory changes. It also refines the profile editing page to correctly handle existing profiles and name validation. A review comment suggests delaying the removal of listeners in the save method to ensure that automatic renaming remains functional if path validation fails.

Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/profile/ProfilePage.java Outdated
@github-actions github-actions Bot added the 40+ label Jul 17, 2026
@Glavo

Glavo commented Sep 11, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T12:32:43.578845Z 85a3e1e Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 85a3e1e8f3

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

menu.getContent().add(new IconedMenuItem(
SVG.EDIT,
i18n("button.edit"),
() -> Controllers.navigate(new GameDirectoryPage(gameDirectory)),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Exclude the edited directory from duplicate-name validation

For every user-created directory whose custom name is unchanged, this new edit route opens GameDirectoryPage with that name, but the validator at GameDirectoryPage.java:131-133 finds the same directory in getGameDirectories() and marks the field invalid. Consequently the Save button remains disabled when the user only changes the path or relative-path setting; the duplicate check must ignore gameDirectory itself.

Useful? React with 👍 / 👎.

menu.getContent().add(new IconedMenuItem(
SVG.EDIT,
i18n("button.edit"),
() -> Controllers.navigate(new GameDirectoryPage(gameDirectory)),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Disable automatic name inference when opening the editor

When the selected directory path ends in .minecraft, constructing this edit page immediately invokes locationChangeListener.changed(...) at GameDirectoryPage.java:198, which replaces the existing display name with the parent-directory name at lines 193-195. Thus opening this menu and saving an unrelated path/toggle change can silently rename the directory (including the built-in default directory); name inference should be limited to creation rather than this edit flow.

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added 10+ and removed 40+ labels Sep 11, 2026
@Glavo
Glavo merged commit ed7ef92 into HMCL-dev:main Sep 11, 2026
3 checks passed
@derskys

derskys commented Sep 11, 2026

Copy link
Copy Markdown

界面内必须改名才能保存这个算是bug吗

更改了路径与下面的相对路径选项, 不能保留原先的名字,不改名的话不让保存

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants