From e1f9c49cedabef526e8f0241eae6b90376dd62a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Loi=CC=88c=20Correnson?= <loic.correnson@cea.fr>
Date: Mon, 24 Apr 2023 16:52:34 +0200
Subject: [PATCH] [ivette] more precise view sub-menu

---
 ivette/src/renderer/Laboratory.tsx | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/ivette/src/renderer/Laboratory.tsx b/ivette/src/renderer/Laboratory.tsx
index 7c3287e930d..30b0f3ed72c 100644
--- a/ivette/src/renderer/Laboratory.tsx
+++ b/ivette/src/renderer/Laboratory.tsx
@@ -379,12 +379,16 @@ function CustomViews(props: CustomViewsProps): JSX.Element {
       setLocal({ current: newCurrent, shapes });
     };
 
+    const onView = (action: string) =>
+      isCurrent ? `${action} View` : `${action} View (${view.label})`;
+    const hasRename = !edited && isCustom;
+
     Dome.popupMenu([
-      { label: 'Rename View', display: (!edited && isCustom), onClick: RENAME },
+      { label: onView('Rename'), display: hasRename, onClick: RENAME },
       { label: 'Restore Default', display: isCurrent, onClick: DEFAULT },
-      { label: 'Duplicate View', onClick: DUPLICATE },
+      { label: onView('Duplicate'), onClick: DUPLICATE },
       'separator',
-      { label: 'Remove View', display: isCustom, onClick: REMOVE },
+      { label: onView('Remove'), display: isCustom, onClick: REMOVE },
     ]);
   };
 
-- 
GitLab