Skip to content

1.40.0: replay links and the Replays part of My Maps - #7

Merged
jeany55 merged 1 commit into
mainfrom
replay-links
Nov 7, 2026
Merged

jeany55 merged 1 commit into
mainfrom
replay-links

Conversation

@jeany55

@jeany55 jeany55 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Needs ai-server 0.36.0 (scm-js/ai-server#18). On an older server nothing changes: the Replays switch shows only when /v1/info says accounts.replays.

Replay links. The editor opened at …/editor/replay/<token> looks the link up (GET /v1/replay-links/:token), downloads the file and opens it in the replay viewer (Aftermath). The address goes back to the editor's own, as for map/ links. A removed link says so in a dialog and leaves the editor as it is.

How it opens: the plugin API has no way to hand a file to the plugin that claimed its extension — document.open reads every file as a map — so the replay is dispatched as a drop event on the document, which the editor routes to Aftermath like a real drop. It waits up to 20 s for Aftermath to start (by its aftermath.open-replay command); if Aftermath is off it says so and offers to save the replay. A host addition (document.open handing a claimed type to its plugin, or api.files.open) would make this direct.

My Maps. A Maps / Replays switch in the toolbar. Replays lists the map, players and races, length, game type, date, size and note, with Open, Make a link / Copy link, Remove link, Delete, and Upload a replay….

Not done: "Share this Replay…" for the replay open in the viewer. A replay is a view-only document whose document.export() is the map it was played on; the API gives a plugin no way to the .rep. Upload is My Maps (and later the scmjs command line).

Korean strings in ko.ts; README section; tests/replays.test.ts and replay cases in tests/share.test.ts. 256/256 tests, typecheck clean, dist/plugin.js rebuilt.

Tried in the live editor (0.9.0) in headless Chromium with this branch served over CORS and a local ai-server: the link opened the replay in Aftermath (toast "Opened the replay: Question (P) vs Drywater (T)"), a dead link showed the notice, and My Maps listed, uploaded (scr_mapname32.rep), copied the link and opened.

Release: tag v1.40.0 after the server is deployed; the editor's src/plugins/defaults.ts pin moves from v1.39.0 to v1.40.0 in a separate scm-js PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VEdp4WWhnaXVYVQTC8xpsy

scmjs.dev/editor/replay/<token> opens a replay kept on scmjs.dev: the plugin
looks the link up, downloads the file and hands it to the replay viewer
(Aftermath) as a dropped .rep, since document.open reads every file as a map.
A removed link says so. My Maps gets a Maps/Replays switch: the account's
replays with Open, Make/Copy link, Remove link, Delete and Upload a replay….
Needs a server with replays (ai-server 0.36.0, /v1/info accounts.replays).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEdp4WWhnaXVYVQTC8xpsy
@jeany55
jeany55 merged commit c612a36 into main Nov 7, 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