Merge branch 'dev' into p16-w1-foundation

# Conflicts:
#	DeepDrftPublic.Client/Controls/SharePopover.razor.cs
This commit is contained in:
daniel-c-harvey
2026-06-19 13:28:50 -04:00
18 changed files with 593 additions and 58 deletions
@@ -1,5 +1,6 @@
using DeepDrftModels.Enums;
using DeepDrftPublic.Client.Common;
using DeepDrftPublic.Client.Helpers;
using DeepDrftPublic.Client.Services;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
@@ -8,19 +9,19 @@ namespace DeepDrftPublic.Client.Controls;
/// <summary>
/// Share affordance with two modes from one source of clipboard/popover-chrome logic
/// (Phase 11 §3b). Track mode (<see cref="EntryKey"/> set) offers a canonical-link copy plus an
/// optional iframe embed snippet. Release mode (<see cref="ReleaseEntryKey"/> set) is copy-link-only —
/// it copies the absolute form of the release's canonical detail URL and hides the embed
/// affordance, since a release page is not a single-track embed. Clipboard writes go through
/// navigator.clipboard; each copy shows a transient "Copied!" confirmation that resets after a
/// short delay.
/// (Phase 11 §3b). Both modes offer a canonical-link copy plus an optional iframe embed snippet.
/// Track mode (<see cref="EntryKey"/> set) embeds a single track (FramePlayer?TrackEntryKey=...);
/// release mode (<see cref="ReleaseEntryKey"/> set) copies the release's canonical detail URL and
/// embeds the whole release (FramePlayer?ReleaseEntryKey=...), which queues and advances through its
/// tracks on first play. Clipboard writes go through navigator.clipboard; each copy shows a transient
/// "Copied!" confirmation that resets after a short delay.
/// </summary>
public partial class SharePopover : ComponentBase, IDisposable
{
/// <summary>Track mode: the vault entry key of the track to share. Mutually exclusive with the release target.</summary>
[Parameter] public string? EntryKey { get; set; }
/// <summary>Release mode: the release's opaque public EntryKey to share. When set (with <see cref="ReleaseMedium"/>), the popover shares the release detail URL and omits the embed option.</summary>
/// <summary>Release mode: the release's opaque public EntryKey to share. When set (with <see cref="ReleaseMedium"/>), the popover shares the release detail URL and embeds the whole release.</summary>
[Parameter] public string? ReleaseEntryKey { get; set; }
/// <summary>Release mode: the medium of the release, used to resolve its canonical detail route.</summary>
@@ -58,8 +59,11 @@ public partial class SharePopover : ComponentBase, IDisposable
private string TrackUrl => $"{Navigation.BaseUri}tracks/{EntryKey}";
private string EmbedSnippet =>
$"""<iframe src="{Navigation.BaseUri}FramePlayer?TrackEntryKey={EntryKey}" width="656" height="196" frameborder="0" style="border-radius:8px;" allow="autoplay"></iframe>""";
// FramePlayer's query param selects the embed mode: ReleaseEntryKey queues the whole release,
// TrackEntryKey stages a single track. The iframe chrome is identical in both modes.
private string EmbedSnippet => IsReleaseMode
? EmbedSnippetBuilder.ForRelease(Navigation.BaseUri, ReleaseEntryKey!)
: EmbedSnippetBuilder.ForTrack(Navigation.BaseUri, EntryKey!);
private void Toggle() => _open = !_open;