c7fcdde6db52ba01fbabfa695b49205bf7261a33
max
  Tue Aug 4 07:40:32 2026 -0700
hgBlat/hgc: QA fixes for the new BLAT table view and alignment page

Address Gerardo's QA findings on the new BLAT UI:
- Table view: label each hit with its own query (new Query column +
"Queries" count in the summary) when the search has multiple queries,
reading cfg.multiQuery / hit.qName from the payload.
- Table view: strip the "hub_NNN_" prefix from the Assembly field so hub
assemblies no longer show a doubled prefix.
- Alignment page: strip the same prefix from the organism in the page title
for non-GenArk assembly hubs (blatAsmLabel fallback path).
- Table view: do not pre-select hit #1; show a prompt until the user clicks
a row, since top hits are often tied.
- Table view: add a divider between the Browser / New tab / Alignment links.
- Alignment page: sidebar link now reads "Side by Side Alignment" to match
the section heading.
- Alignment page: comma-format coordinates and base counts in the summary,
matching the table view and the rest of the browser.

refs #37893

diff --git src/hg/hgBlat/hgBlat.c src/hg/hgBlat/hgBlat.c
index 2161cdbb03f..807d24e78dd 100644
--- src/hg/hgBlat/hgBlat.c
+++ src/hg/hgBlat/hgBlat.c
@@ -595,32 +595,34 @@
 /* "Table" output mode: emit the hit data as an inline JSON object plus an empty container, and let
  * hgBlat.js build the UI (summary strip, DataTable with identity/coverage bars, detail panel).
  * All presentation lives in hgBlat.js; this function only assembles data.
  * On a fresh search the per-hit "Alignment details" links go to hgc's htcUserAli (which reads the
  * ephemeral trash .pslx/.fa); on a shared-link reopen (pslName NULL) there is no trash, so they go
  * to htcBlatAlign instead, which rebuilds each alignment from the durable bigPsl custom track. */
 {
 struct psl *psl;
 jsIncludeDataTablesLibs();
 jsIncludeFile("hgBlat.js", NULL);
 
 struct jsonWrite *jw = jsonWriteNew();
 jsonWriteObjectStart(jw, NULL);
 
 jsonWriteObjectStart(jw, "config");
-jsonWriteString(jw, "db", database);
-jsonWriteString(jw, "organism", organism);
+/* For assembly/GenArk hubs the internal names carry a "hub_NNN_" prefix; drop it so the Assembly
+ * field reads cleanly (and doesn't show the prefix twice), matching the BLAT Results page title. */
+jsonWriteString(jw, "db", trackHubSkipHubName(database));
+jsonWriteString(jw, "organism", trackHubSkipHubName(organism));
 jsonWriteString(jw, "queryName", pslList->qName);
 jsonWriteNumber(jw, "querySize", pslList->qSize);
 jsonWriteNumber(jw, "hitCount", slCount(pslList));
 jsonWriteBoolean(jw, "multiQuery", pslListMultiQuery(pslList));
 jsonWriteBoolean(jw, "hasLocus", locusConn != NULL);
 /* Sharing a link only makes sense when a durable bigPsl custom track was made from the results
  * (autoBigPsl); otherwise there is nothing for the shared session to reopen from. */
 jsonWriteBoolean(jw, "canShare", autoBigPsl);
 /* The classic "Old BLAT result page" view re-reads the trash .pslx from the current search, so it
  * is only offered on a fresh search (pslName set), not on a shared-link reopen rebuilt from the
  * durable custom track (where the trash files may be long gone). */
 jsonWriteBoolean(jw, "canOldPage", pslName != NULL);
 jsonWriteString(jw, "hgsid", cartSessionId(cart));
 jsonWriteStringf(jw, "newSearchUrl", "hgBlat?db=%s&%s", database, uiState);
 char *posStr = cartOptionalString(cart, "position");