From 165b59e3583767d058854a42b0e8daca3ebd192d Mon Sep 17 00:00:00 2001 From: bux Date: Fri, 8 May 2026 15:54:14 +0000 Subject: [PATCH] =?UTF-8?q?agency:=20trailing=20"=20=E2=9C=93"=20suffix=20?= =?UTF-8?q?on=20picked=20button=20(visibility=20fix)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was: leading "✓ " prefix on the picked button. When the button label already starts with a colorful icon (e.g. "✅ Yes"), the prefix gets visually swallowed — "✓ ✅ Yes" reads as just two checkmarks fighting for the leading slot, and on phone-sized button text it's impossible to spot which one is picked. Now: trailing " ✓" suffix. Conventional "is selected" position, sits cleanly at the end of any label regardless of leading icon. On the default 3-button set this gives "✅ Yes ✓" / "⏭ Skip ✓" / "✏️ Edit ✓" — unambiguous and visible at phone scale. Also strips any legacy "✓ " prefix from prior-style cards on the next tap, so the cleanup is automatic. Co-Authored-By: Claude Opus 4.7 (1M context) --- agent/telegram_bot.py | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/agent/telegram_bot.py b/agent/telegram_bot.py index b71e337..3526c52 100644 --- a/agent/telegram_bot.py +++ b/agent/telegram_bot.py @@ -6102,9 +6102,15 @@ def _agency_mark_picked( kbd: list, reset_others: bool = False, ) -> None: - """Mark the tapped button with a "✓ " prefix, keep all buttons - tappable so the user can re-tap (default kinds) or stack actions - (custom buttons). + """Mark the tapped button with a trailing " ✓" suffix; keep all + buttons tappable so the user can re-tap (default kinds) or + stack actions (custom buttons). + + Suffix > prefix: when a label already starts with a colorful + icon (e.g. "✅ Yes"), a leading "✓ " prefix gets visually + swallowed — two checkmarks fighting for the leading slot, + impossible to spot which one is picked. Trailing " ✓" sits + clearly at the end of the label across all icon shapes. reset_others=False — additive. Leaves prior ✓ marks intact so multi-tap on custom buttons accumulates ("Send A" + "Send B"). @@ -6112,8 +6118,13 @@ def _agency_mark_picked( before marking the new one, so only the latest pick is highlighted. Use for the default Yes/Skip/Edit set where the user is changing their mind, not stacking. + + Also strips any legacy leading "✓ " prefix from the previous + mark style, so cards posted before this change clean up on + the next tap. """ - picked_prefix = "✓ " + suffix = " ✓" + legacy_prefix = "✓ " try: if idx < 0 or not kbd: return @@ -6124,11 +6135,13 @@ def _agency_mark_picked( for btn in row: flat_i += 1 text = btn.get("text") or "" + if text.startswith(legacy_prefix): + text = text[len(legacy_prefix):] if flat_i == idx: - if not text.startswith(picked_prefix): - text = picked_prefix + text - elif reset_others and text.startswith(picked_prefix): - text = text[len(picked_prefix):] + if not text.endswith(suffix): + text = text + suffix + elif reset_others and text.endswith(suffix): + text = text[: -len(suffix)] new_row.append({**btn, "text": text}) new_kbd.append(new_row) self.call(