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

Username and poll title sometimes overlay on top of each other #5326

Closed
kittykat opened this issue Dec 21, 2021 · 6 comments · Fixed by #6374
Closed

Username and poll title sometimes overlay on top of each other #5326

kittykat opened this issue Dec 21, 2021 · 6 comments · Fixed by #6374
Assignees
Labels
A-Polls A-Timeline O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@kittykat
Copy link
Contributor

Steps to reproduce

Sometimes poll layout is broken with the username covering part of the poll title. Not sure how to trigger it.

Outcome

ima_6c8775d

Your phone model

iPhoneX

Operating system version

iOS 14.6

Application version

Test Flight

Homeserver

No response

Will you send logs?

No

@kittykat kittykat added T-Defect Something isn't working: bugs, crashes, hangs and other reported problems A-Timeline S-Minor Impairs non-critical functionality or suitable workarounds exist O-Uncommon Most users are unlikely to come across this or unexpected workflow A-Polls labels Dec 21, 2021
@Johennes
Copy link
Contributor

Similar cropping also occasionally happening at the bottom:

Simulator Screen Shot - iPhone 13 mini - 2022-03-30 at 08 42 33

@frakic
Copy link

frakic commented Jun 30, 2022

Still experiencing this on 1.8.20 (20220628212933)

image

Repro steps:

  1. Web/Android user creates a poll in a room
  2. iOS user tries to view it

@Johennes
Copy link
Contributor

Johennes commented Jul 4, 2022

I looked into this issue some more. It's also reproducible by scrolling back to polls that didn't fit the initial screen.

I initially thought the height computation in SizableBaseRoomCell was wrong but even if I set a fixed and large enough size there, I'm still seeing layout issues in the polls cell.

Using the view hierarchy debugger, it looks like the hosting view has the right size but the content inside it is pushed down.

Screenshot 2022-07-03 at 21 35 48

Long tapping the view to show the reactions overlay and then dismissing it fixes the layout (notably without changing the hosting view's position).

Screenshot 2022-07-03 at 21 36 35

I've tried forcing a re-layout in numerous places but haven't been successful so far. The "best" I could get to was using the UIHostingView from SwiftUIX. The latter dynamically grows its parent when the hosted view's size changes. Oddly enough this made the cell revert to the clipped layout when scrolling back up which makes little sense to me.

Jul-03-2022.11-24-26.mp4

@Johennes
Copy link
Contributor

Johennes commented Jul 4, 2022

@pixlwave spotted that the hosting view's size of 238 differs from the view's intrinsic content size of 285 (the constraint of which is grayed out / inactive). Understanding that mismatch could help getting closer to the root cause.

@Johennes
Copy link
Contributor

Johennes commented Jul 4, 2022

In the case above, the hosting view's layout height of 238 is a result of the encapsulated layout height of 257 (applied through the table view / SizableBaseRoomCell height computation) minus the top / bottom margin of 19 applied on the hosting view's container.

Screenshot 2022-07-04 at 11 42 20
Screenshot 2022-07-04 at 11 42 40

On the one hand, this makes it look as if the height computation is wrong after all but, on the other, visually 238 appears to be enough to render the poll. 🤔

Johennes added a commit that referenced this issue Jul 5, 2022
Fixes: #5326
Signed-off-by: Johannes Marbach <johannesm@element.io>
@Johennes
Copy link
Contributor

Johennes commented Jul 5, 2022

It turns out that the hosting view adds safe area insets. 🤔

Screenshot 2022-07-04 at 23 20 27

Some more info and a possible fix can be found in #6374.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Polls A-Timeline O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants