Open
Conversation
When a mini app is configured with mode=compact, the webview sheet still expands to full height. This happens because the server response field `fullsize` in TL_webViewResultUrl overwrites the locally set `defaultFullsize` flag, ignoring the compact mode entirely. Add a compact check in isFullSize() for both BotWebViewSheet and BotWebViewAttachedSheet so that requestProps.compact takes priority over the server-provided fullsize value. Bug: https://bugs.telegram.org/c/45743
|
Hello, |
scutuatua-crypto
approved these changes
Feb 19, 2026
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
Fixes compact mode not working for bot mini apps.
When a mini app is configured with
mode=compact(via BotFather ort.me/bot?startapp=...&mode=compactlinks), the webview sheetincorrectly expands to full height instead of opening at partial height.
Bug report: https://bugs.telegram.org/c/45743
Root cause
When the server responds to
requestWebView/requestAppWebView, theTL_webViewResultUrl.fullsizefield overwrites the localdefaultFullsizevalue that was correctly set based on the compact flag. Since
isFullSize()uses
fullsize ?? defaultFullsize, andfullsizefrom the server responseis never null,
defaultFullsizeis effectively ignored.iOS handles this differently — it determines
fullSizefrom the URLbefore the request and passes it directly to
AttachmentController,independent of the server response.
Changes
isFullSize()now returnsfalsewhenrequestProps.compactis set, giving it priority over the serverresponse.
Testing
https://t.me/namebot?startapp=p1&mode=compactmode=fullscreenstill works correctly (full height, no nav bar)