Forge
csharp4405de34
1#nullable enable
2
3using CascadeIDE.Features.Cockpit;
4using CascadeIDE.Models;
5
6namespace CascadeIDE.ViewModels;
7
8/// <summary>
9/// Cockpit Command Line на Forward host: <c>primary=intercom</c> — Skia в ChatPanel; <c>primary=editor</c> — оверлей <see cref="Views.CockpitCommandLineOverlayView"/> (ADR 0120).
10/// </summary>
11public partial class MainWindowViewModel
12{
13 public CockpitCommandLineOverlayViewModel CockpitCommandLineOverlay { get; private set; } = null!;
14
15 internal async Task OpenCockpitCommandLineOnActiveForwardHostAsync(string initialText = "/")
16 {
17 var text = string.IsNullOrWhiteSpace(initialText) ? "/" : initialText.Trim();
18
19 if (PrimaryWorkSurface == PrimaryWorkSurfaceKind.Intercom)
20 {
21 // UI: Intercom Skia surface.
22 await UiScheduler.Default.InvokeAsync(() =>
23 ChatPanel.CommandLineSession.Open(CockpitCommandLineHostKind.Intercom, text));
24 return;
25 }
26
27 await UiScheduler.Default.InvokeAsync(() =>
28 ChatPanel.CommandLineSession.Open(CockpitCommandLineHostKind.Editor, text));
29 }
30}
31
32
View only · write via MCP/CIDE