shosetsuorg / shosetsu

An android application for reading light novels. Moved to https://gitlab.com/shosetsuorg/shosetsu
https://shosetsu.app
GNU General Public License v3.0
581 stars 34 forks source link

[Bug] [2.0.0-1656] Top of screen eats top of filter menu #155

Closed khonkhortisan closed 2 years ago

khonkhortisan commented 2 years ago

Describe the bug When a filter group is expanded so that the top of the filter list can go off the top of the screen, the top of the filter list is cropped when it's off the top of the screen and then scrolled back into view. This happens whether it was pushed off the screen by expanding or by scrolling

To Reproduce Steps to reproduce the behavior:

  1. Hold phone in landscape mode so you can do this with a shorter menu
  2. Expand all Filtergroups
  3. Scroll to push the top of the filter menu off the top of the screen
  4. Scroll to pull the top of the filter menu back down
  5. See that the top of the menu is missing

Expected behavior The filter menu would scroll or expand past the top of the screen, then scroll or collapse safely back without cropping the top of the menu.

Screenshots Screenshot_20211114-005653_Shosetsu It can crop in the middle of an element, not just between them

Device information:

AND

Additional context Add any other context about the problem here.

khonkhortisan commented 2 years ago

There are two layers of scrolling going on here, controlled by the same input:

Steps to reproduce:

  1. open NOVA, open the filter pop-up, expand all the filter groups lowest to highest.
  2. the filter pop-up is open but not touching the top of the screen, the checkboxes are at the top of the filter pop-up
    • ⇓ pushing down closes the pop-up. Return to step 1.
    • ⇓⇑ pushing down then up moves the pop-up then stays on step 2.
    • ⇑⇓ pushing up then down stays on step 2.
    • ⇑ push the top of the filter pop-up to the top of the screen, where it stops. Continue to step 3.
  3. the filter pop-up and checkboxes are at the top of the screen
    • ⇓ pushing down returns to step 2.
    • ⇓⇑ pushing down then up moves the pop-up then stays on step 3.
    • ↑↓ pushing up then down moves the checkboxes then stays on step 3.
    • ↑ pushing up then letting go puts some checkboxes past the top of the screen. Continue to step 4.
  4. the filter pop-up is at the top of the screen, the checkboxes are past that
    • ↑↓ pushing up then down allows bringing the checkboxes back in view. Return to step 3.
    • ↑ pushing up pushes even more checkboxes past the top of the screen. Stay on step 4.
    • ↓↑ EXPECTED: pushing down then up moves the checkboxes then stays on step 4.
    • ⇓⇑ ACTUAL: pushing down then up moves the pop-up then stays on step 4.
    • ↓ EXPECTED: pushing down brings the checkboxes back into view. Return to step 3.
    • ⇓ ACTUAL: pushing down pushes the filter pop-up down, hiding any checkboxes above the top of the pop-up. Continue to step 5.
  5. checkboxes are scrolled past the top of the filter pop-up, which is in the middle of the screen
    • ⇑ pushing up returns the pop-up to the top of the screen. Return to step 4.
    • ⇑⇓ pushing up then down moves the pop-up then stays on step 5.
    • ⇓⇑ pushing down then up moves the pop-up then stays on step 5.
    • ⇓ pushing down closes the pop-up. Return to step 1.
khonkhortisan commented 2 years ago

reference: https://material.io/components/sheets-bottom I tested this in bluestacks at 540×960 resolution, and noticed that the library FILTER works correctly. When all the filters are expanded: A. half popup: ⇑ pushing the titlebar up moves the popup to the top of the screen ⇓ pushing the titlebar down closes the popup

B. fullscreen popup: ⇑ pushing the titlebar up does nothing ⇓ pushing the titlebar moves it to the middle of the screen

This ended up complicated enough that I made a flowchart for both the library and extension popup behavior in graphviz shosetsu-155-top-of-screen shosetsu-155-top-of-screen.gv.txt When the popup is half-open with the checkboxes scrolled too high:

When everything is as high as it'll go:

Doomsdayrs commented 2 years ago

The filter menu is composed currently of two different view types.

The actual "Popup" is an android BottomSheetDialog, while the contents are composed of Compose views.

Because of this, I believe the BottomSheetDialog scroll mechanics are coming into play and interfering with how Compose is handling view scrolling.

As it currently stands, I do not know how to properly handle this.