Skip to content

Conversation

@adamint
Copy link
Member

@adamint adamint commented May 14, 2025

Description

image

Add text-overflow to the menu item content. We have to set width to 100%, as otherwise width is set to the width of the text content.

Fixes #9222

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
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@adamint adamint requested review from JamesNK and Copilot and removed request for Copilot May 14, 2025 19:15
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 aims to prevent text overflow in resource action URLs by updating the CSS styling and ensuring the proper class is applied to the menu item.

  • Added a CSS rule with text ellipsis styling on resource action URLs.
  • Updated the ResourceMenuItems model to apply the new CSS class.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Aspire.Dashboard/wwwroot/css/app.css Introduces a new CSS selector for resource action URLs with ellipsis styling.
src/Aspire.Dashboard/Model/ResourceMenuItems.cs Applies the new CSS class to the resource action URL menu item.

@adamint adamint force-pushed the dev/adamint/fix-url-overflow-resource-actions branch from c76c2fb to ba41dc1 Compare May 14, 2025 19:29
@adamint adamint requested review from eerhardt and radical as code owners May 14, 2025 19:49
@JamesNK
Copy link
Member

JamesNK commented May 14, 2025

PR has changes from #9317 as well?

Text = url.Text,
Tooltip = url.Url,
Icon = s_linkIcon,
Class = "resource-actions-url-menuitem",
Copy link
Member

@JamesNK JamesNK May 14, 2025

Choose a reason for hiding this comment

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

Is there a reason to not apply the class to all menu items at a lower level?

Or add a style to the fluent menu in AspireMenu, and that style applies to all items inside the fluent menu.

Copy link
Member

Choose a reason for hiding this comment

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

For example, I imagine this problem could also happen if there is a very long command name.

Copy link
Member Author

Choose a reason for hiding this comment

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

No reason, added to all fluent-menu-items.

@JamesNK
Copy link
Member

JamesNK commented May 14, 2025

The URL also appears in the context menu on the graph view. It doesn't help there:

image

I'm guessing the menu on the console page has a max width defined somewhere and that's missing when it is a context menu.

@JamesNK
Copy link
Member

JamesNK commented May 14, 2025

Add a long URL to a resource in the stress test playground for testing now and in the future.

Edit: And a resource command with a very long display name.

@adamint adamint force-pushed the dev/adamint/fix-url-overflow-resource-actions branch from df795be to ca6ef3e Compare May 19, 2025 20:50
@adamint
Copy link
Member Author

adamint commented May 19, 2025

I'm guessing the menu on the console page has a max width defined somewhere and that's missing when it is a context menu.

Seems like it's actually the FluentMenuButton with the max and min width defined (368px and 64px respectively), though I can't find these values in the fluentui-blazor repo. They were not being applied to the resource actions graph context menu because (for some reason) min-width is set to fit-content. I added styling in AspireMenu.razor.cs to add those width rules explicitly.

@adamint adamint requested a review from JamesNK May 19, 2025 20:54
@JamesNK JamesNK merged commit 36681a0 into dotnet:main May 20, 2025
254 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2025
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.

Drop down on Dashboard console logs doesn't git codespace URLs

2 participants