6e89bb12a35c65c0607719f2aa2c7377803d09f9
max
  Fri Sep 4 14:03:07 2026 -0700
Keep the top-right Login/Share a link menu icon inside the blue bar on narrow windows.

On screens under 1100px the icon was positioned with position:fixed, which pins it
to the top of the window.  That is the top of the blue bar only on hgTracks; on
hgGateway and the home page the bar sits below the logo banner, so the icon showed
up in the white area above it.  Use position:sticky instead, which keeps the icon in
the bar on every page and still holds it at the right edge of the visible viewport
while the 1000px-wide bar is scrolled sideways.  The hardcoded background colour is
replaced by the bar's own, which is not the same on all pages.  The links now hang in
their own span so that opening the menu no longer pushes the page content down, and
the icon is left out entirely on mirrors that have no top-right links to show.

refs #38251

diff --git src/hg/htdocs/inc/globalNavBar.inc src/hg/htdocs/inc/globalNavBar.inc
index 9750f22f1bb..26644bdfd39 100644
--- src/hg/htdocs/inc/globalNavBar.inc
+++ src/hg/htdocs/inc/globalNavBar.inc
@@ -1,22 +1,23 @@
 <a href="#mainContent" class="skipNav" tabindex="-1">Skip to main content</a>
 <div id="main-menu-whole">
 
 <!-- Top-right links (Share a link, Login).  These comment placeholders are replaced at runtime by
      menuBar() in lib/web.c (CGI pages) and by hgMenubar.c (static pages).  They sit in their own
-     absolutely-positioned container at the top-right of the bar, not inside the menu list. -->
-<div id="topRightLinks"><button type="button" id="trToggle" aria-label="Menu" aria-expanded="false">&#9776;</button><!-- SHARE_LINK --><!-- LOGIN_LINK --></div>
+     own container at the top-right of the bar, not inside the menu list.  On narrow screens the
+     #trLinks span becomes a dropdown under the menu icon (see nice_menu.css). -->
+<div id="topRightLinks"><button type="button" id="trToggle" aria-label="Menu" aria-expanded="false">&#9776;</button><span id="trLinks"><!-- SHARE_LINK --><!-- LOGIN_LINK --></span></div>
 
 		<div id="main-menu"><div id="block-nice_menus-1" class="clear-block block block-nice_menus">
 
 	<div class="upcorner"></div>
 	<div class="blockbg">
 		<div class="blockcontent">
 						<div class="content">
 
 <nav aria-label="Main menu"><ul class="nice-menu nice-menu-down sf-js-enabled" id="nice-menu-1">
 
 <li class="first even" id="home"><a href="../index.html" ><span id="home-link">Home</span></a></li> 
 
 <li class="menuparent" id="tools1"><a href="../cgi-bin/hgGateway" aria-expanded="false">Genomes</a>
 	<ul style="display: none; visibility: hidden;">
 	<li class="first defaultDropdownLink"><a href="../cgi-bin/hgTracks?db=hg38&amp;position=lastDbPos">Human GRCh38/hg38</a></li>