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/inc/cart.h src/hg/inc/cart.h index 72ff27cc422..f7309d7baca 100644 --- src/hg/inc/cart.h +++ src/hg/inc/cart.h @@ -488,30 +488,35 @@ #define hgSessionPrefix "hgS_" #define hgPublicSessionsPrefix "hgPS_" #define dataTableStateName "DataTableState" #define hgSessionTableState hgSessionPrefix dataTableStateName #define hgPublicSessionsTableState hgPublicSessionsPrefix dataTableStateName #define hgsOtherUserName hgSessionPrefix "otherUserName" #define hgsOtherUserSessionName hgSessionPrefix "otherUserSessionName" #define hgsMergeCart hgSessionPrefix "merge" #define hgsOtherUserSessionLabel hgSessionPrefix "otherUserSessionLabel" #define hgsDoOtherUser hgSessionPrefix "doOtherUser" #define hgsLoadUrlName hgSessionPrefix "loadUrlName" #define hgsDoLoadUrl hgSessionPrefix "doLoadUrl" +// Set when a saved session has just replaced the whole cart, so that the next hgTracks page can +// tell the user what they opened and that their previous browser configuration is gone. +// hgTracks removes it as soon as it has seen it. +#define hgsSessionJustLoaded hgSessionPrefix "sessionJustLoaded" + #define namedSessionTable cartNamedSessionDbTable() void sessionTouchLastUse(struct sqlConnection *conn, char *encUserName, char *encSessionName); /* Increment namedSessionDb.useCount and update lastUse for this session. */ void cartLoadUserSession(struct sqlConnection *conn, char *sessionOwner, char *sessionName, struct cart *cart, struct hash *oldVars, char *actionVar); /* If permitted, load the contents of the given user's session, and then * reload the CGI settings (to support override of session settings). * If non-NULL, oldVars will contain values overloaded when reloading CGI. * If non-NULL, actionVar is a cartRemove wildcard string specifying the * CGI action variable that sent us here. */