[2.x] fix: remove the save draft button when the composer is minimized on mobile - #138
Merged
Conversation
…obile
The composer control guard hid the save button when the composer was
minimized — but only alongside !isFullScreen(), and core's
isFullScreen() is unconditionally true on phones ("we always consider
the composer as full-screen"). On mobile the guard could therefore
never fire, and because the button carries App-backControl, it stayed
pinned in the app header after minimizing. Desktop was unaffected,
which is why only mobile misbehaved.
Minimized is minimized: the guard now checks the position alone. A
composer cannot be minimized and full-screen at the same time, so the
extra clause only ever served to defeat the check on phones.
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.
The bug
On mobile, the save-draft icon correctly appears in the header while the composer is open — but stays pinned there after minimizing the composer.
Root cause
The control-item guard already tried to handle this:
But core's
ComposerState.isFullScreen()is unconditionally true on phones — "or if we are on a mobile device, where we always consider the composer as full-screen". So on mobile the second clause is always false, the guard can never fire, and the button — which carriesApp-backControl, the class core pins into the app header on phones — survives minimization. Desktop evaluatesisFullScreen()as false when minimized, which is why only mobile misbehaved.The subtlety only bites at the exact transition: while the composer is open,
position === 'minimized'short-circuits the whole clause, soisFullScreen()'s phone behaviour never matters until the moment you minimize.The fix
The guard checks position alone. A composer cannot be minimized and full-screen at the same time, so the
!isFullScreen()qualifier only ever served to defeat the check on phones.Verification
Reproduced on a real mobile-viewport session against a dev install before the fix (minimized composer,
item-save-draftstill rendered in.Composer-controls, fixed-positioned into the header), and confirmed fixed after — including manual on-device confirmation that the icon leaves the header on minimize and still appears while composing.