Skip to content

Conversation

@itisAliRH
Copy link
Member

Fix #21649
This PR fixes the issue when editing service credentials. Previously, when a user focused on a secret field (displayed as ********), typing would append new characters to the placeholder string rather than clear it. This resulted in corrupted secrets being saved (e.g., ********newpassword).

Fix.credentials.edit.mp4

Changes

  • Auto-clear on focus: The secret field is now automatically cleared when focused if it contains the placeholder, allowing immediate input of a new value.
  • Restore on blur: If the user leaves the field empty without making changes, the placeholder is restored to indicate that the stored value is preserved.
  • Clear Button: Added a "Clear" button to the input group, allowing users to wipe the secret value if needed explicitly.

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. Go to User > Manage Information > Manage Credentials.
    2. Edit an existing group with a saved secret.
    3. Click the secret field -> verify it clears automatically.
    4. Click away without typing -> verify the placeholder returns.
    5. Use the new "Clear" button -> verify the field is emptied and remains empty.

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@github-actions github-actions bot added this to the 26.1 milestone Jan 23, 2026
Enhance the credentials group form UX by tracking touched fields to provide a neutral initial validation state. Add focus/blur handling for secret inputs to properly clear and restore placeholder values, support explicit clearing of secrets, and ensure validation only triggers after user interaction. This prevents accidental overwrites of existing secrets while giving clearer feedback during editing.
@itisAliRH itisAliRH force-pushed the fix-credential-secret-edit-value branch from fed5a5a to a65caa1 Compare January 23, 2026 11:31
@itisAliRH itisAliRH changed the base branch from dev to release_25.1 January 23, 2026 11:32
@github-actions github-actions bot changed the title Fix secret credential editing and add clear button [25.1] Fix secret credential editing and add clear button Jan 23, 2026
@davelopez
Copy link
Contributor

Nice! Can you target 25.1 since this is a bug fix?

On the other hand, I don't think the clear button adds much usability. If you click it, you are forced to enter the same secret correctly or discard all the changes, so it is probably not worth adding this. And, it could be considered a "new feature" rather than a bug fix.

Also, the tooltip gets stuck when the button gets disabled, another reason to avoid this :)

image

@itisAliRH
Copy link
Member Author

Nice! Can you target 25.1 since this is a bug fix?

@davelopez thank you for your review. I already targeted 25.1.

On the other hand, I don't think the clear button adds much usability. If you click it, you are forced to enter the same secret correctly or discard all the changes, so it is probably not worth adding this. And, it could be considered a "new feature" rather than a bug fix.

The purpose of the clear button is that if the user tries to clear an optional secret and set it to an empty string, the placeholder would be replaced, and it would not let the user clear an optional secret anymore.

Also, the tooltip gets stuck when the button gets disabled, another reason to avoid this :)

It's a general issue we should fix. I'll address it in another PR.

Copy link
Contributor

@davelopez davelopez left a comment

Choose a reason for hiding this comment

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

The purpose of the clear button is that if the user tries to clear an optional secret and set it to an empty string, the placeholder would be replaced, and it would not let the user clear an optional secret anymore.

Ahh, I see, it makes sense then. Thanks!

Swap BButton for the shared GButton component in the credentials group form.
@davelopez
Copy link
Contributor

Thank you @itisAliRH!

@davelopez davelopez merged commit 40046f9 into galaxyproject:release_25.1 Jan 23, 2026
27 checks passed
@itisAliRH itisAliRH deleted the fix-credential-secret-edit-value branch January 23, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editing secret credentials appends to placeholder instead

2 participants