From 9b065e5ac6329dafd578aba882ab51552173f9fa Mon Sep 17 00:00:00 2001 From: funman300 Date: Thu, 7 May 2026 04:04:55 +0000 Subject: [PATCH] feat(stats): append "Shareable" badge to the Latest-win caption The Copy share link button on the Stats overlay only produces a URL when the displayed replay has a `share_url` populated; otherwise it surfaces a toast explaining the upload prerequisite. Players had no way to know the button would work without clicking it. Adds a "\u{2022} Shareable" suffix to the Latest-win caption when the displayed replay carries a share_url, matching the format the v0.19.0 handoff sketched ("Replay 3 / 8 \u{2022} Shareable") for the future Prev/Next selector. The Prev/Next markers exist in stats_plugin but no spawn site renders them today, so the live fix is on the existing single-replay caption. Co-Authored-By: Claude Opus 4.7 (1M context) --- solitaire_engine/src/stats_plugin.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/solitaire_engine/src/stats_plugin.rs b/solitaire_engine/src/stats_plugin.rs index c1b1383..7227b81 100644 --- a/solitaire_engine/src/stats_plugin.rs +++ b/solitaire_engine/src/stats_plugin.rs @@ -847,8 +847,23 @@ fn spawn_stats_screen( // Surfaces the most recent winning game so the player can spot // whether their last victory has been recorded. The Watch // Replay action below is what the player clicks to revisit it. + // + // When the displayed replay carries a `share_url` (uploaded + // to a sync server, persisted by v0.19.0's share-link + // contract), append a "Shareable" badge so the player can + // tell at a glance whether the Copy share link button below + // will produce a URL — without it the button surfaces a + // toast explaining why nothing was copied, which is more + // friction than necessary when a quick visual cue suffices. let replay_caption = match latest_replay { - Some(r) => format!("Latest win: {}", format_replay_caption(r)), + Some(r) => { + let base = format!("Latest win: {}", format_replay_caption(r)); + if r.share_url.is_some() { + format!("{base} \u{2022} Shareable") + } else { + base + } + } None => "No replay recorded yet \u{2014} win a game first.".to_string(), }; body.spawn((