19ffb1f276b652de2cd1f593c19bd25630ed6b59
braney
  Mon Aug 10 17:17:28 2026 -0700
hgTracks: let "Save Color" honor the "don't show this again" checkbox, refs #38071

Every other button in the Drag-and-select dialog clears
hgTracks.enableHighlightingDialog when the box is checked, and stores it.  Save
Color did neither, so the box was ignored: the close handler removed the dialog
as though it had been turned off, and then it came back on the next drag.

saveHlColor only writes prevHlColor, so send the setting alongside it the way
"Zoom In" already does.

diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index b390265ae5f..6de3da06ce7 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -2347,32 +2347,40 @@
                 if ($("#disableDragHighlight").prop('checked'))
                     hgTracks.enableHighlightingDialog = false;
                 var hlColor = $("#hlColorInput").val();
                 dragSelect.highlightThisRegion(newPosition, false, hlColor);
                 $(this).dialog("close");
             },
             "Add Highlight": function() {
                 // Highlight selection
                 if ($("#disableDragHighlight").prop('checked'))
                     hgTracks.enableHighlightingDialog = false;
                 var hlColor = $("#hlColorInput").val();
                 dragSelect.highlightThisRegion(newPosition, true, hlColor);
                 $(this).dialog("close");
             },
             "Save Color": function() {
+                // Honor "don't show this again", the same as every other button here.
+                // The close handler already removes the dialog when the box is checked, but
+                // saveHlColor only writes prevHlColor, so without this the setting is never
+                // stored and the dialog comes back on the next drag.
+                if ($("#disableDragHighlight").prop('checked'))
+                    hgTracks.enableHighlightingDialog = false;
                 var hlColor = $("#hlColorInput").val();
                 dragSelect.saveHlColor( hlColor );
+                if (!hgTracks.enableHighlightingDialog)
+                    cart.setVarsObj({'enableHighlightingDialog': 0 },null,false); // async=false
                 $(this).dialog("close");
             }
         };
         if (typeof doMyVariants !== 'undefined' && doMyVariants) {
             dragSelectButtons["Add Annotation"] = function() {
                 let data = {};
                 let pos = parsePosition(newPosition);
                 data.chrom = pos.chrom;
                 data.start = data.thickStart = pos.start.toString();
                 data.end = data.thickEnd = pos.end.toString();
                 data.score = "0";
                 data.strand = ".";
                 data.color = $("#hlColorInput").val();
                 data.name = "";
                 data.description = "";