chore: final Minor polish — export filename/test断言, downloadBlob 类型/清理, plan docs

address review Minors: drop redundant filename replace, assert 暂无消息,
tighten downloadBlob return type + try/finally, fix plan group time-picker wording.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-06 18:06:17 +08:00
parent 6dfed36c05
commit a66c3be00a
6 changed files with 1019 additions and 6 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ async def export_chat_html(
q = q.order_by(sa.nullslast(Message.timestamp.asc()), Message.msg_id.asc())
rows = (await session.execute(q)).scalars().all()
html = _render_chat_html(list(rows), channel, owner_account_id, peer)
safe = peer.replace("@", "_").replace("/", "_") or "all"
safe = peer or "all"
filename = f"chat-{channel}-{owner_account_id}-{safe}.html".replace("@", "_").replace("/", "_")
return Response(
content=html,
+1
View File
@@ -57,3 +57,4 @@ async def test_export_empty(make_client):
"channel": "wechat", "owner_account_id": "wx_owner", "talker_id": "none"})
assert r.status_code == 200
assert r.headers["content-type"].startswith("text/html")
assert "暂无消息" in r.text