fix(telegram): render full clarify choice text in message body (closes #27497)#28475
Merged
Conversation
…hort button labels When Telegram clarify prompts offer long choices, mobile clients truncate the inline button labels, making options unreadable. Previously only the question was shown in the message body with truncated choice text in button labels. Fix: append the full numbered option list to the message body so users can read complete choice text on any client. Buttons now use short numeric labels (1, 2, ...) to avoid Telegram truncation. The 'Other (type answer)' button is unchanged. Long choice labels are now rendered in full (not truncated to 57 chars + '...') since they appear in the body instead of button labels. Closes: #27497
Contributor
🔎 Lint report:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Salvage of #27852 (@asdlem).
Summary
Telegram mobile truncates inline button labels, making long clarify options unreadable. This fix renders the full numbered choice list in the message body and uses short numeric button labels ("1", "2", …) instead of "{n}. {label}", so the full option text is always visible.
Changes
gateway/platforms/telegram.py::send_clarify: append1. <choice1>\n2. <choice2>to message body (HTML-escaped); buttons keep short numeric labels. "✏️ Other (type answer)" button preserved.tests/gateway/test_telegram_clarify_buttons.py: renamed truncation test →test_long_choice_rendered_in_body_not_truncated; verifies full long-choice text appears inkwargs['text'].Validation
scripts/run_tests.sh tests/gateway/test_telegram_clarify_buttons.py -q→ 12/12 passing.Authorship preserved via cherry-pick. Closes #27497.
Also supersedes #27535 (@luyao618) and #27581 (@yahyasaqban-lab) which proposed functionally identical fixes — both closed with credit.