Titano: editor, import/archive screens, analysis and render jobs, server sync — in progress #2

Merged
Alby96 merged 86 commits from claude/keen-knuth-uhxv8w into main 2026-10-05 23:55:39 +02:00
2 changed files with 21 additions and 5 deletions
Showing only changes of commit ebcdc4d885 - Show all commits

No files matched your search

+2 -2
View File
@@ -9,7 +9,7 @@ namespace Titano.App.Shell;
/// <summary>
/// Attaches an <see cref="EditableField"/> to a text box (DESIGN §4 inputs): Enter commits, Esc reverts, leaving
/// the field commits a valid value.
/// the field commits a valid value. Ctrl+Enter commits and still reaches the screen's shortcut (Import · Ctrl+Enter).
/// </summary>
public static class EditBehavior
{
@@ -37,7 +37,7 @@ public static class EditBehavior
{
field.Commit();
box.SelectAll();
e.Handled = true;
e.Handled = Keyboard.Modifiers != ModifierKeys.Control;
}
else if (e.Key == Key.Escape)
{
+19 -3
View File
@@ -21,17 +21,33 @@ public sealed class RelayCommand(Action<object?> execute, Func<object?, bool>? c
public void Execute(object? parameter) => execute(parameter);
}
/// <summary>Asynchronous command that disables itself while running and reports failures through <see cref="Failed"/>.</summary>
/// <summary>
/// Asynchronous command that disables itself while running and reports failures through <see cref="Failed"/>. Like
/// <see cref="RelayCommand"/>, its buttons re-query it on <see cref="CommandManager.InvalidateRequerySuggested"/>.
/// </summary>
public sealed class AsyncRelayCommand(Func<object?, CancellationToken, Task> execute, Func<object?, bool>? canExecute = null) : ICommand
{
private CancellationTokenSource? _cts;
private EventHandler? _canExecuteChanged;
public AsyncRelayCommand(Func<Task> execute, Func<bool>? canExecute = null)
: this((_, _) => execute(), canExecute is null ? null : _ => canExecute())
{
}
public event EventHandler? CanExecuteChanged;
public event EventHandler? CanExecuteChanged
{
add
{
_canExecuteChanged += value;
CommandManager.RequerySuggested += value;
}
remove
{
_canExecuteChanged -= value;
CommandManager.RequerySuggested -= value;
}
}
/// <summary>Raised on the UI thread when the command throws (other than cancellation).</summary>
public static event Action<Exception>? Failed;
@@ -66,5 +82,5 @@ public sealed class AsyncRelayCommand(Func<object?, CancellationToken, Task> exe
public void Cancel() => _cts?.Cancel();
public void RaiseCanExecuteChanged() => CanExecuteChanged?.Invoke(this, EventArgs.Empty);
public void RaiseCanExecuteChanged() => _canExecuteChanged?.Invoke(this, EventArgs.Empty);
}