diff --git a/templates/base.html b/templates/base.html index b86e681..13a1a86 100644 --- a/templates/base.html +++ b/templates/base.html @@ -92,6 +92,11 @@ color: var(--muted); font-size: 0.92rem; } + .topnav a.active { + background: var(--primary-soft); + color: var(--primary); + border: 1px solid #d8e5ff; + } .topnav a:hover { background: var(--surface-soft); color: var(--text); @@ -363,10 +368,10 @@ diff --git a/templates/scenarios/index.html b/templates/scenarios/index.html index c9626bd..fed1b55 100644 --- a/templates/scenarios/index.html +++ b/templates/scenarios/index.html @@ -35,7 +35,7 @@
-

知识库配置

+

知识库

查看规则树、知识源和切片策略。

diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py index e06cbf8..6729490 100644 --- a/tests/test_scenarios.py +++ b/tests/test_scenarios.py @@ -161,3 +161,22 @@ def test_base_layout_exposes_four_topnav_links(client): assert reverse("documents:list") in content assert reverse("platform_ui:knowledge-base") in content assert reverse("audit:list") in content + + +def test_home_page_uses_unified_four_entry_labels(client): + response = client.get("/") + + content = response.content.decode("utf-8") + assert response.status_code == 200 + assert "

知识库

" in content + assert "

资料包

" in content + assert "

审核智能体

" in content + assert "

处理历史

" in content + + +def test_base_layout_marks_current_topnav_entry_active(client, db): + response = client.get(reverse("documents:list")) + + content = response.content.decode("utf-8") + assert response.status_code == 200 + assert 'href="/documents/" class="active"' in content