Repository navigation
fix(themes): keep article nav bar pinned to bottom in iOS standalone PWAs - #8933
Conversation
…PWAs On iOS standalone PWAs, WebKit fails to repaint `position: fixed` elements after a programmatic scroll, so the article navigation bar (#nav_entries) drifts to the middle of the screen after tapping the prev/next buttons (which scroll the article container in JS). This does not happen in regular Safari, where the browser chrome provides repaint hooks the standalone shell lacks. Promote #nav_entries to its own compositor layer (transform: translateZ(0)) so WebKit keeps it pinned to the viewport across programmatic scrolls. This supersedes FreshRSS#8833, whose `top: auto` was a no-op: nothing in the stylesheet ever sets a `top` value on #nav_entries, so it could not affect positioning. Fixes FreshRSS#8829
| pinned to the viewport after a programmatic scroll (e.g. prev/next entry), | ||
| working around a WebKit bug that otherwise lets it drift to mid-screen. */ | ||
| transform: translateZ(0); | ||
| will-change: transform; |
There was a problem hiding this comment.
I cannot test Safari. Could you double-check whether will-change is necessary? transform might be sufficient.
There was a problem hiding this comment.
Hi! Thanks for the review. I tested it without will-change and the fix works with transform only. I've pushed a commit with this revision.
The compositor layer that keeps #nav_entries pinned in iOS standalone PWAs comes entirely from transform: translateZ(0). The accompanying will-change: transform was redundant — it only hints at upcoming changes and adds nothing to an element already promoted to its own layer. Removing it leaves the bar pinned across programmatic scrolls (verified on an iOS standalone PWA), with no behavioural change. Based on maintainer feedback on FreshRSS#8933.
|
@Alkarex upon further usage following these commits, I found that my fix worked temporarily but whenever the DOM was updated introducing new content, the bug returned. Can this be reverted? I will continue to debug. |
Thanks for the additional feedback. For reverting, please send a new PR |
…ndalone PWAs (#8933)" (#8934) This reverts commit 5c5b0b9 (PR #8933). The `transform: translateZ(0)` added to #nav_entries promotes the element to its own compositor layer, but a non-`none` transform also makes the element a containing block for `position: fixed` descendants and establishes a new stacking context. That side effect introduced a regression, so this restores the previous behaviour while a less invasive fix for #8829 is worked out. Reverting the whole PR (CSS + CREDITS.md) for a clean rollback.
Problem
When FreshRSS is used as a standalone PWA on iOS (added to the home screen), the article navigation bar (
#nav_entries, the prev / up / next buttons) detaches from the bottom and drifts to the middle of the screen after tapping the prev/next buttons.Fixes #8829.
Cause
#nav_entriesisposition: fixed; bottom: 0. On iOS standalone PWAs, WebKit fails to repaintposition: fixedelements after a programmatic scroll. Tapping prev/next runsnext_entry/prev_entry→toggleContent, which scrolls the article container in JS (box_to_move.scrollTop = …). That scripted scroll is the trigger, which is why the bar wanders only after using those buttons — and why it does not happen in regular Safari, where the browser chrome provides repaint hooks the standalone shell lacks.This also explains why #8833 did not fix it: its
top: autowas a no-op, because nothing in the stylesheet ever sets atopvalue on#nav_entries.Fix
Promote
#nav_entriesto its own compositor layer (transform: translateZ(0)+will-change: transform). WebKit then keeps it pinned to the viewport across programmatic scrolls. Minimal, vanilla CSS, no new dependencies.frss.rtl.csswas regenerated withmake rtl(not hand-edited).Testing
Verified on an iPhone home-screen PWA (Mobile Safari 26.x): with the change, the bar stays anchored at the bottom while tapping prev/next through articles. Behaviour in desktop/regular Safari is unchanged.