fix(prompt-editor): fix unexpected blur effect in prompt editor#34069
fix(prompt-editor): fix unexpected blur effect in prompt editor#34069
Conversation
…UpdateBlock and WorkflowVariableBlock
There was a problem hiding this comment.
Pull request overview
Fixes an unexpected blur-related UI effect in the prompt editor by removing the old “clear hide menu timeout” command flow and relocating blur/focus-driven menu visibility handling into the component picker plugin.
Changes:
- Removed
CLEAR_HIDE_MENU_TIMEOUTLexical command and related dispatches/usages across prompt-editor plugins. - Simplified
OnBlurBlockto stop scheduling delayedEscapedispatch on blur. - Added blur/focus-driven delayed hiding to
ComponentPickerwith new test coverage.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| web/eslint-suppressions.json | Updates suppression count to reflect removed export. |
| web/app/components/base/prompt-editor/plugins/workflow-variable-block/index.tsx | Removes CLEAR_HIDE_MENU_TIMEOUT command and dispatch on insert. |
| web/app/components/base/prompt-editor/plugins/workflow-variable-block/tests/index.spec.tsx | Updates expectations after removing clear-timeout dispatch. |
| web/app/components/base/prompt-editor/plugins/update-block.tsx | Stops importing/dispatching CLEAR_HIDE_MENU_TIMEOUT. |
| web/app/components/base/prompt-editor/plugins/on-blur-or-focus-block.tsx | Removes delayed escape/timeout logic and related command registration. |
| web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx | Introduces blur/focus delayed hiding logic scoped to the menu. |
| web/app/components/base/prompt-editor/plugins/component-picker-block/tests/index.spec.tsx | Adds tests for new blur/focus menu visibility behavior. |
| web/app/components/base/prompt-editor/plugins/tests/update-block.spec.tsx | Updates test to stop asserting clear-timeout behavior. |
| web/app/components/base/prompt-editor/plugins/tests/on-blur-or-focus-block.spec.tsx | Updates tests to match simplified blur behavior and removes clear-timeout coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…orkflow-variable-block
…into fix/editor-blur
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #34069 +/- ##
=======================================
Coverage 79.98% 79.98%
=======================================
Files 4609 4609
Lines 182624 182655 +31
Branches 35574 35577 +3
=======================================
+ Hits 146069 146097 +28
- Misses 33337 33340 +3
Partials 3218 3218
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…l timer when targeting var-search-input
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
web/app/components/base/prompt-editor/plugins/on-blur-or-focus-block.tsx:41
OnBlurBlockreturnstrueforBLUR_COMMAND/FOCUS_COMMAND. In Lexical, returningtruestops command propagation, which can prevent other plugins (e.g. the ComponentPicker’s new blur/focus handlers) from seeing these events depending on registration order. Consider returningfalsehere after invoking the callbacks so other listeners can still run, unless you intentionally need to consume the command.
editor.registerCommand(
BLUR_COMMAND,
(event) => {
const target = event?.relatedTarget as HTMLElement
if (!target?.classList?.contains('var-search-input')) {
if (onBlur)
onBlur()
}
return true
},
COMMAND_PRIORITY_EDITOR,
),
editor.registerCommand(
FOCUS_COMMAND,
() => {
if (onFocus)
onFocus()
return true
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Important
Fixes #<issue number>.Summary
Fixes #34047
Screenshots
Before:
20260325101923_rec_.mp4
After:
fixed.mp4
Checklist
make lintandmake type-check(backend) andcd web && npx lint-staged(frontend) to appease the lint gods