60 references to PanelSection
Aspire.Tray.Tests (60)
src\Aspire.Tray\Common\TrayPanel.cs (38)
94private (PanelSection Section, AppHostId Host)? _actions; 169public (PanelSection Section, AppHostId Host)? ActionsRow => _actions; 237_focus = new(PanelTargetKind.Back, PanelSection.None, null); 265BeginConfirm(new(PanelConfirmKind.RemoveMissing, PanelSection.Recent, host)); 663_focus = new(PanelTargetKind.Settings, PanelSection.None, null); 737var recent = target.Key.Section == PanelSection.Recent; 795BeginConfirm(new(PanelConfirmKind.ClearRecent, PanelSection.Recent, null)); 852Add(ListItemKind.Empty, EmptyStateHeight, PanelSection.None, null); 854AddSection(PanelSection.Running, running, expanded: true); 855AddSection(PanelSection.Pinned, pinned, expanded: true); 856AddSection(PanelSection.Recent, state.RecentAppHosts, IsRecentExpanded); 860void Add(ListItemKind kind, double height, PanelSection section, AppHostMenuItem? host, PanelTargetKind target = default) 866void AddSection(PanelSection section, IReadOnlyList<AppHostMenuItem> hosts, bool expanded) 874if (section == PanelSection.Recent && _confirm is { Kind: PanelConfirmKind.ClearRecent }) 901Add(ListItemKind.SectionHeader, SectionHeaderHeight, PanelSection.None, null, PanelTargetKind.LaunchAtSignIn); 902Add(ListItemKind.SettingsToggle, SettingsRowHeight, PanelSection.None, null, PanelTargetKind.LaunchAtSignIn); 903Add(ListItemKind.SectionHeader, SectionHeaderHeight, PanelSection.None, null, PanelTargetKind.Documentation); 904Add(ListItemKind.About, AboutHeight, PanelSection.None, null); 998item.Section == PanelSection.Running && duplicateNames.Contains(item.Host!.DisplayName), palette); 1111case ListItemKind.SectionHeader when item.Section == PanelSection.Recent && _settings is null: 1244private void AddSectionHeader(List<PanelCommand> commands, List<PanelHitTarget> targets, PanelSection section, double top, 1249PanelSection.Running => "RUNNING", 1250PanelSection.Pinned => "PINNED", 1254if (section != PanelSection.Recent) 1257AddLabel(section == PanelSection.Running ? "section.running" : "section.pinned", 1258section == PanelSection.Running ? "Running" : "Pinned", labelBounds, chrome: false); 1282private void AddRow(List<PanelCommand> commands, List<PanelHitTarget> targets, AppHostMenuItem host, PanelSection section, 1356PanelSection.Running => _state.AppHosts.Where(host => host.Id.AppHostPid != 0), 1357PanelSection.Pinned => _state.AppHosts.Where(host => host.Id.AppHostPid == 0), 1370private List<(PanelTargetKind Kind, int Item, PanelIcon Icon, string Label, string Name)> GetRowActions(AppHostMenuItem host, PanelSection section) 1389if (section == PanelSection.Recent) 1401private void AddActions(List<PanelCommand> commands, List<PanelHitTarget> targets, AppHostMenuItem host, PanelSection section, 1496var section = confirm.Section; 1531var backKey = new PanelTargetKey(PanelTargetKind.Back, PanelSection.None, null); 1544var key = new PanelTargetKey(kind, PanelSection.None, null); 1599var key = new PanelTargetKey(kind, PanelSection.None, null); 1740private readonly record struct ListItem(ListItemKind Kind, double Y, double Height, PanelSection Section, AppHostMenuItem? Host, 1744private sealed record PanelConfirm(PanelConfirmKind Kind, PanelSection Section, AppHostMenuItem? Host);
src\Aspire.Tray\Common\TrayPanelScene.cs (1)
165internal readonly record struct PanelTargetKey(PanelTargetKind Kind, PanelSection Section, AppHostId? Host, int Item = 0);
TrayPanelTests.cs (21)
174Assert.Equal([PanelSection.Running, PanelSection.Running, PanelSection.Running, PanelSection.Pinned], 191Assert.Equal(2, panel.Scene.Targets.Count(target => target.Kind == PanelTargetKind.Row && target.Key.Section == PanelSection.Recent)); 233Assert.Equal((PanelSection.Running, host.Id), panel.ActionsRow); 264var target = panel.Scene.Targets.Single(target => target.Key == new PanelTargetKey(kind, PanelSection.Running, host.Id, item)); 314Assert.Equal((PanelSection.Running, state.AppHosts[1].Id), panel.ActionsRow); 331Assert.Equal((PanelSection.Running, host), panel.ActionsRow); 333Assert.Equal(new PanelTargetKey(PanelTargetKind.OpenInMenu, PanelSection.Running, host), panel.FocusedTarget); 337Assert.Equal(new PanelTargetKey(PanelTargetKind.OpenIn, PanelSection.Running, host, 1), panel.FocusedTarget); 341Assert.Equal(new PanelTargetKey(PanelTargetKind.OpenInMenu, PanelSection.Running, host), panel.FocusedTarget); 344Assert.Equal(new PanelTargetKey(PanelTargetKind.ShowInFolder, PanelSection.Running, host), panel.FocusedTarget); 363Assert.Equal((PanelSection.Running, host.Id), panel.ActionsRow); 609Assert.Equal(new PanelTargetKey(PanelTargetKind.Row, PanelSection.Running, state.AppHosts[0].Id), panel.FocusedTarget); 615Assert.Equal(new PanelTargetKey(PanelTargetKind.Row, PanelSection.Running, state.AppHosts[^1].Id), panel.FocusedTarget); 637Assert.DoesNotContain(new PanelTargetKey(PanelTargetKind.Dashboard, PanelSection.Running, state.AppHosts[2].Id), visited); 744Assert.Equal(new PanelTargetKey(PanelTargetKind.ConfirmCancel, PanelSection.Recent, null), panel.FocusedTarget); 779Assert.Equal(new PanelTargetKey(PanelTargetKind.Back, PanelSection.None, null), panel.FocusedTarget); 835Assert.Equal(new PanelTargetKey(PanelTargetKind.Settings, PanelSection.None, null), panel.FocusedTarget); 1501Assert.Equal(PanelResponse.None, panel.Invoke(new(PanelTargetKind.Back, PanelSection.None, null)));