754cf0e3c480484878009aa5ce6dd815f1126d0c
chmalee
  Fri Mar 6 15:02:34 2026 -0800
most public assembly hubs do not have blat/pcr servers available, so when a public hub has been selected from the 'recents' dropdown in the search bar on those cgis, submit their form so the backend can print a message to page telling the user we don't have blat/pcr availabel for those assemblies, refs #36535

diff --git src/hg/js/utils.js src/hg/js/utils.js
index e9c65f475b2..f2d07f87b39 100644
--- src/hg/js/utils.js
+++ src/hg/js/utils.js
@@ -4537,43 +4537,47 @@
     if (!stored) return;
     let recentObj = JSON.parse(stored);
     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 dbFromRecentItem(item) {
+    let db = item.db || item.genome;
+    if (item.hubName && item.category && item.category.startsWith('Assembly Hub'))
+        db = item.hubName + "_" + db;
+    return db;
+}
 
 function recentGenomeHref(res) {
     // 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 db = dbFromRecentItem(res);
     let url = new URL("../cgi-bin/hgTracks", window.location.href);
     url.searchParams.set("hgsid", getHgsid());
     if (res.hubUrl) {
         if (res.category && res.category.startsWith("Assembly Hub")) {
             url.searchParams.set("hubUrl", res.hubUrl);
-            if (res.hubName)
-                db = res.hubName + "_" + db;
         } else if (!res.category) {
             // in practice this shouldn't happen, but just in case:
             let msg = "recentGenomeHref: item has hubUrl but no category: " + JSON.stringify(res);
             console.warn(msg);
             writeToApacheLog(msg);
         }
     }
     url.searchParams.set("db", db);
     url.searchParams.set("position", "lastDbPos");
     return url.toString();
 }
 
 function addRecentGenomesToMenuBar() {
     // Retrieve recent genome selections from localStorage and add them to the "Genomes" menu heading
     // Tries not add duplicate genomes