Skip to content

Keep the costume, sound and sprite right-click menu on top of the editor - #221

Merged
Mistium merged 2 commits into
developfrom
fix-costume-context-menu-clip
Nov 15, 2026
Merged

Mistium merged 2 commits into
developfrom
fix-costume-context-menu-clip

Conversation

@Mistium

@Mistium Mistium commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Right-clicking a costume showed a menu cut off at the edge of the list column, so its items were hidden behind the paint editor. The same happened to sounds and sprites, and on phones the menu was cut down to one item.

The cause was the fade mask that #218 added to the list (mask-image on .list-area). A mask clips everything inside the element, including the position: fixed menu.

  • The sprite, costume and sound menu now renders on document.body through a portal, like the monitor menus already do.
  • The addon context menu API (src/addons/contextmenu.js) finds the menu there by its trigger id, so addon items such as "create folder" still appear.
  • .context-menu now sets its own text colour and user-select: none. The menu used to inherit them from the item, so without this it showed black text on the midnight theme's black menu.
  • Added a unit test for the addon lookup, and mocked createPortal in the snapshot test.

Version: 3.5.0 -> 3.5.1 (patch).

Checked in Chromium and Firefox at desktop and phone sizes, in the light and midnight themes. Duplicate still works from the menu and the addon items still show. lint, typecheck, conventions, i18n, community css, deps, all unit tests (4052 passed), build:deploy and validate-deploy pass locally.

Screenshots

Before, desktop: the menu is cut off at the list edge.
before

After, Chromium:
after chromium

After, Firefox:
after firefox

After, midnight theme:
after midnight

Before, phone: only one item shows.
before phone

After, phone:
after phone

Preview (Cloudflare Pages): https://fix-costume-context-menu-cli.scratch-gui.pages.dev/editor

The list's fade mask clipped the menu at the column edge, so its items
were cut off behind the paint editor. The menu now renders on the page
body, like the monitor menus, and the addon context menu API finds it
there to add its items.
The menu used to inherit its text colour from the item, which it no
longer sits inside, so it set black text on the midnight theme's black
menu.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying scratch-gui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6a0ab36
Status: ✅  Deploy successful!
Preview URL: https://8c61cc63.scratch-gui.pages.dev
Branch Preview URL: https://fix-costume-context-menu-cli.scratch-gui.pages.dev

View logs

@Mistium
Mistium merged commit 51f2c35 into develop Nov 15, 2026
1 check passed
@Mistium
Mistium deleted the fix-costume-context-menu-clip branch November 15, 2026 12:10
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