From 07ce3d4fcdaa6d273a203f3fbb9b6816fcd2c289 Mon Sep 17 00:00:00 2001
From: meijiali <你的邮箱@xxx.com>
Date: Fri, 3 Jul 2026 19:12:08 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=BB=E9=99=A4=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E7=BC=96=E5=8F=B7=E4=BA=95=E5=8F=B7=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/services/task_service.py | 2 +-
app/templates/items/detail.html | 2 +-
app/templates/partials/task_rows.html | 2 +-
app/templates/tasks/detail.html | 2 +-
tests/integration/test_routes.py | 14 ++++++++++----
5 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/app/services/task_service.py b/app/services/task_service.py
index dcc51b1..b7d42c0 100644
--- a/app/services/task_service.py
+++ b/app/services/task_service.py
@@ -156,7 +156,7 @@ def get_task(session: Session, task_id: str) -> Task | None:
def hydrate_task_progress(session: Session, task: Task) -> Task:
display_number = calculate_task_display_number(session, task)
task.display_number = display_number
- task.display_id = f"#{display_number}"
+ task.display_id = str(display_number)
task.created_at_label = format_datetime_minute(task.created_at)
task.scale_label = (
f"{PLATFORM_LABELS.get(task.platform, task.platform)} · "
diff --git a/app/templates/items/detail.html b/app/templates/items/detail.html
index 6daa8a1..1ab1d53 100644
--- a/app/templates/items/detail.html
+++ b/app/templates/items/detail.html
@@ -4,7 +4,7 @@
{% endblock %}
diff --git a/app/templates/partials/task_rows.html b/app/templates/partials/task_rows.html
index 4c28b71..a3eb53a 100644
--- a/app/templates/partials/task_rows.html
+++ b/app/templates/partials/task_rows.html
@@ -4,7 +4,7 @@
{% set ai_percent = rate_percent(task.analysis_success_rate) %}
- {{ task.display_id or ("#" ~ loop.index) }}
+ {{ task.display_id or loop.index }}
{% if task.is_demo %}
Demo 数据
{% endif %}
diff --git a/app/templates/tasks/detail.html b/app/templates/tasks/detail.html
index f6ca8ce..4a42675 100644
--- a/app/templates/tasks/detail.html
+++ b/app/templates/tasks/detail.html
@@ -83,7 +83,7 @@
diff --git a/tests/integration/test_routes.py b/tests/integration/test_routes.py
index 8b12a8f..f9a57f3 100644
--- a/tests/integration/test_routes.py
+++ b/tests/integration/test_routes.py
@@ -99,8 +99,9 @@ def test_index_page_uses_short_task_numbers_compact_fields_and_friendly_error_co
assert response.status_code == 200
visible_text = BeautifulSoup(response.text, "html.parser").get_text(" ")
- assert "#1" in visible_text
- assert "#2" in visible_text
+ assert " 1 " in f" {visible_text} "
+ assert " 2 " in f" {visible_text} "
+ assert "#" not in visible_text
assert first_id not in visible_text
assert second_id not in visible_text
assert "2026-07-03 10:30" in visible_text
@@ -194,11 +195,12 @@ def test_task_detail_uses_short_number_title_and_keeps_full_uuid_for_diagnostics
assert response.status_code == 200
visible_text = BeautifulSoup(response.text, "html.parser").get_text(" ")
- assert " 任务 #1 - 热榜评论分析工具" in response.text
- assert "任务 #1" in visible_text
+ assert " 任务 1 - 热榜评论分析工具" in response.text
+ assert "任务 1" in visible_text
assert "完整 ID" in visible_text
assert task_id in visible_text
assert "任务 #33333333-3333-4333-8333-333333333333" not in visible_text
+ assert "#" not in visible_text
assert "创建时间 2026-07-03 10:30" in visible_text
@@ -416,6 +418,7 @@ def test_result_pages_render_seeded_data():
assert task_response.status_code == 200
assert "热点标题" in task_response.text
+ assert "热点 1:热点标题" in BeautifulSoup(task_response.text, "html.parser").get_text(" ")
assert 'onclick="window.location.reload()"' in task_response.text
assert hotspot_response.status_code == 200
assert "热点总结" in hotspot_response.text
@@ -431,6 +434,9 @@ def test_result_pages_render_seeded_data():
assert " |