087d1f625866a7716ee70496c8ba95053ee3fbfa
chmalee
  Thu Feb 5 11:27:59 2026 -0800
Make the user confirm they actually want to disconnect from a track hub on hgTracks as the button is right next to the refresh button, refs #36704

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index 029cc5105e2..2ee94754526 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -9941,32 +9941,34 @@
                     }
                 }
 
             hPrintf("<button type='button' class=\"hgtButtonHideGroup\" data-group-name=\"%s\" "
                     "title='Hide all tracks in this group'>Hide group</button>&nbsp;",
                     group->name);
 
             if (hub || group->errMessage)
                 {
 		safef(idText, sizeof idText, "%s_%d_disconn", hubName, disconCount);
                 disconCount++;
                 hPrintf("<input name=\"hubDisconnectButton\" title='Disconnect third-party track hub and remove all tracks' "
                         "id='%s'"
                     " type=\"button\" value=\"Disconnect\">\n", idText);
 		jsOnEventByIdF("click", idText,
+                    "if (window.confirm(\"Are you sure you want to disconnect this hub? To reconnect it you will need to navigate to My Data -> Track Hubs and find the hub in the public hubs list or re-enter the URL if the hub is not listed there. Click 'OK' to continue with the disconnect, or 'Cancel' to continue browsing wit hthe hub attached.\")) {"
                     "document.disconnectHubForm.elements['hubId'].value='%s';"
-                    "document.disconnectHubForm.submit();return true;",
+                    "document.disconnectHubForm.submit();return true;"
+                    "}",
 		    hubName + strlen(hubTrackPrefix));
 
 #ifdef GRAPH_BUTTON_ON_QUICKLIFT
 		safef(idText, sizeof idText, "%s_%d_graph", hubName, graphCount);
                 graphCount++;
                 hPrintf("<input name=\"graphButton\" id='%s'"
                     " type=\"button\" value=\"Graph\">\n", idText);
 #endif
 		}
 
             hPrintf("<input type='submit' name='hgt.refresh' value='Refresh' "
                     "title='Update image with your changes. Any of the refresh buttons on this page may be used.'>\n");
             hPrintf("</td></tr></table></th>\n");
             controlGridEndRow(cg);