From 55a5e7c3afb4e8ef83bc5dc9fca7f18020c7a92e Mon Sep 17 00:00:00 2001 From: shiquda Date: Tue, 27 May 2025 12:51:49 +0800 Subject: [PATCH] feat: add title to selection action button in compact mode (#6498) * feat: add title prototype to selection action button in compact mode * fix: optimize the display name logic for action buttons in the selection toolbar --- .../src/windows/selection/toolbar/SelectionToolbar.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/windows/selection/toolbar/SelectionToolbar.tsx b/src/renderer/src/windows/selection/toolbar/SelectionToolbar.tsx index e7eb26e849..0b087a11ea 100644 --- a/src/renderer/src/windows/selection/toolbar/SelectionToolbar.tsx +++ b/src/renderer/src/windows/selection/toolbar/SelectionToolbar.tsx @@ -65,8 +65,10 @@ const ActionIcons: FC<{ const renderActionButton = useCallback( (action: ActionItem) => { + const displayName = action.isBuiltIn ? t(action.name) : action.name + return ( - handleAction(action)}> + handleAction(action)} title={isCompact ? displayName : undefined}> {action.id === 'copy' ? ( renderCopyIcon() @@ -79,9 +81,7 @@ const ActionIcons: FC<{ /> )} - {!isCompact && ( - {action.isBuiltIn ? t(action.name) : action.name} - )} + {!isCompact && {displayName}} ) },