79b7c5730a04d92ca2d917d04752ae6711ff94c7
braney
  Thu Sep 17 12:54:22 2026 -0700
hgTracks: put the denseClick feature behind an hg.conf gate, refs #38364

The hg.conf denseClick flag was a tree-wide default that a trackDb
denseClick setting overrode per track.  A track carrying denseClick on in
trackDb therefore turned the feature on wherever the code was installed,
and there was no way to hold it back from a machine.  hprcPclai and
hprc2annot already carry that line.

Make the flag a gate instead.  While it is off, which is the default, no
track gets clickable dense items whatever its trackDb says.  With the gate
on, a track opts in for itself with the trackDb setting.

Inheritance is unchanged: trackDbSettingOn calls trackDbSetting, which
walks the parent chain, so one line on a composite still covers its
subtracks.

Measured on hg38 chr2:60,000,000-80,000,000 at pix=1200, with the seven
default-on hprcPclai haplotypes in dense.  hprcPclai opts in and holds at
1249 hgc links with the gate on, 0 with it off.  simpleRepeat, which does
not opt in, drops from 1024 hgc links to 0 with the gate on, which is the
behavior the gate exists to prevent.

diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index 942d37cf089..8803bbf7e55 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -5914,37 +5914,38 @@
 boolean doButtons = (isExonNumberMapsCompatible ? FALSE: TRUE);
 
 // Convert start/end coordinates to pix
 int s = tg->itemStart(tg, item);
 int e = tg->itemEnd(tg, item);
 int sClp = (s < winStart) ? winStart : s;
 int eClp = (e > winEnd)   ? winEnd   : e;
 int x1 = round((sClp - winStart)*scale) + xOff;
 int x2 = round((eClp - winStart)*scale) + xOff;
 genericDrawNextItemStuff(tg, hvg, vis, item, scale, x2, x1, -1, y, tg->heightPer, color,
                             doButtons);
 }
 
 boolean denseClickEnabled(struct track *tg)
 /* Should a dense row of this track get one clickable map box per item, instead
- * of a single box that expands the track?  Off unless denseClick is set in
- * hg.conf, and a track can override that with a denseClick trackDb setting. */
+ * of a single box that expands the track?  The hg.conf denseClick flag is a
+ * gate over the whole feature: while it is off, which is the default, no track
+ * gets this no matter what its trackDb says.  With the gate on, a track opts in
+ * with a denseClick trackDb setting. */
 {
-char *setting = trackDbSetting(tg->tdb, "denseClick");
-if (setting != NULL)
+if (!cfgOptionBooleanDefault("denseClick", FALSE))
+    return FALSE;
 return trackDbSettingOn(tg->tdb, "denseClick");
-return cfgOptionBooleanDefault("denseClick", FALSE);
 }
 
 static void denseMapItem(struct track *tg, struct hvGfx *hvg, struct slList *item,
                          int xOff, int y, int width, double scale, char *pixelUsed)
 /* Put down a map box for one item of a dense row, so that a click on it reaches
  * the item's details page instead of expanding the track.  A dense row can hold
  * tens of thousands of items, so skip an item whose every pixel already belongs
  * to an earlier item: that box would sit under the earlier one and could never
  * be clicked.  This holds the row to at most one box per pixel. */
 {
 int s = tg->itemStart(tg, item);
 int e = tg->itemEnd(tg, item);
 int sClp = (s < winStart) ? winStart : s;
 int eClp = (e > winEnd)   ? winEnd   : e;
 int x1 = round((sClp - winStart)*scale) + xOff;