From 2a1f26d8177ac65a6e87125c0c4aefdf1b0cdffc Mon Sep 17 00:00:00 2001 From: Mika Kuns Date: Tue, 14 Apr 2026 17:01:08 +0200 Subject: [PATCH] fix(ui): fix live output visibility and editor dialog graying out MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove wrapping ScrollViewer from live output TextBox — Avalonia TextBox with AcceptsReturn handles its own scrolling; nested ScrollViewer caused layout collapse - Auto-scroll via CaretIndex instead of removed ScrollViewer - Add OnWindowClosed to both editor ViewModels, ensuring the TaskCompletionSource always resolves when the dialog closes (including via X button), preventing RelayCommand from staying permanently disabled Co-Authored-By: Claude Opus 4.6 (1M context) --- .../ViewModels/ListEditorViewModel.cs | 5 ++++ .../ViewModels/MainWindowViewModel.cs | 2 ++ .../ViewModels/TaskEditorViewModel.cs | 5 ++++ .../ViewModels/TaskListViewModel.cs | 2 ++ src/ClaudeDo.Ui/Views/TaskDetailView.axaml | 29 +++++++++---------- src/ClaudeDo.Ui/Views/TaskDetailView.axaml.cs | 7 +++-- 6 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/ClaudeDo.Ui/ViewModels/ListEditorViewModel.cs b/src/ClaudeDo.Ui/ViewModels/ListEditorViewModel.cs index a5ecc84..2898aad 100644 --- a/src/ClaudeDo.Ui/ViewModels/ListEditorViewModel.cs +++ b/src/ClaudeDo.Ui/ViewModels/ListEditorViewModel.cs @@ -114,6 +114,11 @@ public partial class ListEditorViewModel : ViewModelBase RequestClose?.Invoke(); } + public void OnWindowClosed() + { + _tcs.TrySetResult(null); + } + public Task ShowAndWaitAsync() { _tcs = new TaskCompletionSource(); diff --git a/src/ClaudeDo.Ui/ViewModels/MainWindowViewModel.cs b/src/ClaudeDo.Ui/ViewModels/MainWindowViewModel.cs index 9591001..4309d43 100644 --- a/src/ClaudeDo.Ui/ViewModels/MainWindowViewModel.cs +++ b/src/ClaudeDo.Ui/ViewModels/MainWindowViewModel.cs @@ -83,6 +83,7 @@ public partial class MainWindowViewModel : ViewModelBase var window = new ListEditorView { DataContext = editor }; editor.RequestClose += () => window.Close(); + window.Closed += (_, _) => editor.OnWindowClosed(); _ = ShowDialogAsync(window); var entity = await editor.ShowAndWaitAsync(); @@ -116,6 +117,7 @@ public partial class MainWindowViewModel : ViewModelBase var window = new ListEditorView { DataContext = editor }; editor.RequestClose += () => window.Close(); + window.Closed += (_, _) => editor.OnWindowClosed(); _ = ShowDialogAsync(window); var entity = await editor.ShowAndWaitAsync(); diff --git a/src/ClaudeDo.Ui/ViewModels/TaskEditorViewModel.cs b/src/ClaudeDo.Ui/ViewModels/TaskEditorViewModel.cs index 7a07f2a..b388e0b 100644 --- a/src/ClaudeDo.Ui/ViewModels/TaskEditorViewModel.cs +++ b/src/ClaudeDo.Ui/ViewModels/TaskEditorViewModel.cs @@ -113,6 +113,11 @@ public partial class TaskEditorViewModel : ViewModelBase RequestClose?.Invoke(); } + public void OnWindowClosed() + { + _tcs.TrySetResult(null); + } + public Task ShowAndWaitAsync() { _tcs = new TaskCompletionSource(); diff --git a/src/ClaudeDo.Ui/ViewModels/TaskListViewModel.cs b/src/ClaudeDo.Ui/ViewModels/TaskListViewModel.cs index f1bda78..62129db 100644 --- a/src/ClaudeDo.Ui/ViewModels/TaskListViewModel.cs +++ b/src/ClaudeDo.Ui/ViewModels/TaskListViewModel.cs @@ -151,6 +151,7 @@ public partial class TaskListViewModel : ViewModelBase var window = new TaskEditorView { DataContext = editor }; editor.RequestClose += () => window.Close(); + window.Closed += (_, _) => editor.OnWindowClosed(); _ = ShowDialogAsync(window); var saved = await editor.ShowAndWaitAsync(); @@ -197,6 +198,7 @@ public partial class TaskListViewModel : ViewModelBase var window = new TaskEditorView { DataContext = editor }; editor.RequestClose += () => window.Close(); + window.Closed += (_, _) => editor.OnWindowClosed(); _ = ShowDialogAsync(window); var saved = await editor.ShowAndWaitAsync(); diff --git a/src/ClaudeDo.Ui/Views/TaskDetailView.axaml b/src/ClaudeDo.Ui/Views/TaskDetailView.axaml index 7887d63..1fb121a 100644 --- a/src/ClaudeDo.Ui/Views/TaskDetailView.axaml +++ b/src/ClaudeDo.Ui/Views/TaskDetailView.axaml @@ -106,22 +106,19 @@ - - - - - + diff --git a/src/ClaudeDo.Ui/Views/TaskDetailView.axaml.cs b/src/ClaudeDo.Ui/Views/TaskDetailView.axaml.cs index f5d2f6d..c7dbaee 100644 --- a/src/ClaudeDo.Ui/Views/TaskDetailView.axaml.cs +++ b/src/ClaudeDo.Ui/Views/TaskDetailView.axaml.cs @@ -49,8 +49,11 @@ public partial class TaskDetailView : UserControl { if (e.PropertyName == nameof(TaskDetailViewModel.LiveText)) { - var scroll = this.FindControl("LiveOutputScroll"); - scroll?.ScrollToEnd(); + var box = this.FindControl("LiveOutputBox"); + if (box is not null) + { + box.CaretIndex = box.Text?.Length ?? 0; + } } } }