From 7ceffde6b9f637982c33938f2d9acee7459ff4fa Mon Sep 17 00:00:00 2001 From: crazywoola <427733928@qq.com> Date: Tue, 12 May 2026 13:03:54 +0800 Subject: [PATCH] fix marketplace hero shake --- .../marketplace/description/__tests__/index.spec.tsx | 6 ++++++ .../components/plugins/marketplace/description/index.tsx | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/web/app/components/plugins/marketplace/description/__tests__/index.spec.tsx b/web/app/components/plugins/marketplace/description/__tests__/index.spec.tsx index cc6dbde037..b9c8ab2ebe 100644 --- a/web/app/components/plugins/marketplace/description/__tests__/index.spec.tsx +++ b/web/app/components/plugins/marketplace/description/__tests__/index.spec.tsx @@ -97,5 +97,11 @@ describe('Description', () => { expect(container.querySelector('.custom-hero-class')).toBeInTheDocument() }) + + it('should keep the hero bottom padding fixed during collapse animation', () => { + const { container } = render() + + expect(container.firstElementChild).toHaveStyle({ paddingBottom: '24px' }) + }) }) }) diff --git a/web/app/components/plugins/marketplace/description/index.tsx b/web/app/components/plugins/marketplace/description/index.tsx index 0fe37676d3..fa51b35b8e 100644 --- a/web/app/components/plugins/marketplace/description/index.tsx +++ b/web/app/components/plugins/marketplace/description/index.tsx @@ -22,7 +22,6 @@ const MAX_SCROLL = 120 // pixels to fully collapse const EXPANDED_PADDING_TOP = 32 // pt-8 const COLLAPSED_PADDING_TOP = 12 // pt-3 const EXPANDED_PADDING_BOTTOM = 24 // pb-6 -const COLLAPSED_PADDING_BOTTOM = 12 // pb-3 export const Description = ({ className, @@ -112,7 +111,6 @@ export const Description = ({ const tabsMarginTop = useTransform(smoothProgress, [0, 1], [48, marketplaceNav ? 16 : 0]) const titleMarginTop = useTransform(smoothProgress, [0, 1], [marketplaceNav ? 80 : 0, 0]) const paddingTop = useTransform(smoothProgress, [0, 1], [marketplaceNav ? COLLAPSED_PADDING_TOP : EXPANDED_PADDING_TOP, COLLAPSED_PADDING_TOP]) - const paddingBottom = useTransform(smoothProgress, [0, 1], [EXPANDED_PADDING_BOTTOM, COLLAPSED_PADDING_BOTTOM]) useEffect(() => { const container = document.getElementById(scrollContainerId) @@ -172,7 +170,7 @@ export const Description = ({ )} style={{ paddingTop, - paddingBottom, + paddingBottom: EXPANDED_PADDING_BOTTOM, }} > {/* Blue base background */}