···1919 // Set modal flag to true
2020 params.modal = true;
21212222- console.log('Opening modal window with params:', params);
2222+ //console.log('Opening modal window with params:', params);
23232424 // Always use the IPC API
2525 if (api.window && api.window.open) {
···3939 * @returns {Promise<Object>} - Promise resolving to an object with methods to interact with the window
4040 */
4141const createWindow = async (address, params = {}) => {
4242- console.log('Creating window with params:', params);
4242+ //console.log('Creating window with params:', params);
43434444 let windowId;
4545
+23-7
index.js
···246246247247 return {
248248 publish: (source, scope, topic, msg) => {
249249- console.log('ps.pub', topic);
249249+ //console.log('ps.pub', topic);
250250251251 if (topics.has(topic)) {
252252···261261 }
262262 },
263263 subscribe: (source, scope, topic, cb) => {
264264- console.log('ps.sub', source, scope, topic);
264264+ //console.log('ps.sub', source, scope, topic);
265265266266 if (!topics.has(topic)) {
267267 topics.set(topic, new Map([ [source, cb] ]));
···323323324324 let relativePath = pathname;
325325326326- // Ugh
326326+ // Ugh, handle node_modules paths
327327+ // does this even work in packaged build?
327328 const isNode = pathname.indexOf('node_modules') > -1;
329329+328330 if (!isNode) {
329331 relativePath = path.join(host, pathname);
330332331333 // if not core, prepend core path
332334 if (host != APP_CORE_PATH) {
333335 relativePath = path.join(APP_CORE_PATH, relativePath);
336336+ }
337337+338338+ // Ugh, desparate attempt to handle `../` paths
339339+ // FIXME: Complete and utter trash
340340+ try {
341341+ const stat = fs.statSync(relativePath)
342342+ }
343343+ catch(ex) {
344344+ // file does not exist
345345+ // but maybe it's in parent dir
346346+ // b/c what the fuck is happening w/ custom
347347+ // protocols and parent-relative path resolution?!
348348+ const parts = relativePath.split(path.sep);
349349+ relativePath = parts.toSpliced(1, 1).join(path.sep);
334350 }
335351 }
336352···10361052};
1037105310381054const closeOrHideWindow = id => {
10391039- console.log('CLOSE OR HIDE WINDOW CALLED FOR ID:', id);
10551055+ //console.log('CLOSE OR HIDE WINDOW CALLED FOR ID:', id);
1040105610411057 try {
10421058 const win = BrowserWindow.fromId(id);
···10461062 }
1047106310481064 const entry = windowManager.getWindow(id);
10491049- console.log('Window entry from manager:', entry);
10651065+ //console.log('Window entry from manager:', entry);
1050106610511067 if (!entry) {
10521068 console.log('Window not found in window manager, closing directly');
···10551071 }
1056107210571073 const params = entry.params;
10581058- console.log('Window parameters:', params);
10741074+ //console.log('Window parameters:', params);
1059107510601076 // Special case for settings window - always close it on ESC
10611077 if (params.address === settingsAddress) {
···10661082 // Check if window should be hidden rather than closed
10671083 // Either keepLive or modal parameter can trigger hiding behavior
10681084 else if (params.keepLive === true || params.modal === true) {
10691069- console.log(`HIDING window ${id} (${params.address}) - modal: ${params.modal}, keepLive: ${params.keepLive}`);
10851085+ //console.log(`HIDING window ${id} (${params.address}) - modal: ${params.modal}, keepLive: ${params.keepLive}`);
10701086 win.hide();
10711087 } else {
10721088 // close any open windows this window opened