Skip to content

Draw extension booleans and menus correctly in script previews - #225

Merged
Mistium merged 2 commits into
developfrom
scratchblocks-extension-blocks
Nov 21, 2026
Merged

Mistium merged 2 commits into
developfrom
scratchblocks-extension-blocks

Conversation

@Mistium

@Mistium Mistium commented Nov 21, 2026

Copy link
Copy Markdown
Member

Commit pages drew some scripts wrongly. This fixes how scripts are translated to scratchblocks:

  • Extension menus such as lmsLooksPlus_menu_spriteMenu were treated as a block ("menu spriteMenu [Field to type in]"). They now render as a dropdown, [Field to type in v]. Only a single-field call whose name contains _menu_ counts as a menu, so extension reporters with "menu" in their name stay reporters.
  • Extension booleans in boolean slots (and/or operands, and if, repeat until and while conditions) rendered round, or as <(...)>, which scratchblocks draws as a red hexagon. They now render as hexagons.
  • Values with a hidden default (fractch x ?? "a") rendered as (...). They now show the visible value, for example (PASSWORD).
  • Extension block names are split from camelCase: "spriteVisible" now reads "sprite visible".
  • Script headings in the file-diff view showed raw scratchblocks text such as when [enter v] key pressed. They now read "when enter key pressed", the same as the changes view. Colour annotations (:: #277a59) are stripped too.

Screenshots

All are from commit 36650af6 of p1790295130360345000J3JZRS, the commit that was reported.

Before (live mistwarp.org): a round "spriteVisible" reporter with a "menu spriteMenu" block inside.
Before

After (Chromium): a hexagonal "sprite visible" with a dropdown.
After

Headings, before and after (the after shot is Firefox).
Heading before
Heading after

The structured changes view from #223, with its real /changes response routed in. It marks added and removed blocks once api #80 is deployed to production.
Changes view

Checks

The node.js.yml steps were run locally:

  • lint and typecheck;
  • check-conventions --base=origin/develop;
  • i18n:editor:check and i18n:community:check;
  • check:community-css and deps:check;
  • test:unit:ci (4096 passed);
  • build:deploy and validate-deploy.

New tests cover extension booleans, menus, hidden defaults, extension reporters named _menu_, and colour-annotated titles. An independent review found no must-fix items, and its should-fix (the _menu_ reporter case) is fixed.

Version: 3.8.0 → 3.8.1 (a fix).

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying scratch-gui with  Cloudflare Pages  Cloudflare Pages

Latest commit: d110a6a
Status: ✅  Deploy successful!
Preview URL: https://ced167f7.scratch-gui.pages.dev
Branch Preview URL: https://scratchblocks-extension-bloc.scratch-gui.pages.dev

View logs

@Mistium
Mistium merged commit 2683477 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