3fb0b5d2a3d9d8b4429ab8ce25cdb8e00ddccf4a chmalee Fri Feb 13 13:56:04 2026 -0800 Fix links to genark or public hubs to attach hub id onto links in the menu bar. The problem arises because when using hgGateway to connect to an assembly hub, it returns the 'genome' as the organism name which is not a valid value for the 'genome' field when used by hgTracks, refs #36535 diff --git src/hg/js/utils.js src/hg/js/utils.js index c938115bcc2..4351a59028a 100644 --- src/hg/js/utils.js +++ src/hg/js/utils.js @@ -4510,32 +4510,34 @@ } function addRecentGenomesToMenuBar() { // Retrieve recent genome selections from localStorage and add them to the "Genomes" menu heading // Tries not add duplicate genomes let stored = window.localStorage.getItem("recentGenomes"); if (!stored) return; let recentObj = JSON.parse(stored); let results = []; for (let genome of recentObj.stack) { if (recentObj.results[genome]) { let item = document.createElement("li"); let link = document.createElement("a"); // TODO: these links need to work if the result (ie: genark) does not have a db - link.href = "../cgi-bin/hgTracks?hgsid=" + getHgsid() + "&db=" + recentObj.results[genome].db + "&position=lastDbPos"; - link.textContent = recentObj.results[genome].label; + let res = recentObj.results[genome]; + dbOrGenome = 'hubUrl' in res ? res.hubName + "_" + res.db : res.db; + link.href = "../cgi-bin/hgTracks?hgsid=" + getHgsid() + "&db=" + dbOrGenome + "&position=lastDbPos"; + link.textContent = res.label; item.appendChild(link); results.push(item); } } // construct the current list of labels const labelList = []; document.querySelectorAll("#tools1 > ul > li > a").forEach( (a) => { labelList.push(a.textContent); }); // filter our list of recents against the list of "Genomes" let finalResult = results.filter( (result) => { return !labelList.includes(result.firstChild.textContent); });