Skip to content

armgit / dify

Public Imported from GitHub
0

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.

fix(web): remove workflow output title tab stop (#40377)

yyha7156a0702df
diff --git a/oxlint-suppressions.json b/oxlint-suppressions.json
index c6f959876c2..34238581503 100644
--- a/oxlint-suppressions.json
+++ b/oxlint-suppressions.json
@@ -5395,9 +5395,6 @@
}
},
"web/app/components/workflow/run/output-panel.tsx": {
- "jsx_a11y/no-noninteractive-tabindex": {
- "count": 1
- },
"typescript/no-explicit-any": {
"count": 3
}
diff --git a/web/app/components/workflow/run/__tests__/output-panel.spec.tsx b/web/app/components/workflow/run/__tests__/output-panel.spec.tsx
index 09e6247d904..a5adad738be 100644
--- a/web/app/components/workflow/run/__tests__/output-panel.spec.tsx
+++ b/web/app/components/workflow/run/__tests__/output-panel.spec.tsx
@@ -1,6 +1,7 @@
import type { FileEntity } from '@/app/components/base/file-uploader/types'
import type { FileResponse } from '@/types/workflow'
import { render, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
import { TransferMethod } from '@/types/app'
import OutputPanel from '../output-panel'
@@ -37,8 +38,19 @@ vi.mock('@/app/components/workflow/run/status-container', () => ({
}))
vi.mock('@/app/components/workflow/nodes/_base/components/editor/code-editor', () => ({
- default: ({ language, value, height }: { language: string; value: string; height?: number }) => (
+ default: ({
+ language,
+ value,
+ height,
+ title,
+ }: {
+ language: string
+ value: string
+ height?: number
+ title?: React.ReactNode
+ }) => (
<div data-height={height} data-language={language} data-testid="code-editor" data-value={value}>
+ <div>{title}</div>
{value}
</div>
),
@@ -138,6 +150,17 @@ describe('OutputPanel', () => {
)
})
+ it('keeps the non-interactive output title out of the tab order', async () => {
+ const user = userEvent.setup()
+
+ render(<OutputPanel height={200} outputs={{ answer: 'hello', score: 1 }} />)
+
+ const outputTitle = screen.getByText('Output')
+ await user.tab()
+
+ expect(outputTitle).not.toHaveFocus()
+ })
+
it('skips the code editor when structured outputs have no positive height', () => {
render(<OutputPanel height={0} outputs={{ answer: 'hello', score: 1 }} />)
diff --git a/web/app/components/workflow/run/output-panel.tsx b/web/app/components/workflow/run/output-panel.tsx
index 1c1c5463ab5..cc16947fa2e 100644
--- a/web/app/components/workflow/run/output-panel.tsx
+++ b/web/app/components/workflow/run/output-panel.tsx
@@ -84,7 +84,7 @@ const OutputPanel: FC<OutputPanelProps> = ({ isRunning, outputs, error, height }
<CodeEditor
showFileList
readOnly
- title={<div tabIndex={0}>Output</div>}
+ title="Output"
language={CodeLanguage.json}
value={JSON.stringify(outputs, null, 2)}
isJSONStringifyBeauty