From cbcdab5599bdcdc89de6668b3a92dbb305b60e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Luc=20Gagn=C3=A9?= Date: Mon, 2 Mar 2026 01:32:47 -0500 Subject: [PATCH 1/2] fix: focus map element on node select so keyboard shortcuts work on first click When the window did not have focus, clicking a node set currentNode but did not focus the map element. Subsequent key presses (e.g. Delete) were therefore ignored by the map's keydown handler. Adding this.map.focus() inside selectNode ensures the map is always focused after selecting a node, making keyboard shortcuts work immediately after the first click. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- VS Code/MindElixir/MindElixir.js | 2 +- Visual Studio/CodeMindMap/MindElixir/MindElixir.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VS Code/MindElixir/MindElixir.js b/VS Code/MindElixir/MindElixir.js index ff6f2f6..b6de3e3 100644 --- a/VS Code/MindElixir/MindElixir.js +++ b/VS Code/MindElixir/MindElixir.js @@ -1711,7 +1711,7 @@ const rn = function(e, t, n) { const o = S(e); return o ? this.selectNode(o) : void 0; } - e.className = "selected", e.scrollIntoView({ block: "nearest", inline: "nearest" }), this.currentNode = e, t ? this.bus.fire("selectNewNode", e.nodeObj) : this.bus.fire("selectNode", e.nodeObj, n); + e.className = "selected", e.scrollIntoView({ block: "nearest", inline: "nearest" }), this.currentNode = e, this.map.focus(), t ? this.bus.fire("selectNewNode", e.nodeObj) : this.bus.fire("selectNode", e.nodeObj, n); } }, cn = function() { this.currentNode && (this.currentNode.className = ""), this.currentNode = null, this.bus.fire("unselectNode"); diff --git a/Visual Studio/CodeMindMap/MindElixir/MindElixir.js b/Visual Studio/CodeMindMap/MindElixir/MindElixir.js index ff6f2f6..b6de3e3 100644 --- a/Visual Studio/CodeMindMap/MindElixir/MindElixir.js +++ b/Visual Studio/CodeMindMap/MindElixir/MindElixir.js @@ -1711,7 +1711,7 @@ const rn = function(e, t, n) { const o = S(e); return o ? this.selectNode(o) : void 0; } - e.className = "selected", e.scrollIntoView({ block: "nearest", inline: "nearest" }), this.currentNode = e, t ? this.bus.fire("selectNewNode", e.nodeObj) : this.bus.fire("selectNode", e.nodeObj, n); + e.className = "selected", e.scrollIntoView({ block: "nearest", inline: "nearest" }), this.currentNode = e, this.map.focus(), t ? this.bus.fire("selectNewNode", e.nodeObj) : this.bus.fire("selectNode", e.nodeObj, n); } }, cn = function() { this.currentNode && (this.currentNode.className = ""), this.currentNode = null, this.bus.fire("unselectNode"); From 9e7709abb5d9338b0533f86582996a15745453a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Luc=20Gagn=C3=A9?= Date: Mon, 2 Mar 2026 01:38:20 -0500 Subject: [PATCH 2/2] fix: add CopyWebpackPlugin to dev webpack config so MindElixir.js is copied to out/ Without this, running bundle-dev or watch did not produce out/MindElixir/MindElixir.js, causing the webview to fail to load the diagram. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- VS Code/webpack.dev.config.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/VS Code/webpack.dev.config.js b/VS Code/webpack.dev.config.js index da1340d..ac16790 100644 --- a/VS Code/webpack.dev.config.js +++ b/VS Code/webpack.dev.config.js @@ -1,4 +1,5 @@ const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { mode: 'development', @@ -35,5 +36,15 @@ module.exports = { devtool: 'source-map', optimization: { minimize: false // Keep readable for debugging - } + }, + plugins: [ + new CopyWebpackPlugin({ + patterns: [ + { + from: 'MindElixir/MindElixir.js', + to: 'MindElixir/MindElixir.js' + } + ] + }) + ] };