Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix(web): make the scroll-to-node action a button (#40214)
yyhe4420227b5b3
diff --git a/oxlint-suppressions.json b/oxlint-suppressions.jsonindex 99da2f53904..68d258113a4 100644--- a/oxlint-suppressions.json+++ b/oxlint-suppressions.json@@ -3711,14 +3711,6 @@"count": 2}},- "web/app/components/workflow/header/scroll-to-selected-node-button.tsx": {- "jsx_a11y/click-events-have-key-events": {- "count": 1- },- "jsx_a11y/no-static-element-interactions": {- "count": 1- }- },"web/app/components/workflow/header/test-run-menu.tsx": {"erasable-syntax-only/enums": {"count": 1diff --git a/web/app/components/workflow/header/__tests__/scroll-to-selected-node-button.spec.tsx b/web/app/components/workflow/header/__tests__/scroll-to-selected-node-button.spec.tsxindex c80036969a9..24628da3f80 100644--- a/web/app/components/workflow/header/__tests__/scroll-to-selected-node-button.spec.tsx+++ b/web/app/components/workflow/header/__tests__/scroll-to-selected-node-button.spec.tsx@@ -1,4 +1,5 @@-import { fireEvent, render, screen } from '@testing-library/react'+import { render, screen } from '@testing-library/react'+import userEvent from '@testing-library/user-event'import { createNode } from '../../__tests__/fixtures'import { resetReactFlowMockState, rfState } from '../../__tests__/reactflow-mock-state'import ScrollToSelectedNodeButton from '../scroll-to-selected-node-button'@@ -32,7 +33,8 @@ describe('ScrollToSelectedNodeButton', () => {expect(container.firstChild).toBeNull()})- it('should render the action and scroll to the selected node when clicked', () => {+ it('should render a button and scroll to the selected node when clicked', async () => {+ const user = userEvent.setup()rfState.nodes = [createNode({id: 'node-1',@@ -46,9 +48,36 @@ describe('ScrollToSelectedNodeButton', () => {render(<ScrollToSelectedNodeButton />)- fireEvent.click(screen.getByText('workflow.panel.scrollToSelectedNode'))+ const button = screen.getByRole('button', {+ name: 'workflow.panel.scrollToSelectedNode',+ })+ expect(button).toHaveAttribute('type', 'button')++ await user.click(button)expect(mockScrollToWorkflowNode).toHaveBeenCalledWith('node-2')expect(mockScrollToWorkflowNode).toHaveBeenCalledTimes(1)})++ it('should support native keyboard activation', async () => {+ const user = userEvent.setup()+ rfState.nodes = [+ createNode({+ id: 'node-2',+ data: { selected: true },+ }),+ ]++ render(<ScrollToSelectedNodeButton />)++ const button = screen.getByRole('button', {+ name: 'workflow.panel.scrollToSelectedNode',+ })+ button.focus()+ await user.keyboard('{Enter}')+ await user.keyboard(' ')++ expect(mockScrollToWorkflowNode).toHaveBeenNthCalledWith(1, 'node-2')+ expect(mockScrollToWorkflowNode).toHaveBeenNthCalledWith(2, 'node-2')+ })})diff --git a/web/app/components/workflow/header/scroll-to-selected-node-button.tsx b/web/app/components/workflow/header/scroll-to-selected-node-button.tsxindex b6a94678c88..04779379519 100644--- a/web/app/components/workflow/header/scroll-to-selected-node-button.tsx+++ b/web/app/components/workflow/header/scroll-to-selected-node-button.tsx@@ -13,14 +13,15 @@ const ScrollToSelectedNodeButton: FC = () => {if (!selectedNode) return nullreturn (- <div+ <button+ type="button"className={cn(- 'flex h-6 cursor-pointer items-center justify-center rounded-md border-[0.5px] border-effects-highlight bg-components-actionbar-bg px-3 system-xs-medium whitespace-nowrap text-text-tertiary shadow-lg backdrop-blur-xs transition-colors duration-200 hover:text-text-accent',+ 'flex h-6 cursor-pointer appearance-none items-center justify-center rounded-md border-[0.5px] border-effects-highlight bg-components-actionbar-bg px-3 system-xs-medium whitespace-nowrap text-text-tertiary shadow-lg backdrop-blur-xs transition-colors duration-200 hover:text-text-accent focus-visible:ring-2 focus-visible:ring-state-accent-solid focus-visible:outline-hidden',)}onClick={() => scrollToWorkflowNode(selectedNode.id)}>{t(($) => $['panel.scrollToSelectedNode'], { ns: 'workflow' })}- </div>+ </button>)}