From 6a6154659f19514a81751b7c0539194c6579bb15 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Tue, 7 Jul 2026 10:14:20 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84(frontend)=20improve=20ui/ux=20befo?= =?UTF-8?q?re=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following the recommendations of the design team, we lightly improved some UI/UX elements to be more consistent and user-friendly before the next release. It includes the following changes: - add a background to the grid - add a fadein to the header buttons - reduce the generic size icon - add a title to the doc item --- .../impress/configuration/theme/default.json | 2 +- .../apps/impress/src/components/Effect.tsx | 56 +++++++++++++++++++ .../components/SimpleDocItem.tsx | 1 + .../docs/docs-grid/components/DocsGrid.tsx | 3 +- .../header/components/HeaderFloatingBar.tsx | 19 ++++--- .../components/LeftPanelCollapseButton.tsx | 6 +- .../apps/impress/src/layouts/MainLayout.tsx | 28 +++++++--- .../apps/impress/src/pages/docs/index.tsx | 10 +++- 8 files changed, 103 insertions(+), 22 deletions(-) diff --git a/src/backend/impress/configuration/theme/default.json b/src/backend/impress/configuration/theme/default.json index 3f87d89c7..4c752dd48 100644 --- a/src/backend/impress/configuration/theme/default.json +++ b/src/backend/impress/configuration/theme/default.json @@ -142,7 +142,7 @@ "icon": { "src": "/assets/icon-docs.svg", "style": { - "width": "40px", + "width": "36px", "height": "auto" }, "alt": "", diff --git a/src/frontend/apps/impress/src/components/Effect.tsx b/src/frontend/apps/impress/src/components/Effect.tsx index 53cffc2a4..5d79c8c2f 100644 --- a/src/frontend/apps/impress/src/components/Effect.tsx +++ b/src/frontend/apps/impress/src/components/Effect.tsx @@ -1,3 +1,6 @@ +import { PropsWithChildren, useEffect, useState } from 'react'; +import styled, { keyframes } from 'styled-components'; + export const showEffect = ` transform: scaleY(1); opacity: 1; @@ -9,3 +12,56 @@ export const hideEffect = ` opacity: 0; max-height: 0; `; + +const fadeIn = keyframes` + from { + opacity: 0; + } + to { + opacity: 1; + } +`; + +const fadeOut = keyframes` + from { + opacity: 1; + } + to { + opacity: 0; + } +`; + +const FadeItem = styled.div<{ $isVisible: boolean }>` + display: flex; + animation: ${({ $isVisible }) => ($isVisible ? fadeIn : fadeOut)} 0.2s ease + forwards; +`; + +export const FadeComponent = ({ + children, + isVisible, +}: PropsWithChildren<{ isVisible: boolean }>) => { + const [isGroupMounted, setIsGroupMounted] = useState(isVisible); + + useEffect(() => { + if (isVisible) { + setIsGroupMounted(true); + } + }, [isVisible]); + + const handleFadeOutEnd = () => { + if (!isVisible) { + setIsGroupMounted(false); + } + }; + + if (!isGroupMounted) { + return null; + } + + return ( + + {children} + + ); +}; diff --git a/src/frontend/apps/impress/src/features/docs/doc-management/components/SimpleDocItem.tsx b/src/frontend/apps/impress/src/features/docs/doc-management/components/SimpleDocItem.tsx index ce0c88fe8..1dc0c2e0b 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-management/components/SimpleDocItem.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-management/components/SimpleDocItem.tsx @@ -100,6 +100,7 @@ export const SimpleDocItem = ({ $weight="500" $css={ItemTextCss} data-testid="doc-title" + title={docTitle} > {docTitle} diff --git a/src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGrid.tsx b/src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGrid.tsx index d32e97407..1f0747162 100644 --- a/src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGrid.tsx +++ b/src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGrid.tsx @@ -90,10 +90,9 @@ export const DocsGrid = ({ { const { t } = useTranslation(); const { isPanelOpen } = useLeftPanelStore(); + const isVisible = (isTablet && !isPanelOpen) || isMobile; + return ( {isTablet && ( )} - {(isTablet && !isPanelOpen) || isMobile ? ( - <> - - - - - - ) : null} + + + + + + + + ); }; diff --git a/src/frontend/apps/impress/src/features/left-panel/components/LeftPanelCollapseButton.tsx b/src/frontend/apps/impress/src/features/left-panel/components/LeftPanelCollapseButton.tsx index c0df08fe5..7ca7dea0f 100644 --- a/src/frontend/apps/impress/src/features/left-panel/components/LeftPanelCollapseButton.tsx +++ b/src/frontend/apps/impress/src/features/left-panel/components/LeftPanelCollapseButton.tsx @@ -1,6 +1,7 @@ import { Button } from '@gouvfr-lasuite/cunningham-react'; import { Text } from '@/components'; +import { FadeComponent } from '@/components/Effect'; import { CardFloatingBar } from '@/components/FloatingBar'; import LeftPanelIcon from '../assets/left-panel.svg'; @@ -27,15 +28,16 @@ export const LeftPanelCollapseButton = ({ icon={