Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 16, 2025

Description

Adds a toggle button to SecretText inputs in InteractionsInputDialog that allows users to reveal/hide password text. The button displays to the right of the input field using eye icons consistent with the dashboard's existing masking UI.

secret-text-toggle

Update: Moved toggle button inside text box area. This UX pattern is more popular
image

Implementation:

  • Wrapped SecretText inputs in flex container with toggle button
  • Added JavaScript module to toggle input type attribute between "password" and "text"
  • Visibility state tracked on InputViewModel.IsSecretTextVisible property to support multiple password fields in same dialog
  • Reuses existing GridValueMaskShowValue/HideValue resource strings and Icons.Regular.Size16.Eye/EyeOff icons
  • Uses JSInteropHelpers.SafeDisposeAsync for proper JS module disposal with circuit disconnect handling

Files changed:

  • InteractionsInputDialog.razor - Added toggle button UI to SecretText case
  • InteractionsInputDialog.razor.cs - State management and JS interop
  • InteractionsInputDialog.razor.js - Toggle function
  • InteractionsInputDialog.razor.css - Flex layout styling
  • InputViewModel.cs - Added IsSecretTextVisible property for tracking visibility state

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No
Original prompt

Add button to toggle viewing secret text inputs in the InteractionsInputDialog. The button should display to the right of the input text. The button should use the eye and eye with cross icons used in other places in the dashboard.
Clicking on the button should invoke a javascript function that toggles the input type between text and password.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Added JavaScript function to toggle input type between text and password
- Added FluentButton with eye icons next to SecretText inputs
- Implemented state management for visibility tracking
- Added CSS styling for the toggle button layout
- Used existing GridValueMaskShowValue/HideValue resource strings

Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com>
Copilot AI changed the title [WIP] Add toggle button for viewing secret text inputs Add toggle button for password visibility in InteractionsInputDialog Dec 16, 2025
Copilot AI requested a review from JamesNK December 16, 2025 03:03
…RenderAsync, use SafeDisposeAsync

- Removed _secretTextVisibility dictionary, tracked on InputViewModel.IsSecretTextVisible property instead
- Moved OnAfterRenderAsync back to original location after OnParametersSet
- Used JSInteropHelpers.SafeDisposeAsync for proper JS module disposal
- Simplified IsSecretTextVisible method by directly accessing property
- Made GetSecretTextIcon static as it doesn't access instance data

Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com>
Copilot AI requested a review from JamesNK December 16, 2025 03:19
@github-actions
Copy link
Contributor

github-actions bot commented Dec 16, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13584

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13584"

@JamesNK JamesNK marked this pull request as ready for review December 16, 2025 03:42
Copilot AI review requested due to automatic review settings December 16, 2025 03:42
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 adds password visibility toggle functionality to secret text inputs in the InteractionsInputDialog, allowing users to reveal or hide password values using eye/eye-off icons.

Key changes:

  • Added toggle button with eye icons to SecretText inputs for showing/hiding password text
  • Implemented JavaScript interop to toggle input type between "password" and "text"
  • Added IsSecretTextVisible property to InputViewModel to track visibility state per input field

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
InputViewModel.cs Added IsSecretTextVisible property to track visibility state
InteractionsInputDialog.razor.js Added JavaScript function to toggle password input type
InteractionsInputDialog.razor.css Updated CSS for flex container layout and spacing
InteractionsInputDialog.razor.cs Added JS interop setup, toggle handler, and icon getter method
InteractionsInputDialog.razor Added toggle button UI next to SecretText inputs
InteractionInputField.razor Renamed CSS class and adjusted progress ring styling

@JamesNK JamesNK changed the title Add toggle button for password visibility in InteractionsInputDialog Add toggle button for secret visibility in InteractionsInputDialog Dec 16, 2025
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.

2 participants