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