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
This commit is contained in:
Luke De Feo
2023-07-10 09:22:39 -07:00
committed by Facebook GitHub Bot
parent cc0f42be76
commit 5aa0ddb0a3
2 changed files with 28 additions and 1 deletions

View File

@@ -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(<BigGrepContextMenuItems node={hoveredNode} />);
}
const focus = hoveredNode != null &&
focusedNodeId !== hoveredNodeId &&
@@ -545,8 +551,9 @@ const ContextMenu: React.FC<{
<Menu>
{focus}
{removeFocus}
{(focus || removeFocus) && <Menu.Divider />}
{(focus || removeFocus) && <Menu.Divider key="divider-focus" />}
{copyItems}
{hoveredNode && <IDEContextMenuItems node={hoveredNode} />}
</Menu>
)}
trigger={['contextMenu']}>

View File

@@ -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 <></>;
}