| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| const { navigationBarHeight } = useNovelContext(); | ||
| // Use reactive viewport height so footer animation targets stay correct | ||
| // when the host window is resized (e.g. WSA, foldables, split-screen). | ||
| // The previous SCREEN_HEIGHT constant from @gorhom/bottom-sheet captures |
There was a problem hiding this comment.
comments are ok, but there is no need to explain the old way.
Sorry, something went wrong.
There was a problem hiding this comment.
Done in 1334ea9 — dropped the two lines that explain what the previous SCREEN_HEIGHT did, kept the two that describe the current behaviour. Rechecked the new comments in core.js too; those only describe the current code, so I left them as-is.
Sorry, something went wrong.
Per review feedback (lnreader#1827): the inline comment explaining what the previous SCREEN_HEIGHT constant from @gorhom/bottom-sheet did is context that belongs in the PR description, not the code. Keep the two lines that explain what the new code does.
|
Could you rebase the PR once? |
Sorry, something went wrong.
Current master already contains the reactive viewport and footer changes that this branch originally carried. Preserve those upstream implementations and retain the remaining desktop-host behavior by mapping unmodified navigation keys to paged and scroll reader actions while ignoring editable targets and shortcut modifiers.
| Back | FazBrowse Home | New Git URL |
Summary
Reader UI assumed a fixed viewport captured at first render. A few host environments break that assumption — Windows Subsystem for Android (WSA), foldables, freeform multi-window, split-screen — so click-zone classification, page count, scroll amounts and the bottom-menu animation all kept the original viewport values after the host window changed size. There was also no keyboard support, which is the dominant input on desktop-class hosts like WSA.
This PR makes the reader layout reactive to viewport changes and adds keyboard page navigation.
android/app/src/main/assets/js/core.js
src/screens/reader/components/ReaderFooter.tsx
Why
Tested on WSA where the host can be resized at any time. Before:
After: all three flows behave as expected. On phones / fixed-size devices behaviour is unchanged — innerWidth/Height equals the device width/height when the app is full-screen, the resize listener never fires, and the keyboard handler simply has no events to react to.
Test plan
Notes