df22e780c9e8a304b59e6d26bc34e0f729e33e45
galt
  Thu Nov 13 17:07:54 2025 -0800
Adds a checkbox that turns on rearrangement mode automatically for all CTs generated by hgBlat. This is one of the main features of the ticket, but not all desired features. fixes #32857

diff --git src/hg/hgBlat/hgBlat.c src/hg/hgBlat/hgBlat.c
index 901fa42df3e..0816e941f76 100644
--- src/hg/hgBlat/hgBlat.c
+++ src/hg/hgBlat/hgBlat.c
@@ -30,30 +30,31 @@
 #include "portable.h"
 #include "portable.h"
 #include "dystring.h"
 #include "chromInfo.h"
 #include "net.h"
 #include "fuzzyFind.h"
 #include "chromAlias.h"
 #include "subText.h"
 
 struct cart *cart;	/* The user's ui state. */
 struct hash *oldVars = NULL;
 boolean orgChange = FALSE;
 boolean dbChange = FALSE;
 boolean allGenomes = FALSE;
 boolean allResults = FALSE;
+boolean autoRearr = FALSE;
 static long enteredMainTime = 0;
 
 
 boolean autoBigPsl = FALSE;  // DEFAULT VALUE change to TRUE in future
 
 /* for earlyBotCheck() function at the beginning of main() */
 #define delayFraction   0.5    /* standard penalty is 1.0 for most CGIs */
                                 /* this one is 0.5 */
 static boolean issueBotWarning = FALSE;
 
 struct gfResult
 /* Detailed gfServer results, this is a span of several nearby tiles, minimum 2 for dna. */
     {
     struct gfResult *next;
     /* have to multiply translated coordinates by 3 */
@@ -2120,30 +2121,40 @@
 htmlPrintf("<TEXTAREA NAME=userSeq ROWS=14 COLS=140>%s</TEXTAREA>\n", userSeq);
 printf("</TD>\n");
 printf("</TR>\n");
 
 printf("<TR>\n");
 printf("<TD COLSPAN=1 ALIGN=CENTER style='overflow:hidden;white-space:nowrap;font-size:0.9em'>\n");
 cgiMakeCheckBoxWithId("allResults", allResults, "allResults");
 printf("<span id=allResultsText>All Results (no minimum matches)</span>");
 // clicking on the All Results text clicks the checkbox.
 jsOnEventById("click", "allResultsText", 
     "document.mainForm.allResults.click();"
     "return false;"   // cancel the default
     );
 printf("</TD>\n");
 
+printf("<TD COLSPAN=1 ALIGN=CENTER style='overflow:hidden;white-space:nowrap;font-size:0.9em'>\n");
+cgiMakeCheckBoxWithId("autoRearr", autoRearr, "autoRearr");
+printf("<span id=autoRearrText>Automatically Turn on Rearrangement Mode in Custom Tracks</span>");
+// clicking on the autoRearr text clicks the checkbox.
+jsOnEventById("click", "autoRearrText", 
+    "document.mainForm.autoRearr.click();"
+    "return false;"   // cancel the default
+    );
+printf("</TD>\n");
+
 printf("<TD COLSPAN=4 style='text-align:right'>\n");
 printf("<INPUT style=' font-size:1.0em; width:100px' TYPE=SUBMIT NAME=Submit VALUE=Submit>\n");
 printf("<INPUT style='font-size:1.0em' TYPE=SUBMIT NAME=Lucky VALUE=\"I'm feeling lucky\">\n");
 printf("<INPUT style='font-size:1.0em' TYPE=SUBMIT NAME=Clear VALUE=Clear>\n");
 printf("</TD>\n");
 printf("</TR>\n");
 
 printf("<TR>\n"); 
 puts("<TD COLSPAN=5 WIDTH=\"100%\">\n" 
     "Paste in a query sequence to find its location in the\n"
     "the genome. Multiple sequences may be searched \n"
     "if separated by lines starting with '>' followed by the sequence name.\n"
     "</TD>\n"
     "</TR>\n"
 );
@@ -2408,30 +2419,31 @@
 
 cart = theCart;
 dnaUtilOpen();
 
 orgChange = sameOk(cgiOptionalString("changeInfo"),"orgChange");
 if (orgChange)
     cgiVarSet("db", hDefaultDbForGenome(cgiOptionalString("org"))); 
 getDbAndGenome(cart, &db, &organism, oldVars);
 chromAliasSetup(db);
 char *oldDb = cloneString(db);
 
 // n.b. this changes to default db if db doesn't have BLAT
 findClosestServer(&db, &organism);
 
 allResults = cartUsualBoolean(cart, "allResults", allResults);
+autoRearr  = cartUsualBoolean(cart, "autoRearr", autoRearr);
 
 /* Get sequence - from userSeq variable, or if 
  * that is empty from a file. */
 if (clearUserSeq)
     {
     cartSetString(cart, "userSeq", "");
     cartSetString(cart, "seqFile", "");
     }
 userSeq = cartUsualString(cart, "userSeq", "");
 if (isEmpty(userSeq))
     {
     userSeq = cartOptionalString(cart, "seqFile");
     }
 if (isEmpty(userSeq) || orgChange)
     {