3bcf86a0995e5a15ad5a2a8ff5533f48d5d43653 max Fri Sep 18 07:15:28 2026 -0700 hgTracks: tell the user what a session load just did, refs #38157 #Preview2 week - bugs introduced now will need a build patch to fix When a saved session is loaded it replaces the whole cart, and the view the user had before is gone without a word. hgTracks now shows a note on that page saying which session was opened, who saved it and when, the session description if it has one, and that the previous configuration cannot be brought back. Only on that one page: cart.c leaves a marker when a full (non-merge) session load happens and hgTracks takes it out again. Recommended track sets merge into the cart, so they get no note. The note uses a new notifBoxOnce() in utils.js, which has only a Close button: a one-page message does not need 'Don't show again'. Its .notifBoxOnce style is the card grey of the new Sessions page, and it sets no width, so unlike the other notifBoxes it cannot stick out of the window. Switch off with sessionLoadNotice=off in hg.conf. diff --git src/hg/lib/cart.c src/hg/lib/cart.c index 64ecbb3b31d..e239216bf5c 100644 --- src/hg/lib/cart.c +++ src/hg/lib/cart.c @@ -954,30 +954,36 @@ cartParseOverHashExt(cart, row[1], TRUE); cartSetString(cart, sessionVar, hgsid); if (sessionTableString != NULL) cartSetString(cart, hgSessionTableState, sessionTableString); if (pubSessionsTableString != NULL) cartSetString(cart, hgPublicSessionsTableState, pubSessionsTableString); if (oldVars) hashEmpty(oldVars); /* Overload settings explicitly passed in via CGI (except for the * command that sent us here): */ loadCgiOverHash(cart, oldVars); if (isNotEmpty(actionVar)) cartRemove(cart, actionVar); hDisconnectCentral(&conn2); + /* A full (non-merge) load just threw away whatever the user had in the browser before. + * Leave a marker so that the next hgTracks page can say what was opened and that the + * old view is gone. A merge keeps the current view, so it needs no note. */ + if (!merge) + cartSetString(cart, hgsSessionJustLoaded, "on"); + /* When loading another user's session, strip accepted-share cart vars * so we don't carry shares from the session owner into the current user's * cart. Shares are per-user; they should be re-accepted via share link. */ char *userName = wikiLinkUserName(); if (cfgOptionBooleanDefault("doMyVariants", FALSE) && (userName == NULL || !sameString(sessionOwner, userName))) { cartRemoveLike(cart, MYVAR_SHARED_CART_PREFIX "*"); } } else errAbort("Sharing has not been enabled for user %s's session %s.", sessionOwner, sessionName); } else