From b9cddece191cb7b110029d9b7432a71d17d58183 Mon Sep 17 00:00:00 2001 From: Server <10.9.8.250@reg.snw.su> Date: Mon, 10 Aug 2026 14:09:39 +0000 Subject: [PATCH] Group header buttons and release 0.2.1 --- docslib/__init__.py | 2 +- docslib/templates/client.css | 8 +++++--- pyproject.toml | 2 +- tests/test_server.py | 5 ++++- uv.lock | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/docslib/__init__.py b/docslib/__init__.py index 89d7082..c7c059d 100644 --- a/docslib/__init__.py +++ b/docslib/__init__.py @@ -5,4 +5,4 @@ from .server import build, create_app, run from .ui import HeaderButton __all__ = ["Component", "HeaderButton", "Page", "build", "create_app", "run"] -__version__ = "0.2.0" +__version__ = "0.2.1" diff --git a/docslib/templates/client.css b/docslib/templates/client.css index a21c94c..99e1a1f 100644 --- a/docslib/templates/client.css +++ b/docslib/templates/client.css @@ -48,14 +48,15 @@ button { color: inherit; } .app-shell { --desktop-sidebar-width: clamp(270px, 25vw, 400px); display: flex; width: 100%; height: 100%; flex-direction: column; overflow: hidden; background: var(--shell); } .desktop-header { position: relative; z-index: 20; display: grid; min-height: 76px; flex: 0 0 76px; grid-template-columns: minmax(260px, 1fr) auto; align-items: center; gap: 18px; padding: 12px 20px; background: var(--shell); } .desktop-title { overflow: hidden; margin: 0; font-size: 1.55rem; font-weight: 450; line-height: 1.1; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; } -.header-link { display: block; width: 100%; padding: 6px 12px; border: 1px solid transparent; border-radius: 20px; color: var(--text); background: transparent; text-decoration: none; line-height: 1.2; transition: background .16s ease, border-color .16s ease; } +.header-link { display: block; width: 100%; padding: 6px 12px; border: 0; border-radius: 20px; color: var(--text); background: transparent; text-decoration: none; line-height: 1.2; transition: background .16s ease; } .header-link:hover { background: var(--control); } .header-link.active { color: var(--text); background: var(--active); } -.header-link:not(.active):not(:hover) { border-color: var(--border); } .desktop-main { display: flex; min-width: 0; min-height: 0; flex: 1; overflow: hidden; } .desktop-sidebar { display: flex; width: var(--desktop-sidebar-width); min-width: 0; height: 100%; flex: 0 0 var(--desktop-sidebar-width); flex-direction: column; overflow: hidden; padding: 0 18px 22px; background: var(--shell); } -.sidebar-header-buttons { display: flex; flex: 0 0 auto; flex-direction: column; gap: 4px; margin-bottom: 24px; } +.sidebar-header-buttons { display: flex; flex: 0 0 auto; flex-direction: column; gap: 4px; margin-bottom: 24px; border: 1px solid #222; border-radius: 16px; background: #111; } +.sidebar-header-buttons .header-link { color: #f4f4f4; } +.sidebar-header-buttons .header-link:hover { background: #222; } .page-tree { min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; } .desktop-sidebar > .page-tree { flex: 1; padding: 0 2px 24px; } @@ -65,6 +66,7 @@ button { color: inherit; } .tree-link:hover { background: var(--control); } .tree-link.active { background: var(--active); } .sidebar-header-buttons .header-link.active, .desktop-sidebar .tree-link.active, .mobile-menu-view .header-link.active, .mobile-menu-view .tree-link.active { color: var(--selection-text); background: var(--selection-bg); } +.sidebar-header-buttons .header-link.active { color: #050505; background: #f0f0f0; } .desktop-sidebar .tree-link.active .tree-number, .mobile-menu-view .tree-link.active .tree-number { color: var(--selection-number); } .tree-number { flex: 0 0 auto; color: var(--muted); } .tree-title { min-width: 0; overflow-wrap: anywhere; } diff --git a/pyproject.toml b/pyproject.toml index 4fe3bcf..83bcdb9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "shared-docs-lib" -version = "0.2.0" +version = "0.2.1" description = "Build self-contained, Obsidian-like documentation sites from Python functions." readme = "README.md" requires-python = ">=3.10" diff --git a/tests/test_server.py b/tests/test_server.py index fe41cce..e37dc8d 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -99,6 +99,9 @@ def test_all_endpoints_and_self_contained_build(tmp_path): assert '".".repeat(dots)' in html assert "setTimeout(placeholderTick, 5000)" in html assert '.sidebar-header-buttons .header-link:not(.active):first-child' not in html + assert "border: 1px solid transparent" not in html + assert ".sidebar-header-buttons { display: flex; flex: 0 0 auto; flex-direction: column; gap: 4px; margin-bottom: 24px; border: 1px solid #222; border-radius: 16px; background: #111; }" in html + assert ".sidebar-header-buttons .header-link.active { color: #050505; background: #f0f0f0; }" in html assert "--tree-line: #2c2c2c" in html assert "height: 44px" in html assert "refresh-expanded" in html @@ -123,7 +126,7 @@ def test_all_endpoints_and_self_contained_build(tmp_path): def test_build_writes_static_bundle(tmp_path): - assert __version__ == "0.2.0" + assert __version__ == "0.2.1" @Page("1", "Static page") def static_page(): diff --git a/uv.lock b/uv.lock index 0acddfd..c9df3b7 100644 --- a/uv.lock +++ b/uv.lock @@ -452,7 +452,7 @@ wheels = [ [[package]] name = "shared-docs-lib" -version = "0.2.0" +version = "0.2.1" source = { editable = "." } dependencies = [ { name = "fastapi" },