Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a parent to replicas when selecting a resource #2123

Merged
merged 9 commits into from
Feb 15, 2024

Conversation

adamint
Copy link
Member

@adamint adamint commented Feb 7, 2024

Fixes #1179

Adds a disabled parent to resource dropdowns for replicas in console log; structured log; traces, and metrics pages, per Leslie's idea.

image

Microsoft Reviewers: Open in CodeFlow

@adamint adamint changed the title Dev/adamint/metrics replicas dropdown Add a parent to replicas in resource selects Feb 7, 2024
@adamint adamint changed the title Add a parent to replicas in resource selects Add a parent to replicas when selecting a resource Feb 7, 2024
@JamesNK
Copy link
Member

JamesNK commented Feb 7, 2024

Overall it looks good.

The default disabled state is a little too transperent. Can you reduce it a bit?

@JamesNK
Copy link
Member

JamesNK commented Feb 7, 2024

It doesn't look that great in dark mode:

image

The dark background of unselected menu items looks odd. I checked the main branch and it looks the same so it's not a regression in this PR.

However, if I switch between light and dark mode in the app without refreshing the page then they disappear.

image

@tlmii I think you did the style here. What is it supposed to look like?

@tlmii
Copy link
Member

tlmii commented Feb 8, 2024

@tlmii I think you did the style here. What is it supposed to look like?

I think I see what's going on, but I'm not quite sure why yet. I'll take a look.

@tlmii
Copy link
Member

tlmii commented Feb 8, 2024

@tlmii I think you did the style here. What is it supposed to look like?

I think I see what's going on, but I'm not quite sure why yet. I'll take a look.

Alright, I tracked down what's going on. I think there's a bug in the fluentui styles (in the web components, not the blazor components). I've posted to the discord to ask if I'm on the right track and to see if I should file an issue.

To be clear, it shouldn't really look like either of these images. It should get the floating layer background color, and it partially does when loaded (hence the lighter "frame"). But it loses it when you change styles, and even on first load it doesn't correctly set the items themselves to have the floating layer background color.

I should also note, I'm a little worried about using disabled items for things you want to actually be readable. There's no contrast guarantees for disabled elements, so the color recipes don't handle it (and the a11y tools wouldn't actually flag it). We'd need to override for ourselves.

@adamint
Copy link
Member Author

adamint commented Feb 8, 2024

I should also note, I'm a little worried about using disabled items for things you want to actually be readable. There's no contrast guarantees for disabled elements, so the color recipes don't handle it (and the a11y tools wouldn't actually flag it). We'd need to override for ourselves.

@leslierichardson95

Since this is a purely cosmetic addition, we could also add screen-readable information to the individual replica options that mention that it is a replica. I think this would be acceptable

@adamint
Copy link
Member Author

adamint commented Feb 8, 2024

I added a label to replica options that notes that they are part of a replica set.

@adamint
Copy link
Member Author

adamint commented Feb 8, 2024

@tlmii is the disabled transparency part of the styling issues you're talking about?

@tlmii
Copy link
Member

tlmii commented Feb 8, 2024

@tlmii is the disabled transparency part of the styling issues you're talking about?

@adamint Not sure to what you're referring with "disabled transparency"? The contrast issues I mentioned (the lighter color of the text for disabled items) is separate from the styling bug in the underlying component. Though I think fixing the bug will make the contrast worse because the background color is supposed to be lighter than it is right now.

@adamint
Copy link
Member Author

adamint commented Feb 9, 2024

Ahh, I see. Increased opacity in both light and dark themes:

image
image

@@ -53,6 +55,10 @@ fluent-toolbar[orientation=horizontal] {
--reconnection-ui-bg: #D6D6D6;
--error-counter-badge-foreground-color: #ffffff;

/* overrides of default fluentui-blazor styling */
--error: #E10B11 !important;
--disabled-opacity: 0.85 !important;
Copy link
Member

Choose a reason for hiding this comment

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

Setting this variable is a global change. Is it possible to limit the scope?

Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't found a way to do that, considering fluentui-blazor applies the color directly to the elements, and I don't think any selector is specific enough to override a style applied directly to an element?

@adamint adamint merged commit 66d14b1 into dotnet:main Feb 15, 2024
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 22, 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.

Redundancy in Menu Items for Project Replicas
4 participants