diff --git a/src/SharpFM.Plugin/IUpdateCheckable.cs b/src/SharpFM.Plugin/IUpdateCheckable.cs new file mode 100644 index 0000000..6954c85 --- /dev/null +++ b/src/SharpFM.Plugin/IUpdateCheckable.cs @@ -0,0 +1,29 @@ +using System.Threading; +using System.Threading.Tasks; + +namespace SharpFM.Plugin; + +/// +/// Opt-in capability for plugins that have a remote update channel. Implementing +/// this interface is independent of — a plugin opts in by +/// implementing both. Plugins that ship with the host binary (or otherwise have +/// no separate release cadence) should not implement this; the host will simply +/// display without a check-for-updates affordance. +/// +public interface IUpdateCheckable +{ + /// + /// Query the plugin's update channel and return what the host should surface + /// in the About dialog. Implementations choose the channel (public manifest, + /// licensing endpoint, anonymous GitHub releases for a public repo, etc.) — + /// the host has no knowledge of any specific plugin's source. + /// + /// + /// Implementations should fail silently on network errors, returning a + /// result with set to + /// false rather than throwing. A thrown exception is treated by the + /// host as a check failure and silently suppressed. + /// + /// + Task CheckForUpdatesAsync(CancellationToken ct); +} diff --git a/src/SharpFM.Plugin/UpdateCheckResult.cs b/src/SharpFM.Plugin/UpdateCheckResult.cs new file mode 100644 index 0000000..3eb9bf2 --- /dev/null +++ b/src/SharpFM.Plugin/UpdateCheckResult.cs @@ -0,0 +1,30 @@ +using System; + +namespace SharpFM.Plugin; + +/// +/// Outcome of an call. +/// All three optional fields may be null when +/// is false. +/// +/// +/// true when the channel reports a newer version than what the plugin +/// is currently running. +/// +/// +/// Human-readable version string of the latest release (e.g. "2.0.0"). +/// Format is the plugin's choice; the host displays it verbatim. +/// +/// +/// Where to point the user to obtain the update — typically a release notes +/// or download page. Opened in the system browser on click. +/// +/// +/// Optional short summary surfaced alongside the version (e.g. release +/// highlights). The host shows it as plain text; do not include markup. +/// +public sealed record UpdateCheckResult( + bool UpdateAvailable, + string? LatestVersion, + Uri? ReleaseUrl, + string? Notes); diff --git a/src/SharpFM/Dialogs/AboutDialog.axaml b/src/SharpFM/Dialogs/AboutDialog.axaml new file mode 100644 index 0000000..a7e7c12 --- /dev/null +++ b/src/SharpFM/Dialogs/AboutDialog.axaml @@ -0,0 +1,102 @@ + + + + + + + + + +