-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
Summary
Multiple setTimeout calls pass the result of a function call instead of a callback function.
Pattern in code:
setTimeout(this.someMethod(...), 500)
This executes the method immediately on the current tick, then passes its return value to setTimeout. That defeats the intended defer behavior and can add avoidable synchronous work/jank while editing blocks.
Affected locations
js/widgets/phrasemaker.js:1135js/widgets/phrasemaker.js:1140js/widgets/phrasemaker.js:1208js/widgets/phrasemaker.js:3159js/widgets/phrasemaker.js:3161js/widgets/timbre.js:1041js/widgets/timbre.js:1044js/widgets/timbre.js:1047js/widgets/timbre.js:1049js/widgets/timbre.js:1051
Expected behavior
Deferred code should be wrapped in a callback:
setTimeout(() => this.someMethod(...), 500)
Why this matters
- Avoids unnecessary synchronous block graph/layout work.
- Restores intended timing and reduces potential UI stutter under rapid interactions.
Suggested fix
Replace each affected call with callback-wrapped versions (or direct async flow where delay is not needed).
Optional follow-up
Add a lint rule/check to catch setTimeout(<call expression>, ...) misuse in widgets.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels