50 references to ResourceListDensity
Aspire.Dashboard (14)
Components\Dialogs\SettingsDialog.razor.cs (3)
28private IReadOnlyList<IconToggleOption<ResourceListDensity>> _densityOptions = []; 91new(ResourceListDensity.Comfortable, new Icons.Regular.Size20.AppsListDetail(), Loc[nameof(Dashboard.Resources.Dialogs.SettingsDialogResourceListDensityComfortable)]), 92new(ResourceListDensity.Compact, new Icons.Regular.Size20.AppsList(), Loc[nameof(Dashboard.Resources.Dialogs.SettingsDialogResourceListDensityCompact)]),
Components\Layout\ResourcesLayout.razor.cs (1)
1848private bool IsCompact => ViewPreferences.Density == ResourceListDensity.Compact;
Model\DashboardViewPreferences.cs (10)
71private const ResourceListDensity DefaultDensity = ResourceListDensity.Compact; 76public ResourceListDensity Density { get; private set; } = DefaultDensity; 111public async Task SetDensityAsync(ResourceListDensity density) 152var density = await ReadDensityAsync().ConfigureAwait(false); 170private async Task<ResourceListDensity> ReadDensityAsync() 177await localStorage.SetUnprotectedAsync(BrowserStorageKeys.ResourceListDensity, nameof(ResourceListDensity.Comfortable)).ConfigureAwait(false); 178return ResourceListDensity.Comfortable; 181return result.Success && Enum.TryParse<ResourceListDensity>(result.Value, out var value) && Enum.IsDefined(value) ? value : DefaultDensity;
Aspire.Dashboard.Components.Tests (35)
Dialogs\SettingsDialogTests.cs (1)
99Assert.Equal(ResourceListDensity.Comfortable, preferences.Density);
Layout\ResourceRowAvailabilityTests.cs (2)
87await cut.InvokeAsync(() => Services.GetRequiredService<DashboardViewPreferences>().SetDensityAsync(ResourceListDensity.Compact)); 441cut.InvokeAsync(() => Services.GetRequiredService<DashboardViewPreferences>().SetDensityAsync(ResourceListDensity.Comfortable));
Layout\ResourcesLayoutTests.cs (29)
413await cut.InvokeAsync(() => Services.GetRequiredService<DashboardViewPreferences>().SetDensityAsync(ResourceListDensity.Comfortable)); 455await cut.InvokeAsync(() => Services.GetRequiredService<DashboardViewPreferences>().SetDensityAsync(ResourceListDensity.Comfortable)); 461[InlineData(ResourceListDensity.Compact)] 462[InlineData(ResourceListDensity.Comfortable)] 463public async Task WideRowMetadata_PreservesRuntimeStateAndAccessibleHealthWithRelativeStart(ResourceListDensity density) 506var compact = density is ResourceListDensity.Compact; 1161await cut.InvokeAsync(() => Services.GetRequiredService<DashboardViewPreferences>().SetDensityAsync(ResourceListDensity.Comfortable)); 1255await cut.InvokeAsync(() => preferences.SetDensityAsync(ResourceListDensity.Comfortable)); 1258await cut.InvokeAsync(() => preferences.SetDensityAsync(ResourceListDensity.Compact)); 1644[InlineData(CommandViewModelState.Enabled, false, false, ResourceListDensity.Comfortable)] 1645[InlineData(CommandViewModelState.Enabled, true, false, ResourceListDensity.Compact)] 1646[InlineData(CommandViewModelState.Disabled, true, false, ResourceListDensity.Comfortable)] 1647[InlineData(CommandViewModelState.Enabled, true, true, ResourceListDensity.Compact)] 1648[InlineData(CommandViewModelState.Hidden, true, false, ResourceListDensity.Comfortable)] 1649[InlineData(null, false, false, ResourceListDensity.Compact)] 1651CommandViewModelState? setState, bool highlighted, bool readOnly, ResourceListDensity density) 1815[InlineData(true, ResourceListDensity.Comfortable)] 1816[InlineData(true, ResourceListDensity.Compact)] 1817[InlineData(false, ResourceListDensity.Comfortable)] 1818public async Task RowMenuTerminal_SelectsOnlyItsResourceAndPreservesViewState(bool desktop, ResourceListDensity density) 1847var spacer = density == ResourceListDensity.Compact ? rail[^1] : rail[0]; 2510[InlineData("Persistent", ResourceListDensity.Comfortable, "Container (persistent)")] 2511[InlineData("Persistent", ResourceListDensity.Compact, "Container (persistent)")] 2512[InlineData("Session", ResourceListDensity.Comfortable, "Container")] 2513[InlineData("Session", ResourceListDensity.Compact, "Container")] 2514[InlineData(null, ResourceListDensity.Comfortable, "Container")] 2515[InlineData(null, ResourceListDensity.Compact, "Container")] 2516public async Task AppHost_ContainerLifetimeQualifiesTypeAndBadgesResourceGlyph(string? lifetime, ResourceListDensity density, string expectedType) 2531Assert.Equal(density is ResourceListDensity.Compact ? [expectedType] : [],
Model\DashboardViewPreferencesTests.cs (3)
67Assert.Equal(ResourceListDensity.Comfortable, preferences.Density); 74Assert.Equal(ResourceListDensity.Comfortable, reopenedPreferences.Density); 104Assert.Equal(ResourceListDensity.Compact, preferences.Density);
Aspire.Dashboard.Playwright.Tests (1)
Integration\Playwright\Infrastructure\PlaywrightTestsBase.cs (1)
50localStorage.setItem('{{BrowserStorageKeys.ResourceListDensity}}', '"{{nameof(ResourceListDensity.Comfortable)}}"');