Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Aspire.Dashboard/Components/Controls/AspireMenu.razor
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@namespace Aspire.Dashboard.Components
@using System.Collections.Immutable
@using Aspire.Dashboard.Model
@inherits FluentComponentBase

<FluentMenu @ref="_menu" Anchor="@Anchor" Anchored="@Anchored" Open="@Open" OpenChanged="OnOpenChanged" Style="@Style" VerticalThreshold="@VerticalThreshold" HorizontalThreshold="200">
@* aspire-menu-container is added to the div parent of FluentMenu, not the FluentMenu *@
<FluentMenu Class="aspire-menu-container" @ref="_menu" Anchor="@Anchor" Anchored="@Anchored" Open="@Open" OpenChanged="OnOpenChanged" Style="@Style" VerticalThreshold="@VerticalThreshold" HorizontalThreshold="200">
@foreach (var item in Items)
{
@if (item.IsDivider)
Expand All @@ -14,7 +14,7 @@
{
var additionalMenuItemAttributes = new Dictionary<string, object>(item.AdditionalAttributes ?? ImmutableDictionary<string, object>.Empty)
{
{ "title", item.Tooltip ?? item.Text ?? string.Empty }
{ "title", !string.IsNullOrEmpty(item.Tooltip) ? item.Tooltip : item.Text ?? string.Empty }
};

<FluentMenuItem Id="@item.Id" Class="@item.Class" OnClick="() => HandleItemClicked(item)" Disabled="@item.IsDisabled" AdditionalAttributes="@additionalMenuItemAttributes">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
OnMenuChanged="@OnFormatOptionChanged">
@foreach (var option in _options)
{
<FluentMenuItem Id="@option.Id" Disabled="@(!EnabledOptions.Contains(option.Id))" Value="@option.Id">@option.Name</FluentMenuItem>
<FluentMenuItem Class="overflow-fluent-menu-item" Id="@option.Id" Disabled="@(!EnabledOptions.Contains(option.Id))" Value="@option.Id" title="@option.Name">@option.Name</FluentMenuItem>
}
</FluentMenuButton>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/Aspire.Dashboard/Components/Layout/MobileNavMenu.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<FluentMenu Open="@IsNavMenuOpen" Anchored="false" Style="grid-area: nav-menu; height: 100vh; margin-top: 2px;">
<FluentMenu Class="aspire-menu-container" Open="@IsNavMenuOpen" Anchored="false" Style="grid-area: nav-menu; height: 100vh; margin-top: 2px;">
@foreach (var item in GetMobileNavMenuEntries())
{
<FluentMenuItem OnClick="@(async () => { CloseNavMenu(); await item.OnClick(); })" Style="height: 40px; width: 100vw; margin-bottom: 6px;">
<FluentMenuItem OnClick="@(async () => { CloseNavMenu(); await item.OnClick(); })" Style="height: 40px; width: 100vw; margin-bottom: 6px;" title="@item.Text">
<span>@item.Text</span>

@if (item.Icon is { } icon)
Expand Down
7 changes: 6 additions & 1 deletion src/Aspire.Dashboard/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,12 @@ fluent-tooltip[anchor="dialog_close"] > div {
margin-right: 3px;
}

fluent-menu-item::part(content) {
.aspire-menu-container > fluent-menu > fluent-menu-item::part(content) {
Copy link
Preview

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

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

The CSS selector assumes .aspire-menu-container wraps the <fluent-menu>, but you applied the class directly on the <FluentMenu> element. As a result the rule won’t match. Either move the class to a parent container or adjust the selector to target fluent-menu.aspire-menu-container.

Suggested change
.aspire-menu-container > fluent-menu > fluent-menu-item::part(content) {
fluent-menu.aspire-menu-container > fluent-menu-item::part(content) {

Copilot uses AI. Check for mistakes.

width: 100%;
text-overflow: ellipsis;
Copy link
Preview

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

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

To reliably trigger an ellipsis, you should also include overflow: hidden; and white-space: nowrap; on the same element.

Suggested change
text-overflow: ellipsis;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;

Copilot uses AI. Check for mistakes.

}

.overflow-fluent-menu-item::part(content) {
width: 100%;
text-overflow: ellipsis;
Comment on lines +825 to 832
Copy link
Preview

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

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

[nitpick] Both scoped and utility selectors set identical properties (width: 100% and text-overflow: ellipsis). Consider extracting them into a shared rule or CSS variable to reduce duplication.

Suggested change
.aspire-menu-container > fluent-menu > fluent-menu-item::part(content) {
width: 100%;
text-overflow: ellipsis;
}
.overflow-fluent-menu-item::part(content) {
width: 100%;
text-overflow: ellipsis;
.full-width-ellipsis {
width: 100%;
text-overflow: ellipsis;
}
.aspire-menu-container > fluent-menu > fluent-menu-item::part(content) {
@apply .full-width-ellipsis;
}
.overflow-fluent-menu-item::part(content) {
@apply .full-width-ellipsis;

Copilot uses AI. Check for mistakes.

}
Expand Down
Loading