feat(ui): Throttle-Stufen im Ausfuehrung-Tab sichtbar machen

Die vier UsageThrottle-Prozente waren nur per Gauge-Drag im Usage-Monitor
erreichbar und wurden im Settings-Modal unsichtbar durchgeschleift. Jetzt
read-only angezeigt plus Button in den Usage-Monitor. Der Button schliesst die
Settings absichtlich: Save() schreibt die beim Oeffnen gelesenen Throttle-Werte
zurueck und wuerde ein zwischenzeitliches Draggen ueberschreiben.
This commit is contained in:
mika kuns
2026-08-27 10:39:08 +02:00
parent 4464dc6ff1
commit 31d53b0033
5 changed files with 71 additions and 0 deletions
@@ -66,6 +66,18 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
[RelayCommand]
private void OpenRepoImport() => RequestRepoImport?.Invoke();
// Same deal for the usage monitor, which owns the throttle-stage editor. It must *close* this
// modal rather than stack on top: Save() writes the throttle values it read at open, so a drag
// made while Settings is still open would be overwritten on save.
public Action? RequestUsageMonitor { get; set; }
[RelayCommand]
private void OpenUsageMonitor() => RequestUsageMonitor?.Invoke();
/// Read-only echo of the four throttle percentages, which are edited by dragging the
/// usage-monitor gauges — without this the Execution tab silently carries them through.
[ObservableProperty] private string _throttleSummary = "";
[ObservableProperty] private string _validationError = "";
[ObservableProperty] private bool _isBusy;
[ObservableProperty] private string _statusMessage = "";
@@ -135,6 +147,9 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
_throttleStages = (
dto.UsageThrottleFiveHourSoftPct, dto.UsageThrottleFiveHourHardPct,
dto.UsageThrottleSevenDaySoftPct, dto.UsageThrottleSevenDayHardPct);
ThrottleSummary = Loc.T("settings.general.throttleStagesValues",
_throttleStages.FiveSoft, _throttleStages.FiveHard,
_throttleStages.SevenSoft, _throttleStages.SevenHard);
Worktrees.WorktreeStrategy = dto.WorktreeStrategy ?? "sibling";
Worktrees.CentralWorktreeRoot = dto.CentralWorktreeRoot;
Worktrees.WorktreeAutoCleanupEnabled = dto.WorktreeAutoCleanupEnabled;
@@ -148,6 +163,7 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
}
else StatusMessage = Loc.T("vm.settingsModal.workerOffline");
await Files.LoadClaudeBinAsync();
await Prime.LoadAsync();
await OnlineInbox.LoadAsync();
await SessionSkills.LoadAsync(dto?.SessionSkills);
@@ -252,6 +252,18 @@
<TextBlock Text="{loc:Tr settings.general.autoContinueOnUsageLimitHint}"
Opacity="0.6" FontSize="12" TextWrapping="Wrap"/>
</StackPanel>
<!-- Throttle stages live on the usage-monitor gauges (drag + spinner per stage);
echoed read-only here so they aren't invisible on the tab that owns the gate. -->
<StackPanel Spacing="4">
<TextBlock Classes="field-label" Text="{loc:Tr settings.general.throttleStagesHeading}"/>
<TextBlock Text="{Binding ThrottleSummary}" Classes="meta"/>
<TextBlock Text="{loc:Tr settings.general.throttleStagesHint}"
Opacity="0.6" FontSize="12" TextWrapping="Wrap"/>
<Button Classes="btn" HorizontalAlignment="Left"
Content="{loc:Tr settings.general.openUsageMonitor}"
Command="{Binding OpenUsageMonitorCommand}"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
</TabItem>
@@ -394,6 +406,22 @@
<TabItem Header="{loc:Tr settings.sidebar.categoryFiles}">
<ScrollViewer>
<StackPanel Spacing="12" Margin="0,8,0,0">
<!-- claude_bin from worker.config.json — saved on its own button, not the modal's
Save, because the worker owns that file rather than app_settings. -->
<StackPanel Spacing="6">
<TextBlock Classes="section-label" Text="{loc:Tr settings.files.cliSection}"/>
<TextBlock Classes="meta" Text="{loc:Tr settings.files.claudeBinHint}" TextWrapping="Wrap"/>
<Grid ColumnDefinitions="*,Auto" ColumnSpacing="8">
<TextBox Grid.Column="0" Text="{Binding Files.ClaudeBin, Mode=TwoWay}"
PlaceholderText="claude"/>
<Button Grid.Column="1" Classes="btn" Content="{loc:Tr settings.save}"
Command="{Binding Files.SaveClaudeBinCommand}"/>
</Grid>
<ctl:OperationIndicator Status="{Binding Files.ClaudeBinOp}"/>
<TextBlock Classes="path-mono" TextWrapping="Wrap"
Text="{Binding Files.ClaudeBinResolvedHint}"
IsVisible="{Binding Files.ClaudeBinResolvedHint, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
</StackPanel>
<StackPanel Spacing="6">
<TextBlock Classes="section-label" Text="{loc:Tr settings.files.agentsSection}"/>
<TextBlock Classes="meta" Text="{loc:Tr settings.files.agentsHint}"
@@ -77,6 +77,11 @@ public sealed class WindowDialogService : IDialogService
dlg.Close();
if (Shell is not null) _ = Shell.OpenRepoImportCommand.ExecuteAsync(null);
};
vm.RequestUsageMonitor = () =>
{
dlg.Close();
if (Shell is not null) _ = Shell.OpenUsageMonitorCommand.ExecuteAsync(null);
};
await dlg.ShowDialog(ActiveOwner());
}