Skip to content

0.27.0: Share on the timeline, and replays opened at a shared moment - #40

Merged
jeany55 merged 1 commit into
mainfrom
share-moment
Nov 15, 2026
Merged

jeany55 merged 1 commit into
mainfrom
share-moment

Conversation

@jeany55

@jeany55 jeany55 commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Share on the replay's timeline, and replays opened at a shared moment. Goes with scm-js/plugin-scmjs-dev's share-moment (1.41.0), which gives the link.

What changed

  • Share beside Play From Here opens a popover over the map, above the button, so the timeline stays in view:
    • From the start / From 6:42 (the time under the playhead; chosen when the playhead is past the first second; follows the playhead while open, and a press on the timeline moves it without closing the popover)
    • with a time, Whoever opens it: Watches or Plays as <name> (<race>), the player watched through listed first
    • the link (read-only, scrolled to its end) and one gold button: Copy link (Copied for a moment), Keep and copy link with "Sharing keeps this replay on your scmjs.dev account.", or Sign in to share (with several sign-in providers, the press shows Sign in with … for each; after the sign-in the popover is still there with the link, copied where the browser allows)
    • closes on Esc and on a press outside (including in the Game view's frame); keys pressed in it stay in it (Space presses its button, not Play)
  • The link: https://scmjs.dev/replay/<token>?t=6:42[&play=<slot>], play being the same slot Play From Here hands the play page.
  • Aftermath never talks to the server: it asks the scmjs.dev plugin's scmjs-dev.replays service (vendor/scmjs-dev.d.ts). No scmjs.dev plugin, no Share button. A replay opened from a link has its link and shares it with no sign-in and no upload.
  • A new service, aftermath.replays (open(file, { link, at })), takes a replay with where it came from. The scmjs.dev plugin opens replay links through it: the replay opens at the link's moment, paused, with "Opened at 6:42 from a shared link" on its own line under the timeline's row until the first play or seek.
  • share.ts (the popover and its pure parts), Korean for every new string, README (the timeline list and a Share section), 0.27.0.

A choice the spec left open, and one place I departed from it

  • The moment opens at the first frame whose clock reads that second, ceil(s * 1000 / 42), not the spec's round(s * 1000 / 42): with round, t=6:42 lands on frame 9,571, which the timeline (and the game) show as 6:41. The difference is at most one frame. The play page's agent should know.

Checked

  • npm test and the typecheck pass (245 tests, tests/share.test.ts new: the moment's frame, the link's t/play, the popover's state signed out / not kept / kept / kept without a link). This working copy's node_modules (a symlink to the main checkout) has no @scm-js/mod, so npm test and npm run typecheck fail there before any change of mine (4 suites, the module not found); I ran both with @scm-js/mod 1.2.x resolved from a scratch install. CI installs it.
  • In the real editor behind the site stand-in (localhost:5220, the play page beside it), with this build and the scmjs.dev build loaded and the account server stood in for with Playwright routes (the real server was not used): Share signed out (Sign in to share, providers, sign-in, one upload, link copied), signed in and not kept (Keep and copy link, one upload), signed in and already kept (Copy link, no upload), kept without a link (Copy link makes it, no upload), on a replay opened from a link (Copy link at once, no request); From the start vs From the time; Plays as; Esc, a press on the map/Game view, a press on the timeline; the copied link opened in a fresh tab landing at that time, paused, with the line, and the address back to /editor/; the same link with play=1 sent by the stand-in to /play/?replay=…&t=6%3A42&play=1; Play From Here still opens the play page with its menu; no Share without the scmjs.dev plugin; Korean.
  • The narrowest strip tried: a 640 px window (372 px strip). The popover fits; the strip's row itself overflows sideways at that width, as it did before.

Not done

  • No release, tag or pin. The editor's own guide (docs/guide.md, Play From Here and replay links) does not mention Share yet.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VEdp4VUa2TKJmLTeeLr7vq

Share, beside Play From Here, opens a popover over the map above it: From the
start or From 6:42 (the time under the playhead, chosen when it is past the
start, and following it while the popover is open), with a time Whoever opens
it Watches or Plays as one of the players (the one watched through first),
the link, and one gold button. The button is Copy link (Copied for a moment),
Keep and copy link with "Sharing keeps this replay on your scmjs.dev
account." when the account has not got it, or Sign in to share; with several
ways to sign in it shows them, and after the sign-in the popover is still
there with the link, copied where the browser allows. Esc and a press
anywhere but the popover or the timeline close it; keys pressed in it are its
own.

The link is https://scmjs.dev/replay/<token>?t=6:42[&play=<slot>], the slot
being the one Play From Here hands the play page. Aftermath never talks to
the server: the scmjs.dev plugin's scmjs-dev.replays service (1.41.0) says
where the replay stands and gives the link, signing in and keeping the
replay as needed. Without that plugin there is no Share button; a replay
opened from a link has its link and shares it with no sign-in.

The aftermath.replays service takes a replay with where it came from: its
link and the moment its ?t= says. It opens there, paused, at the first frame
whose clock reads that time (a frame after round(s * 1000 / 42) at most), with
"Opened at 6:42 from a shared link" under the timeline's row until the first
play or seek.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEdp4VUa2TKJmLTeeLr7vq
@jeany55
jeany55 marked this pull request as ready for review November 15, 2026 15:17
@jeany55
jeany55 merged commit f947da9 into main Nov 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant