From 5b824fb745d75b5aa2ae9ffb33d9bce98267351d Mon Sep 17 00:00:00 2001 From: jelveh Date: Wed, 8 Jul 2026 22:33:13 -0700 Subject: [PATCH] Extract resolveTileDisplay and broaden app search Move logic that determines a tile's displayed title and target link into resolveTileDisplay (use hostname/index_url for external apps) and have buildTileHtml consume it. Expose data-target-link on tiles. Update app search to match the displayed title, raw title, name, and uid so queries find website-shortcut tiles and external apps consistently (matching Home tab behavior). --- src/gui/src/UI/Dashboard/TabApps.js | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/gui/src/UI/Dashboard/TabApps.js b/src/gui/src/UI/Dashboard/TabApps.js index 0ce36f231..d739182d9 100644 --- a/src/gui/src/UI/Dashboard/TabApps.js +++ b/src/gui/src/UI/Dashboard/TabApps.js @@ -32,14 +32,14 @@ const APP_NAMES_NO_UNINSTALL = new Set([ * along with this program. If not, see . */ -function buildTileHtml (app) { +// 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, and open the app's website (index_url) on click — +// matching the Home tab. +function resolveTileDisplay (app) { 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, and open the app's website (index_url) on click — - // matching the Home tab. const appUid = app.uid || app.uuid; if ( app.external && @@ -51,6 +51,11 @@ function buildTileHtml (app) { targetLink = app.index_url; } + return { title, targetLink }; +} + +function buildTileHtml (app) { + const { title, targetLink } = resolveTileDisplay(app); const iconUrl = app.iconUrl || window.icons['app.svg']; let h = `
`; @@ -389,10 +394,16 @@ const TabApps = { let list = this._apps; if ( query ) { + // Match the same values the tiles expose as data-app-name, + // data-app-title (the displayed title, e.g. the hostname for + // website shortcuts), and data-app-uid. list = list.filter(app => { - const title = (app.title || '').toLowerCase(); + const title = resolveTileDisplay(app).title.toLowerCase(); + const rawTitle = (app.title || '').toLowerCase(); const name = (app.name || '').toLowerCase(); - return title.includes(query) || name.includes(query); + const uid = String(app.uid || app.uuid || '').toLowerCase(); + return title.includes(query) || rawTitle.includes(query) + || name.includes(query) || uid.includes(query); }); }