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