Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: attachments popup [WPB-10499] #3373

Merged
merged 9 commits into from
Aug 27, 2024
Merged

feat: attachments popup [WPB-10499] #3373

merged 9 commits into from
Aug 27, 2024

Conversation

Garzas
Copy link
Contributor

@Garzas Garzas commented Aug 26, 2024

BugWPB-10499 Detach keyboard behavior from attachments box


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

This pull request addresses various issues related to inconsistent state management of attachments and the keyboard across different Android devices and versions. The main focus was on enhancing the user experience by streamlining processes and rectifying bugs that affected the UI's behavior during interactions with the bottom sheets and attachments.

Causes (Optional)

The underlying causes of the issues included buggy state management mechanisms that varied across different devices and Android versions. There were inconsistencies in how attachments and keyboard heights were handled, leading to a user experience that could often feel unpredictable and jumpy, particularly when transitioning between different states of the UI.

Solutions

  • Centralized Bottom Sheet Management: Consolidated all bottom sheets (location, self-deleting, edit) into a single management point to ensure consistency across different parts of the application.

  • IME Padding Workaround: Implemented a workaround for hardcoded IME padding within the bottom sheet. This helps to prevent the bottom sheet from jumping when the keyboard is dismissed, ensuring a smoother transition and a more stable user interface.

  • Enhanced Animations: Introduced animations for showing and hiding attachments, which not only improve the aesthetics but also provide clearer feedback to the user regarding the UI's state changes.

  • Attachments Popup with Ripple Reveal Animation: Added a ripple reveal animation for the attachments popup, which enhances visual engagement and makes the interface more interactive and responsive to user actions.

  • Simplified Process Management: Streamlined the processes for managing the visibility of attachments and the height adjustments of the keyboard and attachments. This simplification helps reduce complexity and improves the maintainability of the code.

  • Removed Redundant Workarounds and States: Eliminated the read-only mode workaround that was previously required for managing text input, and also removed unnecessary states for attachments that complicated the state management unnecessarily.

How to Test

Play around with message composer and all attachments

Attachments (Optional)

Screen_recording_20240826_134114.webm

@Garzas Garzas self-assigned this Aug 26, 2024
@echoes-hq echoes-hq bot added the echoes: unplanned Any work item that isn’t part of the product or technical roadmap. label Aug 26, 2024
Copy link

Ups 🫰🟨

This PR is too big. Please try to break it up into smaller PRs.

@@ -63,6 +63,7 @@ hilt-work = "1.2.0"
# Android UI
accompanist = "0.32.0" # adjusted to work with compose-destinations "1.9.54"
material = "1.12.0"
material3 = "1.3.0-beta05"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is already 1.3.0-rc01 available maybe we can give it a try

Copy link

@Garzas Garzas requested a review from MohamadJaara August 26, 2024 13:28
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 46.42857% with 30 lines in your changes missing coverage. Please review.

Project coverage is 44.39%. Comparing base (ea42d47) to head (8eca5f2).

Files Patch % Lines
...mposer/state/MessageCompositionInputStateHolder.kt 61.76% 8 Missing and 5 partials ⚠️
...droid/ui/home/messagecomposer/KeyboardModifiers.kt 0.00% 6 Missing ⚠️
...d/ui/home/conversations/ConversationScreenState.kt 0.00% 5 Missing ⚠️
.../ui/home/messagecomposer/EnabledMessageComposer.kt 0.00% 2 Missing ⚠️
...messagecomposer/state/AdditionalOptionMenuState.kt 60.00% 2 Missing ⚠️
...essagecomposer/state/MessageComposerStateHolder.kt 33.33% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3373      +/-   ##
===========================================
- Coverage    44.48%   44.39%   -0.10%     
===========================================
  Files          462      463       +1     
  Lines        15492    15465      -27     
  Branches      2578     2578              
===========================================
- Hits          6892     6865      -27     
+ Misses        7874     7872       -2     
- Partials       726      728       +2     
Files Coverage Δ
...droid/ui/home/messagecomposer/AttachmentOptions.kt 0.00% <ø> (ø)
...me/messagecomposer/location/LocationPickerState.kt 100.00% <100.00%> (ø)
.../ui/home/messagecomposer/EnabledMessageComposer.kt 0.00% <0.00%> (ø)
...messagecomposer/state/AdditionalOptionMenuState.kt 37.93% <60.00%> (-12.07%) ⬇️
...essagecomposer/state/MessageComposerStateHolder.kt 66.66% <33.33%> (+8.33%) ⬆️
...d/ui/home/conversations/ConversationScreenState.kt 0.00% <0.00%> (ø)
...droid/ui/home/messagecomposer/KeyboardModifiers.kt 0.00% <0.00%> (ø)
...mposer/state/MessageCompositionInputStateHolder.kt 62.96% <61.76%> (-3.04%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea42d47...8eca5f2. Read the comment docs.

Copy link
Contributor

Built wire-android-staging-compat-pr-3373.apk is available for download

Copy link
Contributor

Built wire-android-dev-debug-pr-3373.apk is available for download

fun requestFocus() {
if (!inputFocused) {
focusRequester.requestFocus()
focusRequester.captureFocus() // TODO check
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check and remove it after playtest

@Garzas Garzas added this pull request to the merge queue Aug 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 27, 2024
@Garzas Garzas added this pull request to the merge queue Aug 27, 2024
Merged via the queue into develop with commit 8fa1f4f Aug 27, 2024
12 of 13 checks passed
@Garzas Garzas deleted the feat/attachments-popup branch August 27, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: unplanned Any work item that isn’t part of the product or technical roadmap. size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants