Repository navigation
fix: add Enter key support to login and exclude Windows from Unix tests - #1409
ankitsharma101 wants to merge 2 commits into
Conversation
Part 1: Login UX Enhancement - Add form submission on Enter key press - Auto-focus username field on page load - Add @pressEnter handlers to both input fields - Import ref and onMounted from Vue composition API Part 2: Windows Build Fix - Add build tags to limits_test.go to exclude from Windows builds - Fixes golang.org/x/sys/unix import error on Windows - Aligns with existing limits.go build constraints Tested on Windows 11: - Go 1.24.6: Build succeeds without errors - Chrome/Edge: Enter key and auto-focus work correctly Fixes apache#1405
|
Hi! I see the CI failed, but it looks like a file system error on the testing side. My changes only added Enter key support to the login form and build tags for Windows. These errors seem unrelated to my code. The build worked fine on my Windows machine. Should I do anything, or can you re-run the tests? Thanks! |
There was a problem hiding this comment.
Pull request overview
Improves cross-platform developer experience and login UX by enabling Enter-to-submit behavior on the Vue 3 login screen and preventing Unix-only limit tests from running on Windows.
Changes:
- Add template
@pressEnterhandlers so pressing Enter in username/password inputs triggers login. - Auto-focus the username input on mount for a smoother login flow.
- Add
//go:build !windowsbuild tags to excludelimits_test.gofrom Windows builds (matchinglimits.go).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ui-vue3/src/Login.vue | Adds Enter key submission and autofocus for the username field. |
| pkg/common/util/os/limits_test.go | Adds !windows build constraints to avoid importing x/sys/unix on Windows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The ci fails because the license header should be placed at the very beginning of the file, as well as |
|
Thanks for the review! I've moved the build tags to after the license header as requested. The file now has the correct order. |
|
@ikun-Lg reviewer |
|
I noticed that Let me know and I'll update accordingly! |
125d6c3 to
15a05fa
Compare
|
Thanks for the suggestion — I’ve rolled back the branch to commit Please go ahead and re-run the CI. I’m happy to help investigate further if any issues still persist or if you’d like me to test additional scenarios (especially on Windows). Thanks again for the guidance! |
|
I found that the limit.go and limit_test.go are useless, I've already remove them, you can merge the develop branch and re-commit. |
|
Thanks for the update! I've merged the latest develop branch into my PR branch and removed the obsolete limits_test.go file as suggested. The branch is now synced with develop. Please let me know if any further changes are needed. |
|
robocanic
left a comment
There was a problem hiding this comment.
Review 总结
回车提交登录的方向是合理的,但当前分支基于旧版 Login.vue,与 develop 已有冲突,且直接 rebase 之后自动聚焦会失效。
问题
ui-vue3/src/Login.vue(整体):PR 当前状态为CONFLICTING。develop上的Login.vue已重构为通过loadAuthConfiguration()异步加载认证配置,密码表单位于<a-row v-if="passwordEnabled">,并且<a-card :loading="loadingConfiguration">。需要先 rebase 到最新develop并重新应用改动,同时保留 Provider 登录相关逻辑。ui-vue3/src/Login.vue:39-41(onMounted+usernameInputRef.value?.focus()):在最新develop上,用户名输入框要等配置加载完成(loadingConfiguration变为false且passwordEnabled为true)后才会渲染,而onMounted触发时usernameInputRef.value仍是undefined。因为使用了?.,不会报错,但自动聚焦会静默失效。建议在表单渲染后再聚焦,例如在loadAuthConfiguration完成后await nextTick()再focus(),或watchpasswordEnabled && !loadingConfiguration。ui-vue3/src/Login.vue:80, 92(@pressEnter="loginHandle"):回车直接调用loginHandle,没有并发保护。按住 Enter 会连续触发keydown,导致多次并发的login请求以及重复的meshesSearch/router.replace。建议增加submitting标志位(并同时用于按钮的loading/disabled),或者在提交前调用表单的validate()(目前rules: required实际并未被任何提交路径使用)。- 缺失测试:
develop已有ui-vue3/src/Login.test.ts(其中a-input被 stub 成<input />)。建议补充用例覆盖“在用户名/密码输入框按回车会触发登录”以及“密码表单渲染后用户名输入框获得焦点”。 - PR 描述/标题已过期:描述和标题中提到的
pkg/common/util/os/limits_test.go的//go:build !windows改动已不在本 PR 中(相关文件已在develop上被移除,diff 只剩Login.vue)。请更新标题和描述,避免Closes #1405误导 reviewer 认为 Windows 构建问题也已在此修复。
There was a problem hiding this comment.
本轮审查基于 merge-base 82e2512e(Base develop 已领先该分支 20 个 commit)。changed_files=1,实际 Diff 也只有 ui-vue3/src/Login.vue。
结论:当前不可合并
P1 · CI 失败原因可确定性复现:格式化门禁
Head c362767a 的 CI (ubuntu-latest - Go 1.24) 为 failure。失败链路在 .github/workflows/ci.yml:
- name: Build Frontend (Vue3)
working-directory: ui-vue3
run: |
yarn install --frozen-lockfile
yarn build # 内部执行 prettier --write src/
...
- name: Check Code Format
run: make fmt && git status && [[ -z $(git status -s) ]]新增的三行带行尾空格:
77: <a-input
89: <a-input
90: type="password"
用仓库的 ui-vue3/.prettierrc.json 在 Head 文件上实测:
$ npx prettier@3.0.3 --check src/Login.vue
[warn] src/Login.vue
[warn] Code style issues found in the above file. Run Prettier to fix. (exit 1)
$ npx prettier@3.0.3 --write src/Login.vue
- <a-input
+ <a-input
- type="password"
+ type="password"
yarn build 会把这 3 行改写掉,随后 git status -s 非空,[[ -z ... ]] 为假,作业失败。这不是 flaky,而是每次必现。去掉行尾空格即可。
P1 · PR 声称的 Windows 构建修复不存在
PR 描述写「pkg/common/util/os/limits_test.go 添加 //go:build !windows」,但:
$ git ls-tree -r --name-only origin/develop | grep -i limits
(无输出)
该路径在 develop 上不存在,整个 Diff 也没有任何 Go 文件改动。也就是说,描述里的第 2 项修复(也是这个 PR 标题的一部分:「exclude Windows from Unix tests」)没有提交进来。请确认是漏推 commit,还是这部分已被上游以其他方式解决。
P3 · 分支落后 20 个 commit
登录页所在的 ui-vue3 在此期间可能有改动,建议 rebase 后重跑前端构建,避免与已合入的样式/接口变更冲突。
交互改动本身
@pressEnter + onMounted 自动聚焦的实现与 ant-design-vue 4.x 的事件契约一致,a-input 组件实例也暴露 focus(),这部分没有问题。可以顺带考虑两点(非阻断):
- 连续按 Enter 会并发触发多次
loginHandle,当前没有 in-flight 防护; loginHandle未先调用表单校验,空用户名会直接打到后端(与按钮点击的既有行为一致,不是本 PR 引入)。
|
补充一点状态更新(相对上面那条审查意见): 当前 也就是说本 PR 唯一修改的文件
因此建议:先 rebase 到当前 |




What This Fixes
Closes #1405
I ran into a couple of issues while trying to build Dubbo Admin on Windows 11:
limits_test.gotries to import Unix-specific packagesThis PR fixes both issues.
Changes Made
Login Form Improvements
The login form now works like you'd expect - press Enter and it submits. I also made it so the username field gets focus automatically when the page loads, which feels more natural.
What I changed:
@pressEnterhandlers to both input fields (using Ant Design Vue's built-in event)refandonMountedto auto-focus the username field on page loadWindows Build Fix
The test file
pkg/common/util/os/limits_test.gowas causing build failures on Windows because it importsgolang.org/x/sys/unix, which obviously doesn't exist on Windows.What I changed:
limits.goin the same directoryThe build tags look like this:
Testing
I tested everything on my Windows 11 machine with Go 1.24.6.
Login form:
/api/v1/auth/login)Windows build:
Before my changes, running
go buildwould fail with an error about the Unix package not being available. After adding the build tags, it builds successfully and creates thedubbo-admin.exefile (~97MB).Notes
I'm working on GSoC 2026 prep and trying to get Dubbo Admin running on Windows. These are real issues I hit while following the build instructions, so hopefully this helps other Windows developers too.
My Apache ICLA was confirmed on Feb 5, 2026.
Let me know if you'd like me to adjust anything!