diff --git a/app/tree/index.py b/app/tree/index.py index ece2c8d..a4bade8 100644 --- a/app/tree/index.py +++ b/app/tree/index.py @@ -20,6 +20,7 @@ from __future__ import annotations import base64 +import dataclasses import json from dataclasses import dataclass, field from datetime import datetime @@ -367,6 +368,11 @@ class L1Node: state_changes=l2d["card"]["state_changes"], subtitle=l2d["card"].get("subtitle", ""), ) + # 旧格式兼容:L2 无 card subtitle 时从 L3 children 聚合 + if not l2_card.subtitle: + l3_subs = [n.card.subtitle for n in l3_nodes if n.card.subtitle] + if l3_subs: + l2_card = dataclasses.replace(l2_card, subtitle="\n".join(l3_subs)) tr2 = l2d.get("time_range") l2_nodes.append( L2Node(