Skip to content

paint-boolean-ops: fix toolbar state handling - #9164

Open
griffpatch wants to merge 1 commit into
ScratchAddons:masterfrom
griffpatch:codex/fix-open-close-shape
Open

paint-boolean-ops: fix toolbar state handling#9164
griffpatch wants to merge 1 commit into
ScratchAddons:masterfrom
griffpatch:codex/fix-open-close-shape

Conversation

@griffpatch

@griffpatch griffpatch commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • manage Open/Close from Scratch's Reshape sub-toolbar instead of the fixed toolbar/More menu lifecycle
  • support selected paths nested inside Groups and CompoundPaths
  • keep disabled shaping operations in the More menu visually and behaviorally consistent

Why

Open/Close belongs to the Reshape mode-tools sub-toolbar, but its insertion was tied to mutations in the separate fixed toolbar. In the narrow layout, opening More caused the unrelated mutation that finally inserted the button, and switching tools could leave it behind. The Reshape sub-toolbar is now watched directly, including cases where React replaces or reuses its Curved/Pointed group.

Testing this fix also exposed two problems in the same toolbar path:

  • Grouped and compound paths: Open/Close only considered top-level paths, so it stayed disabled when the selected editable path was inside a Group or CompoundPath. Scratch supports opening and closing those child paths, so the button state and operation now use the same nested-path selection.
  • Disabled More-menu items: In the narrow layout, disabled shaping operations could still look enabled because More-menu items need both Scratch's menu-specific disabled class and its shared button disabled class. Applying both keeps their state and appearance consistent with Scratch's native items.

These changes are included because they affect the same Open/Close selection state and responsive More-menu behavior exercised by #9159, rather than being separate toolbar features.

Validation

  • targeted ESLint check
  • node --check addons/paint-boolean-ops/userscript.js
  • git diff --check
  • manually tested narrow and wide layouts, Select/Text transitions, grouped and compound paths, disabled More-menu items, and undo

Fixes #9159

@griffpatch
griffpatch marked this pull request as ready for review August 13, 2026 10:18
@DNin01 DNin01 added this to the v1.46.0 milestone Aug 13, 2026
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.

Open/Close Shape button doesn't appear until More menu is opened

2 participants