Merge claudedo/64a2e2653d244714b76d637b3e0f3be8
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using ClaudeDo.Data;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
@@ -15,6 +14,8 @@ public sealed partial class FilesSettingsTabViewModel : ViewModelBase
|
||||
[ObservableProperty] private string _statusMessage = "";
|
||||
[ObservableProperty] private bool _isBusy;
|
||||
[ObservableProperty] private bool _hasCustomizedPrompts;
|
||||
[ObservableProperty] private string? _viewedKindName;
|
||||
[ObservableProperty] private string _viewedContent = "";
|
||||
|
||||
public string SystemPromptPath { get; } = PromptFiles.PathFor(PromptKind.System);
|
||||
public string PlanningPromptPath { get; } = PromptFiles.PathFor(PromptKind.Planning);
|
||||
@@ -49,20 +50,11 @@ public sealed partial class FilesSettingsTabViewModel : ViewModelBase
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void OpenPrompt(string? kindName)
|
||||
private void ViewPrompt(string? kindName)
|
||||
{
|
||||
if (!Enum.TryParse<PromptKind>(kindName, ignoreCase: true, out var kind)) return;
|
||||
try
|
||||
{
|
||||
// No override file yet: seed it with today's bundled default (hash-tracked, so a later
|
||||
// default change reconciles this file away automatically unless the user actually edits it)
|
||||
// rather than leaving a plain file that would freeze the prompt forever.
|
||||
if (!File.Exists(PromptFiles.PathFor(kind)))
|
||||
PromptFiles.Save(kind, PromptFiles.DefaultFor(kind));
|
||||
Process.Start(new ProcessStartInfo(PromptFiles.PathFor(kind)) { UseShellExecute = true });
|
||||
}
|
||||
catch (Exception ex) { StatusMessage = Loc.T("vm.filesTab.openFailed", ex.Message); }
|
||||
finally { RefreshCustomizedPrompts(); }
|
||||
ViewedKindName = kindName;
|
||||
ViewedContent = PromptFiles.ReadOrDefault(kind);
|
||||
}
|
||||
|
||||
private void RefreshCustomizedPrompts()
|
||||
|
||||
Reference in New Issue
Block a user