The reader rebuilds its scroller when an item opens on a phone (#450)
Every scroll_stuck report since the added fields was a short drag over text in a reader whose content had just been swapped, with nothing over it, nothing inert and the touch left alone by the page: iOS kept the drag and did not scroll. That fits WebKit keeping an overflow box's scroller sized for what was there before. Overflow is taken away for two frames after each open, and after a stuck drag is caught, so the scroller is built again; the report now says how long since the last one, which tells whether this freed it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RqkrVCCH8YcP2Y3i8VNYWA
This commit is contained in:
@@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Fixed
|
||||
|
||||
- On a phone, the line under an unread episode's title starts where the title does, past its dot, and the date sits on the title's line instead of between the two (#500).
|
||||
- On an iPhone, the reader rebuilds its scrolling each time an item opens, and again after a drag that did not move it, so a freshly opened item scrolls on the first try (#450).
|
||||
- The count under All Subscriptions counts only its own unread items, not those of feeds hidden from it, so it agrees with the header (#499).
|
||||
- An item without a title is named in bold like the rest of the list, not in regular weight beside them (#498).
|
||||
- The X on a playlist's episode marks it played again; it did nothing (#497).
|
||||
|
||||
@@ -243,7 +243,20 @@ document.addEventListener('touchend', ev => {
|
||||
if(stuckDrag(dy, dx, g.top, d.scrollTop, room)) stuck(d, t, g, dy, room, ms);
|
||||
}, 300);
|
||||
});
|
||||
/// Makes iOS build the reader's scroller again (#450): every stuck drag was on a reader whose
|
||||
/// content had been swapped, with nothing over it and the touch left alone, which is WebKit keeping
|
||||
/// a scroller sized for what was there before. Two frames without overflow, so the hidden state is
|
||||
/// committed and not merged away with the change back.
|
||||
function rearm(d: HTMLElement){
|
||||
d.style.overflowY = 'hidden';
|
||||
requestAnimationFrame(() => requestAnimationFrame(() => { d.style.overflowY = ''; }));
|
||||
}
|
||||
let stuckAt = 0;
|
||||
function stuck(d: HTMLElement, t: Touch, g: NonNullable<typeof drag>, dy: number, room: number, ms: number){
|
||||
rearm(d);
|
||||
// A second report soon after the first says rearm did not free it.
|
||||
const again = stuckAt ? Math.round((Date.now() - stuckAt) / 1000) + 's ago' : 'never';
|
||||
stuckAt = Date.now();
|
||||
const inert = ([...document.body.children] as HTMLElement[]).filter(el => el.inert).map(named).join(' ');
|
||||
report('scroll_stuck', {feed: S.feed, state: [
|
||||
`top ${g.top} of ${room}`, `drag ${Math.round(dy)}px`, `started on ${g.on}`,
|
||||
@@ -253,5 +266,5 @@ function stuck(d: HTMLElement, t: Touch, g: NonNullable<typeof drag>, dy: number
|
||||
`overflow ${getComputedStyle(d).overflowY}`, `reading ${document.body.classList.contains('reading')}`,
|
||||
`shown ${Math.round((Date.now() - shownAt) / 1000)}s ago`, `${S.entries.length} loaded`,
|
||||
`from x ${Math.round(g.x)}`, `${g.moves} moves seen in ${ms}ms`, `touch ${g.cancelled ? 'cancelled' : 'left alone'}`,
|
||||
`slid ${slidAt ? Math.round((Date.now() - slidAt) / 1000) + 's ago' : 'never'}`].join(', ')});
|
||||
`slid ${slidAt ? Math.round((Date.now() - slidAt) / 1000) + 's ago' : 'never'}`, `last stuck ${again}`].join(', ')});
|
||||
}
|
||||
|
||||
@@ -425,6 +425,7 @@ function showDetail(e: Entry|null){
|
||||
const narrow=!!window.matchMedia?.('(max-width:820px)')?.matches;
|
||||
box.innerHTML=detailHtml(e);
|
||||
if(files) files.innerHTML=narrow?'':`<div class="fhd">Files</div>${encs}`;
|
||||
if(narrow) rearm(box);
|
||||
$<HTMLButtonElement>('#dback').onclick=()=>showDetail(null);
|
||||
const view=box.querySelector<HTMLSelectElement>('.tview');
|
||||
if(view) view.onchange=()=>{
|
||||
|
||||
Reference in New Issue
Block a user