refactor(routines): use category and short uuid for recent history representation

This commit is contained in:
Piotr Oleszczyk 2026-03-03 20:29:36 +01:00
parent 28fb74b9bf
commit 0e7a39836f

View file

@ -259,9 +259,13 @@ def _build_recent_history(session: Session) -> str:
for s in steps:
if s.product_id:
p = session.get(Product, s.product_id)
step_names.append(p.name if p else str(s.product_id))
if p:
short_id = str(p.id)[:8]
step_names.append(f"{_ev(p.category)} [{short_id}]")
else:
step_names.append(f"unknown [{str(s.product_id)[:8]}]")
elif s.action_type:
step_names.append(_ev(s.action_type))
step_names.append(f"action: {_ev(s.action_type)}")
lines.append(
f" {r.routine_date} {_ev(r.part_of_day).upper()}: {', '.join(step_names)}"
)