fix(ui): report failed paste/drop in the interactive terminal
PasteAsync silently swallowed every exception and returned void, so a package update renaming Iciclecreek's private write seam would break Ctrl+V/drop with zero user-visible signal. PasteAsync/SendTextAsync now return bool (mirroring SendLineAsync), and the view checks the result, routing a failure through InteractiveTerminalViewModel.ErrorReported -> ConPtyPaneViewModel.ErrorReported -> the existing footer error strip.
This commit is contained in:
+31
@@ -124,4 +124,35 @@ public class InteractiveTerminalViewModelTests
|
||||
terminal.IsRunning = true; // records LaunchedAt via the first clock call
|
||||
return terminal;
|
||||
}
|
||||
|
||||
// ── Paste/drop failure reporting (fix: PasteAsync used to swallow every exception and return
|
||||
// void, so a failed Ctrl+V or file drop gave the user no signal at all) ────────────────────
|
||||
|
||||
[Fact]
|
||||
public async Task PasteAsync_ReturnsFalse_WhenSessionNotRunning()
|
||||
{
|
||||
using var terminal = new InteractiveTerminalViewModel();
|
||||
|
||||
Assert.False(await terminal.PasteAsync());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SendTextAsync_ReturnsFalse_WhenSessionNotRunning()
|
||||
{
|
||||
using var terminal = new InteractiveTerminalViewModel();
|
||||
|
||||
Assert.False(await terminal.SendTextAsync("dropped/path"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReportSendFailed_RaisesErrorReported()
|
||||
{
|
||||
using var terminal = new InteractiveTerminalViewModel();
|
||||
string? error = null;
|
||||
terminal.ErrorReported += msg => error = msg;
|
||||
|
||||
terminal.ReportSendFailed();
|
||||
|
||||
Assert.NotNull(error);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user