namespace DodoSSH.Client.Terminal;

/// <summary>
/// The embedded browser that renders terminals.
/// </summary>
/// <remarks>
/// <para>
/// <b>Declared, not yet wired.</b> Nothing in the application implements this today: the view assigns
/// <c>NativeWebView.Source</c> directly in <c>MainWindow.axaml.cs</c>, and the headless shell tests
/// substitute <see cref="ITerminalAssetProvider" /> instead — they never need a browser, because the view
/// models do not own one. So swapping WebView backends currently means editing the XAML and its code-behind.
/// This interface records the shape that swap should take; it is not a seam that exists yet, and it should
/// not be cited as one.
/// </para>
/// <para>
/// Deliberately tiny, and that part is worth keeping. Everything the renderer needs — its files, its
/// connection token, its socket URL — arrives over the loopback HTTP server, so the only thing a host has to
/// do is navigate. A backend swap is therefore one method wide however it is eventually wired.
/// </para>
/// <para>
/// The candidates are two, not three: <c>Avalonia.Controls.WebView</c> is the package and
/// <c>NativeWebView</c> is the control it ships, so they are one option — whose Linux backend is WPE WebKit,
/// with WebKitGTK the more widely installed library it is not using — and CEF is the heavyweight escape
/// hatch. An earlier version of this remark counted the package and the control separately and had the
/// Linux backend the wrong way round, which made the interchangeability argument rest on a miscount.
/// </para>
/// </remarks>
public interface ITerminalHost
{
    /// <summary>Points the embedded browser at the renderer page.</summary>
    Task NavigateAsync(Uri pageUrl, CancellationToken cancellationToken);
}
