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:
committed by
Facebook GitHub Bot
parent
cc0f42be76
commit
5aa0ddb0a3
@@ -37,6 +37,10 @@ import {UIDebuggerMenuItem} from './util/UIDebuggerMenuItem';
|
|||||||
import {tracker} from '../tracker';
|
import {tracker} from '../tracker';
|
||||||
|
|
||||||
import {useVirtualizer, Virtualizer} from '@tanstack/react-virtual';
|
import {useVirtualizer, Virtualizer} from '@tanstack/react-virtual';
|
||||||
|
import {
|
||||||
|
BigGrepContextMenuItems,
|
||||||
|
IDEContextMenuItems,
|
||||||
|
} from './fb-stubs/IDEContextMenu';
|
||||||
|
|
||||||
const {Text} = Typography;
|
const {Text} = Typography;
|
||||||
|
|
||||||
@@ -513,6 +517,8 @@ const ContextMenu: React.FC<{
|
|||||||
/>
|
/>
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
copyItems.push(<BigGrepContextMenuItems node={hoveredNode} />);
|
||||||
}
|
}
|
||||||
const focus = hoveredNode != null &&
|
const focus = hoveredNode != null &&
|
||||||
focusedNodeId !== hoveredNodeId &&
|
focusedNodeId !== hoveredNodeId &&
|
||||||
@@ -545,8 +551,9 @@ const ContextMenu: React.FC<{
|
|||||||
<Menu>
|
<Menu>
|
||||||
{focus}
|
{focus}
|
||||||
{removeFocus}
|
{removeFocus}
|
||||||
{(focus || removeFocus) && <Menu.Divider />}
|
{(focus || removeFocus) && <Menu.Divider key="divider-focus" />}
|
||||||
{copyItems}
|
{copyItems}
|
||||||
|
{hoveredNode && <IDEContextMenuItems node={hoveredNode} />}
|
||||||
</Menu>
|
</Menu>
|
||||||
)}
|
)}
|
||||||
trigger={['contextMenu']}>
|
trigger={['contextMenu']}>
|
||||||
|
|||||||
@@ -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 <></>;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user