diff --git a/meshchatx/meshchat.py b/meshchatx/meshchat.py index 01d23ce..86e752b 100644 --- a/meshchatx/meshchat.py +++ b/meshchatx/meshchat.py @@ -13110,6 +13110,15 @@ class ReticulumMeshChat: self.config.nomad_micron_wasm_enabled.set( self._parse_bool(data["nomad_micron_wasm_enabled"]), ) + if not self.config.nomad_micron_wasm_enabled.get(): + self.config.nomad_micron_default_engine.set("js") + + if "nomad_micron_default_engine" in data: + if self.config.nomad_micron_wasm_enabled.get(): + raw = str(data["nomad_micron_default_engine"] or "").strip().lower() + self.config.nomad_micron_default_engine.set( + "wasm" if raw == "wasm" else "js" + ) if "nomad_default_page_path" in data: from meshchatx.src.backend.page_node import is_allowed_page_filename @@ -14592,6 +14601,8 @@ class ReticulumMeshChat: "nomad_render_html_enabled": ctx.config.nomad_render_html_enabled.get(), "nomad_render_plaintext_enabled": ctx.config.nomad_render_plaintext_enabled.get(), "nomad_micron_wasm_enabled": ctx.config.nomad_micron_wasm_enabled.get(), + "nomad_micron_default_engine": ctx.config.nomad_micron_default_engine.get() + or "js", "nomad_default_page_path": ctx.config.nomad_default_page_path.get(), "local_message_auto_delete_enabled": ctx.config.local_message_auto_delete_enabled.get(), "local_message_auto_delete_value": ctx.config.local_message_auto_delete_value.get(), diff --git a/meshchatx/src/backend/config_manager.py b/meshchatx/src/backend/config_manager.py index d1f595c..23b1a77 100644 --- a/meshchatx/src/backend/config_manager.py +++ b/meshchatx/src/backend/config_manager.py @@ -463,7 +463,12 @@ class ConfigManager: self.nomad_micron_wasm_enabled = self.BoolConfig( self, "nomad_micron_wasm_enabled", - False, + True, + ) + self.nomad_micron_default_engine = self.StringConfig( + self, + "nomad_micron_default_engine", + "js", ) self.nomad_default_page_path = self.StringConfig( self, diff --git a/meshchatx/src/frontend/components/archives/ArchivesPage.vue b/meshchatx/src/frontend/components/archives/ArchivesPage.vue index 043fc36..e8b6904 100644 --- a/meshchatx/src/frontend/components/archives/ArchivesPage.vue +++ b/meshchatx/src/frontend/components/archives/ArchivesPage.vue @@ -273,21 +273,25 @@ export default { return isMicronWasmBundled() && (GlobalState.config || {}).nomad_micron_wasm_enabled === true; }, nomadMicronWasmActive() { + const engineWasm = (GlobalState.config?.nomad_micron_default_engine || "js") === "wasm"; return ( this.nomadMicronWasmFeatureEffective && this.nomadMicronWasmReady === true && - typeof globalThis.micronConvert === "function" + typeof globalThis.micronConvert === "function" && + engineWasm ); }, nomadRenderOptions() { const c = GlobalState.config || {}; const hash = this.viewingArchive?.destination_hash || null; + const engineWasm = (c.nomad_micron_default_engine || "js") === "wasm"; return { renderMarkdown: c.nomad_render_markdown_enabled !== false, renderHtml: c.nomad_render_html_enabled !== false, renderPlaintext: c.nomad_render_plaintext_enabled !== false, nomadDestinationHash: hash, - nomad_micron_wasm_use: this.nomadMicronWasmFeatureEffective && this.nomadMicronWasmReady === true, + nomad_micron_wasm_use: + this.nomadMicronWasmFeatureEffective && this.nomadMicronWasmReady === true && engineWasm, }; }, selectedNode() { @@ -391,6 +395,16 @@ export default { } ); + this.$watch( + () => GlobalState.config?.nomad_micron_default_engine, + () => { + const a = this.viewingArchive; + if (a) { + this.renderedContent = this.renderFullContent(a); + } + } + ); + if (isMicronWasmBundled() && GlobalState.config?.nomad_micron_wasm_enabled === true) { preloadNomadMicronWasm().then((ok) => { this.nomadMicronWasmReady = ok === true; diff --git a/meshchatx/src/frontend/components/nomadnetwork/NomadNetworkPage.vue b/meshchatx/src/frontend/components/nomadnetwork/NomadNetworkPage.vue index fe816c7..57fecb8 100644 --- a/meshchatx/src/frontend/components/nomadnetwork/NomadNetworkPage.vue +++ b/meshchatx/src/frontend/components/nomadnetwork/NomadNetworkPage.vue @@ -163,14 +163,15 @@