fix(messenger): remove bottom bar flash and scale-down on chat open - #1159
Merged
Conversation
The Send $ button and message input flashed/resized when entering a chat from the DM feed. typingConstraints.enabled starts false and only resolves a frame or two after open, once Room confirms whether the chat has a cash message. The bar rendered its default full-width layout first, then crossfaded and scaled down to the pill + input. Add a resolved flag to TypingConstraints (false until the async query answers once) and hold the bottom bar invisible-but-measured via alpha until resolved, then reveal the final layout directly with a snap transition. Height stays reserved so the message list padding never jumps. Fresh contacts have no chatId (the observeMessages typing flow never fires), so dispatch TypingEnabled(false) explicitly to resolve them and avoid a permanently hidden bar.
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.
Problem
The Send $ button and message input box visibly flashed and resized when entering a chat from the DM feed — the bar loaded a full-width "Send $" button that then crossfaded and scaled down to the pill + input layout.
Root cause
typingConstraints.enabledstartsfalseand only resolves a frame or two after the screen opens, once Room confirms whether the chat has a cash message. The bottom bar'sAnimatedContentrendered the defaultfalselayout first, then animated thefalse → truetransition — producing the visible flash and full-width→pill resize.Fix
resolvedflag toTypingConstraints,falseuntil the async typing-enabled query answers at least once.alpha 0) untilresolved, then reveal the final layout directly. Because the bar stays measured,SubcomposeLayoutstill reserves its height and the message list padding never jumps.transitionSpec(no crossfade / size transform) since the only layout change is the hidden initial resolution. TheSendCashButton's own color/label springs still animate the typing interaction.chatId, so theobserveMessages-driven typing flow never fires. DispatchTypingEnabled(false)explicitly in that branch so those chats resolve and the bar can't stay hidden forever.Testing
./gradlew :apps:flipcash:features:messenger:compileDebugKotlin— passes.