| 1 | namespace CascadeIDE.Cockpit.Composition.EnvironmentReadiness; |
| 2 | |
| 3 | /// <summary> |
| 4 | /// Выбирает <see cref="EnvironmentReadinessPresentationKind"/> по ширине контейнера (ADR 0068: проекция ≠ payload). |
| 5 | /// Стабильные id строк и порядок — в <see cref="EnvironmentReadinessInstrumentDeck.OrderedCellIds"/> / снимке канала. |
| 6 | /// </summary> |
| 7 | public static class EnvironmentReadinessPresentationResolver |
| 8 | { |
| 9 | /// <summary>Порог ширины (px) для режима таблицы; страница вторичного контура использует то же значение.</summary> |
| 10 | public const double DefaultWideLayoutMinWidthPx = 420; |
| 11 | |
| 12 | public static EnvironmentReadinessPresentationKind Resolve(double containerWidth, double wideLayoutMinWidthPx = DefaultWideLayoutMinWidthPx) |
| 13 | { |
| 14 | if (containerWidth <= 0) |
| 15 | return EnvironmentReadinessPresentationKind.CompactCards; |
| 16 | |
| 17 | return containerWidth >= wideLayoutMinWidthPx |
| 18 | ? EnvironmentReadinessPresentationKind.WideTable |
| 19 | : EnvironmentReadinessPresentationKind.CompactCards; |
| 20 | } |
| 21 | } |
| 22 | |
View only · write via MCP/CIDE