Changeset 77019fa in Klonkt for src/assets/js/mod/read.js


Ignore:
Timestamp:
08/20/2026 10:24:40 AM (3 weeks ago)
Author:
Robin <roboburr@…>
Branches:
main
Children:
96a99bf
Parents:
22d2dba5
Message:

Reader: the last post snaps too

Its top used to be unreachable — too little page below it to bring it to
the top edge (measured: snap point 2548, max scroll 2356) — so the
browser fell back to the nearest reachable position, the bottom. The
previous answer was to drop its snap point; this is the real one: the
LAST post gets a full screen height, which makes that top exactly
reachable (shorter posts grow to fit, taller ones already were). Costs
nothing visually — posts have no frame, only a separator above.

lvh, not svh: with a disappearing address bar the visible screen is
sometimes the large viewport, and svh would fall just short.

Co-Authored-By: Claude Fable 5 <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/assets/js/mod/read.js

    r22d2dba5 r77019fa  
    392392    easing: (t) => 1 - Math.pow(1 - t, 4),
    393393  });
    394   // Het snappunt is de bovenkant van elk bericht. Het laatste doet niet mee:
    395   // zijn bovenkant is niet te bereiken, er zit te weinig pagina onder.
     394  // Het snappunt is de bovenkant van elk bericht -- ook van het laatste. Dat
     395  // deed eerder niet mee omdat zijn bovenkant onbereikbaar was; sinds het
     396  // laatste bericht in CSS een volle schermhoogte krijgt, kan hij wel.
    396397  const berichten = [...document.querySelectorAll('.feed-reader .read-post')];
    397   berichten.slice(0, -1).forEach((a) => snap.addElement(a, { align: 'start' }));
     398  berichten.forEach((a) => snap.addElement(a, { align: 'start' }));
    398399
    399400  // ALLEEN VOORUIT VANGEN. Dit hoort bij de ruime zone hierboven en is niet
Note: See TracChangeset for help on using the changeset viewer.