Skip to content

Conversation

@CiiLu
Copy link
Contributor

@CiiLu CiiLu commented Jan 3, 2026

  • 确认后 reject 改为使用 validator
  • 外置登录服务器、网络下载整合包添加 URL 校验

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors input field validation across the application by replacing imperative validation in reject callbacks with declarative validator objects. The changes improve user experience by providing immediate feedback on invalid input rather than waiting for submission.

Key Changes:

  • Introduced validator-based validation for input dialogs using the existing Validator and URLValidator classes
  • Replaced manual validation checks in callbacks with upfront validators that disable submission buttons when input is invalid
  • Added URL validation for external login servers and modpack download URLs

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
InputDialogPane.java Added constructor overload that accepts validators, implements real-time validation with button state management
Controllers.java Updated prompt() method signature to accept varargs validators while maintaining backward compatibility; reorganized imports
WorldListPage.java Added file name validator to world import dialog to prevent invalid filenames upfront
Versions.java Refactored version rename and duplicate operations to use validators instead of manual validation in callbacks; reorganized imports for clarity
DownloadPage.java Added file name validator to download dialog; removed manual validation check from callback
ModpackSelectionPage.java Added URL validator to remote modpack selection to ensure valid URLs before download attempts
AddAuthlibInjectorServerPane.java Replaced button disable binding with URL validator and real-time validation; ensures valid URLs before server lookup

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Glavo Glavo merged commit 11d182f into HMCL-dev:main Jan 3, 2026
2 checks passed
@CiiLu CiiLu deleted the va branch January 3, 2026 12:52
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.

2 participants