Repository navigation
1.40.0: replay links and the Replays part of My Maps - #7
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Needs ai-server 0.36.0 (scm-js/ai-server#18). On an older server nothing changes: the Replays switch shows only when
/v1/infosaysaccounts.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 formap/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.openreads every file as a map — so the replay is dispatched as adropevent on the document, which the editor routes to Aftermath like a real drop. It waits up to 20 s for Aftermath to start (by itsaftermath.open-replaycommand); if Aftermath is off it says so and offers to save the replay. A host addition (document.openhanding a claimed type to its plugin, orapi.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 thescmjscommand line).Korean strings in
ko.ts; README section;tests/replays.test.tsand replay cases intests/share.test.ts. 256/256 tests, typecheck clean,dist/plugin.jsrebuilt.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.tspin 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