From c8e29d9a7d43e4db90a3b46b4db98225ddb0d5ea Mon Sep 17 00:00:00 2001 From: yyh <92089059+lyzno1@users.noreply.github.com> Date: Wed, 26 Aug 2026 10:50:06 +0000 Subject: [PATCH] fix(web): preserve link semantics in button-styled navigation (#41312) --- .../src/button/__tests__/index.spec.tsx | 11 ++- .../set-password/page.tsx | 16 ++--- web/app/account/(commonLayout)/header.tsx | 14 ++-- web/app/account/oauth/authorize/page.tsx | 17 +++-- web/app/activate/activateForm.tsx | 11 +-- .../environment-access-point-cards.spec.tsx | 10 +-- .../__tests__/service-api-card.spec.tsx | 10 +-- .../built-in-access-points/index.tsx | 30 +++++--- .../access-point/shared/access-point-url.tsx | 10 +-- .../shared/service-api-card-view.tsx | 38 +++++----- .../version-selection/index.tsx | 11 ++- .../in-site-message/__tests__/index.spec.tsx | 59 ++++++--------- .../__tests__/notification.spec.tsx | 7 +- .../components/app/in-site-message/index.tsx | 65 ++++++++++------- .../app/overview/customize/index.tsx | 70 ++++++++---------- .../annotation-reply/__tests__/index.spec.tsx | 14 ++-- .../annotation-reply/index.tsx | 17 +++-- .../markdown-blocks/__tests__/button.spec.tsx | 12 ++-- .../base/markdown-blocks/button.tsx | 24 +++++-- .../billing/apps-full-in-dialog/index.tsx | 27 ++++--- .../datasets/create-from-pipeline/header.tsx | 16 +++-- .../__tests__/index.spec.tsx | 12 ++-- .../create/embedding-process/index.tsx | 42 ++++++----- .../create-from-pipeline/actions/index.tsx | 13 ++-- .../create-from-pipeline/left-header.tsx | 19 ++--- .../__tests__/index.spec.tsx | 29 ++------ .../processing/embedding-process/index.tsx | 30 ++++---- .../connector/__tests__/index.spec.tsx | 12 ++-- .../create/__tests__/index.spec.tsx | 20 +++--- .../external-knowledge-base/create/index.tsx | 7 +- .../datasets/extra-info/service-api/card.tsx | 15 ++-- .../plugins/install-plugin/base/installed.tsx | 26 +++---- .../list/__tests__/card-wrapper.spec.tsx | 17 ++--- .../plugins/marketplace/list/card-wrapper.tsx | 20 +++--- web/app/components/plugins/provider-card.tsx | 21 +++--- .../publisher/__tests__/index.spec.tsx | 37 +++------- .../publisher/__tests__/popup.spec.tsx | 33 ++++----- .../rag-pipeline-header/publisher/popup.tsx | 71 +++++++++++++------ web/app/components/tools/provider/detail.tsx | 25 +++---- .../components/edit-in-console-link.tsx | 2 +- .../workflow/variable-inspect/right.tsx | 10 ++- .../workflow/workflow-generator/index.tsx | 16 ++--- .../components/__tests__/chooser.spec.tsx | 43 ++++------- web/app/device/components/chooser.tsx | 31 ++++---- web/app/device/page.tsx | 8 ++- .../forgot-password/ChangePasswordForm.tsx | 20 ++++-- .../ForgotPasswordForm.spec.tsx | 19 ++--- .../forgot-password/ForgotPasswordForm.tsx | 41 ++++++----- .../set-password/__tests__/page.spec.tsx | 30 +++++--- web/app/reset-password/set-password/page.tsx | 16 ++--- web/app/signin/components/social-auth.tsx | 10 +-- web/app/signin/invite-settings/page.tsx | 12 ++-- .../__tests__/access-surface-cards.spec.tsx | 2 +- 53 files changed, 587 insertions(+), 611 deletions(-) diff --git a/packages/dify-ui/src/button/__tests__/index.spec.tsx b/packages/dify-ui/src/button/__tests__/index.spec.tsx index ea99dc3800a..e58d031af6d 100644 --- a/packages/dify-ui/src/button/__tests__/index.spec.tsx +++ b/packages/dify-ui/src/button/__tests__/index.spec.tsx @@ -17,15 +17,14 @@ describe('Button', () => { await expect.element(screen.getByRole('button')).toHaveAttribute('type', 'submit') }) - it('renders custom element via render prop', async () => { + it('renders a non-native button via render prop', async () => { const screen = await render( - }> - Link + }> + Custom button , ) - const button = screen.getByRole('button', { name: 'Link' }).element() - expect(button.tagName).toBe('A') - expect(button).toHaveAttribute('href', '/test') + const button = screen.getByRole('button', { name: 'Custom button' }).element() + expect(button.tagName).toBe('DIV') }) }) diff --git a/web/app/(shareLayout)/webapp-reset-password/set-password/page.tsx b/web/app/(shareLayout)/webapp-reset-password/set-password/page.tsx index 204954e9e19..96ce4c1335e 100644 --- a/web/app/(shareLayout)/webapp-reset-password/set-password/page.tsx +++ b/web/app/(shareLayout)/webapp-reset-password/set-password/page.tsx @@ -1,5 +1,5 @@ 'use client' -import { Button } from '@langgenius/dify-ui/button' +import { Button, buttonVariants } from '@langgenius/dify-ui/button' import { cn } from '@langgenius/dify-ui/cn' import { Field, FieldDescription, FieldLabel } from '@langgenius/dify-ui/field' import { Form } from '@langgenius/dify-ui/form' @@ -12,6 +12,7 @@ import { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' import { validPassword } from '@/config' import useDocumentTitle from '@/hooks/use-document-title' +import Link from '@/next/link' import { useRouter, useSearchParams } from '@/next/navigation' import { changeWebAppPasswordWithToken } from '@/service/common' @@ -182,16 +183,13 @@ const ChangePasswordForm = () => {
{t(($) => $[`${prefixCustomize}.way2.name`], { ns: 'appOverview' })}
- +{t(($) => $['success.subtitle'])}