From ad4e21ee61e763fd4de787bcd22f4525fc4cca61 Mon Sep 17 00:00:00 2001 From: jelveh Date: Mon, 6 Jul 2026 19:21:34 -0700 Subject: [PATCH] Open external apps via index_url from Apps tab When an app is external and provides an index_url, use its hostname as the tile title and store the index_url in a new data-target-link attribute. Update the click handler to open the target link in a new tab for external apps, and fall back to opening the internal /app/{name} page for others. This aligns Apps tab behavior with the Home tab and ensures external apps navigate to their website. --- src/gui/src/UI/Dashboard/TabApps.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/gui/src/UI/Dashboard/TabApps.js b/src/gui/src/UI/Dashboard/TabApps.js index dc5b01a7b..a49153f7d 100644 --- a/src/gui/src/UI/Dashboard/TabApps.js +++ b/src/gui/src/UI/Dashboard/TabApps.js @@ -46,10 +46,12 @@ function buildAppsGrid (apps) { let h = '
'; for ( const app of apps ) { let title = (app.title || app.name || '').trim(); + let targetLink = ''; // External apps (not owned by a Puter user) can report an opaque app-… id // as their title (uid === name === title); in that case show the hostname - // of index_url instead, matching the Home tab. + // of index_url instead, and open the app's website (index_url) on click — + // matching the Home tab. const appUid = app.uid || app.uuid; if ( app.external && @@ -58,11 +60,12 @@ function buildAppsGrid (apps) { app.index_url ) { title = new URL(app.index_url).hostname; + targetLink = app.index_url; } const iconUrl = app.iconUrl || window.icons['app.svg']; - h += `
`; + h += `
`; h += '
'; h += ``; h += '
'; @@ -225,12 +228,17 @@ const TabApps = { updateSearch($input); }); - // Handle app tile clicks + // Handle app tile clicks. External apps carry a target link (their + // index_url) and open the app's website directly; everything else + // opens the Puter app page — matching the Home tab. $el_window.on('click', '.myapps-tile', function (e) { e.preventDefault(); e.stopPropagation(); const appName = $(this).attr('data-app-name'); - if ( appName ) { + const targetLink = $(this).attr('data-target-link'); + if ( targetLink && targetLink !== '' ) { + window.open(targetLink, '_blank'); + } else if ( appName ) { window.open(`/app/${appName}`, '_blank'); } });