Fix empty header button containers and bump to 0.5.2

This commit is contained in:
snw 2026-10-25 18:19:30 +03:00
parent f7811cd999
commit 0e1660970e
4 changed files with 8 additions and 5 deletions

View file

@ -1,3 +1,3 @@
"""Single source of truth for the SharedDocsLib package version.""" """Single source of truth for the SharedDocsLib package version."""
__version__ = "0.5.1" __version__ = "0.5.2"

View file

@ -371,6 +371,9 @@
} }
container.append(link); container.append(link);
}); });
// Hide the whole block, including its border and flex spacing, when empty.
// Re-evaluate after rendering so invalid buttons and live updates work too.
container.style.display = container.childElementCount ? "" : "none";
} }
function assetDataUri(name) { function assetDataUri(name) {

View file

@ -44,7 +44,7 @@
<section class="desktop-main"> <section class="desktop-main">
<aside class="desktop-sidebar"> <aside class="desktop-sidebar">
<nav id="desktop-header-buttons" class="sidebar-header-buttons" aria-label="⋯"></nav> <nav id="desktop-header-buttons" class="sidebar-header-buttons" aria-label="⋯" style="display: none"></nav>
<nav id="desktop-page-tree" class="page-tree" aria-label="≡"></nav> <nav id="desktop-page-tree" class="page-tree" aria-label="≡"></nav>
</aside> </aside>
@ -62,7 +62,7 @@
<section id="mobile-menu-view" class="mobile-view mobile-menu-view"> <section id="mobile-menu-view" class="mobile-view mobile-menu-view">
<h1 id="mobile-site-title" class="mobile-site-title">{{DOCSLIB_TITLE}}</h1> <h1 id="mobile-site-title" class="mobile-site-title">{{DOCSLIB_TITLE}}</h1>
<nav id="mobile-header-buttons" class="mobile-header-buttons" aria-label="⋯"></nav> <nav id="mobile-header-buttons" class="mobile-header-buttons" aria-label="⋯" style="display: none"></nav>
<button id="mobile-theme-button" class="mobile-theme-button glyph-button" aria-label="◐"><span id="mobile-theme-icon">☀</span></button> <button id="mobile-theme-button" class="mobile-theme-button glyph-button" aria-label="◐"><span id="mobile-theme-icon">☀</span></button>
<nav id="mobile-page-tree" class="page-tree mobile-page-tree" aria-label="≡"></nav> <nav id="mobile-page-tree" class="page-tree mobile-page-tree" aria-label="≡"></nav>
</section> </section>

View file

@ -121,7 +121,7 @@ def test_all_endpoints_and_self_contained_build(tmp_path):
assert html_response.status_code == 200 assert html_response.status_code == 200
assert "http://127.0.0.1:9000/manifest.json" in html assert "http://127.0.0.1:9000/manifest.json" in html
assert "http://127.0.0.1:9000/version" in html assert "http://127.0.0.1:9000/version" in html
assert 'globalThis.COMPILED_FROM_VERSION = "0.5.1";' in html assert f'globalThis.COMPILED_FROM_VERSION = "{__version__}";' in html
assert ".content { --custom-test: yes; }" in html assert ".content { --custom-test: yes; }" in html
assert r'document.body.dataset.customTest = \"yes\";' in html assert r'document.body.dataset.customTest = \"yes\";' in html
assert 'id="docslib-loading"' in html assert 'id="docslib-loading"' in html
@ -287,7 +287,7 @@ def test_all_endpoints_and_self_contained_build(tmp_path):
def test_build_writes_static_bundle(tmp_path): def test_build_writes_static_bundle(tmp_path):
assert __version__ == "0.5.1" assert __version__ == "0.5.2"
@Page("1", "Static page") @Page("1", "Static page")
def static_page(): def static_page():