From 7e30aba12a32e0d99c529ef7bb81ec4f46bfdc76 Mon Sep 17 00:00:00 2001 From: yyh <92089059+lyzno1@users.noreply.github.com> Date: Fri, 31 Jul 2026 20:43:11 +0800 Subject: [PATCH] refactor(ui): simplify scroll area API (#39857) --- packages/dify-ui/src/dialog/index.stories.tsx | 12 +- packages/dify-ui/src/drawer/index.stories.tsx | 13 +- packages/dify-ui/src/public-types.test-d.ts | 188 ----- .../src/scroll-area/__tests__/index.spec.tsx | 125 +++- .../dify-ui/src/scroll-area/index.stories.tsx | 50 +- packages/dify-ui/src/scroll-area/index.tsx | 48 +- .../components/app/access-config/index.tsx | 70 +- .../app/overview/settings/index.tsx | 694 +++++++++--------- web/app/components/billing/pricing/index.tsx | 6 +- .../datasets/access-config/index.tsx | 70 +- web/app/components/explore/sidebar/index.tsx | 6 +- web/app/components/goto-anything/index.tsx | 14 +- .../header/account-setting/index.tsx | 75 +- .../model-selector/popup-layout.tsx | 11 +- .../account-setting/permission-group-list.tsx | 217 +++--- .../workspace-role-checkbox-list.tsx | 183 ++--- web/app/components/integrations/page.tsx | 56 +- .../integrations/section-layout.tsx | 30 +- .../integrations/tool-provider-list.tsx | 6 +- .../main-nav/components/web-apps-section.tsx | 11 +- .../components/plugin-section.tsx | 62 +- .../components/plugin-task-list.tsx | 165 +++-- .../plugin-page/plugins-panel-results.tsx | 6 +- .../config-credentials.tsx | 350 +++++---- .../block-selector/snippets/index.tsx | 6 +- .../block-selector/trigger-plugin/item.tsx | 6 +- .../agent-v2/agent-detail/access/page.tsx | 67 +- .../configure/__tests__/page.spec.tsx | 9 +- .../components/orchestrate/files/tree.tsx | 67 +- .../components/orchestrate/index.tsx | 72 +- .../orchestrate/skills/detail-dialog.tsx | 83 ++- .../configure/components/workspace.tsx | 4 - .../logs/components/logs-table.tsx | 6 +- .../agent-v2/agent-detail/monitoring/page.tsx | 90 +-- web/features/agent-v2/roster/page.tsx | 6 +- .../deployments/create-guide/ui/layout.tsx | 23 +- web/i18n/ar-TN/agent-v-2.json | 1 - web/i18n/de-DE/agent-v-2.json | 1 - web/i18n/en-US/agent-v-2.json | 1 - web/i18n/es-ES/agent-v-2.json | 1 - web/i18n/fa-IR/agent-v-2.json | 1 - web/i18n/fr-FR/agent-v-2.json | 1 - web/i18n/hi-IN/agent-v-2.json | 1 - web/i18n/id-ID/agent-v-2.json | 1 - web/i18n/it-IT/agent-v-2.json | 1 - web/i18n/ja-JP/agent-v-2.json | 1 - web/i18n/ko-KR/agent-v-2.json | 1 - web/i18n/nl-NL/agent-v-2.json | 1 - web/i18n/pl-PL/agent-v-2.json | 1 - web/i18n/pt-BR/agent-v-2.json | 1 - web/i18n/ro-RO/agent-v-2.json | 1 - web/i18n/ru-RU/agent-v-2.json | 1 - web/i18n/sl-SI/agent-v-2.json | 1 - web/i18n/th-TH/agent-v-2.json | 1 - web/i18n/tr-TR/agent-v-2.json | 1 - web/i18n/uk-UA/agent-v-2.json | 1 - web/i18n/vi-VN/agent-v-2.json | 1 - web/i18n/zh-Hans/agent-v-2.json | 1 - web/i18n/zh-Hant/agent-v-2.json | 1 - 59 files changed, 1467 insertions(+), 1463 deletions(-) delete mode 100644 packages/dify-ui/src/public-types.test-d.ts diff --git a/packages/dify-ui/src/dialog/index.stories.tsx b/packages/dify-ui/src/dialog/index.stories.tsx index d113a80293d..d171d862a9f 100644 --- a/packages/dify-ui/src/dialog/index.stories.tsx +++ b/packages/dify-ui/src/dialog/index.stories.tsx @@ -19,8 +19,8 @@ import { Field, FieldControl, FieldDescription, FieldError, FieldLabel } from '. import { Form } from '../form' import { Input } from '../input' import { + ScrollArea, ScrollAreaContent, - ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, @@ -334,7 +334,7 @@ const OutsideScrollingContentDemo = () => { - + { - + @@ -418,11 +418,11 @@ const InsideScrollingContentDemo = () => { title="Release notes" description="Highlights from the latest workspace update." /> - + @@ -431,7 +431,7 @@ const InsideScrollingContentDemo = () => { - + setOpen(false)} /> diff --git a/packages/dify-ui/src/drawer/index.stories.tsx b/packages/dify-ui/src/drawer/index.stories.tsx index 1f7264f1719..8ddcc1ddf16 100644 --- a/packages/dify-ui/src/drawer/index.stories.tsx +++ b/packages/dify-ui/src/drawer/index.stories.tsx @@ -23,8 +23,8 @@ import { Button } from '../button' import { cn } from '../cn' import { Input } from '../input' import { + ScrollArea, ScrollAreaContent, - ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, @@ -723,16 +723,19 @@ export const MobileNavigation: Story = { - - +