Skip to content

设备代码流在完成授权后隐藏二维码#6087

Merged
Glavo merged 6 commits into
HMCL-dev:mainfrom
CiiLu:mmsssssss
May 29, 2026
Merged

设备代码流在完成授权后隐藏二维码#6087
Glavo merged 6 commits into
HMCL-dev:mainfrom
CiiLu:mmsssssss

Conversation

@CiiLu

@CiiLu CiiLu commented May 13, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread HMCL/src/main/resources/assets/lang/I18N.properties
Comment thread HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N_zh.properties Outdated
@Glavo

Glavo commented May 13, 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 Microsoft device login flow by introducing a new 'DeviceLoginCompleted' state and event. This ensures that users are notified once the authorization step is finished while the launcher completes the remaining login tasks. The changes involve updates to the OAuth callback interface, the addition of a specific event class, and UI logic to display a completion hint. Review feedback correctly identified a grammatical error in the English localization and character inconsistencies in the Traditional Chinese translation, both of which included specific code suggestions for correction.

Comment thread HMCL/src/main/resources/assets/lang/I18N.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N_zh.properties Outdated
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
Comment thread HMCL/src/main/resources/assets/lang/I18N_zh.properties 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 adds a completion event to the OAuth device login flow, enabling the UI to display a message once authorization is finished. It includes updates to the OAuth callback interface, event management, and localized strings. Reviewer feedback highlights the need for explicit error handling in the polling loop to avoid null tokens and suggests a grammatical fix for the English translation.

Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/auth/OAuth.java
Comment thread HMCL/src/main/resources/assets/lang/I18N.properties 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 implements a completion event for Microsoft device code login, updating the UI to show a progress indicator and localized message once authorization is finished. Feedback was provided regarding the need for robust error handling in the OAuth polling loop to prevent incorrect success signals on failure, as well as a suggestion to correct the English grammar in the new localization string.

Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/auth/OAuth.java
Comment thread HMCL/src/main/resources/assets/lang/I18N.properties Outdated
@Glavo

Glavo commented May 28, 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 LoginCompletedDeviceCodeEvent and a corresponding callback to handle the completion of Microsoft device login, updating the UI state to show a completion hint and loading spinner. It also updates localization files to support this new state. The review feedback correctly identifies grammatical errors in the English localization file (I18N.properties), specifically pointing out that 'work' is uncountable and suggesting the correction from 'There are some extra work' to 'There is some extra work'.

account.methods.microsoft.close_page=Microsoft account authorization is now completed.\n\
\n\
There are some extra works for us, but you can safely close this tab for now.
There are some extra work for us, but you can safely close this tab for now.

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.

medium

“work”是不可数名词,因此“There are some extra work”在语法上是不正确的,应该使用单数形式的 be 动词“There is some extra work”。

   There is some extra work for us, but you can safely close this tab for now.

account.methods.microsoft.hint=Click the "Log in" button to start adding your Microsoft account.
account.methods.microsoft.methods.device=Log In with QR Code
account.methods.microsoft.methods.device.hint=Scan QR code or visit <a href="%s">%s</a> to complete login, enter <b>%s</b> in the opened page.
account.methods.microsoft.methods.device.hint.completed=Microsoft account authorization is now completed. There are some extra work for us, just wait for a while.

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.

medium

同样地,“work”是不可数名词,这里应该使用“There is some extra work”而不是“There are some extra work”。

account.methods.microsoft.methods.device.hint.completed=Microsoft account authorization is now completed. There is some extra work for us, just wait for a while.

@Glavo Glavo merged commit 3bed03c into HMCL-dev:main May 29, 2026
2 checks passed
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.

3 participants