Skip to content

Commit 36681a0

Browse files
authored
Prevent text overflow in resource action URLs (#9314)
1 parent 5c4f9f5 commit 36681a0

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

playground/Stress/Stress.AppHost/Program.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,19 @@
7979

8080
builder.AddProject<Projects.Stress_TelemetryService>("stress-telemetryservice")
8181
.WithUrls(c => c.Urls.Add(new() { Url = "https://someplace.com", DisplayText = "Some place" }))
82-
.WithUrl("https://someotherplace.com/some-path", "Some other place");
82+
.WithUrl("https://someotherplace.com/some-path", "Some other place")
83+
.WithUrl("https://extremely-long-url.com/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz//abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/abcdefghijklmno")
84+
.WithCommand(
85+
name: "long-command",
86+
displayName: "This is a custom command with a very long command display name",
87+
executeCommand: (c) =>
88+
{
89+
return Task.FromResult(CommandResults.Success());
90+
},
91+
commandOptions: new CommandOptions
92+
{
93+
IconName = "CloudDatabase"
94+
});
8395

8496
#if !SKIP_DASHBOARD_REFERENCE
8597
// This project is only added in playground projects to support development/debugging

src/Aspire.Dashboard/Components/Controls/AspireMenu.razor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ public async Task OpenAsync(int screenWidth, int screenHeight, int clientX, int
7777
.AddStyle("right", $"{right}px", right != 0)
7878
.AddStyle("top", $"{top}px", top != 0)
7979
.AddStyle("bottom", $"{bottom}px", bottom != 0)
80+
// max-width and min-width values come from fluentui-blazor stylesheet
81+
// explicitly set to override min-width: fit-content applied by library to some menus
82+
.AddStyle("max-width", "368px")
83+
.AddStyle("min-width", "64px")
8084
.Build();
8185

8286
Open = true;

src/Aspire.Dashboard/wwwroot/css/app.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,3 +817,8 @@ fluent-tooltip[anchor="dialog_close"] > div {
817817
vertical-align: text-bottom;
818818
margin-right: 3px;
819819
}
820+
821+
fluent-menu-item::part(content) {
822+
width: 100%;
823+
text-overflow: ellipsis;
824+
}

0 commit comments

Comments
 (0)