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

Fix last row sometimes being missing in List #4911

Merged
merged 4 commits into from
Jun 22, 2024

Conversation

dweymouth
Copy link
Contributor

@dweymouth dweymouth commented Jun 4, 2024

Description:

Fixes #4909

The calculateVisibleRowHeights calculation derived maxRow as the max row that could possibly be visible, but the rest of the function treated it as the first row that couldn't be visible (i.e. inclusive vs exclusive bound issue).

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@dweymouth
Copy link
Contributor Author

A bunch of list tests are failing as they seem to depend on the old incorrect behavior. I'd appreciate if someone can check my assumptions before I update them all though.

@andydotxyz
Copy link
Member

It does seem as though you've found an off-by-one.
Just make sure it does not relate to a header row/column counting...

@dweymouth
Copy link
Contributor Author

It does seem as though you've found an off-by-one. Just make sure it does not relate to a header row/column counting...

List doesn't have header rows builtin like table

@andydotxyz
Copy link
Member

Haha you got me :) I should sleep more!

@dweymouth
Copy link
Contributor Author

Haha you got me :) I should sleep more!

Also just that I'm quite familiar with the List API as something like 40% of my app UI is different kind of lists (with another 40% being gridwraps maybe) 😄

@dweymouth dweymouth force-pushed the list-fix-lastrow-missing branch from 973be22 to b6498b0 Compare June 22, 2024 14:51
@coveralls
Copy link

Coverage Status

coverage: 65.979% (+0.02%) from 65.963%
when pulling bfbee04 on dweymouth:list-fix-lastrow-missing
into c3215ee on fyne-io:develop.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

Hmm. Is it possible to get some kind of code to reproduce this or a test that clearly shows it? I notice no difference in lists on my computer.

@dweymouth
Copy link
Contributor Author

It was a rounding error so it only reproduced at certain list widget sizes relative to the row size. Larger rows (ie taller than just a label) seemed to reproduce the problem more often too. Drag the window size around while being scrolled right near the bottom of the list and eventually you should get the original problem to repro

@andydotxyz
Copy link
Member

I was able to replicate the issue with one of my apps and this does indeed fix it.

Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

Thanks so much for solving this

@dweymouth dweymouth merged commit 0e478c3 into fyne-io:develop Jun 22, 2024
12 checks passed
@dweymouth dweymouth deleted the list-fix-lastrow-missing branch June 22, 2024 19:06
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.

4 participants