d84555710af610b002bd9492ca0702d622c00bc8
chmalee
  Thu Mar 5 11:07:17 2026 -0800
Oops I overcorrected when fixing 3fb0b5d2a3d, which led to weird conditions where sometimes a genark hub would show up under 'Connected Hubs' depending on where you searched for the genark genome. When creating links to genarks, we only need the db= parameter, as fixUpDb in the cart code handles connecting to genarks transparently. So remove explicit hubUrl and genome parameters from genark links in the menu bar and in hgSearch ajax calls, refs #36535

diff --git src/hg/js/utils.js src/hg/js/utils.js
index f08bf39e019..13d1a418f1a 100644
--- src/hg/js/utils.js
+++ src/hg/js/utils.js
@@ -4535,49 +4535,38 @@
     let newStack = [];
     for (let key of recentObj.stack) {
         let item = recentObj.results[key];
         if (item && item.hubUrl === hubUrl) {
             delete recentObj.results[key];
         } else {
             newStack.push(key);
         }
     }
     recentObj.stack = newStack;
     window.localStorage.setItem("recentGenomes", JSON.stringify(recentObj));
 }
 
 
 function recentGenomeHref(res) {
-    // Build an hgTracks URL for a recent genome entry. GenArk assemblies need
-    // db=, genome=, and a fully qualified hubUrl= so that fixUpDb() and
-    // hubConnectLoadHubs() in cartNew() can connect the hub. UCSC native
-    // databases just need db=.
+    // Build an hgTracks URL for a recent genome entry. GenArk assemblies are
+    // handled transparently by fixUpDb() in cartNew() when given just db= with
+    // the accession. UCSC native databases also just need db=.
     let db = res.db || res.genome;
     let url = new URL("../cgi-bin/hgTracks", window.location.href);
     url.searchParams.set("hgsid", getHgsid());
     url.searchParams.set("db", db);
     url.searchParams.set("position", "lastDbPos");
-    if (res.hubUrl) {
-        // The findGenome API returns a relative hubUrl (e.g. GCA/.../hub.txt)
-        // while hgGateway stores it already prefixed (e.g. /gbdb/genark/GCA/.../hub.txt).
-        let hubUrl = res.hubUrl;
-        if (!hubUrl.startsWith("/gbdb/genark/")) {
-            hubUrl = "/gbdb/genark/" + hubUrl;
-        }
-        url.searchParams.set("genome", db);
-        url.searchParams.set("hubUrl", window.location.origin + hubUrl);
-    }
     return url.toString();
 }
 
 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");