From 633edaadac1281b418e71f1af7a8df298aa8017c Mon Sep 17 00:00:00 2001 From: VolodymyrBg Date: Thu, 6 Mar 2025 19:27:52 +0200 Subject: [PATCH 1/6] Update remix-ui-vertical-icons-panel.tsx --- .../src/lib/remix-ui-vertical-icons-panel.tsx | 78 ++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx index 108052d4824..90ebbff601c 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx @@ -26,6 +26,8 @@ const RemixUiVerticalIconsPanel = ({ verticalIconsPlugin, icons }: RemixUiVertic const iconPanelRef = useRef() const [activateScroll, dispatchScrollAction] = useReducer(verticalScrollReducer, initialState) const [theme, setTheme] = useState('dark') + const [isPanelHovered, setIsPanelHovered] = useState(false) + const [tooltipPosition, setTooltipPosition] = useState({ top: 0, left: 0 }) const online = useContext(onLineContext) const evaluateScrollability = () => { @@ -67,9 +69,64 @@ const RemixUiVerticalIconsPanel = ({ verticalIconsPlugin, icons }: RemixUiVertic verticalIconsPlugin.call('manager', 'deactivatePlugin', name) } + const handlePanelMouseEnter = (e: React.MouseEvent) => { + const rect = iconPanelRef.current.getBoundingClientRect() + setTooltipPosition({ top: rect.top, left: rect.right + 10 }) + setIsPanelHovered(true) + } + + const handlePanelMouseLeave = () => { + setIsPanelHovered(false) + } + + const renderAllPluginNames = () => { + return ( +
+
Plugins
+
    + {icons.map((icon) => ( +
  • + {icon.profile.displayName || icon.profile.name} + {icon.active && ( + + )} +
  • + ))} +
+
+ Click any icon to open a plugin +
+ Use "Close Others" to keep only that plugin open +
+
+ ) + } + + const closeOtherPlugins = (exceptName: string) => { + icons.forEach((icon) => { + if (icon.profile.name !== exceptName && icon.active) { + verticalIconsPlugin.toggle(icon.profile.name) + } + }) + } + return (
-
+
+ {isPanelHovered && ( +
+ {renderAllPluginNames()} +
+ )}
) } From e57f9fdfada9689fffb3f407e7f388b06ad9fecf Mon Sep 17 00:00:00 2001 From: VolodymyrBg Date: Thu, 6 Mar 2025 19:28:13 +0200 Subject: [PATCH 2/6] Update vertical-icons-context-menu.tsx --- .../src/lib/vertical-icons-context-menu.tsx | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/vertical-icons-context-menu.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/vertical-icons-context-menu.tsx index 8d8ca869860..898ae6bf13f 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/vertical-icons-context-menu.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/vertical-icons-context-menu.tsx @@ -6,7 +6,7 @@ export interface VerticalIconsContextMenuProps extends React.DetailedHTMLProps void @@ -14,7 +14,7 @@ export interface VerticalIconsContextMenuProps extends React.DetailedHTMLProps void profileName: string canBeDeactivated: boolean @@ -27,7 +27,7 @@ interface MenuLinksProps { interface MenuProps { verticalIconsPlugin: Plugin profileName: string - listItems: {Documentation: string; CanDeactivate: boolean} + listItems: {Documentation: string; CanDeactivate: boolean; CloseOthers: boolean} hide: () => void } @@ -65,10 +65,22 @@ const VerticalIconsContextMenu = (props: VerticalIconsContextMenuProps) => { ) } -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const MenuForLinks = ({ listItems, hide, profileName, contextMenuAction }: MenuLinksProps) => { +const MenuForLinks = ({ listItems, hide, profileName, contextMenuAction, verticalIconPlugin, toggle }: MenuLinksProps) => { return ( + {listItems.CloseOthers && ( + + )} {listItems.CanDeactivate ? (