From a233b2f53a142659b0909a642fb7bb42fde8ad09 Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 8 Sep 2026 07:44:41 +0000 Subject: [PATCH] fix: make panel and node resizing keyboard accessible (#41963) Co-authored-by: yyh --- oxlint-suppressions.json | 9 +- .../prompt-editor-height-resize-wrap.spec.tsx | 69 +++++++ .../prompt-editor-height-resize-wrap.tsx | 59 +++++- .../resize-handle/__tests__/index.spec.tsx | 89 +++++++++ .../components/base/resize-handle/index.tsx | 64 ++++++ .../components/base/resize-handle/keyboard.ts | 30 +++ .../__tests__/snippet-run-panel.spec.tsx | 24 ++- .../snippets/components/snippet-run-panel.tsx | 27 ++- .../__tests__/node-resizer.browser.spec.tsx | 187 ++++++++++++++++++ .../__tests__/node-resizer.spec.tsx | 129 ++++++++++++ .../nodes/_base/components/node-resizer.tsx | 111 ++++++++++- .../workflow-panel/__tests__/index.spec.tsx | 120 ++++++++++- .../_base/components/workflow-panel/index.tsx | 20 +- .../components/workflow/note-node/index.tsx | 2 +- .../panel-width-integration.spec.tsx | 148 ++++++++++++++ .../panel/__tests__/panel-width.spec.ts | 36 ++++ .../panel/__tests__/workflow-preview.spec.tsx | 24 ++- .../__tests__/debug-and-preview.spec.tsx | 23 ++- .../panel/debug-and-preview/index.tsx | 30 +-- web/app/components/workflow/panel/index.tsx | 14 +- .../components/workflow/panel/panel-width.ts | 11 ++ .../workflow/panel/workflow-preview.tsx | 28 ++- .../variable-inspect/__tests__/index.spec.tsx | 58 ++++++ .../workflow/variable-inspect/index.tsx | 29 ++- .../__tests__/detail-page-navigation.spec.tsx | 10 +- web/features/skills/detail/file-tree.tsx | 20 +- web/i18n/ar-TN/common.json | 7 + web/i18n/ar-TN/workflow.json | 1 + web/i18n/de-DE/common.json | 7 + web/i18n/de-DE/workflow.json | 1 + web/i18n/en-US/common.json | 7 + web/i18n/en-US/workflow.json | 1 + web/i18n/es-ES/common.json | 7 + web/i18n/es-ES/workflow.json | 1 + web/i18n/fa-IR/common.json | 7 + web/i18n/fa-IR/workflow.json | 1 + web/i18n/fr-FR/common.json | 7 + web/i18n/fr-FR/workflow.json | 1 + web/i18n/hi-IN/common.json | 7 + web/i18n/hi-IN/workflow.json | 1 + web/i18n/id-ID/common.json | 7 + web/i18n/id-ID/workflow.json | 1 + web/i18n/it-IT/common.json | 7 + web/i18n/it-IT/workflow.json | 1 + web/i18n/ja-JP/common.json | 7 + web/i18n/ja-JP/workflow.json | 1 + web/i18n/ko-KR/common.json | 7 + web/i18n/ko-KR/workflow.json | 1 + web/i18n/lo-LA/common.json | 7 + web/i18n/lo-LA/workflow.json | 1 + web/i18n/nl-NL/common.json | 7 + web/i18n/nl-NL/workflow.json | 1 + web/i18n/pl-PL/common.json | 7 + web/i18n/pl-PL/workflow.json | 1 + web/i18n/pt-BR/common.json | 7 + web/i18n/pt-BR/workflow.json | 1 + web/i18n/ro-RO/common.json | 7 + web/i18n/ro-RO/workflow.json | 1 + web/i18n/ru-RU/common.json | 7 + web/i18n/ru-RU/workflow.json | 1 + web/i18n/sl-SI/common.json | 7 + web/i18n/sl-SI/workflow.json | 1 + web/i18n/th-TH/common.json | 7 + web/i18n/th-TH/workflow.json | 1 + web/i18n/tr-TR/common.json | 7 + web/i18n/tr-TR/workflow.json | 1 + web/i18n/uk-UA/common.json | 7 + web/i18n/uk-UA/workflow.json | 1 + web/i18n/vi-VN/common.json | 7 + web/i18n/vi-VN/workflow.json | 1 + web/i18n/zh-Hans/common.json | 7 + web/i18n/zh-Hans/workflow.json | 1 + web/i18n/zh-Hant/common.json | 7 + web/i18n/zh-Hant/workflow.json | 1 + 74 files changed, 1472 insertions(+), 91 deletions(-) create mode 100644 web/app/components/app/configuration/config-prompt/__tests__/prompt-editor-height-resize-wrap.spec.tsx create mode 100644 web/app/components/base/resize-handle/__tests__/index.spec.tsx create mode 100644 web/app/components/base/resize-handle/index.tsx create mode 100644 web/app/components/base/resize-handle/keyboard.ts create mode 100644 web/app/components/workflow/nodes/_base/components/__tests__/node-resizer.browser.spec.tsx create mode 100644 web/app/components/workflow/nodes/_base/components/__tests__/node-resizer.spec.tsx create mode 100644 web/app/components/workflow/panel/__tests__/panel-width-integration.spec.tsx create mode 100644 web/app/components/workflow/panel/__tests__/panel-width.spec.ts create mode 100644 web/app/components/workflow/panel/panel-width.ts diff --git a/oxlint-suppressions.json b/oxlint-suppressions.json index 2a3bb75e6b0..082500034b6 100644 --- a/oxlint-suppressions.json +++ b/oxlint-suppressions.json @@ -221,11 +221,6 @@ "count": 2 } }, - "web/app/components/app/configuration/config-prompt/prompt-editor-height-resize-wrap.tsx": { - "jsx-a11y/no-static-element-interactions": { - "count": 1 - } - }, "web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx": { "typescript/no-explicit-any": { "count": 3 @@ -2947,7 +2942,7 @@ "count": 1 }, "jsx-a11y/no-static-element-interactions": { - "count": 6 + "count": 5 } }, "web/app/components/snippets/hooks/use-snippet-run.ts": { @@ -4438,7 +4433,7 @@ "count": 4 }, "jsx-a11y/no-static-element-interactions": { - "count": 5 + "count": 4 }, "typescript/no-explicit-any": { "count": 1 diff --git a/web/app/components/app/configuration/config-prompt/__tests__/prompt-editor-height-resize-wrap.spec.tsx b/web/app/components/app/configuration/config-prompt/__tests__/prompt-editor-height-resize-wrap.spec.tsx new file mode 100644 index 00000000000..86d6cad85c6 --- /dev/null +++ b/web/app/components/app/configuration/config-prompt/__tests__/prompt-editor-height-resize-wrap.spec.tsx @@ -0,0 +1,69 @@ +import { fireEvent, render, screen, waitFor } from '@testing-library/react' +import userEvent from '@testing-library/user-event' +import { useState } from 'react' +import PromptEditorHeightResizeWrap from '../prompt-editor-height-resize-wrap' + +function Editor({ hideResize = false }: { hideResize?: boolean }) { + const [height, setHeight] = useState(200) + return ( + +