feat(app): taskbar progress, Windows notifications, job toasts, rail badges and section shortcuts
UI-05: the main window's TaskbarItemInfo mirrors the job bar (progress, sliding while the total is unknown) and turns red while a failure waits on the Jobs screen. UI-06: the Uploader's tray icon moves to Titano.Ui (Interop/TrayIcon, with a balloon click callback and error balloons) and the Uploader keeps using it. While the main window is minimised, hidden or behind another program, every toast (card inserted, auto-import, job ended, server messages) also becomes a Windows notification; clicking it restores the window and runs the toast's action. The icon exists only while such a notification can be clicked. Settings › General gains Notifications (on by default) and Startup: Start with Windows writes the HKCU Run value "Titano" with --minimized, and the window then waits minimised on the taskbar. UI-07: Ctrl+1…6 and Ctrl+, navigate from anywhere in the window, as the rail tooltips say (not behind the first-run dialog). The editor's 1:1 view moves to Ctrl+Shift+1; its tooltip key is renamed so no translation keeps the old shortcut. UI-08: the Jobs screen raises one toast when a long operation ends (render, deep analysis, verify, rebuild, maintenance, upload: Open; failures: Retry, or Import for a failed import), whichever screen started it. Background work and scans end silently, and a finished render of the sequence open in the editor is left to the editor's own toast with its output file. UI-10: the Jobs badge adds failures not seen on the Jobs screen yet; the Server badge counts settings conflicts waiting for a choice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
60 files changed
+836
-108
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Shell;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Sections;
|
||||
using Titano.Core.Diagnostics;
|
||||
@@ -26,6 +27,7 @@ public sealed class ShellViewModel : LocalizedViewModel
|
||||
private string? _serverName;
|
||||
private int _jobCount;
|
||||
private int _queuedCount;
|
||||
private int _unseenFailures;
|
||||
private WelcomeViewModel? _welcome;
|
||||
private Guid? _currentSequenceId;
|
||||
|
||||
@@ -48,12 +50,13 @@ public sealed class ShellViewModel : LocalizedViewModel
|
||||
Library.IsSelected = true;
|
||||
Library.PropertyChanged += OnCurrentChanged;
|
||||
|
||||
// The rail and its shortcuts (Ctrl+1…6, Ctrl+,) navigate only while no first-run dialog covers the shell.
|
||||
NavigateCommand = new RelayCommand(p =>
|
||||
{
|
||||
if (p is SectionViewModel s) Navigate(s.Key);
|
||||
else if (p is SectionKey k) Navigate(k);
|
||||
else if (p is string name && Enum.TryParse<SectionKey>(name, out var key)) Navigate(key);
|
||||
});
|
||||
}, _ => IsShellEnabled);
|
||||
ToggleRailCommand = new RelayCommand(() => IsRailCollapsed = !IsRailCollapsed);
|
||||
services.Server.PropertyChanged += (_, _) => SetConnection(services.Server.ServerName);
|
||||
if (!_settings.FirstRunCompleted) _welcome = new WelcomeViewModel(this);
|
||||
@@ -89,6 +92,7 @@ public sealed class ShellViewModel : LocalizedViewModel
|
||||
if (!Set(ref _welcome, value)) return;
|
||||
OnPropertyChanged(nameof(IsWelcomeOpen));
|
||||
OnPropertyChanged(nameof(IsShellEnabled));
|
||||
CommandManager.InvalidateRequerySuggested();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,8 +200,20 @@ public sealed class ShellViewModel : LocalizedViewModel
|
||||
public string JobAnnouncement => _jobActive && _jobName is not null ? _jobName : JobText;
|
||||
|
||||
/// <summary>
|
||||
/// Updates the global job bar (and the taskbar progress through the window). <paramref name="name"/> says which job
|
||||
/// it is without its progress ("Render: Harbour sunset"); null reads <paramref name="text"/>.
|
||||
/// The taskbar button mirrors the job bar (BRIEF §11.5): the running job's progress, sliding while its total is
|
||||
/// unknown; red while no job runs and a failure waits on the Jobs screen; nothing otherwise.
|
||||
/// </summary>
|
||||
public TaskbarItemProgressState TaskbarState =>
|
||||
_jobActive ? _jobIndeterminate ? TaskbarItemProgressState.Indeterminate : TaskbarItemProgressState.Normal
|
||||
: _unseenFailures > 0 ? TaskbarItemProgressState.Error
|
||||
: TaskbarItemProgressState.None;
|
||||
|
||||
/// <summary>0…1 for <see cref="TaskbarState"/>; a waiting failure fills the button.</summary>
|
||||
public double TaskbarProgress => _jobActive ? _jobProgress : _unseenFailures > 0 ? 1 : 0;
|
||||
|
||||
/// <summary>
|
||||
/// Updates the global job bar and the taskbar button. <paramref name="name"/> says which job it is without its
|
||||
/// progress ("Render: Harbour sunset"); null reads <paramref name="text"/>.
|
||||
/// </summary>
|
||||
public void SetJob(string? text, double progress, bool indeterminate = false, string? name = null)
|
||||
{
|
||||
@@ -208,6 +224,17 @@ public sealed class ShellViewModel : LocalizedViewModel
|
||||
IsJobIndeterminate = indeterminate;
|
||||
OnPropertyChanged(nameof(JobText));
|
||||
OnPropertyChanged(nameof(JobAnnouncement));
|
||||
OnPropertyChanged(nameof(TaskbarState));
|
||||
OnPropertyChanged(nameof(TaskbarProgress));
|
||||
}
|
||||
|
||||
/// <summary>Failed jobs not seen on the Jobs screen yet (the taskbar button turns red while no job runs).</summary>
|
||||
public void SetUnseenFailures(int count)
|
||||
{
|
||||
if (_unseenFailures == count) return;
|
||||
_unseenFailures = count;
|
||||
OnPropertyChanged(nameof(TaskbarState));
|
||||
OnPropertyChanged(nameof(TaskbarProgress));
|
||||
}
|
||||
|
||||
// ---- Status strip ----
|
||||
|
||||
Reference in new issue
Block a user