From 3de82a7ef06982dbc1919ada9571c05f1b8e877b Mon Sep 17 00:00:00 2001 From: Server <10.9.8.250@reg.snw.su> Date: Mon, 10 Aug 2026 14:22:42 +0000 Subject: [PATCH] Make sidebar actions theme-aware and release 0.2.2 --- docslib/__init__.py | 2 +- docslib/templates/client.css | 7 +++---- pyproject.toml | 2 +- tests/test_server.py | 8 +++++--- uv.lock | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docslib/__init__.py b/docslib/__init__.py index c7c059d..05215f1 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.1" +__version__ = "0.2.2" diff --git a/docslib/templates/client.css b/docslib/templates/client.css index 99e1a1f..d3a761d 100644 --- a/docslib/templates/client.css +++ b/docslib/templates/client.css @@ -54,9 +54,9 @@ button { color: inherit; } .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; border: 1px solid #222; border-radius: 16px; background: #111; } -.sidebar-header-buttons .header-link { color: #f4f4f4; } -.sidebar-header-buttons .header-link:hover { background: #222; } +.sidebar-header-buttons { display: flex; flex: 0 0 auto; flex-direction: column; gap: 4px; margin-bottom: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); } +.sidebar-header-buttons .header-link { color: var(--text); } +.sidebar-header-buttons .header-link:hover { background: var(--control); } .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; } @@ -66,7 +66,6 @@ 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 83bcdb9..ce2b372 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "shared-docs-lib" -version = "0.2.1" +version = "0.2.2" 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 e37dc8d..85f68f4 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -100,8 +100,10 @@ def test_all_endpoints_and_self_contained_build(tmp_path): 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 ".sidebar-header-buttons { display: flex; flex: 0 0 auto; flex-direction: column; gap: 4px; margin-bottom: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }" in html + assert ".sidebar-header-buttons .header-link { color: var(--text); }" in html + assert ".sidebar-header-buttons .header-link:hover { background: var(--control); }" in html + assert ".sidebar-header-buttons .header-link.active { color: #050505; background: #f0f0f0; }" not in html assert "--tree-line: #2c2c2c" in html assert "height: 44px" in html assert "refresh-expanded" in html @@ -126,7 +128,7 @@ def test_all_endpoints_and_self_contained_build(tmp_path): def test_build_writes_static_bundle(tmp_path): - assert __version__ == "0.2.1" + assert __version__ == "0.2.2" @Page("1", "Static page") def static_page(): diff --git a/uv.lock b/uv.lock index c9df3b7..03498a3 100644 --- a/uv.lock +++ b/uv.lock @@ -452,7 +452,7 @@ wheels = [ [[package]] name = "shared-docs-lib" -version = "0.2.1" +version = "0.2.2" source = { editable = "." } dependencies = [ { name = "fastapi" },