Repository navigation
Fix Fast Groups toggle restrictions after widget adoption - #770
Merged
Merged
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-01a0c564-c177-701a-b053-86d219fe1663 Co-authored-by: Alexander Brown <drjkl@comfy.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #766.
Fixes Comfy-Org/ComfyUI_frontend#17817.
Restore
max oneandalways onefor 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 FastGroupsToggleRowWidgetbecomes false, and enabling a group skips every other toggle instead of disabling them. The fix checks for the callabledoModeChangemethod.The same handler also tests
!w.valuewhen enforcingalways one. Each value is an object, including{toggled: false}, so it is truthy even for an inactive group. Readtoggledinstead 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
instanceofcheck.Validation
TestFastGroupsRestrictionsto the existing browser test runner. It uses real registered nodes, groups, widget adoption, and node modes, without mocks.default,max one, andalways one, including attempts to disable the last active group.always oneproduced modes[0, 2], then[2, 0], then[2, 0]when clicking the active toggle again.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 buildfails on Linux because__build__.pyis not executable and its fallback uses a Windows path. Runningpython3 __build__.pyreaches TypeScript but fails on missing exports in the pinned frontend types package.pnpm exec tsc --noEmitreports 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
instanceofexpressions 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
instanceofresults 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.