8295800d611b301861e0b6e8597e856ae96abf78
chmalee
  Mon Nov 24 16:19:31 2025 -0800
successful HGVS searches get saved into the 'recent searches' dropdown on hgTracks. the position box tries to suggest hgvs when the search term is longer than 8 characters, otherwise we assume it's a gene, refs #35984

diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index 6b70118b2b3..6497cd8565c 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -4295,30 +4295,35 @@
         if ($('#positionInput').length) {
             if (!suggestBox.initialized) { // only call init once
                 suggestBox.init(getDb(),
                             $("#suggestTrack").length > 0,
                             function (item) {
                                 if (["helpDocs", "publicHubs", "trackDb"].includes(item.type) ||
                                         item.id.startsWith("hgc")) {
                                     if (item.geneSymbol) {
                                         selectedGene = item.geneSymbol;
                                         // Overwrite item's long value with symbol after the autocomplete plugin is done:
                                         window.setTimeout($('#positionInput').val(item.geneSymbol), 0);
                                     } else {
                                         selectedGene = item.value;
                                     }
                                     window.location.assign(item.id);
+                                } else if (item.type === "hgvs") {
+                                    let newPos = genomePos.setByCoordinates(item.chrom, item.start, item.end);
+                                    dragSelect.highlightThisRegion(newPos, true, "#fcfcac");
+                                    let withPadding = genomePos.setByCoordinates(item.chrom, item.start-5, item.end+5);
+                                    $("#goButton").trigger("click");
                                 } else {
                                     genomePos.set(item.id, getSizeFromCoordinates(item.id));
                                     if ($("#suggestTrack").length && $('#hgFindMatches').length) {
                                         // Set cart variables to open the hgSuggest gene track and highlight
                                         // the chosen transcript.  These variables will be submittted by the goButton
                                         // click handler.
                                         vis.makeTrackVisible($("#suggestTrack").val());
                                         cart.addVarsToQueue(["hgFind.matches"],[$('#hgFindMatches').val()]);
                                     }
                                     $("#goButton").trigger("click");
                                 }
                             },
                             function (position) {
                                 genomePos.set(position, getSizeFromCoordinates(position));
                             }