Forge
csharpdeeb25a2
1#nullable enable
2using System.Collections.ObjectModel;
3using CascadeIDE.Cockpit.Channels.WorkspaceHealth;
4using CascadeIDE.Cockpit.ComputingUnits;
5using CascadeIDE.Cockpit.ComputingUnits.IdeHealth;
6
7namespace CascadeIDE.Cockpit.Composition.WorkspaceHealth;
8
9/// <summary>
10/// CCU «композиция поверхности канала» (<see cref="ICockpitComputeUnit"/>, ADR 0097): упорядочивает сегменты IDE Health из <see cref="IdeHealthInputSnapshot"/> (без Avalonia).
11/// Порядок — <see cref="IdeHealthInstrumentDeck"/> (ADR 0063). Канал продуктово — IDE Health (ADR 0089), не «Workspace Health» в смысле UI-лейбла.
12/// </summary>
13public sealed class IdeHealthSurfaceCompositor : IIdeHealthSurfaceCompositor
14{
15 public ObservableCollection<IdeHealthSegment> Compose(
16 ObservableCollection<IdeHealthSegment> scene,
17 IdeHealthInputSnapshot payload,
18 in IdeHealthSurfaceDecision decision)
19 {
20 if (!decision.Enabled)
21 return scene;
22
23 scene.Clear();
24 Append(scene, IdeHealthSource.Build, payload.Solution.Build);
25 Append(scene, IdeHealthSource.Tests, payload.Solution.Tests);
26 Append(scene, IdeHealthSource.Debug, payload.Solution.Debug);
27 Append(scene, IdeHealthSource.Git, payload.Workspace.Git);
28 return scene;
29 }
30
31 private static void Append(
32 ObservableCollection<IdeHealthSegment> target,
33 IdeHealthSource source,
34 IdeHealthSegmentInput input)
35 {
36 target.Add(new IdeHealthSegment
37 {
38 Source = source,
39 Stratum = input.Stratum,
40 Scope = input.Scope,
41 ProjectPath = input.ProjectPath,
42 LineText = input.LineText,
43 CockpitShort = input.CockpitShort,
44 IsBuildRunning = source == IdeHealthSource.Build && input.IsBuildRunning
45 });
46 }
47}
48
View only · write via MCP/CIDE