mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-20 16:01:18 +02:00
Add context menu support and Vim keybindings in Sidebar and Tree components
This commit is contained in:
@@ -104,7 +104,7 @@ function Sidebar({ className }: { className?: string }) {
|
||||
}
|
||||
|
||||
// Select the 0th index on focus if none selected
|
||||
focusActiveItem();
|
||||
setTimeout(focusActiveItem, 100);
|
||||
});
|
||||
|
||||
const handleDragEnd = useCallback(async function handleDragEnd({
|
||||
@@ -360,6 +360,12 @@ const sidebarTreeAtom = atom<TreeNode<SidebarModel> | null>((get) => {
|
||||
});
|
||||
|
||||
const actions = {
|
||||
'sidebar.context_menu': {
|
||||
enable: isSidebarFocused,
|
||||
cb: async function (tree: TreeHandle) {
|
||||
tree.showContextMenu();
|
||||
},
|
||||
},
|
||||
'sidebar.selected.delete': {
|
||||
enable: isSidebarFocused,
|
||||
cb: async function (_: TreeHandle, items: SidebarModel[]) {
|
||||
|
||||
Reference in New Issue
Block a user