fix(nav,footer): hide Activate from sidebar, surface it in Help popover

- Collapse the Account section: Activate now lives in the same
  hidden sidebar section as Close (single ``_hidden`` group). Both
  pages stay registered with ``st.navigation`` so /activate and
  /close remain URL-routable for the Help-popover / Close-button
  links — only the sidebar entries + their section header are
  hidden via CSS.
- Help popover always exposes a license-management link now:
  ``Activate now →`` when the license is inactive, ``Manage
  license →`` when it is active and valid. Both point at
  ``./activate``.
- Extend the sidebar-hide CSS to also match ``a[href$="/activate"]``
  and the section that contains it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-18 15:39:14 +00:00
parent 9e8b4b2ca9
commit d840230e48
4 changed files with 30 additions and 19 deletions

View File

@@ -88,17 +88,20 @@ def _build_navigation() -> dict[str, list]:
default=True,
url_path="home",
)
# Activate + Close are both reached from the sticky-footer Help
# popover (Activate / Manage-license link and Close button). They
# are registered with ``st.navigation`` so ``/activate`` and
# ``/close`` remain URL-routable — pages not listed in the dict
# 404 even by direct hit — but their sidebar entries are hidden
# via CSS in ``hide_streamlit_chrome``. We group them under a
# single section header that is also hidden by that same CSS rule
# so no orphan "Account" / "Close" label is left in the sidebar.
activate = st.Page(
"pages/_Activate.py",
title=_t("nav.activate_title") or "Activate",
icon="🔑",
url_path="activate",
)
# Close is registered so it remains URL-routable (/close) for the
# sticky-footer Close button. It is hidden from the sidebar via CSS
# in ``hide_streamlit_chrome`` rather than being unregistered —
# ``st.navigation`` requires every routable page to be listed; pages
# not in the dict 404 even by direct URL hit.
close = st.Page(
"pages/99_Close.py",
title=_t("nav.close_title") or "Close",
@@ -106,15 +109,13 @@ def _build_navigation() -> dict[str, list]:
url_path="close",
)
account_header = _t("nav.section_account") or "Account"
close_header = _t("nav.section_close") or "Close"
return {
"": [home],
section_label("cleaners"): by_section["cleaners"],
section_label("transformations"): by_section["transformations"],
section_label("automations"): by_section["automations"],
account_header: [activate],
close_header: [close],
# Hidden section — see comment above + CSS in hide_streamlit_chrome.
"_hidden": [activate, close],
}