Skip to content

Fix Fast Groups toggle restrictions after widget adoption - #770

Merged
rgthree merged 1 commit into
rgthree:mainfrom
DrJKL:fix/fast-groups-toggle-restrictions
Sep 25, 2026
Merged

rgthree merged 1 commit into
rgthree:mainfrom
DrJKL:fix/fast-groups-toggle-restrictions

Conversation

@DrJKL

@DrJKL DrJKL commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #766.
Fixes Comfy-Org/ComfyUI_frontend#17817.

Restore max one and always one for Fast Groups Muter and Fast Groups Bypasser. The production change is two lines in the TypeScript source and the same two lines in the shipped JavaScript.

Investigation and root cause

Recent ComfyUI frontends adopt custom widgets into their widget classes. Adoption preserves the object and its methods but changes its prototype. As a result, widget instanceof FastGroupsToggleRowWidget becomes false, and enabling a group skips every other toggle instead of disabling them. The fix checks for the callable doModeChange method.

The same handler also tests !w.value when enforcing always one. Each value is an object, including {toggled: false}, so it is truthy even for an inactive group. Read toggled instead to prevent switching off the last active group.

This preserves the existing click-only restriction policy. It does not change Fast Actions button behavior, group refresh scheduling, or workflow mode persistence. #594 concerns Fast Actions dispatch and bulk toggle state; it does not replace the failing instanceof check.

Validation

  • Added TestFastGroupsRestrictions to the existing browser test runner. It uses real registered nodes, groups, widget adoption, and node modes, without mocks.
  • All 6 cases and 18 checks pass in Chromium with the classic canvas renderer. Both node types cover default, max one, and always one, including attempts to disable the last active group.
  • The identical suite against unchanged upstream JavaScript fails 8 checks across the 4 restricted-mode cases. Both default-mode cases pass.
  • Real canvas clicks on Fast Groups Muter with always one produced modes [0, 2], then [2, 0], then [2, 0] when clicking the active toggle again.
  • The frontend used for validation includes fix: restore Impact, WAS Pause, and RefMod compatibility Comfy-Org/ComfyUI_frontend#18301. No image generation or workflow-tab persistence claim is made.

To run the suite, build with tests enabled, open a disposable workflow, and run await rgthree_tests.TestFastGroupsRestrictions() in the browser console. The suite clears the current graph.

Build limitation: the unchanged checkout's pnpm build fails on Linux because __build__.py is not executable and its fallback uses a Windows path. Running python3 __build__.py reaches TypeScript but fails on missing exports in the pinned frontend types package. pnpm exec tsc --noEmit reports the same 1,236 diagnostics before and after this change, with no added diagnostics. For browser validation, the affected modules were emitted using the installed TypeScript compiler and the existing build's import-path rewriting. The full build is not passing.

Related identity-check audit

Audited the remaining 55 instanceof expressions in first-party TypeScript and checked their shipped JavaScript counterparts, constructor comparisons, and prototype checks. No other widget-class identity check remains. The remaining expressions cover 4 graph-node checks, 9 internal Python-parser checks, and 42 DOM or built-in checks. Those objects do not pass through widget adoption.

In Chromium, a core KSampler and an rgthree Label retained their expected instanceof results after graph insertion and workflow save/reload. Label's exact constructor comparison also remained true. Dynamic Context's graph-node check was inspected in source only because the unreleased feature is disabled by default. No additional adoption-related fix was identified.

@rgthree rgthree left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@rgthree
rgthree merged commit bec8e6e into rgthree:main Sep 25, 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.

Fast Groups muter and bypass loose functionality in frontend latest. toggleRestriction in Fast Groups Bypasser no longer working

3 participants