Skip to content

[Enhancement] 账户列表优化#6093

Open
ToobLac wants to merge 8 commits into
HMCL-dev:mainfrom
ToobLac:account-order
Open

[Enhancement] 账户列表优化#6093
ToobLac wants to merge 8 commits into
HMCL-dev:mainfrom
ToobLac:account-order

Conversation

@ToobLac
Copy link
Copy Markdown
Contributor

@ToobLac ToobLac commented May 16, 2026

  • 搜索
  • 拖拽改变顺序(搜索时禁用)

Closes #5999 Resolves #5615 Resolves #3046

CalbootOnceMore and others added 2 commits May 1, 2026 21:57
@Glavo
Copy link
Copy Markdown
Member

Glavo commented May 29, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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 search functionality and drag-and-drop reordering for the account list page. The review feedback highlights several critical improvements: wrapping the reordering list operations in a try-finally block to guarantee that the selection check flag is safely reset, preventing a potential NullPointerException by checking for null search queries before converting to lowercase, and avoiding an IndexOutOfBoundsException by validating the index when toggling an account's portable status.

Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java Outdated
Copy link
Copy Markdown
Member

@Glavo Glavo left a comment

Choose a reason for hiding this comment

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

本 PR 可以把全局账户拖到便携账户中间,但实际这两类账户被存储在不同的文件里,这种次序不会被持久化,下次启动 HMCL 后次序会丢失。

@ToobLac
Copy link
Copy Markdown
Contributor Author

ToobLac commented May 31, 2026

本 PR 可以把全局账户拖到便携账户中间,但实际这两类账户被存储在不同的文件里,这种次序不会被持久化,下次启动 HMCL 后次序会丢失。

Solved

@Glavo
Copy link
Copy Markdown
Member

Glavo commented Jun 1, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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 implements account searching and drag-and-drop reordering in the account list page. The review feedback highlights several critical and high-severity issues, including a potential IndexOutOfBoundsException when loading accounts with out-of-bounds indices, loss of selection state when moving accounts, potential NullPointerExceptions during search filtering, list corruption if drag-and-drop is performed while searching, and potential layout calculation inaccuracies during drag-and-drop target indexing.

Comment thread HMCL/src/main/java/org/jackhuang/hmcl/setting/Accounts.java Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants