feat(ui): Cheat-Sheet-Fenster im Hilfe-Menue

Sechs Markdown-Sheets (git, Conventional Commits, Claude CLI, Claude-Config,
dotnet CLI, PowerShell) als EmbeddedResource, gerendert im modelosen, per
Topmost anpinnbaren CheatSheetsWindow. MarkdownView bekommt dafuer das Opt-in
CommandRows: `befehl` - beschreibung wird zu Mono-Chip + Copy-Button, jede
##-Sektion landet in einem Expander. Enthaelt ausserdem: Mission Control
wird beim Oeffnen aus dem Minimiert-Zustand geholt, nicht nur aktiviert.
This commit is contained in:
mika kuns
2026-09-07 08:17:37 +02:00
parent 7c7c33d677
commit 0db9fadee9
20 changed files with 749 additions and 7 deletions
@@ -28,6 +28,7 @@ public sealed class WindowDialogService : IDialogService
private readonly Window _owner;
private MissionControlWindow? _missionControl;
private DiffViewerView? _diffViewerWindow;
private CheatSheetsWindow? _cheatSheets;
public WindowDialogService(Window owner) => _owner = owner;
@@ -182,9 +183,29 @@ public sealed class WindowDialogService : IDialogService
_missionControl ??= new MissionControlWindow { DataContext = vm };
if (!_missionControl.IsVisible)
_missionControl.Show(); // modeless, independent top-level window
// Activate() alone does not restore a minimised window — it stays in the taskbar and the
// button looks dead. Un-minimise first, then take focus.
if (_missionControl.WindowState == WindowState.Minimized)
_missionControl.WindowState = WindowState.Normal;
_missionControl.Activate(); // bring to front / focus
}
public void ShowCheatSheets(CheatSheetsViewModel vm)
{
// Modeless and single-instance, like Mission Control: the point is to park it beside the
// shell, so a second window (or a modal that blocks the shell) would defeat it.
if (_cheatSheets is null)
{
_cheatSheets = new CheatSheetsWindow { DataContext = vm };
vm.CloseAction = () => _cheatSheets?.Close();
_cheatSheets.Closed += (_, _) => _cheatSheets = null;
_cheatSheets.Show(_owner);
}
if (_cheatSheets.WindowState == WindowState.Minimized)
_cheatSheets.WindowState = WindowState.Normal;
_cheatSheets.Activate();
}
public Task<bool> ConfirmAsync(string message)
{
var tcs = new TaskCompletionSource<bool>();