d3d46ec513c57c6f94c97faa8f5cfcbdd644da22
max
  Mon Aug 10 09:30:56 2026 -0700
hgc: add a 'Back to Genome Browser' button to the non-BLAT alignment pages, refs #37893

The modern alignment page in its neutral (non-BLAT) form had an empty title bar
on the right and no obvious way back to the browser.  Add a 'Back to Genome
Browser >' button that returns to hgTracks at this alignment's own location
(db + chrom:start-end + hgsid) - the plain-track-click counterpart of the
hgBlat context's 'Back to results'.

diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index 4eeff009ddd..fef34392649 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -9132,39 +9132,44 @@
        "#blatAlnContent h4:first-child{margin-top:0}"          /* Alignment Summary flush at top */
        "#blatAlnContent h4 a{color:#fff}"
        /* undo bootstrap.css (pulled in by webStartGbNoBanner's gbHeader) on the sequence blocks:
         * it would give <pre> a grey box, a border and word-break that mangles the alignment */
        "#blatAlnContent pre{margin:0; padding:2px 0 12px; line-height:1.4; background:none; border:0;"
        " border-radius:0; color:#374a5e; white-space:pre; word-break:normal; word-wrap:normal}"
        /* key-value summary strip, mirroring hgBlat's .blatStrip (label over value, thin dividers) */
        ".blatAlnStrip{display:flex; align-items:center; gap:24px; flex-wrap:wrap; margin:2px 0 14px}"
        ".blatAlnStat{display:flex; flex-direction:column; gap:1px}"
        ".blatAlnStat .k{font-size:12px; color:#5b6572; font-weight:700}"
        ".blatAlnStat .v{font-size:14px; color:#1e2833; font-weight:700}"
        ".blatAlnStrip .d{width:1px; height:28px; background:#d0d0d0}"
        "</style>\n");
 
 /* gold title bar, drawn directly (no framework subheadingBar, no JS): title on the left, then (in
- * the hgBlat context only) a "Back to results" and, when a durable track backs the results, a
- * "Share a link" button. */
+ * the hgBlat context) a "Back to results" and, when a durable track backs the results, a "Share a
+ * link" button; in a plain track click, a "Back to Genome Browser" button that returns to hgTracks
+ * at this alignment's location. */
 printf("<div class='blatTitleBar'>");
 printf("<span class='blatTtl'>%s Base Alignment: %s</span>",
        blatContext ? "BLAT" : "", blatAsmLabel(database));
 printf("<span class='blatBtns'>");
 if (blatContext)
     printf("<a href='hgBlat?blatReopen=1&hgsid=%s' class='blatBtn'>"
            "\xe2\x80\xb9 Back to results</a>", cartSessionId(cart));
+else
+    printf("<a href='hgTracks?db=%s&position=%s:%d-%d&hgsid=%s' class='blatBtn'>"
+           "Back to Genome Browser \xe2\x80\xba</a>",
+           database, psl->tName, psl->tStart + 1, psl->tEnd, cartSessionId(cart));
 if (canShare)
     printf("<a href='#' id='blatShareBtn' class='blatBtn'>Share a link</a>");
 printf("</span></div>\n");
 
 /* one white panel laid out as two grid columns: a full-height "jump to" sidebar on the left, and on
  * the right an "Alignment Summary" header, the summary line, and the base-by-base alignment inlined
  * so the whole page scrolls */
 printf("<div id='blatAlnBody'>\n");
 
 printf("<div id='blatAlnContent'>\n");
 printf("<h4>Alignment summary</h4>\n");
 /* comma-format the coordinates and base counts, matching the new Table view (readable at the
  * hundreds-of-millions scale of genomic coordinates, and the convention elsewhere in the browser) */
 char tStartC[32], tEndC[32], matchC[32], qSizeC[32];
 sprintLongWithCommas(tStartC, psl->tStart + 1);