From 98c2ffeec72a13baffbcf95ee59a2fc8a1db88cc Mon Sep 17 00:00:00 2001 From: yyh <92089059+lyzno1@users.noreply.github.com> Date: Wed, 19 Aug 2026 13:16:12 +0000 Subject: [PATCH] fix(ui): align toast swipe direction with viewport (#40980) --- .../src/toast/__tests__/index.spec.tsx | 75 +++++++++++++++++++ packages/dify-ui/src/toast/index.tsx | 3 +- 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/packages/dify-ui/src/toast/__tests__/index.spec.tsx b/packages/dify-ui/src/toast/__tests__/index.spec.tsx index a53a9731a3b..36fc4d14f3b 100644 --- a/packages/dify-ui/src/toast/__tests__/index.spec.tsx +++ b/packages/dify-ui/src/toast/__tests__/index.spec.tsx @@ -88,6 +88,81 @@ describe('@langgenius/dify-ui/toast', () => { ) }) + it('should reject a downward swipe and dismiss upward from the top-right viewport', async () => { + const baseUIAnimationGlobal = globalThis as BaseUIAnimationGlobal + const animationState = baseUIAnimationGlobal.BASE_UI_ANIMATIONS_DISABLED + baseUIAnimationGlobal.BASE_UI_ANIMATIONS_DISABLED = false + + try { + const screen = await render( + <> + +