From e101c2ca7c8a3993a7b61a0b358bbc8d82705cac Mon Sep 17 00:00:00 2001 From: Ryan Di Date: Tue, 23 Sep 2025 11:38:41 +1000 Subject: [PATCH] move hidden action btns to extra popover --- packages/excalidraw/components/Actions.tsx | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/excalidraw/components/Actions.tsx b/packages/excalidraw/components/Actions.tsx index a6ab1df726..7e2f848ba3 100644 --- a/packages/excalidraw/components/Actions.tsx +++ b/packages/excalidraw/components/Actions.tsx @@ -606,6 +606,9 @@ const CombinedExtraActions = ({ setAppState, container, app, + showRedo, + showDuplicate, + showDelete, }: { appState: UIAppState; targetElements: ExcalidrawElement[]; @@ -613,6 +616,9 @@ const CombinedExtraActions = ({ setAppState: React.Component["setState"]; container: HTMLDivElement | null; app: AppClassProperties; + showRedo?: boolean; + showDuplicate?: boolean; + showDelete?: boolean; }) => { const isEditingTextOrNewElement = Boolean( appState.editingTextElement || appState.newElement, @@ -734,6 +740,9 @@ const CombinedExtraActions = ({
{renderAction("group")} {renderAction("ungroup")} + {showRedo && renderAction("redo")} + {showDuplicate && renderAction("duplicateSelection")} + {showDelete && renderAction("deleteSelectedElements")} {showLinkIcon && renderAction("hyperlink")} {showCropEditorAction && renderAction("cropEditor")}
@@ -908,9 +917,9 @@ export const MobileShapeActions = ({ const ADDITIONAL_WIDTH = WIDTH + GAP; - const showDelete = width >= MIN_WIDTH; - const showDuplicate = width >= MIN_WIDTH + 2 * ADDITIONAL_WIDTH; - const showRedo = width >= MIN_WIDTH + 3 * ADDITIONAL_WIDTH; + const showDeleteOutside = width >= MIN_WIDTH; + const showDuplicateOutside = width >= MIN_WIDTH + 2 * ADDITIONAL_WIDTH; + const showRedoOutside = width >= MIN_WIDTH + 3 * ADDITIONAL_WIDTH; return (
{renderAction("undo")}
- {showRedo && ( + {showRedoOutside && (
{renderAction("redo")}
)} - {showDuplicate && ( + {showDuplicateOutside && (
{renderAction("duplicateSelection")}
)} - {showDelete && ( + {showDeleteOutside && (
{renderAction("deleteSelectedElements")}