Add context menu support and Vim keybindings in Sidebar and Tree components

This commit is contained in:
Gregory Schier
2025-10-28 08:45:36 -07:00
parent 68637d24c7
commit 5b8114f6f3
4 changed files with 35 additions and 7 deletions

View File

@@ -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[]) {