ad032e072d0427c066c425a88672288ed1b6c133
max
  Wed Jan 21 08:13:31 2026 -0800
fixes after code review and feedback from mark, refs #36978, and refs #36917

diff --git src/hg/hgTrackUi/hgTrackUi.c src/hg/hgTrackUi/hgTrackUi.c
index e40cd0e0547..b54c78ee2ce 100644
--- src/hg/hgTrackUi/hgTrackUi.c
+++ src/hg/hgTrackUi/hgTrackUi.c
@@ -2760,74 +2760,76 @@
     if (childRef == superTdb->children) // first time through
         {
         printf("<TR style='border-bottom: none'><TD style='margin-bottom:10px' NOWRAP colspan=2>\n");
 
         printf("<b>Apply visibility: </b>\n");
         printf("<select id='superSubViz' class='normalText'>\n");
         printf("<option value='hide'>Hide</option>");
         printf("<option value='dense'>Dense</option>");
         printf("<option value='squish'>Squish</option>");
         printf("<option value='pack' selected='selected'>Pack</option>");
         printf("<option value='full'>Full</option>\n");
         printf("</select>\n");
 
         printInfoIcon("The 'Apply to all' button sets all tracks below to the visibility selected on this dropdown. The 'Apply to all visible' button sets this visibility on all tracks below that are not hidden.");
 
+        // First button: set all selectors that are not on 'hide' to the current value of the top select 
+        printf("<button type='button' id='superVizApplyButton'>Apply to all visible tracks</button>\n");
+	jsOnEventById("click", "superVizApplyButton", "let newVal = $('#superSubViz').val(); $('#superTrackTable select').filter(function() { return $(this).val() !== 'hide'; }).val(newVal).trigger('change').removeClass('hiddenText').addClass('normalText'); ");
+
+        // Second button: set all selectors to the current value of the top select
         printf("<button type='button' style='margin-left: 10px' id='superVizApplyAllButton'>Apply to all</button>&nbsp;\n");
-        // set all selectors to the current value of the top select
 	jsOnEventById("click", "superVizApplyAllButton", "let newVal = $('#superSubViz').val(); $('#superTrackTable select').val(newVal).trigger('change').removeClass('hiddenText').addClass('normalText');");
         
-        // set all selectors that are not on 'hide' to the current value of the top select 
-        printf("<button type='button' id='superVizApplyButton'>Apply to all visible tracks</button>\n");
-	jsOnEventById("click", "superVizApplyButton", "let newVal = $('#superSubViz').val(); $('#superTrackTable select').filter(function() { return $(this).val() !== 'hide'; }).val(newVal).trigger('change').removeClass('hiddenText').addClass('normalText'); ");
         printf("</TD></TR>\n");
         }
     printf("<TR><TD NOWRAP>");
     if (!tdbIsDownloadsOnly(tdb))
         {
 	char id[256];
         enum trackVisibility tv =
                 hTvFromString(cartUsualString(cart, tdb->track,hStringFromTv(tdb->visibility)));
 	safef(id, sizeof id, "%s_check", tdb->track);
         printf("<INPUT style='display:none' class='subtrackCheckbox' TYPE=CHECKBOX id='%s'%s>",
                id, (tv != tvHide?" CHECKED":""));
         safef(javascript, sizeof(javascript), "superT.selChanged(this)");
         struct slPair *event = slPairNew("change", cloneString(javascript));
 
         char *onlyVis = trackDbSetting(tdb, "onlyVisibility");
         hTvDropDownClassVisOnlyAndExtra(tdb->track, tv, tdb->canPack,
                                         (tv == tvHide ? "hiddenText":"normalText"),
                                         onlyVis,
                                         event);
 
         // print a group of buttons that act like radiobuttons (see javascript lines below)
         printf("<div data-trackname='%s' class='seg-btn-group' style='margin-right:12px'>", tdb->track);
         char *trackVizStr = hStringFromTv(tv);
 
-        // vizList is e.g.  {"Hide", "Dense", "Squish", "Pack", "Full"}, but can be shorter, e.g. when canPack=false
+        // vizList is e.g.  {"hide", "dense", "squish", "pack", "full"}, but can be shorter, e.g. when canPack=false
         char **vizList = hTvGetVizArr(tv, tdb->canPack, onlyVis);
         int vizListLen = arrNullLen(vizList);
         for (int i = 0; i < vizListLen; i++) {
             char *buttonViz = vizList[i];
             // the currently active viz mode is an 'active' button = pressed
             if (strcasecmp(buttonViz, trackVizStr) == 0)
                 printf("<button class='seg-active'>");
             else
                 printf("<button>");
-            printf("%s</button>",buttonViz);
+            printf("%c%s", toupper((unsigned char)buttonViz[0]), buttonViz + 1); // upcase first letter
+            puts("</button>");
         }
-        puts("</div");
+        puts("</div>");
         
         printf("</TD>\n<TD>");
         hPrintPennantIcon(tdb);
 	safef(id, sizeof id, "%s_link", tdb->track);
         // the <select> tag is only needed to send arguments to the hgTracks CGI. It will be hidden, see below.
         printf("<A HREF='%s?%s=%s&c=%s&g=%s' id='%s'>%s</A>&nbsp;", 
                     tdbIsDownloadsOnly(tdb) ? hgFileUiName(): hTrackUiForTrack(tdb->track),
                     cartSessionVarName(), cartSessionId(cart), chromosome, cgiEncode(tdb->track), 
                     id, tdb->shortLabel);
 	jsOnEventById("click", id, "superT.submitAndLink(this);");
         }
     else
         {
         printf("<A HREF='%s?%s=%s&g=%s'>Downloads</A>",
                hgFileUiName(),cartSessionVarName(), cartSessionId(cart), cgiEncode(tdb->track));