fix(rich-ui): don't duplicate option list when menu renders#141
Merged
Conversation
When postRich rendered the inline keyboard, it also showed the verbose
text fallback ("*Available:*" + every option key) above it. Buttons
already enumerate the options — redundant noise.
Fix: add optional `RichResponse.menuCaption` for the concise body
shown next to the keyboard. Transports prefer it when rendering a
menu; fall back to `text` (verbose) when caption is absent or when
menu can't render.
`buildSelectableMenu()` now sets:
- `text` (fallback): header + *Available:* list + hint
- `menuCaption` (with menu): header + hint only
+3 tests:
- rich-helpers: caption is concise (no Available block, no option keys)
- telegram-postrich: menuCaption is sent (not text) when both present
- telegram-postrich: falls back to text when menuCaption absent
565 tests green (+3).
Architect review of PR #141 caught drift: design doc shows old RichResponse shape. Add menuCaption + one-line rationale; point to types.ts as source of truth.
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.
When the inline keyboard renders, the verbose
*Available:*block above it is redundant — the buttons already show the options.Fix: Add optional
RichResponse.menuCaptionfor the concise body shown next to the keyboard. Transports use it when rendering a menu; fall back totext(verbose) otherwise.buildSelectableMenu()now sets both:text(fallback): header + Available list + hintmenuCaption(with menu): header + hint onlyTests: 565 green (+3). Mutation-tested: assert
textcontent NOT in sent payload whenmenuCaptionis set.