Skip to content

Conversation

@Mine-diamond
Copy link
Contributor

@Mine-diamond Mine-diamond commented Jan 4, 2026

在之前的逻辑中,当用户点击“重命名实例”时,弹窗默认显示的名称是实例的原名。由于校验器会检查名称是否已存在,导致用户一打开弹窗就会看到“此实例已存在”的错误提示。

此外,用户通常认为“重名”是指与其他实例名称冲突,保持原名不应被视为错误。这不符合用户的使用习惯,且容易造成误导。
现在会进行判断,如果是原名则什么都不做。

之前 image
现在 image

@Mine-diamond Mine-diamond changed the title feat: 允许重命名时使用原名,避免触发“已存在”报错 feat: 允许重命名时使用原名 Jan 4, 2026
@Mine-diamond Mine-diamond changed the title feat: 允许重命名时使用原名 feat: 允许重命名实例时使用原名 Jan 4, 2026
@neveler
Copy link
Contributor

neveler commented Jan 5, 2026

感觉原名不给校验提示就可以,确定按钮应继续保持禁用状态。

@Mine-diamond
Copy link
Contributor Author

感觉原名不给校验提示就可以,确定按钮应继续保持禁用状态。

但是禁用状态与校验器状态绑定,没办法在校验器不报错时禁用确定按钮

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 improves the user experience when renaming game instances by allowing users to keep the original name without triggering a validation error. Previously, when the rename dialog opened with the instance's current name pre-filled, the validator would immediately show an "instance already exists" error, which was confusing since users typically expect "duplicate name" to mean a conflict with a different instance.

Key changes:

  • Modified the validator to allow the original name as a valid input
  • Added early return logic to skip unnecessary file system operations when the name hasn't changed

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

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