3d006a7244d91a9d72260986a5741a5aa65787dc
chmalee
  Tue May 12 15:01:28 2026 -0700
Widen 'jump to position' dialog after creating a myVariants item via hgvs. Remove 'update custom track' button from hgTrackUi for myVariants tracks. Fix item clicks not working after item name update in last commit, refs #33808

diff --git src/hg/hgTracks/myVariantsTrack.c src/hg/hgTracks/myVariantsTrack.c
index 3076c344944..2f098d1408b 100644
--- src/hg/hgTracks/myVariantsTrack.c
+++ src/hg/hgTracks/myVariantsTrack.c
@@ -566,34 +566,39 @@
 struct dyString *query = sqlDyStringCreate("select * from %s where ", tableName);
 hAddBinToQueryGeneral("bin", winStart, winEnd, query);
 sqlDyStringPrintf(query, " chrom='%s' and chromStart < %d and chromEnd > %d",
         chromName, winEnd, winStart);
 if (isNotEmpty(whereExtra))
     sqlDyStringPrintf(query, " and (%-s)", whereExtra);
 struct sqlResult *sr = sqlGetResult(conn, query->string);
 dyStringFree(&query);
 char **row;
 struct dyString *mouseover = dyStringNew(0);
 while ((row = sqlNextRow(sr)) != NULL)
     {
     struct myVariants *item = myVariantsLoad(row);
     struct bed *bed;
     AllocVar(bed);
+    /* bed->name is the item identifier passed to hgc, which parses "id name"
+     * to look up the row by primary key.  myVariantsName() strips the "id "
+     * prefix for the displayed label. */
+    char buf[64];
+    safef(buf, sizeof(buf), "%u %s", item->id, item->name);
     bed->chrom = item->chrom;
     bed->chromStart = item->chromStart;
     bed->chromEnd = item->chromEnd;
-    bed->name = cloneString(item->name);
+    bed->name = cloneString(buf);
     bed->score = item->score;
     bed->strand[0] = item->strand[0];
     bed->thickStart = item->thickStart;
     bed->thickEnd = item->thickEnd;
     bed->itemRgb = item->itemRgb;
     lf = bedMungToLinkedFeatures(&bed, tdb, 9, 0, 1000, TRUE);
     dyStringClear(mouseover);
     if (item->mouseover && isNotEmpty(item->mouseover))
         lf->mouseOver = cloneString(item->mouseover);
     else
         {
         dyStringPrintf(mouseover, "%s", item->name);
         if (item->ref != NULL && isNotEmpty(item->ref))
             dyStringPrintf(mouseover, "<br>Ref: %s", item->ref);
         if (item->alt != NULL && isNotEmpty(item->alt))
@@ -650,34 +655,40 @@
     if (!db)
         return;
     char *tableName = myVariantsGetDbTable(userName);
     struct sqlConnection *conn = hAllocConn(CUSTOM_TRASH);
     myVariantsEditOrDelete(track->track, conn, tableName);
     struct dyString *whereClause = sqlDyStringCreate("db='%s'", database);
     lfList = loadMyVariantsItems(conn, tableName, track->tdb,
         dyStringCannibalize(&whereClause));
     hFreeConn(&conn);
     }
 slReverse(&lfList);
 track->items = lfList;
 }
 
 char *myVariantsName(struct track *track, void *item)
-/* Return name of one of an item to display on left side. */
+/* Return the display label, stripping the "id " prefix that lf->name carries
+ * for hgc's lookup. */
 {
 struct linkedFeatures *lf = item;
 char *name = lf->name;
+if (name == NULL)
+    return name;
+char *space = strchr(name, ' ');
+if (space != NULL)
+    return space + 1;
 return name;
 }
 
 void myVariantsDrawLeftLabels(struct track *track, int seqStart, int seqEnd,
     struct hvGfx *hvg, int xOff, int yOff, int width, int height,
     boolean withCenterLabels, MgFont *font,
     Color color, enum trackVisibility vis)
 /* Draw left label - just in dense or full mode. Needed to cope with empty space at top of track. */
 {
 int y = yOff + myVariantsExtraHeight(track);
 int fontHeight = mgFontLineHeight(font);
 if (withCenterLabels)
     y += mgFontLineHeight(font);
 if (vis == tvDense)
     hvGfxTextRight(hvg, xOff, y, width-1, fontHeight, color, font, track->shortLabel);