Skip to content

QuickEditor height adjustments for the new Scopes #635

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

Open
wants to merge 3 commits into
base: feature/quick_editor_about_info
Choose a base branch
from

Conversation

AdamGrzybkowski
Copy link
Contributor

Description

This PR adjusts various aspect of the QE height in the new scopes:

  • e4c227c Limits the total height to make sure QE won't be drawn behind the status bar.
  • ddd5f6b Add the animateContentHeight modifier to animated About editor height changes (this applies to any content change but in general when switching from loading to loaded or error state).
  • dacb127 Updated the possible Detens and the initial detent based on scope (and other factors) for the QE.
Max height Content animation Initial peek detent for About editor
Screenshot 2025-05-20 at 12 12 34 animate_height Screenshot 2025-05-20 at 12 17 00

Note: I've noticed a weird behavior in the AvatarAndAbout scope. With scrolling set to horizontal and the initial page to Avatar picker, the sheet reverts to Peek detent instead of FullyExpanded. I have a feeling this is rather related to the AvatarPicker UI hierarchy so I would like to work on it separately (GRA-103).

Testing Steps

  1. Max height is easy - just launch the About editor with all the fields and expand it fully. Same for the avatar picker in the vertical scrolling mode (with enough images).
  2. The content animation is a bit tricky now that we have the peek detent as initial, but you can play around with it to see.
  3. Sheet detents - Launch the About editor and confirm the sheet is not fully expanded. Rotate the phone to landscape and repeat - this QE should be fully extended as it doesn't make sense to use peek detent when we have very little screen height to work with.

@AdamGrzybkowski AdamGrzybkowski added the [Feature] Gravatar-Quickeditor Gravatar Quick Editor module label May 20, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors QuickEditor height logic and detent configuration to support new scope options while adding subtle UI improvements. Key changes include updating modal detents resolution in multiple components, introducing a debug log for current detent changes, and adding an animated content size modifier in the About editor.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
gravatar-quickeditor/src/main/java/com/gravatar/quickeditor/ui/editor/extensions/QuickEditorExtensions.kt Updated modal detents reference to use scopeOption.modalDetents() directly.
gravatar-quickeditor/src/main/java/com/gravatar/quickeditor/ui/editor/bottomsheet/GravatarQuickEditorBottomSheet.kt Refactored modal detents logic, added a debug log for current detent, and adjusted visibility for the 'peek' detent.
gravatar-quickeditor/src/main/java/com/gravatar/quickeditor/ui/editor/QuickEditorViewModel.kt Removed a private initialPage property in favor of a restructured, shared internal property.
gravatar-quickeditor/src/main/java/com/gravatar/quickeditor/ui/editor/QuickEditorScopeOption.kt Added an internal initialPage getter to streamline scope-based page selection.
gravatar-quickeditor/src/main/java/com/gravatar/quickeditor/ui/abouteditor/AboutEditor.kt Enhanced the AboutEditor container with an animateContentSize modifier for smoother UI transitions.
Comments suppressed due to low confidence (1)

gravatar-quickeditor/src/main/java/com/gravatar/quickeditor/ui/editor/bottomsheet/GravatarQuickEditorBottomSheet.kt:332

  • [nitpick] Consider renaming the local variable (e.g. to 'computedInitialDetent') to avoid the ambiguity with the function name 'initialDetent'.
val initialDetent = initialDetent(windowHeightSizeClass)

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 20, 2025

📲 You can test the changes from this Pull Request in Gravatar Demo by scanning the QR code below to install the corresponding build.
App NameGravatar Demo
Commit51d27a9
Direct Downloadgravatar-demo-prototype-build-pr635-51d27a9.apk

Base automatically changed from adam/GRA-27 to feature/quick_editor_about_info May 20, 2025 11:59
@etoledom
Copy link
Contributor

I see one interesting big difference between platforms:

On iOS we have the Save button pinned at the bottom for any size of the sheet (either medium, expanded, or intrinsic content height)

I see on Android that, instead, the Save button will move out of the screen when the sheet is small:

CleanShot 2025-05-21 at 09 22 47

@etoledom
Copy link
Contributor

Note: I've noticed a weird behavior in the AvatarAndAbout scope.

Is this what you mean?

I see that when opening the Avatar Picker on the Avatar & About scope, with horizontal layout, the initial height of the sheet is smaller than the content and some part of the bottom will get hidden under the screen.

It works good on Avatar Picker scope.

CleanShot 2025-05-21 at 09 26 39

@etoledom
Copy link
Contributor

For this reason also (Sticky save button), we decided to remove the save button from landscape mode with keyboard

Automattic/Gravatar-SDK-iOS#756 (comment)

@pinarol
Copy link

pinarol commented May 21, 2025

I remember like we wanted to always display the Save button. (The landscape + keyboard open mode is an exceptional case we discovered later though). But the idea to me was that the input fields inside the borders would be scrollable not the button. We can get some early design feedback once the feature is in a testable/mature state I think.

@etoledom
Copy link
Contributor

We can get some early design feedback once the feature is in a testable/mature state I think.

@pinarol - Do you mean to keep it this way on Android for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Gravatar-Quickeditor Gravatar Quick Editor module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants