141f698576f7b9f88861d533c847a93153b39d05
galt
  Wed Dec 3 19:52:35 2025 -0800
Feeback from Code review with Jonathan, fixes hgFindMatches for loadGV. refs #36738

diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index b2ff0e63e98..920e46a683e 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -273,32 +273,31 @@
 int maxShade = 9;	/* Highest shade in a color gradient. */
 Color shadesOfGray[10+1];	/* 10 shades of gray from white to black
                                  * Red is put at end to alert overflow. */
 Color shadesOfBrown[10+1];	/* 10 shades of brown from tan to tar. */
 struct rgbColor brownColor = {100, 50, 0, 255};
 struct rgbColor tanColor = {255, 240, 200, 255};
 struct rgbColor guidelineColor = {220, 220, 255, 255};
 struct rgbColor multiRegionAltColor = {235, 235, 255, 255};
 struct rgbColor undefinedYellowColor = {240,240,180, 255};
 
 Color shadesOfSea[10+1];       /* Ten sea shades. */
 struct rgbColor darkSeaColor = {0, 60, 120, 255};
 struct rgbColor lightSeaColor = {200, 220, 255, 255};
 
 struct hash *hgFindMatches; /* The matches found by hgFind that should be highlighted. */
-struct hash *origHgFindMatches; /* For use with pdf mode that sets hgFindMatches = NULL.
-                                  Original searches can use for bigBedLoading, squishy pack, etc.  */
+boolean hgFindMatchesShowHighlight; /* For use with pdf mode which suppresses label highlight */
 
 struct trackLayout tl;
 
 void initTl()
 /* Initialize layout around small font and a picture about 600 pixels
  * wide. */
 {
 trackLayoutInit(&tl, cart);
 
 }
 
 static boolean isTooLightForTextOnWhite(struct hvGfx *hvg, Color color)
 /* Return TRUE if text in this color would probably be invisible on a white background. */
 {
 struct rgbColor rgbColor =  hvGfxColorIxToRgb(hvg, color);
@@ -4468,31 +4467,31 @@
 /* special process for KG, because of "hgg_prot" piggy back */
 if (sameWord(tg->table, "knownGene"))
     {
     mapName = cloneString(mapName);
     chp = strstr(mapName, "&hgg_prot");
     if (chp != NULL) *chp = '\0';
     }
 #ifndef GBROWSE
 /* special case for PCR Results (may have acc+name mapItemName): */
 else if (sameString(tg->table, PCR_RESULT_TRACK_NAME))
     mapName = pcrResultItemAccession(mapName);
 #endif /* GBROWSE */
 
 /* Only highlight if names are in the hgFindMatches hash with
    a 1. */
-highlight = (hgFindMatches != NULL &&
+highlight = (hgFindMatchesShowHighlight &&
 	     ( ((name != NULL) && (hashIntValDefault(hgFindMatches, name, 0) == 1)) ||
 	       ((mapName != NULL) &&  hashIntValDefault(hgFindMatches, mapName, 0) == 1)));
 return highlight;
 }
 
 double scaleForWindow(double width, int seqStart, int seqEnd)
 /* Return the scale for the window. */
 {
 return width / (seqEnd - seqStart);
 }
 
 boolean nextItemCompatible(struct track *tg)
 /* Check to see if we draw nextPrev item buttons on a track. */
 {
 return (withNextExonArrows && tg->nextExonButtonable && tg->nextPrevExon);
@@ -15999,18 +15998,18 @@
 /* Read from the cart the string assocated with matches and
    put the matching items into a hash for highlighting later. */
 {
 char *matchLine = NULL;
 struct slName *nameList = NULL, *name = NULL;
 matchLine = cartOptionalString(cart, "hgFind.matches");
 if(matchLine == NULL)
     return;
 nameList = slNameListFromString(matchLine,',');
 hgFindMatches = newHash(5);
 for(name = nameList; name != NULL; name = name->next)
     {
     hashAddInt(hgFindMatches, name->name, 1);
     }
 slFreeList(&nameList);
-origHgFindMatches = hgFindMatches;  // can use with pdf mode when hgFindMatches = NULL
+hgFindMatchesShowHighlight = TRUE;  // default to showing the highlight searched item label.
 }