From 5d1598f5c14cb27cf65ff25c05a2642cd0d4f5ab Mon Sep 17 00:00:00 2001 From: bruce Date: Thu, 4 Jun 2026 03:27:16 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E7=BB=9F=E4=B8=80=E5=9B=9B=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E5=AF=BC=E8=88=AA=E5=BD=93=E5=89=8D=E6=80=81=E4=B8=8E?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=85=A5=E5=8F=A3=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/base.html | 13 +++++++++---- templates/scenarios/index.html | 2 +- tests/test_scenarios.py | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) 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