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

499 Inconsistent padding #596

Merged
merged 9 commits into from
Dec 10, 2024
Merged

499 Inconsistent padding #596

merged 9 commits into from
Dec 10, 2024

Conversation

jeden
Copy link
Contributor

@jeden jeden commented Nov 28, 2024

Related Issue

Summary of Changes

Note: in this PR the min iOS version has been increased to 16.

Some implementation details:

  • iOS automatically chooses how to position the visible area when the keyboard is visible. If there's enough real estate, the bottom button is completely visible, positioned right above the keyboard. In case of not enough space, it seems to keep the edited text field at the vertical center of the visible area above the keyboard.
  • Adding a scroll view (with or without a geometry reader) invalidates the height calculation and causes the sheet view to not be displayed at all (except for a small frame at the bottom). If the view is not scrollable it works fine. This shouldn't be a major issue though, with larger text the bottom button might go out of the visible space, and so does the title area, but the text edit should still remain visible.

Only the halfSheet() modifier, and corresponding places where it is used, have been refactored.

PresentHostingController and CustomHostingController require additional refactoring that will be addressed on a separate ticket (#647)

Need Regression Testing

  • Yes: all UI places where pull-up sheets are displayed
  • No

Risk Assessment

  • Low
  • Medium: any implementation mistake can lead to incorrect layouts that might affect UX
  • High

Additional Notes

Screenshots (if applicable)

See this comment for a list of screenshots where the half sheet is used.

#499

- Temporary implementation
# Conflicts:
#	FRW/Modules/Wallet/MoveAsset/MoveTokenView.swift
Comment on lines +130 to +131
.lineLimit(nil)
.fixedSize(horizontal: false, vertical: true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This enables the text to be displayed in multiple lines, if needed, otherwise it stays on a single line and wrapped if necessary.

@zhouxl
Copy link
Collaborator

zhouxl commented Nov 28, 2024

custom height is only on iOS 16 and up?

@jeden jeden linked an issue Nov 29, 2024 that may be closed by this pull request
@lmcmz
Copy link
Member

lmcmz commented Dec 1, 2024

Can we have a horizontal solution cross the app ?
Cause this is no an issue on this page only, We have many place need adjust dynamic height.

@lmcmz
Copy link
Member

lmcmz commented Dec 1, 2024

Meanwhile, when I put more elements in this bottom sheet, it doesn't dynamic adjust the content height.
IMG_4624

@jeden
Copy link
Contributor Author

jeden commented Dec 1, 2024

custom height is only on iOS 16 and up?

@zhouxl I thought I had answered to this question... maybe it was in the other PR that I closed.

Anyway yes, unfortunately this works on iOS 16+ only

@jeden
Copy link
Contributor Author

jeden commented Dec 2, 2024

Can we have a horizontal solution cross the app ? Cause this is no an issue on this page only, We have many place need adjust dynamic height.

@lmcmz Yes, the implementation is reusable, but it requires some minor refactoring on a case-by-case basis, similar to what done in MoveTokenView.swift

@jeden
Copy link
Contributor Author

jeden commented Dec 2, 2024

Meanwhile, when I put more elements in this bottom sheet, it doesn't dynamic adjust the content height.
@lmcmz
What have you added? Can you share the code so I can take a look?

@jeden
Copy link
Contributor Author

jeden commented Dec 2, 2024

Meanwhile, when I put more elements in this bottom sheet, it doesn't dynamic adjust the content height.
@lmcmz
What have you added? Can you share the code so I can take a look?

nvm... I see you've duplicated the source-target row. I'll check that out

@jeden
Copy link
Contributor Author

jeden commented Dec 2, 2024

@lmcmz what device and iOS version are you on?

This is taken from the iPhone 15 Pro (simulator), iPhone SE (simulator):

image
image

And this from my iPhone 15 Pro (device)
image

@lmcmz
Copy link
Member

lmcmz commented Dec 2, 2024

This move token view can be init from multiple places. The one I tested from home screen doesn't work.

I would suggest we apply this dynamic height configuration in all places using

CustomHostingController
halfSheet
PresentHostingController

@lmcmz
Copy link
Member

lmcmz commented Dec 2, 2024

Meanwhile, I can see this bottom sheet have a transparent background on bottom safe area. We need fix this.

Probably, we fix on different PR, the insufficient storage alert shown't overlap with the move fee UI, it was overlap due to the height is not dynamic.

Screenshot 2024-12-03 at 12 10 59 am

@jeden
Copy link
Contributor Author

jeden commented Dec 2, 2024

This move token view can be init from multiple places. The one I tested from home screen doesn't work.

Can we meet today so you can show me in which case it does not work? Because I am unable to reproduce that.

I would suggest we apply this dynamic height configuration in all places using

CustomHostingController
halfSheet
PresentHostingController

I suggest deferring this to a separate ticket, to prevent this from being out of sync with develop again.

@jeden
Copy link
Contributor Author

jeden commented Dec 2, 2024

Meanwhile, I can see this bottom sheet have a transparent background on bottom safe area. We need fix this.

Probably, we fix on different PR, the insufficient storage alert shown't overlap with the move fee UI, it was overlap due to the height is not dynamic.

Screenshot 2024-12-03 at 12 10 59 am

The button is on an overlay, so it doesn't contribute to the underlying view's height — and the alert is displayed in the same overlay (because it's linked to the button). In order for that to happen I should move the button from the overlay to the view.

@lmcmz
Copy link
Member

lmcmz commented Dec 4, 2024

It doesn't look good when there is a keyboard
IMG_4630

@jeden
Copy link
Contributor Author

jeden commented Dec 4, 2024

Yeah I haven't reworked on that after the discussions of the past couple days

@jeden jeden added the blocked label Dec 4, 2024
@jeden jeden marked this pull request as draft December 4, 2024 00:30
@lmcmz
Copy link
Member

lmcmz commented Dec 9, 2024

Not sure, why we are not continue working on this.
We need meet following requirements:

  1. Adapted for keyboard input scenarios
  2. The bottom safe area has no background
  3. We need apply this auto resize to all our bottom sheet popup.

@jeden
Copy link
Contributor Author

jeden commented Dec 9, 2024

This is what I have been working on in the latest days. I haven't pushed any commit since I needed to fix the layout issues first and then check and refactor all places where the half sheet is used.

I should resubmit this for review today or tomorrow. However I think I'll defer the other 2 usages (PresentHostingController and CustomHostingController) to a separate ticket, because this is diverging too much from dev and merging might become more complicated the more I wait.

@jeden
Copy link
Contributor Author

jeden commented Dec 9, 2024

  1. backup tips shown on home

image

  1. settings -> devices -> device info -> key location -> swipe left -> tap "Revoke":

image

  1. home -> plus button -> tap any circled plus button

image

  1. settings -> backup -> multi-backup -> swipe left any backup -> tap "Delete"

image

  1. settings -> linked accounts -> any child account -> tap "Unlink Account"

image

  1. settings -> backup -> multi-backup -> tap any -> tap "Delete Backup"

image

  1. NFT -> tap plus button -> any NFT, tap circular plus button

image

  1. NFT -> tap any NFT -> tap the "Move" button

image

  1. home -> tap "Stake" button -> tap "Stake New Node" -> tap any token -> input amount -> tap "Next"

image

  1. home -> tap any token -> tap swap button -> type amount -> select destination token -> tap "Swap beta"

image

  1. home -> tap any token -> tap "move" button

image

  1. home -> tap any token -> tap send button -> select recipient -> type amount -> tap "Next"

image

@jeden jeden marked this pull request as ready for review December 10, 2024 00:43
@jeden jeden removed the blocked label Dec 10, 2024
@jeden jeden requested review from zhouxl and lmcmz and removed request for zhouxl December 10, 2024 00:48
@jeden jeden merged commit 06585d6 into develop Dec 10, 2024
1 check passed
@jeden jeden deleted the fts/499-inconsistent-padding-v2 branch December 10, 2024 22:46
@jeden jeden mentioned this pull request Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent padding
3 participants