diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 879d395..5bc042b 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -589,10 +589,23 @@ fn main() {
.setup(|app| {
debug_log("Tauri setup started");
let app_data = app.path().app_data_dir().unwrap_or_default();
- let _app_data_str = clean_path(&app_data);
let vyla_files = if let Ok(appdata_env) = std::env::var("APPDATA") {
- std::path::PathBuf::from(appdata_env).join("vyla-home").join("vyla-home-files")
+ std::path::PathBuf::from(appdata_env)
+ .join("vyla-home")
+ .join("vyla-home-files")
+ } else if let Ok(_home) = std::env::var("HOME") {
+ #[cfg(target_os = "macos")]
+ let base = std::path::PathBuf::from(&home)
+ .join("Library")
+ .join("Application Support");
+ #[cfg(target_os = "linux")]
+ let base = std::path::PathBuf::from(&home)
+ .join(".local")
+ .join("share");
+ #[cfg(not(any(target_os = "macos", target_os = "linux")))]
+ let base = app_data.clone();
+ base.join("vyla-home").join("vyla-home-files")
} else {
app_data.join("vyla-home-files")
};
@@ -637,21 +650,25 @@ fn main() {
.build()?;
let (main_js, root_dir) = resolve_script_and_root(app);
+ debug_log("Searching for node binary...");
let node_bin = match find_node_binary(app) {
- Some(bin) => bin,
+ Some(bin) => {
+ debug_log(&format!("Found node binary: {}", bin));
+ bin
+ }
None => {
- let _ = window.emit(
- "error",
- serde_json::json!({
- "message": "Node.js runtime not found. Please ensure Node.js is installed or bundled correctly."
- }),
- );
+ debug_log("FATAL: No node binary found in bundle or PATH.");
+ std::thread::sleep(std::time::Duration::from_millis(600));
+ let _ = window.eval("document.getElementById('status-message').textContent='Error: Node runtime missing. Please reinstall.';");
+ let _ = window.eval("var b=document.getElementById('debug-log-box');b.style.display='block';b.textContent='Node binary not found. bin/node missing from app bundle or not executable.';");
return Ok(());
}
};
let vyla_files_str = clean_path(&vyla_files);
+ std::thread::sleep(std::time::Duration::from_millis(400));
+
let mut cmd = Command::new(&node_bin);
cmd.arg(&main_js)
.current_dir(&root_dir)
@@ -847,12 +864,12 @@ fn main() {
}
Err(e) => {
debug_log(&format!("Failed to spawn node: {}", e));
- let _ = window.emit(
- "error",
- serde_json::json!({
- "message": format!("Failed to launch backend runtime: {}", e)
- }),
+ let emsg = format!("Failed to spawn node: {}", e);
+ let js = format!(
+ "document.getElementById('status-message').textContent='Spawn Error';var b=document.getElementById('debug-log-box');b.style.display='block';b.textContent={};",
+ serde_json::to_string(&emsg).unwrap_or_default()
);
+ let _ = window.eval(&js);
}
}
diff --git a/ui/index.html b/ui/index.html
index 50a8a3d..e9d5c9f 100644
--- a/ui/index.html
+++ b/ui/index.html
@@ -271,61 +271,66 @@
console.warn("OGL Shader background failed to load (offline):", err);
}
- if (!window.__OGL_LOADED__) {
- document.body.style.background = "radial-gradient(circle at 80% 20%, #1e1b4b 0%, #050505 70%)";
- } else {
- const { Renderer, Program, Triangle, Mesh } = window.__OGL_LOADED__;
- const rayContainer = document.getElementById("side-rays");
- const settings = {
- speed: 2.5,
- rayColor1: "#EAB308",
- rayColor2: "#96c8ff",
- intensity: 2,
- spread: 2,
- origin: "top-right",
- tilt: 0,
- saturation: 1.5,
- blend: 0.75,
- falloff: 1.6,
- opacity: 1
- };
+ window.dispatchEvent(new Event('ogl-ready'));
+
- function hexToRgb(hex) {
- const match = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
- if (!match) return [1, 1, 1];
- return [
- parseInt(match[1], 16) / 255,
- parseInt(match[2], 16) / 255,
- parseInt(match[3], 16) / 255
- ];
- }
+