Skip to content

Describe commits and pull requests by what changed in each sprite - #223

Merged
Mistium merged 3 commits into
developfrom
commit-changes-view
Nov 21, 2026
Merged

Mistium merged 3 commits into
developfrom
commit-changes-view

Conversation

@Mistium

@Mistium Mistium commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Commit and pull request pages now describe a change by what happened in each sprite, using the new changes view from MistWarp/api#80 (GET /v1/projects/:id/commits/:sha/changes and pulls/:index/diff?view=changes).

What the page shows

  • What changed: a short summary first, for example "4 scripts changed. 5 scripts added. 1 extension changed. Saved state changed in 6 sprites." If only saved state changed, it says so.
  • One section per sprite, using the sprite's real name:
    • Changed scripts are drawn as blocks, trimmed to the changed part with change stripes.
    • Added and removed scripts are drawn in full, up to 8 per sprite with a "Show more" button.
    • Moved scripts get one line naming the old and new region file.
  • Rewritten scripts are folded. Scripts whose blocks did not change (an older fractch spelling or call form) are left out of the sections and counted in one summary sentence.
  • Variables, extensions, comments, costumes and sounds are listed as sentences, such as Costume "happy" added or Variable "x" renamed to "y". Changed items can be expanded to show their before and after text. Costume and sound files keep the before and after previews.
  • Saved state is folded into one collapsed row. This covers variable values, sprite position, size, layer and visibility, the current costume, monitors and script canvas positions. Open it for a per-sprite table with long decimals rounded.
  • Sidebar: each sprite shows its count of changes, or "Saved state only" or "No block changes". Selecting a sprite filters both the sections and the summary.
  • Older views kept. The commit page gets a File diff tab with the previous per-file view, loaded when opened. The pull request Files tab gets a "Show file diff" button.

Preview

https://commit-changes-view.scratch-gui.pages.dev/project/p1790295130360345000J3JZRS/commits/c713b2e91898ae1a17f3a8e85656f1f7c60b039d

The Cloudflare branch preview uses the live API, so it shows the old view (the fallback) until API #80 is deployed. After that, the same link shows the new view.

Fallback

Until API #80 is deployed, /changes returns 404 and the pages look exactly as they do today. The same happens for legacy: true commits, errors, and an old server that ignores view=changes. A remix's first commit with an empty structured result also uses the old view, so the remix-base recovery still works.

Screenshots

These were taken from the dev server. The /changes responses were generated from this branch's API code against real public archives, because the API is not deployed yet.

The live commit page before this change. Unchanged scripts are drawn in full and a layer change is the first thing you see:
before

The same commit after (Chromium):
after, light

Dark theme:
after, dark

Firefox:
after, firefox

Phone width:
after, phone

Saved state expanded:
saved state

A sprite with only saved state selected in the sidebar:
sprite filter

Costume changes with previews:
costumes

Pull request Files tab. The pull is mocked from a real commit's changes, because production has no public pull requests:
pull request

Pull request, dark theme, phone width:
pull request phone

Pull request, Firefox, dark theme:
pull request firefox

Review

An independent review found one must-fix: thumbnail texts overwrote the real "before" text in the File diff tab. It also found these should-fixes:

  • sprites whose only change was a costume file were dropped;
  • costumes were counted twice;
  • the summary ignored the sprite filter;
  • too-large sprites showed "0 changes";
  • thumbnail loading was heavy, and the pull request page had none.

All of them are fixed on this branch.

Checks

I ran the node.js.yml steps locally, because GitHub Actions are not running on this repo:

  • lint, typecheck, conventions, editor and community i18n checks, community CSS check, deps check: all pass.
  • test:unit:ci: 4083 passed, 1 skipped.
  • build:deploy and validate-deploy: pass.

New tests are in test/unit/community-commit-changes.test.jsx.

Version

3.6.0 → 3.7.0 (new feature, backwards compatible).

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Deploying scratch-gui with  Cloudflare Pages  Cloudflare Pages

Latest commit: ad56270
Status: ✅  Deploy successful!
Preview URL: https://b7c1c84a.scratch-gui.pages.dev
Branch Preview URL: https://commit-changes-view.scratch-gui.pages.dev

View logs

@Mistium
Mistium merged commit b6acf66 into develop Nov 21, 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