fix(nav,footer): drop orphan _hidden section header, show footer on Activate

Two follow-ups to the prior sidebar/footer cleanup:

- The "_hidden" section header was still visible in the sidebar
  because Streamlit renders ``stNavSectionHeader`` as a sibling of
  ``stNavSection``, not a child — so the ``:has()`` rule on the
  section was hiding the items list but leaving the header
  (and its collapse/drilldown marker) behind. Move Activate +
  Close into the unlabeled section (key ``""``) alongside Home so
  there is no header to leak in the first place, then hide just
  the two links via ``stSidebarNavLinkContainer:has(...)`` (with
  a defensive ``a[href$=...]`` fallback for browsers without
  ``:has()`` support).
- The sticky footer was missing on ``pages/_Activate.py`` because
  the page never called ``render_sticky_footer`` — added the
  call so the Help / Close bar persists when the user follows
  the popover's Activate / Manage link.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-18 15:45:22 +00:00
parent d840230e48
commit b2449d3139
3 changed files with 27 additions and 19 deletions

View File

@@ -60,29 +60,29 @@ header[data-testid="stHeader"] {
footer {
display: none !important;
}
/* Hide the Activate + Close entries from the sidebar nav — both
/* Hide the Activate + Close entries from the sidebar nav. Both
pages stay registered (so /activate and /close remain
URL-routable) but are reached from the sticky-footer Help
popover instead of the sidebar. */
popover instead of the sidebar. They are grouped under the
unlabeled section alongside Home in ``app.py`` so hiding the
two links here leaves no orphan section header behind. We
target the LinkContainer (Streamlit's per-entry wrapper) so the
list item collapses, not just the inner anchor — otherwise the
container's spacing would still occupy a row. */
[data-testid="stSidebarNav"] [data-testid="stSidebarNavLinkContainer"]:has(a[href$="/activate"]),
[data-testid="stSidebarNav"] [data-testid="stSidebarNavLinkContainer"]:has(a[href$="/activate/"]),
[data-testid="stSidebarNav"] [data-testid="stSidebarNavLinkContainer"]:has(a[href$="/close"]),
[data-testid="stSidebarNav"] [data-testid="stSidebarNavLinkContainer"]:has(a[href$="/close/"]) {
display: none !important;
}
/* Defensive fallback for browsers without :has() support — at
least hide the anchor itself so the entry isn't clickable. */
[data-testid="stSidebarNav"] a[href$="/activate"],
[data-testid="stSidebarNav"] a[href$="/activate/"],
[data-testid="stSidebarNav"] a[href$="/close"],
[data-testid="stSidebarNav"] a[href$="/close/"] {
display: none !important;
}
/* Hide the section header that wraps those entries so no orphan
label is left above the hidden links. Streamlit tags each nav
section with ``data-testid="stNavSection"``; the :has() selector
picks only the one(s) containing those links. Modern browsers
(Chrome 105+, Safari 15.4+, Firefox 121+) all support :has();
older browsers fall back to showing the section header, which
is visually harmless. */
[data-testid="stSidebarNav"] [data-testid="stNavSection"]:has(a[href$="/activate"]),
[data-testid="stSidebarNav"] [data-testid="stNavSection"]:has(a[href$="/activate/"]),
[data-testid="stSidebarNav"] [data-testid="stNavSection"]:has(a[href$="/close"]),
[data-testid="stSidebarNav"] [data-testid="stNavSection"]:has(a[href$="/close/"]) {
display: none !important;
}
/* Reclaim top padding lost from hidden header. Slim the bottom too —
Streamlit's default leaves several rems below the last widget. */
.stAppViewBlockContainer,