Skip to content

fix: add Enter key support to login and exclude Windows from Unix tests#1409

Open
ankitsharma101 wants to merge 1 commit intoapache:developfrom
ankitsharma101:fix/issue-1405-ux-and-windows-fixes
Open

fix: add Enter key support to login and exclude Windows from Unix tests#1409
ankitsharma101 wants to merge 1 commit intoapache:developfrom
ankitsharma101:fix/issue-1405-ux-and-windows-fixes

Conversation

@ankitsharma101
Copy link

What This Fixes

Closes #1405

I ran into a couple of issues while trying to build Dubbo Admin on Windows 11:

  1. The login form doesn't submit when you press Enter (you have to click the button)
  2. The build fails on Windows because limits_test.go tries to import Unix-specific packages

This 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:

  • Added @pressEnter handlers to both input fields (using Ant Design Vue's built-in event)
  • Used Vue 3's ref and onMounted to auto-focus the username field on page load
  • The button click still works exactly the same way as before

Windows Build Fix

The test file pkg/common/util/os/limits_test.go was causing build failures on Windows because it imports golang.org/x/sys/unix, which obviously doesn't exist on Windows.

What I changed:

  • Added Go build tags at the top of the file to exclude it from Windows builds
  • This matches the pattern already used in limits.go in the same directory

The build tags look like this:

//go:build !windows
// +build !windows

Testing

I tested everything on my Windows 11 machine with Go 1.24.6.

Login form:

  • Auto-focus works - cursor is already in the username field when you load the page
  • Pressing Enter in either field submits the form (I verified this in the browser's Network tab - it makes the API call to /api/v1/auth/login)
  • Clicking the button still works
  • No errors in the console

Windows build:
Before my changes, running go build would fail with an error about the Unix package not being available. After adding the build tags, it builds successfully and creates the dubbo-admin.exe file (~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!

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
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2026

@ankitsharma101
Copy link
Author

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!

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.

UX Enhancements and Windows Build Fixes

1 participant