fix(telegram): restore 2×2 exec-approval button layout - #70912
Merged
kshitijk4poor merged 3 commits intoJul 25, 2026
Merged
Conversation
Pair conditional approval buttons into rows of two so the full Allow Once / Session / Always / Deny set stays readable instead of one truncated 4x1 row.
Assert the full set renders as 2x2 and the three-button case keeps Deny on its own second row.
Follow-up for salvaged PR NousResearch#70615 — the 2-button smart_deny case (Allow Once + Deny only) was exercised by an existing test but only at the flat-label level, not asserting the row pairing. Adds the missing row-structure assertion using the same capture pattern as the 4-button and 3-button tests.
kshitijk4poor
force-pushed
the
salvage/70615-telegram-approval-2x2
branch
from
July 24, 2026 18:18
65a4b0e to
d6d8a87
Compare
|
Confirmed from a real Telegram mobile deployment: the current single-row 4-button layout truncates the labels enough to make the approval scope difficult to distinguish. Restoring the 2×2 layout is materially clearer on mobile. The dynamic 2-per-row approach here also handles the reduced button sets cleanly. Thanks for preserving the original contributor attribution and adding the regression coverage. |
3 tasks
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.
Summary
Exec-approval buttons on Telegram were flattened into a single 4-button row after the smart-deny conditional keyboard change (d48bf74), truncating labels on mobile. This pairs them into rows of 2, restoring the readable 2×2 grid.
Root cause: commit d48bf74 refactored the hardcoded 2×2 keyboard into a dynamic
buttonslist but wrapped it asInlineKeyboardMarkup([buttons])— one single row instead of the original 2×2 layout.Changes
plugins/platforms/telegram/adapter.py: ReplaceInlineKeyboardMarkup([buttons])withInlineKeyboardMarkup([buttons[i:i+2] for i in range(0, len(buttons), 2)])— pairs buttons into rows of 2, matching the existingsend_choice_pickerconvention.tests/gateway/test_telegram_approval_buttons.py: Regression tests for 4-button (2×2), 3-button (2+1), and 2-button smart_deny (1×2) row layouts.Validation
Salvage of #70615 by @HexLab98 — contributor commits cherry-picked with authorship preserved. Added one follow-up test for the 2-button smart_deny row-structure case.
Closes #70615