TASK 4 ship step 5.5: social bar bug fixes + bar on the live output — direction-snap drag (SocialBarSnap.Decide + ClearValue, local Canvas.Top was overriding the binding), fediverse nodeinfo subdomain probing + load-time heal (settable FediverseSoftware), SocialBarRenderer strip blitted above the flash via a re-read FramePump socialBar seam — 155 tests passing, 0 warnings

This commit is contained in:
2026-08-13 09:29:58 -07:00
parent e72ba71165
commit ac60a26d82
16 changed files with 666 additions and 52 deletions
+33 -3
View File
@@ -19,8 +19,22 @@ public sealed class SocialEntry : INotifyPropertyChanged
public string Handle { get; init; } = string.Empty;
public string ProfileUrl { get; init; } = string.Empty;
/// <summary>Fediverse instance software (nodeinfo) for <see cref="Service"/> = Fediverse.</summary>
public string? FediverseSoftware { get; init; }
private string? _fediverseSoftware;
/// <summary>Fediverse instance software (nodeinfo) for <see cref="Service"/> = Fediverse.
/// Settable so the load-time heal can fill a missing name and the bar icon
/// updates in place.</summary>
public string? FediverseSoftware
{
get => _fediverseSoftware;
set
{
if (_fediverseSoftware == value) return;
_fediverseSoftware = value;
Raise(nameof(FediverseSoftware));
Raise(nameof(LogoData));
}
}
public string ServiceName => Service.ToString();
public string LogoData => Service == SocialService.Fediverse
@@ -238,7 +252,7 @@ public static class SocialServiceIcons
}
/// <summary>True when the input is a fediverse handle (@user@domain); out the parts.</summary>
private static bool TryParseFediverse(string input, out string user, out string domain)
public static bool TryParseFediverse(string input, out string user, out string domain)
{
user = domain = string.Empty;
if (string.IsNullOrWhiteSpace(input) || input[0] != '@') return false;
@@ -249,3 +263,19 @@ public static class SocialServiceIcons
return true;
}
}
/// <summary>
/// Direction-based snap for the social bar drag (preview): a drag toward the top
/// edge snaps the bar to the top, toward the bottom snaps it to the bottom — the
/// bar is never left mid-screen. Returns null inside the deadzone so a drag that
/// hasn't committed to a direction doesn't flip the bar.
/// </summary>
public static class SocialBarSnap
{
public static SocialBarPosition? Decide(double deltaY, double deadzone = 6)
{
if (deltaY <= -deadzone) return SocialBarPosition.Top;
if (deltaY >= deadzone) return SocialBarPosition.Bottom;
return null;
}
}