17fe5238421ff301f2b7360c96db92104e405094
chmalee
  Tue May 12 12:09:08 2026 -0700
myVariants fixes: widen drag-select dialog a bit to fit the new button, save only the actual variant position, not the variant plus padding position when making a variant out of an hgvs term, refs #33808

diff --git src/hg/hgTracks/myVariantsTrack.c src/hg/hgTracks/myVariantsTrack.c
index 31cf394a06a..016a79c73c1 100644
--- src/hg/hgTracks/myVariantsTrack.c
+++ src/hg/hgTracks/myVariantsTrack.c
@@ -125,32 +125,37 @@
     char *hgvs = jsonStringVal(hgvsJson, "hgvsInput");
     if (hgvs)
         {
         struct hgPositions *hgp = NULL;
         AllocVar(hgp);
         hgp->query = cloneString(hgvs);
         hgp->database = database;
         hgp->useAlias = FALSE;
         if (matchesHgvs(cart, database, hgvs, hgp, measureTiming))
             {
             fixSinglePos(hgp);
             if (hgp->singlePos)
                 {
                 // fill out an item AND redirect to that location somehow?
                 item->chrom = hgp->singlePos->chrom;
-                item->chromStart = item->thickStart = hgp->singlePos->chromStart;
-                item->chromEnd = item->thickEnd = hgp->singlePos->chromEnd;
+                // matchesHgvs widens the position by HGVS_FIND_PADDING on each
+                // side for visual context; the saved variant should be the exact
+                // mapped span.
+                item->chromStart = item->thickStart =
+                    hgp->singlePos->chromStart + HGVS_FIND_PADDING;
+                item->chromEnd = item->thickEnd =
+                    hgp->singlePos->chromEnd - HGVS_FIND_PADDING;
                 item->strand[0] = '.';
                 item->score = 0;
                 item->bin = binFromRange(item->chromStart, item->chromEnd);
                 item->name = hgp->singlePos->name;
                 item->ref = cloneString("");
                 item->alt = cloneString("");
                 item->db = database;
                 item->description = cloneString(hgp->singlePos->description);
                 item->project = cloneString("");
                 item->mouseover = cloneString("");
                 }
             }
         else
             {
             /* HGVS didn't match - try hgFind for position/gene resolution */