|
46 | 46 | </Border> |
47 | 47 |
|
48 | 48 | <!-- Body split: left file tree, right CLI output --> |
49 | | - <Grid Grid.Row="1" ColumnDefinitions="320,Auto,*,Auto,*"> |
| 49 | + <Grid Grid.Row="1"> |
| 50 | + <Grid.ColumnDefinitions> |
| 51 | + <ColumnDefinition Width="220"/> |
| 52 | + <ColumnDefinition Width="Auto"/> |
| 53 | + <ColumnDefinition Width="*"/> |
| 54 | + <ColumnDefinition Width="Auto"/> |
| 55 | + <ColumnDefinition Width="*" MinWidth="400"/> |
| 56 | + </Grid.ColumnDefinitions> |
50 | 57 | <!-- Left: directory tree --> |
51 | 58 | <Border BorderBrush="#333" BorderThickness="0,0,1,0" Background="#1F1F1F"> |
52 | 59 | <Grid RowDefinitions="Auto,*"> |
53 | 60 | <TextBlock Margin="10,8" FontWeight="SemiBold" Text="Workspace Files" Foreground="#E6E6E6"/> |
54 | 61 | <TreeView x:Name="WorkspaceTree" Grid.Row="1" ItemsSource="{Binding TreeRoots}" SelectionChanged="OnTreeSelectionChanged"> |
55 | 62 | <TreeView.DataTemplates> |
56 | 63 | <TreeDataTemplate DataType="models:FileTreeItem" ItemsSource="{Binding Children}"> |
57 | | - <StackPanel Orientation="Horizontal" Spacing="6"> |
58 | | - <Path Width="14" Height="14" |
59 | | - Data="{Binding IconGeometry}" |
60 | | - Fill="{Binding StatusBrush}"/> |
61 | | - <TextBlock Text="{Binding Name}" Foreground="#E6E6E6"/> |
62 | | - <TextBlock Margin="6,0,0,0" Text="{Binding GitStatusShort}" Foreground="{Binding StatusBrush}"/> |
63 | | - </StackPanel> |
| 64 | + <Grid ColumnDefinitions="Auto,6,*" VerticalAlignment="Center"> |
| 65 | + <Grid Width="16" Height="16" VerticalAlignment="Center" ClipToBounds="True"> |
| 66 | + <Path Width="16" Height="16" |
| 67 | + Data="{Binding IconGeometry}" |
| 68 | + Fill="#CFCFCF" |
| 69 | + Stretch="Uniform"/> |
| 70 | + <TextBlock Text="{Binding GitStatusLetter}" |
| 71 | + IsVisible="{Binding HasStatusLetter}" |
| 72 | + Foreground="#444444" |
| 73 | + FontSize="10" |
| 74 | + FontWeight="Bold" |
| 75 | + HorizontalAlignment="Center" |
| 76 | + VerticalAlignment="Center" |
| 77 | + TextAlignment="Center" |
| 78 | + Margin="-3,0,0,0"/> |
| 79 | + </Grid> |
| 80 | + <TextBlock Grid.Column="2" Text="{Binding Name}" Foreground="#E6E6E6" VerticalAlignment="Center"/> |
| 81 | + </Grid> |
64 | 82 | </TreeDataTemplate> |
65 | 83 | </TreeView.DataTemplates> |
66 | 84 | </TreeView> |
|
91 | 109 | </StackPanel> |
92 | 110 | </Border> |
93 | 111 | <Border Grid.Row="1" BorderBrush="#555" BorderThickness="1" CornerRadius="0,0,4,4"> |
94 | | - <ae:TextEditor x:Name="EditorCurrent" |
95 | | - Document="{Binding CurrentFileDocument, Mode=OneWay}" |
96 | | - IsReadOnly="False" |
97 | | - WordWrap="False" |
98 | | - ShowLineNumbers="True" |
99 | | - Background="#0A0A0A" |
100 | | - Foreground="#E6E6E6" |
101 | | - FontFamily="Consolas, Menlo, monospace" |
102 | | - FontSize="13" /> |
| 112 | + <Grid> |
| 113 | + <ae:TextEditor x:Name="EditorCurrent" |
| 114 | + Document="{Binding CurrentFileDocument, Mode=OneWay}" |
| 115 | + IsReadOnly="False" |
| 116 | + WordWrap="False" |
| 117 | + ShowLineNumbers="True" |
| 118 | + Background="#0A0A0A" |
| 119 | + Foreground="#E6E6E6" |
| 120 | + FontFamily="Consolas, Menlo, monospace" |
| 121 | + FontSize="13" /> |
| 122 | + <Image x:Name="ImageCurrent" Stretch="Uniform" IsVisible="False"/> |
| 123 | + </Grid> |
103 | 124 | </Border> |
104 | 125 | </Grid> |
105 | 126 |
|
|
117 | 138 | </Border> |
118 | 139 |
|
119 | 140 | <Border Grid.Column="0" Grid.Row="1" BorderBrush="#555" BorderThickness="1" CornerRadius="0,0,4,4"> |
120 | | - <ae:TextEditor x:Name="EditorBase" |
121 | | - Document="{Binding BaseFileDocument, Mode=OneWay}" |
122 | | - IsReadOnly="True" |
123 | | - WordWrap="False" |
124 | | - ShowLineNumbers="True" |
125 | | - Background="#0A0A0A" |
126 | | - Foreground="#E6E6E6" |
127 | | - FontFamily="Consolas, Menlo, monospace" |
128 | | - FontSize="13" /> |
| 141 | + <Grid> |
| 142 | + <ae:TextEditor x:Name="EditorBase" |
| 143 | + Document="{Binding BaseFileDocument, Mode=OneWay}" |
| 144 | + IsReadOnly="True" |
| 145 | + WordWrap="False" |
| 146 | + ShowLineNumbers="True" |
| 147 | + Background="#0A0A0A" |
| 148 | + Foreground="#E6E6E6" |
| 149 | + FontFamily="Consolas, Menlo, monospace" |
| 150 | + FontSize="13" /> |
| 151 | + <Image x:Name="ImageBase" Stretch="Uniform" IsVisible="False"/> |
| 152 | + </Grid> |
129 | 153 | </Border> |
130 | 154 | <GridSplitter Grid.Column="1" Grid.Row="1" Width="5" Background="#2A2A2A" HorizontalAlignment="Stretch" |
131 | 155 | ResizeDirection="Columns" ShowsPreview="True"/> |
132 | 156 | <Border Grid.Column="2" Grid.Row="1" BorderBrush="#555" BorderThickness="1" CornerRadius="0,0,4,4"> |
133 | | - <ae:TextEditor x:Name="EditorCurrent2" |
134 | | - Document="{Binding CurrentFileDocument, Mode=OneWay}" |
135 | | - IsReadOnly="False" |
136 | | - WordWrap="False" |
137 | | - ShowLineNumbers="True" |
138 | | - Background="#0A0A0A" |
139 | | - Foreground="#E6E6E6" |
140 | | - FontFamily="Consolas, Menlo, monospace" |
141 | | - FontSize="13" /> |
| 157 | + <Grid> |
| 158 | + <ae:TextEditor x:Name="EditorCurrent2" |
| 159 | + Document="{Binding CurrentFileDocument, Mode=OneWay}" |
| 160 | + IsReadOnly="False" |
| 161 | + WordWrap="False" |
| 162 | + ShowLineNumbers="True" |
| 163 | + Background="#0A0A0A" |
| 164 | + Foreground="#E6E6E6" |
| 165 | + FontFamily="Consolas, Menlo, monospace" |
| 166 | + FontSize="13" /> |
| 167 | + <Image x:Name="ImageCurrent2" Stretch="Uniform" IsVisible="False"/> |
| 168 | + </Grid> |
142 | 169 | </Border> |
143 | 170 | </Grid> |
144 | 171 | </Grid> |
|
148 | 175 | ResizeDirection="Columns" ShowsPreview="True"/> |
149 | 176 |
|
150 | 177 | <!-- Right: CLI session area --> |
151 | | - <Grid Grid.Column="4" RowDefinitions="Auto,*,Auto"> |
| 178 | + <Grid x:Name="RightPaneGrid" Grid.Column="4" RowDefinitions="Auto,*,Auto" MinWidth="400" SizeChanged="OnRightPaneSizeChanged"> |
152 | 179 | <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="10" Spacing="8"> |
153 | 180 | <TextBlock FontWeight="SemiBold" Text="Codex CLI Session"/> |
154 | 181 | <TextBlock Text="—"/> |
155 | 182 | <TextBlock Text="{Binding SessionStatus}"/> |
156 | 183 | <ProgressBar Width="60" Height="6" IsIndeterminate="True" IsVisible="{Binding IsBusy}" Margin="8,0,0,0" Opacity="0.35"/> |
157 | 184 | <TextBlock Text="•" Margin="8,0,0,0"/> |
158 | 185 | <TextBlock Text="{Binding TokenStats}"/> |
| 186 | + |
159 | 187 | </StackPanel> |
160 | 188 |
|
161 | 189 | <Border Grid.Row="1" Margin="10" BorderBrush="#DDD" BorderThickness="1" CornerRadius="4"> |
|
175 | 203 | <Button x:Name="RestartCliButton" Click="OnRestartCliClick" IsEnabled="{Binding HasWorkspace}">Restart Session</Button> |
176 | 204 | <Button x:Name="StopCliButton" Click="OnStopCliClick" IsEnabled="{Binding IsCliRunning}">Stop</Button> |
177 | 205 | <Button x:Name="ClearLogButton" Click="OnClearLogClick">Clear Log</Button> |
| 206 | + <Button x:Name="OpenShellButton" Click="OnOpenShellClick">Shell</Button> |
178 | 207 | </StackPanel> |
179 | | - <StackPanel Orientation="Horizontal" Spacing="8"> |
180 | | - <TextBox HorizontalAlignment="Stretch" MinWidth="200" Watermark="Type input and press Enter" |
181 | | - Text="{Binding CliInput, Mode=TwoWay}" KeyDown="OnCliInputKeyDown"/> |
182 | | - <Button x:Name="SendCliInputButton" Click="OnSendCliInputClick" IsEnabled="{Binding IsCliRunning}">Send</Button> |
183 | | - </StackPanel> |
| 208 | + <Grid ColumnDefinitions="*,Auto" ColumnSpacing="8"> |
| 209 | + <TextBox Grid.Column="0" x:Name="CliInputTextBox" |
| 210 | + Watermark="Type input and press Enter" |
| 211 | + TextWrapping="Wrap" |
| 212 | + ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
| 213 | + ScrollViewer.VerticalScrollBarVisibility="Auto" |
| 214 | + AcceptsReturn="True" |
| 215 | + Height="60" |
| 216 | + Text="{Binding CliInput, Mode=TwoWay}" |
| 217 | + KeyDown="OnCliInputKeyDown"/> |
| 218 | + <Button Grid.Column="1" x:Name="SendCliInputButton" Click="OnSendCliInputClick" IsEnabled="{Binding IsCliRunning}" IsDefault="True">Send</Button> |
| 219 | + </Grid> |
184 | 220 | </StackPanel> |
| 221 | + |
| 222 | + <!-- Shell modal overlay on a canvas for precise positioning --> |
| 223 | + <Canvas x:Name="ShellOverlay" Grid.RowSpan="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
| 224 | + <Border x:Name="ShellPanel" IsVisible="{Binding IsShellPanelOpen}" |
| 225 | + MinWidth="380" Height="100" |
| 226 | + Background="#1A1A1A" BorderBrush="#22FFFFFF" BorderThickness="1" CornerRadius="6"> |
| 227 | + <Grid> |
| 228 | + <!-- Close 'x' in corner --> |
| 229 | + <Button Content="✕" Width="20" Height="20" |
| 230 | + HorizontalAlignment="Right" VerticalAlignment="Top" |
| 231 | + Margin="0,0,0,0" Padding="0" |
| 232 | + Click="OnCloseShellClick"/> |
| 233 | + <StackPanel Orientation="Vertical" Margin="8,6,28,6" Spacing="6"> |
| 234 | + <!-- Prompt line above input --> |
| 235 | + <StackPanel Orientation="Horizontal" Spacing="6"> |
| 236 | + <TextBlock VerticalAlignment="Center" FontFamily="Consolas, Menlo, monospace" Foreground="#CFCFCF" Text="{Binding ShellPromptPath}"/> |
| 237 | + <TextBlock VerticalAlignment="Center" FontFamily="Consolas, Menlo, monospace" Foreground="#CFCFCF" Text="$"/> |
| 238 | + </StackPanel> |
| 239 | + <!-- Input and Run button --> |
| 240 | + <Grid ColumnDefinitions="*,Auto"> |
| 241 | + <TextBox Grid.Column="0" x:Name="ShellInputTextBox" |
| 242 | + FontFamily="Consolas, Menlo, monospace" |
| 243 | + Background="#0A0A0A" |
| 244 | + Foreground="#E6E6E6" |
| 245 | + Watermark="Enter command" |
| 246 | + HorizontalAlignment="Stretch" |
| 247 | + MinWidth="120" |
| 248 | + Padding="0, 0, 2, 0" |
| 249 | + ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
| 250 | + KeyDown="OnShellInputKeyDown"/> |
| 251 | + <Button Grid.Column="1" Padding="8,0,8,0" x:Name="RunShellButton" Click="OnRunShellClick">Run</Button> |
| 252 | + </Grid> |
| 253 | + </StackPanel> |
| 254 | + </Grid> |
| 255 | + </Border> |
| 256 | + </Canvas> |
185 | 257 | </Grid> |
186 | 258 | </Grid> |
187 | 259 | </Grid> |
|
0 commit comments