59 references to PanelSection
Aspire.Tray.Tests (59)
src\Aspire.Tray\Common\TrayPanel.cs (37)
66private (PanelSection Section, AppHostId Host)? _actions; 141public (PanelSection Section, AppHostId Host)? ActionsRow => _actions; 210_focus = new(PanelTargetKind.Back, PanelSection.None, null); 238BeginConfirm(new(PanelConfirmKind.RemoveMissing, PanelSection.Recent, host)); 558_focus = new(PanelTargetKind.Settings, PanelSection.None, null); 632var recent = target.Key.Section == PanelSection.Recent; 690BeginConfirm(new(PanelConfirmKind.ClearRecent, PanelSection.Recent, null)); 746Add(ListItemKind.Empty, EmptyStateHeight, PanelSection.None, null); 748AddSection(PanelSection.Running, running, expanded: true); 749AddSection(PanelSection.Pinned, pinned, expanded: true); 750AddSection(PanelSection.Recent, state.RecentAppHosts, IsRecentExpanded); 754void Add(ListItemKind kind, double height, PanelSection section, AppHostMenuItem? host, PanelTargetKind target = default) 760void AddSection(PanelSection section, IReadOnlyList<AppHostMenuItem> hosts, bool expanded) 768if (section == PanelSection.Recent && _confirm is { Kind: PanelConfirmKind.ClearRecent }) 795Add(ListItemKind.SectionHeader, SectionHeaderHeight, PanelSection.None, null, PanelTargetKind.LaunchAtSignIn); 796Add(ListItemKind.SettingsToggle, SettingsRowHeight, PanelSection.None, null, PanelTargetKind.LaunchAtSignIn); 797Add(ListItemKind.SectionHeader, SectionHeaderHeight, PanelSection.None, null, PanelTargetKind.Documentation); 798Add(ListItemKind.About, AboutHeight, PanelSection.None, null); 869item.Section == PanelSection.Running && duplicateNames.Contains(item.Host!.DisplayName), palette); 984private void AddSectionHeader(List<PanelCommand> commands, List<PanelHitTarget> targets, PanelSection section, double top, 989PanelSection.Running => "RUNNING", 990PanelSection.Pinned => "PINNED", 994if (section != PanelSection.Recent) 997AddLabel(section == PanelSection.Running ? "section.running" : "section.pinned", 998section == PanelSection.Running ? "Running" : "Pinned", labelBounds, chrome: false); 1022private void AddRow(List<PanelCommand> commands, List<PanelHitTarget> targets, AppHostMenuItem host, PanelSection section, 1095PanelSection.Running => _state.AppHosts.Where(host => host.Id.AppHostPid != 0), 1096PanelSection.Pinned => _state.AppHosts.Where(host => host.Id.AppHostPid == 0), 1109private List<(PanelTargetKind Kind, int Item, PanelIcon Icon, string Label, string Name)> GetRowActions(AppHostMenuItem host, PanelSection section) 1128if (section == PanelSection.Recent) 1140private void AddActions(List<PanelCommand> commands, List<PanelHitTarget> targets, AppHostMenuItem host, PanelSection section, 1235var section = confirm.Section; 1269var backKey = new PanelTargetKey(PanelTargetKind.Back, PanelSection.None, null); 1282var key = new PanelTargetKey(kind, PanelSection.None, null); 1340var key = new PanelTargetKey(kind, PanelSection.None, null); 1480private readonly record struct ListItem(ListItemKind Kind, double Y, double Height, PanelSection Section, AppHostMenuItem? Host, 1484private sealed record PanelConfirm(PanelConfirmKind Kind, PanelSection Section, AppHostMenuItem? Host);
src\Aspire.Tray\Common\TrayPanelScene.cs (1)
149internal readonly record struct PanelTargetKey(PanelTargetKind Kind, PanelSection Section, AppHostId? Host, int Item = 0);
TrayPanelTests.cs (21)
134Assert.Equal([PanelSection.Running, PanelSection.Running, PanelSection.Running, PanelSection.Pinned], 151Assert.Equal(2, panel.Scene.Targets.Count(target => target.Kind == PanelTargetKind.Row && target.Key.Section == PanelSection.Recent)); 193Assert.Equal((PanelSection.Running, host.Id), panel.ActionsRow); 224var target = panel.Scene.Targets.Single(target => target.Key == new PanelTargetKey(kind, PanelSection.Running, host.Id, item)); 274Assert.Equal((PanelSection.Running, state.AppHosts[1].Id), panel.ActionsRow); 291Assert.Equal((PanelSection.Running, host), panel.ActionsRow); 293Assert.Equal(new PanelTargetKey(PanelTargetKind.OpenInMenu, PanelSection.Running, host), panel.FocusedTarget); 297Assert.Equal(new PanelTargetKey(PanelTargetKind.OpenIn, PanelSection.Running, host, 1), panel.FocusedTarget); 301Assert.Equal(new PanelTargetKey(PanelTargetKind.OpenInMenu, PanelSection.Running, host), panel.FocusedTarget); 304Assert.Equal(new PanelTargetKey(PanelTargetKind.ShowInFolder, PanelSection.Running, host), panel.FocusedTarget); 323Assert.Equal((PanelSection.Running, host.Id), panel.ActionsRow); 505Assert.Equal(new PanelTargetKey(PanelTargetKind.Row, PanelSection.Running, state.AppHosts[0].Id), panel.FocusedTarget); 511Assert.Equal(new PanelTargetKey(PanelTargetKind.Row, PanelSection.Running, state.AppHosts[^1].Id), panel.FocusedTarget); 533Assert.DoesNotContain(new PanelTargetKey(PanelTargetKind.Dashboard, PanelSection.Running, state.AppHosts[2].Id), visited); 640Assert.Equal(new PanelTargetKey(PanelTargetKind.ConfirmCancel, PanelSection.Recent, null), panel.FocusedTarget); 675Assert.Equal(new PanelTargetKey(PanelTargetKind.Back, PanelSection.None, null), panel.FocusedTarget); 731Assert.Equal(new PanelTargetKey(PanelTargetKind.Settings, PanelSection.None, null), panel.FocusedTarget); 1261Assert.Equal(PanelResponse.None, panel.Invoke(new(PanelTargetKind.Back, PanelSection.None, null)));