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) <noreply@anthropic.com>
This commit is contained in:
funman300
2026-05-07 04:04:55 +00:00
parent e1b8766e15
commit 9b065e5ac6
+16 -1
View File
@@ -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((