Repository navigation
fix: the attach tray is the tile grid again - #507
Merged
Merged
Conversation
Merging feat/attach-tray kept Develop's older list sheet wired into the chat: AttachTray shipped, the sheet stayed, and attach still dimmed the conversation behind a scrim with the keyboard up underneath. Only the tray's own view was left out of the merge; everything it needs was there. The chat now opens AttachTray in its own bottom bar, under the composer: - the plus turns into the cross that closes the tray, and closing it hands focus back to the field, so the draft is never lost; - opening the tray clears focus and hides the keyboard, and the tray is built to the measured keyboard height, so the composer holds still (0 px across the swap, per AttachTrayHeight); - the composer clears nothing while the tray holds that slot, and its keyboard height comes from ImeGuard, so an OEM that overstates the inset cannot hand the tray a window-sized slot; - Back closes the tray before it leaves the chat; - every picker still goes through launchOrExplain, so a device without a camera app explains itself instead of crashing. AttachSheet is removed with its preview: with the tray wired in it was a second, unused attach UI. JUnit: AttachTrayWiringTest (the tray in the bottom bar, all five tiles, the keyboard swap, the Back handler, the dead sheet) and AudioAttachmentTest reads the tray's Audio tile instead of the sheet's row. scripts/test-attach-tray.sh: 26 checks on emulator-5556, 0 failed; on the sheet build the same script fails 5, including "the keyboard stayed up under the tray" and "the conversation disappeared behind the tray".
Tapping the crossed attach button closed the tray and the composer fell to the bottom of the window, then climbed back up as the keyboard rose — a 800 px flicker over the swap. It happened because the composer cleared its inset the moment the tray closed, while the keyboard had not arrived yet: its padding went to zero and the keyboard's own animation pushed it back afterwards. The tray's visibility is now read through a transition state, so the composer clears nothing for as long as the tray is on screen (including its fade-out), and a swap flag holds the slot the tray vacated until the keyboard actually arrives. The tray also leaves in 90 ms instead of 200, so it is off screen before the returning keyboard reaches it rather than hanging over the keys. The tray's fade-in and the whole of the keyboard's rise are unchanged, so the composer sits at the same height throughout: 0 px in the regression script's measurement, and no frame in a screen recording shows it move. scripts/test-attach-tray.sh reads the composer's height from the app's own AttachTrayHeight log for the swap back (27 checks, 0 failed; the build without the hold reports a composer of 283 dp against a 295 dp slot while the keyboard returns). JUnit: AttachTrayWiringTest pins the swap-aware inset, the held slot and the faster tray exit.
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.
What changed
The chat opens
AttachTrayin its own bottom bar, under the composer: the camera as the tall tile, gallery, audio, location and contact beside it. The old list sheet (AttachSheet) and its preview are gone.+turns into the×that closes the tray, and closing it hands focus back to the field, so the draft is never lost.ImeGuard, so an OEM that overstates the IME inset cannot hand the tray a window-sized slot.launchOrExplain.Why
Merging
feat/attach-trayresolvedChatScreen.ktby keeping Develop's older list sheet, soAttachTraycompiled and shipped unused: attaching still dimmed the conversation behind a scrim, left the keyboard up underneath it, and covered the message being replied to.Closing the tray then had a second problem: the composer cleared its inset the moment the tray left, while the keyboard had not arrived yet, so it dropped to the bottom of the window and climbed back with the keyboard — the ~800 px flicker in the recording.
Testing
./gradlew testDebugUnitTestpassesapp/src/test/java/for the changed logic (AttachTrayWiringTest;AudioAttachmentTestnow reads the tray's Audio tile)scripts/test-*.shadded, and it fails before the fix / passes afterscripts/test-attach-tray.shonemulator-5556: 27 passed, 0 failed.On the old sheet build the same script fails on "the keyboard stayed up under the tray" and "the conversation disappeared behind the tray". On the build without the swap hold it reports:
The fixed build across the close (from the app's own
AttachTrayHeightlog):scripts/test-tray-follows-keyboard.sh: 5 passed, 0 failed at 420 dpi (295 dp) and 320 dpi (374 dp).Scripts side, merged to
Messages-scriptsDevelopfirst:3836f4e(the location prompt the app actually shows) and0649647(the composer holds still on the way back).Related issue
None — reported with a screen recording of the flicker.