fix(ui): fix live output visibility and editor dialog graying out
- 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) <noreply@anthropic.com>
This commit is contained in:
@@ -114,6 +114,11 @@ public partial class ListEditorViewModel : ViewModelBase
|
||||
RequestClose?.Invoke();
|
||||
}
|
||||
|
||||
public void OnWindowClosed()
|
||||
{
|
||||
_tcs.TrySetResult(null);
|
||||
}
|
||||
|
||||
public Task<ListEntity?> ShowAndWaitAsync()
|
||||
{
|
||||
_tcs = new TaskCompletionSource<ListEntity?>();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -113,6 +113,11 @@ public partial class TaskEditorViewModel : ViewModelBase
|
||||
RequestClose?.Invoke();
|
||||
}
|
||||
|
||||
public void OnWindowClosed()
|
||||
{
|
||||
_tcs.TrySetResult(null);
|
||||
}
|
||||
|
||||
public Task<TaskEntity?> ShowAndWaitAsync()
|
||||
{
|
||||
_tcs = new TaskCompletionSource<TaskEntity?>();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user