fix(frontend): add list instance emails endpoint and Select in AddUser#7903
fix(frontend): add list instance emails endpoint and Select in AddUser#7903claude[bot] wants to merge 25 commits intomainfrom
Conversation
Add a new GET /users/list_instance_emails endpoint that returns all instance user emails (from the password table). This endpoint is only available on non-cloud instances. In the frontend AddUser component, when the instance emails are available (non-cloud), replace the email text input with a Select component that allows both selecting from existing instance users and typing custom emails. Closes #7902 Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
Deploying windmill with
|
| Latest commit: |
6c226c6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fd67b868.windmill.pages.dev |
| Branch Preview URL: | https://claude-issue-7902-20260211-1.windmill.pages.dev |
Also fixes "Add new userss" typo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the endpoint from global to workspace-scoped route
(/w/{workspace}/users/list_instance_emails) and add require_admin
check so only workspace admins can list instance emails.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add client-side email format validation with error message display and disable the Add button when email is invalid. Replace plain <input> elements with TextInput component for consistent styling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a custom value (not in the items list) is selected, reopening the dropdown now pre-fills the filter with the current value so users can directly edit it. Also hide the "Use custom email" create option when the filter matches the current value, and show the regular placeholder instead of the value when editing a custom entry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the bind:value getter/setter and placeholder-as-display hack with
a standard controlled input pattern (value={inputValue} + oninput handler).
- Remove showPlaceholderOnOpen prop (replaced by default behavior)
- Add allowUserInput prop: typed text syncs to value in real-time
- Separate rawLabel (for filtering) from displayText (for transformed display)
- Hide dropdown when no items match in allowUserInput mode
- Simplify AddUser to use allowUserInput instead of createText/onCreateItem
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit updates the EE repository reference after PR #415 was merged in windmill-ee-private. Previous ee-repo-ref: 8c214ec5039be5353f5fea920e27b0c6af61e1fd New ee-repo-ref: c927593b0b49867284fc64d50c59daba6c70da84 Automated by sync-ee-ref workflow.
|
🤖 Updated |
|
Claude finished @Guilhem-lm's task in 2m 28s —— View job Review Summary
OverviewThis PR adds an autocomplete dropdown for the "Add user" flow in workspace settings, backed by a new backend endpoint that returns all instance user emails. The approach is reasonable: a new What works well
Issues to addressSee inline comments for detailed feedback on each file. The main points:
None of these are blocking — the code works correctly in the happy path. Items 1-3 are the most impactful for polish. How to testOn a non-cloud Windmill instance, go to Workspace Settings (gear icon → Members tab). Click the "Add new user" button in the top-right corner. An autocomplete dropdown should appear instead of a plain text input. The dropdown should list all instance users that are not already members of the current workspace. Typing in the field should filter the list, and you should also be able to type a custom email that doesn't appear in the dropdown. Entering an invalid email (e.g., "notanemail") should show a validation error below the field, and the "Add" button should be disabled. On a cloud-hosted instance (or if the endpoint fails), the plain email text input should appear instead. |
- Add LIMIT 1000 to list_instance_emails SQL query - Add loading state to prevent UI flash in AddUser - Show email validation error only after blur - Guard loadInstanceEmails with workspaceStore check Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add onClose callback to AutocompleteSelect and use it in AddUser to defer validation until the user finishes interacting with the dropdown, avoiding visual noise between the dropdown and error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit updates the EE repository reference after PR #420 was merged in windmill-ee-private. Previous ee-repo-ref: 931813b75b8260faa13ddc07f36a11607b7e3bf6 New ee-repo-ref: 592848d59ca2304926fb2bd85d000668a7f46a77 Automated by sync-ee-ref workflow.
|
🤖 Updated |
Summary
GET /w/{workspace}/users/list_instance_emailsendpoint that returns all instance user emails (requires workspace admin, disabled on cloud)AutocompleteSelectdropdown that suggests existing instance users not yet in the workspaceTextInputon cloud or if the endpoint failsInputErrorCloses #7902
Changes
Backend
list_instance_emailsendpoint inwindmill-api-usersthat queries emails from thepasswordtable (sorted alphabetically). Disabled on cloud-hosted instances. Requires workspace admin.Frontend
AutocompleteSelect.svelte: A dedicated component for the "type anything, value syncs live" use case. ReusesSelectDropdownandprocessItemsfrom the existing select infrastructure. Keeps the widely-usedSelectcomponent unchanged.AddUser.svelte: On non-cloud instances, fetches instance emails and renders anAutocompleteSelect(with type-to-filter and custom email support). Falls back toTextInputon cloud or if the endpoint fails. Existing workspace members are filtered out. Email validation added.WorkspaceUserSettings.svelte: Passes current workspace member emails toAddUserfor filtering.Select.svelte: Minor fix —on:closetoonClickon CloseButton (Svelte 5 migration).Screenshot
Test plan