Skip to content

Highlight selected rows#1231

Merged
tlmii merged 2 commits intomicrosoft:mainfrom
tlmii:dev/selected-rows
Dec 6, 2023
Merged

Highlight selected rows#1231
tlmii merged 2 commits intomicrosoft:mainfrom
tlmii:dev/selected-rows

Conversation

@tlmii
Copy link
Copy Markdown
Member

@tlmii tlmii commented Dec 6, 2023

Addresses part of #1081.

This adds some highlighting (using the same color as used for the menu hover to ensure contrast) to the various grid rows when they're selected in a Summary/Details view. Also, at the suggestion of various UI/UX/Accessibility folks I changed the subtext color to not be "ghosted" when hovered/highlighted. That avoids the issue of having to thread the needle of contrast with two foreground colors and two (or three) background colors.

The remainder of #1081 is around how we do selection (full row vs buttons, etc) and this PR doesn't address that.

image
image
image
image
image
image

}
else
{
return $"log-row-{entry.Severity.ToString().ToLowerInvariant()}";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is combination of log-row-* & selected-row? Could be weird format change on row when selecting-deselecting depending on severity.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is no combination. It looks like selected row takes precedence. It's not ideal, but I want to try it out before passing judgement.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah having selected override the severity was kind of picking the option I disliked the least. Severity overriding selection seemed worse, and trying to come up with a color combo for severity + selection didn't seem likely to work out. I debated outlining + background, but figured something like that should come from feedback.

Copy link
Copy Markdown
Member

@JamesNK JamesNK Dec 6, 2023

Choose a reason for hiding this comment

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

Tried selecting error/warning rows and it is Good Enough. The background color is overwritten but the error/warning icons are still visible.

Coming up with color combos for every situation in light and dark would be a lot of work for not much value.

Comment thread src/Aspire.Dashboard/Components/Pages/Resources.razor Outdated
}
else
{
return $"log-row-{entry.Severity.ToString().ToLowerInvariant()}";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is no combination. It looks like selected row takes precedence. It's not ideal, but I want to try it out before passing judgement.

}
else
{
return (viewModel.Span.SpanId == _span?.SpanId) ? "selected-span" : string.Empty;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think the concept of selected-span is still used. There used to be a link on the logs page to a span, and it would be selected. The logs link was removed.

But I can double check and clean up later.

Co-authored-by: James Newton-King <james@newtonking.com>
}

private string? GetRowClass(ResourceViewModel resource)
=> string.Equals(resource.Name, SelectedResourceName, StringComparison.Ordinal) ? "selected-row" : null;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This would be a candidate for StringComparisons.ResourceName, in future.

@tlmii tlmii merged commit fc52d4a into microsoft:main Dec 6, 2023
@tlmii tlmii deleted the dev/selected-rows branch December 6, 2023 15:52
@eerhardt
Copy link
Copy Markdown
Member

eerhardt commented Dec 6, 2023

@tlmii - this looks like it broke the build:

src/Aspire.Dashboard/Components/Pages/Resources.razor.cs(201,41): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'SelectedResourceName' does not exist in the current context

Can someone take a look?

Looks like it conflicted with a289a31

@tlmii
Copy link
Copy Markdown
Member Author

tlmii commented Dec 6, 2023

On it

@adamint
Copy link
Copy Markdown
Member

adamint commented Dec 6, 2023

Thanks, Tim. feel free to ping if you need an approval.

@github-actions github-actions Bot locked and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants