Skip to content

Commit

Permalink
Mask button doesn't jump on mouse over (dotnet#5799)
Browse files Browse the repository at this point in the history
In details views, we show sensitive values as masked by default. The user has to click a button to show them on screen. This prevents accidentally revealing secrets to onlookers.

The mask button is visible for any sensitive value.

There is also a menu button, that opens a popup to allow copying and visualizing the value. This button is only displayed when the mouse hovers over the row in the name/value grid.

Previously, these were (in order):

- Mask button (always visible)
- Menu button (visible on hover)

Because these were right-aligned, the mask button would be pushed left to make space for the menu button on house hover.

To the user who wanted to toggle a row's mask status, the button they want to press would jump to the left just as the mouse got close. This is surprising and a bit annoying.

This change reorders the buttons so that nothing moves on screen when the mouse hovers over the row.
  • Loading branch information
drewnoakes authored Sep 21, 2024
1 parent efa88c9 commit eec556f
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/Aspire.Dashboard/Components/Controls/GridValue.razor
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@
@ContentAfterValue
</span>
}
@if (EnableMasking)
{
<div @onclick:stopPropagation="true">
<FluentButton Appearance="Appearance.Lightweight"
IconEnd="@(IsMasked ? _unmaskIcon : _maskIcon)"
Title="@(IsMasked ? Loc[nameof(ControlsStrings.GridValueMaskShowValue)] : Loc[nameof(ControlsStrings.GridValueMaskHideValue)])"
OnClick="ToggleMaskStateAsync"
aria-label="@(IsMasked ? Loc[nameof(ControlsStrings.GridValueMaskShowValue)] : Loc[nameof(ControlsStrings.GridValueMaskHideValue)])" />
</div>
}

@{
(string, object)[] uncapturedCopyAttributes = [
Expand Down Expand Up @@ -75,4 +65,15 @@
</FluentMenuItem>
</FluentMenu>
</div>

@if (EnableMasking)
{
<div @onclick:stopPropagation="true">
<FluentButton Appearance="Appearance.Lightweight"
IconEnd="@(IsMasked ? _unmaskIcon : _maskIcon)"
Title="@(IsMasked ? Loc[nameof(ControlsStrings.GridValueMaskShowValue)] : Loc[nameof(ControlsStrings.GridValueMaskHideValue)])"
OnClick="ToggleMaskStateAsync"
aria-label="@(IsMasked ? Loc[nameof(ControlsStrings.GridValueMaskShowValue)] : Loc[nameof(ControlsStrings.GridValueMaskHideValue)])" />
</div>
}
</div>

0 comments on commit eec556f

Please sign in to comment.