90b8f880be12956b899d973bc565bffdc9b7ce89
jcasper
  Fri Aug 28 08:27:13 2026 -0700
Moving sort comment on the faceted composite UI, and ading a 'hide subtracks', refs #36320

diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index ad331852541..ba3f2b888ac 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -5814,30 +5814,54 @@
 }
 
 boolean compositeChildHideEmptySubtracks(struct cart *cart, struct trackDb *childTdb,
                                         char **retMultiBedFile, char **retSubtrackIdFile)
 /* Parse hideEmptySubtracks setting and check cart
  * Return TRUE if we should hide empties
  */
 {
 struct trackDb *tdb = tdbGetComposite(childTdb);
 if (!tdb)
     return FALSE;
 return compositeHideEmptySubtracks(cart, tdb, retMultiBedFile, retSubtrackIdFile);
 
 }
 
+void compositeHideEmptySubtracksUi(struct cart *cart, struct trackDb *tdb)
+/* Print the checkbox controlling the hideEmptySubtracks setting, for composites that
+ * have it.  Prints nothing for the ones that don't. */
+{
+boolean hideSubtracksDefault;
+// TODO: Gray out or otherwise suppress when in multi-region mode
+if (!compositeHideEmptySubtracksSetting(tdb, &hideSubtracksDefault, NULL, NULL))
+    return;
+char *hideLabel = "Hide empty subtracks";
+hideLabel = trackDbSettingOrDefault(tdb, SUBTRACK_HIDE_EMPTY_LABEL, hideLabel);
+printf("<p><b>%s:</b> &nbsp;", hideLabel);
+char buf[128];
+safef(buf, sizeof buf, "%s.%s", tdb->track, SUBTRACK_HIDE_EMPTY);
+boolean doHideEmpties = compositeHideEmptySubtracks(cart, tdb, NULL, NULL);
+cgiMakeCheckBox(buf, doHideEmpties);
+
+// info icon with explanatory text on mouseover
+char *info =
+    "Subtracks with no data in the browser window are hidden. Changing the browser window"
+    " by zooming or scrolling may result in display of a different selection of tracks.";
+printInfoIcon(info);
+printf("</p>");
+}
+
 static void compositeUiSubtracks(char *db, struct cart *cart, struct trackDb *parentTdb)
 // Display list of subtracks and descriptions with checkboxes to control visibility and
 // possibly other nice things including links to schema and metadata and a release date.
 {
 char buffer[SMALLBUF];
 struct trackDb *subtrack;
 
 // Get list of leaf subtracks to work with
 struct slRef *subtrackRef, *subtrackRefList = trackDbListGetRefsToDescendantLeaves(parentTdb->subtracks);
 
 membersForAll_t* membersForAll = membersForAllSubGroupsGet(parentTdb,NULL);
 sortOrder_t* sortOrder = sortOrderGet(cart, parentTdb);
 char *displaySubs = NULL;
 int subCount = slCount(subtrackRefList);
 if (subCount > LARGE_COMPOSITE_CUTOFF && membersForAll->dimensions != NULL)
@@ -9829,49 +9853,31 @@
 boolean viewsOnly = FALSE;
 
 if (primarySubtrack == NULL && !cartVarExists(cart, "ajax"))
     {
     if (trackDbSetting(tdb, "dragAndDrop") != NULL)
         jsIncludeFile("jquery.tablednd.js", NULL);
     jsIncludeFile("ajax.js",NULL);
     jsIncludeFile("hui.js",NULL);
     jsIncludeFile("subCfg.js",NULL);
     jsIncludeFile("ddcl.js", NULL);
     webIncludeResourceFile("ui.dropdownchecklist.css");
     jsIncludeFile("ui.dropdownchecklist.js",NULL);
     }
 cgiDown(0.3);
 
-boolean hideSubtracksDefault;
-// TODO: Gray out or otherwise suppress when in multi-region mode 
-if (compositeHideEmptySubtracksSetting(tdb, &hideSubtracksDefault, NULL, NULL))
-    {
-    char *hideLabel = "Hide empty subtracks";
-    hideLabel = trackDbSettingOrDefault(tdb, SUBTRACK_HIDE_EMPTY_LABEL, hideLabel);
-    printf("<p><b>%s:</b> &nbsp;", hideLabel);
-    char buf[128];
-    safef(buf, sizeof buf, "%s.%s", tdb->track, SUBTRACK_HIDE_EMPTY);
-    boolean doHideEmpties = compositeHideEmptySubtracks(cart, tdb, NULL, NULL);
-    cgiMakeCheckBox(buf, doHideEmpties);
-
-    // info icon with explanatory text on mouseover
-    char *info = 
-        "Subtracks with no data in the browser window are hidden. Changing the browser window"
-        " by zooming or scrolling may result in display of a different selection of tracks.";
-    printInfoIcon(info);
-    printf("</p>");
-    }
+compositeHideEmptySubtracksUi(cart, tdb);
 
 if (trackDbCountDescendantLeaves(tdb) < MANY_SUBTRACKS && !hasSubgroups)
     {
     if (primarySubtrack)
         compositeUiSubtracksMatchingPrimary(db, cart, tdb,primarySubtrack);
     else
         compositeUiSubtracks(db, cart, tdb);
     return;
     }
 if (fakeSubmit)
     cgiMakeHiddenVar(fakeSubmit, "submit");
 
 if (primarySubtrack == NULL)
     {
     if (subgroupingExists(tdb,"view"))