5915dcd2939889c51c286d540a60abef615fab77 lrnassar Fri Sep 4 13:43:35 2026 -0700 Fix new BLAT result tracks starting hidden due to stale cart visibility variables. refs #38086 Custom track ids are deterministic from the track name, so a re-created same-named BLAT result track inherited the visibility of a previously hidden and since-deleted one (the variable outlives the track). Seen with I'm feeling lucky: the user lands on hgTracks and the new result track is invisible. buildBigPsl now clears any stale visibility variable for the tracks it creates, after every block that can set hide. diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c index 0afd5b635ff..c940dc698da 100644 --- src/hg/hgc/hgc.c +++ src/hg/hgc/hgc.c @@ -27616,30 +27616,42 @@ struct customTrack *ct, *next, *keptList = NULL; for (ct = ctList; ct != NULL; ct = next) { next = ct->next; if (ct->tdb != NULL && sameOk(trackDbSetting(ct->tdb, "blatResult"), "on")) { cartRemove(cart, ct->tdb->track); /* no orphaned visibility for a reused ct_ id */ continue; /* drop it; customTracksSaveCart below writes out only the kept list */ } slAddHead(&keptList, ct); } slReverse(&keptList); ctList = keptList; } +/* Custom track ids are deterministic from the track name, so a fresh BLAT track can be assigned + * the same ct_ id as an earlier same-named track the user (or blatOldTracks=hide) hid and later + * deleted. The old visibility cart variable outlives the deleted track and would silently start + * the new track hidden (seen with "I'm feeling lucky": the user lands on hgTracks and the result + * is invisible, RM #38086). A brand-new track should always show with its declared visibility, + * so drop any stale cart variable for its id. Runs after every block above that can set "hide" + * (blatOldTracks=hide included), so ordering cannot hide the new track again. */ +struct customTrack *newCt; +for (newCt = newCts; newCt != NULL; newCt = newCt->next) + if (newCt->tdb != NULL) + cartRemove(cart, newCt->tdb->track); + theCtList = customTrackAddToList(ctList, newCts, NULL, FALSE); customTracksSaveCart(database, cart, theCtList); /* Pin this bigPsl file in the cart so hgBlat's Table view can reopen exactly these results from a * shared session (see doShareReopen in hgBlat.c) - unambiguously, even when the cart holds several * BLAT custom tracks from earlier searches. */ cartSetString(cart, "blatLastBigBed", bigBedFile); cartSetString(cart, "i", "PrintAllSequences"); hgCustom(newCts->tdb->track, NULL); if (sameOk(cartOptionalString(cart, "autoRearr"), "1")) { char snakeVar[256];