From 5aa0ddb0a31f15ad36a14c6055989d80e3a7b1ed Mon Sep 17 00:00:00 2001 From: Luke De Feo Date: Mon, 10 Jul 2023 09:22:39 -0700 Subject: [PATCH] Move open in ide and big grep to context menu Summary: Originally we planned to move the IDE inline in the row but this is hard to do well, especially with the horizontal scroll as well as the extra buttons for biggrep, codehub, AS and vscode. Context menu is still very natural so lets try this Reviewed By: lblasa Differential Revision: D47210289 fbshipit-source-id: 339508c820915298161bf95fd1c3cea60b800746 --- .../public/ui-debugger/components/Tree.tsx | 9 ++++++++- .../components/fb-stubs/IDEContextMenu.tsx | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 desktop/plugins/public/ui-debugger/components/fb-stubs/IDEContextMenu.tsx diff --git a/desktop/plugins/public/ui-debugger/components/Tree.tsx b/desktop/plugins/public/ui-debugger/components/Tree.tsx index 8cab6b398..8680de51b 100644 --- a/desktop/plugins/public/ui-debugger/components/Tree.tsx +++ b/desktop/plugins/public/ui-debugger/components/Tree.tsx @@ -37,6 +37,10 @@ import {UIDebuggerMenuItem} from './util/UIDebuggerMenuItem'; import {tracker} from '../tracker'; import {useVirtualizer, Virtualizer} from '@tanstack/react-virtual'; +import { + BigGrepContextMenuItems, + IDEContextMenuItems, +} from './fb-stubs/IDEContextMenu'; const {Text} = Typography; @@ -513,6 +517,8 @@ const ContextMenu: React.FC<{ /> )), ); + + copyItems.push(); } const focus = hoveredNode != null && focusedNodeId !== hoveredNodeId && @@ -545,8 +551,9 @@ const ContextMenu: React.FC<{ {focus} {removeFocus} - {(focus || removeFocus) && } + {(focus || removeFocus) && } {copyItems} + {hoveredNode && } )} trigger={['contextMenu']}> diff --git a/desktop/plugins/public/ui-debugger/components/fb-stubs/IDEContextMenu.tsx b/desktop/plugins/public/ui-debugger/components/fb-stubs/IDEContextMenu.tsx new file mode 100644 index 000000000..577eea27a --- /dev/null +++ b/desktop/plugins/public/ui-debugger/components/fb-stubs/IDEContextMenu.tsx @@ -0,0 +1,20 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +import React from 'react'; + +import {UINode} from '../../types'; + +export function IDEContextMenuItems(_: {node: UINode}) { + return <>; +} + +export function BigGrepContextMenuItems(_: {node: UINode}) { + return <>; +}