Skip to content

Commit f7b682a

Browse files
Merge pull request #4 from semantic-developer/feature/planning
shell support
2 parents 576b174 + e6eeab4 commit f7b682a

File tree

10 files changed

+1007
-165
lines changed

10 files changed

+1007
-165
lines changed

SemanticDeveloper/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ A cross‑platform desktop UI (Avalonia/.NET 8) for driving the Codex CLI using
3535
4. “CLI Settings” lets you change:
3636
- `Command` (default: `codex`)
3737
- `Additional Arguments` (e.g., `--model=gpt-5-high` or `-c model=gpt-5-high`)
38-
- Auto‑approve tool/patch requests
38+
- Verbose logging (show suppressed output)
3939

4040
5. The left file tree and right log pane are resizable using the vertical splitter between them.
4141

@@ -66,6 +66,9 @@ The app integrates basic Git operations directly in the header. All actions use
6666
- Example log: `Created and checked out 'feature-x' (based on origin/main).`
6767
- Switch Branch…
6868
- Checks out an existing branch by name (no automatic fetch/merge).
69+
- Rollback Changes…
70+
- Hard‑resets the working directory to `HEAD` and deletes untracked files.
71+
- Prompts for confirmation since this discards local changes.
6972
- Refresh
7073
- Refreshes the branch label and the file tree’s Git status coloring.
7174

@@ -88,7 +91,7 @@ Notes
8891
`cwd`, `approval_policy` (defaults to `on-request`), `sandbox_policy` (defaults to
8992
`workspace-write`), optional `model`, and default reasoning fields.
9093
- Auto‑approval: when the CLI emits an `exec_approval_request` or `apply_patch_approval_request`,
91-
the app responds with the corresponding approval submission (can be disabled in settings).
94+
the app automatically approves the request. There is no setting to toggle this.
9295

9396
- Conversation rendering (right pane):
9497
- Messages are labeled and colorized: `You:`, `Assistant:`, and `System:`.

SemanticDeveloper/SemanticDeveloper/MainWindow.axaml

Lines changed: 113 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,39 @@
4646
</Border>
4747

4848
<!-- 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>
5057
<!-- Left: directory tree -->
5158
<Border BorderBrush="#333" BorderThickness="0,0,1,0" Background="#1F1F1F">
5259
<Grid RowDefinitions="Auto,*">
5360
<TextBlock Margin="10,8" FontWeight="SemiBold" Text="Workspace Files" Foreground="#E6E6E6"/>
5461
<TreeView x:Name="WorkspaceTree" Grid.Row="1" ItemsSource="{Binding TreeRoots}" SelectionChanged="OnTreeSelectionChanged">
5562
<TreeView.DataTemplates>
5663
<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>
6482
</TreeDataTemplate>
6583
</TreeView.DataTemplates>
6684
</TreeView>
@@ -91,15 +109,18 @@
91109
</StackPanel>
92110
</Border>
93111
<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>
103124
</Border>
104125
</Grid>
105126

@@ -117,28 +138,34 @@
117138
</Border>
118139

119140
<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>
129153
</Border>
130154
<GridSplitter Grid.Column="1" Grid.Row="1" Width="5" Background="#2A2A2A" HorizontalAlignment="Stretch"
131155
ResizeDirection="Columns" ShowsPreview="True"/>
132156
<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>
142169
</Border>
143170
</Grid>
144171
</Grid>
@@ -148,14 +175,15 @@
148175
ResizeDirection="Columns" ShowsPreview="True"/>
149176

150177
<!-- 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">
152179
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="10" Spacing="8">
153180
<TextBlock FontWeight="SemiBold" Text="Codex CLI Session"/>
154181
<TextBlock Text=""/>
155182
<TextBlock Text="{Binding SessionStatus}"/>
156183
<ProgressBar Width="60" Height="6" IsIndeterminate="True" IsVisible="{Binding IsBusy}" Margin="8,0,0,0" Opacity="0.35"/>
157184
<TextBlock Text="" Margin="8,0,0,0"/>
158185
<TextBlock Text="{Binding TokenStats}"/>
186+
159187
</StackPanel>
160188

161189
<Border Grid.Row="1" Margin="10" BorderBrush="#DDD" BorderThickness="1" CornerRadius="4">
@@ -175,13 +203,57 @@
175203
<Button x:Name="RestartCliButton" Click="OnRestartCliClick" IsEnabled="{Binding HasWorkspace}">Restart Session</Button>
176204
<Button x:Name="StopCliButton" Click="OnStopCliClick" IsEnabled="{Binding IsCliRunning}">Stop</Button>
177205
<Button x:Name="ClearLogButton" Click="OnClearLogClick">Clear Log</Button>
206+
<Button x:Name="OpenShellButton" Click="OnOpenShellClick">Shell</Button>
178207
</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>
184220
</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>
185257
</Grid>
186258
</Grid>
187259
</Grid>

0 commit comments

Comments
 (0)