From 62699d6c82199d06dcc12803e7815004e55e14d2 Mon Sep 17 00:00:00 2001 From: EiSiMo Date: Thu, 23 Apr 2026 13:56:17 +0200 Subject: [PATCH] =?UTF-8?q?ui(notifications):=20=E2=82=AC/m=C2=B2=20to=20c?= =?UTF-8?q?ent=20precision,=20link=20whole=20address=20to=20Maps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - sqm_price now renders with 2 decimals + German comma separator (e.g. "(12,35 €/m²)" instead of "(12 €/m²)"). - Map link covers BOTH address lines, not just the street. Telegram Markdown can't span link text across newlines, so each line gets its own [text](gmaps_url) — same URL, both lines blue + clickable, layout stays two-line. Co-Authored-By: Claude Opus 4.7 (1M context) --- web/notifications.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/notifications.py b/web/notifications.py index 2ead525..484e037 100644 --- a/web/notifications.py +++ b/web/notifications.py @@ -118,7 +118,8 @@ def on_match(user_id: int, flat: dict) -> None: rent_str = _fmt_num(rent) if sqm_price: - rent_str += f" ({sqm_price:.0f} €/m²)" + # German-style decimal separator, rounded to the cent. + rent_str += f" ({sqm_price:.2f} €/m²)".replace(".", ",") body = ( f"{line1}\n{line2}\n" @@ -129,8 +130,14 @@ def on_match(user_id: int, flat: dict) -> None: f"Original: {link}\n" f"lazyflat: {deep_link}" ) + # Telegram Markdown can't span link text across newlines, so emit two + # separate links that share the same Google Maps URL — both lines render + # blue + clickable, layout stays two-line. + addr_md = f"[{line1}]({gmaps})" + if line2: + addr_md += f"\n[{line2}]({gmaps})" md = ( - f"[{line1}]({gmaps})\n{line2}\n" + f"{addr_md}\n" f"Miete: {rent_str}\n" f"Fläche: {_fmt_num(size)}\n" f"Zimmer: {_fmt_num(rooms)}\n"