From e8d6b9412010684d0478621829c96061308f45ee Mon Sep 17 00:00:00 2001 From: kay delaney <45561153+kaydelaney@users.noreply.github.com> Date: Thu, 5 Jun 2025 10:32:28 +0100 Subject: [PATCH] Dashboards: Tweak undo/redo tooltips for a11y clarity (#106325) --- .../dashboard-scene/scene/new-toolbar/RightActions.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/app/features/dashboard-scene/scene/new-toolbar/RightActions.tsx b/public/app/features/dashboard-scene/scene/new-toolbar/RightActions.tsx index cb4a43334ef..721c3396a28 100644 --- a/public/app/features/dashboard-scene/scene/new-toolbar/RightActions.tsx +++ b/public/app/features/dashboard-scene/scene/new-toolbar/RightActions.tsx @@ -169,13 +169,14 @@ function UndoButton({ dashboard }: ToolbarActionProps) { const editPane = dashboard.state.editPane; const { undoStack } = editPane.useState(); const undoAction = undoStack[undoStack.length - 1]; + const tooltip = undoAction ? `Undo '${undoAction.description}'` : 'Undo'; return ( editPane.undoAction()} - tooltip={undoAction?.description} + tooltip={tooltip} /> ); } @@ -184,12 +185,13 @@ function RedoButton({ dashboard }: ToolbarActionProps) { const editPane = dashboard.state.editPane; const { redoStack } = editPane.useState(); const redoAction = redoStack[redoStack.length - 1]; + const tooltip = redoAction ? `Redo '${redoAction?.description}'` : 'Redo'; return ( editPane.redoAction()} /> );