about summary refs log tree commit diff
path: root/app/javascript/mastodon/components/intersection_observer_article.js
AgeCommit message (Collapse)Author
2023-02-20Rename JSX files with proper `.jsx` extension (#23733)Renaud Chaput
2023-01-30Upgrade ESlint to v8 (#23305)Nick Schonning
2021-07-13Change references to tootsuite/mastodon to mastodon/mastodon (#16491)Claire
* Change references to tootsuite/mastodon to mastodon/mastodon * Remove obsolete test fixture * Replace occurrences of tootsuite/mastodon with mastodon/mastodon in CHANGELOG And a few other places
2020-09-26Add unread notification markers (#14818)ThibG
* Add unread notification markers Fixes #14804 * Allow IntersectionObserverArticle's children to be updated
2020-03-08Code style improvements in JavaScript (#13159)Bèr Kessels
* JS-linter: fix trailing comma's * Configure eslinter to ignore this onchange error.
2020-01-02Fix 12661 (#12744)Matt Panaro
* Revert "persist last-intersected status update and restore when ScrollableList is restored" This reverts commit 07e26142ef6a8e74bd2ac5e9b461a5a1699bd4c8. accidentally merged spurious code in https://github.com/tootsuite/mastodon/pull/12661. https://github.com/tootsuite/mastodon/pull/12735 removes the slowdown that this code was trying to solve; and other functionality successfully restores the view state of the list * Revert "cache currently-viewing status id to avoid calling redux with identical value" This reverts commit c93df2159fbd3888a5c48d8a8b8ae61dbbc54b89. accidentally merged spurious code in https://github.com/tootsuite/mastodon/pull/12661. https://github.com/tootsuite/mastodon/pull/12735 removes the slowdown that this code was trying to solve; and other functionality successfully restores the view state of the list
2019-12-29Summary: fix slowness due to layout thrashing when reloading a large … ↵Matt Panaro
(#12661) * Summary: fix slowness due to layout thrashing when reloading a large set of status updates in order to limit the maximum size of a status in a list view (e.g. the home timeline), so as to avoid having to scroll all the way through an abnormally large status update (see https://github.com/tootsuite/mastodon/pull/8205), the following steps are taken: •the element containing the status is rendered in the browser •its height is calculated, to determine if it exceeds the maximum height threshold. Unfortunately for performance, these steps are carried out in the componentDidMount(/Update) method, which also performs style modifications on the element. The combination of height request and style modification during javascript evaluation in the browser leads to layout-thrashing, where the elements are repeatedly re-laid-out (see https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing & https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Performance_best_practices_for_Firefox_fe_engineers). The solution implemented here is to memoize the collapsed state in Redux the first time the status is seen (e.g. when fetched as part of a small batch, to populate the home timeline) , so that on subsequent re-renders, the value can be queried, rather than recalculated. This strategy is derived from https://github.com/tootsuite/mastodon/pull/4439 & https://github.com/tootsuite/mastodon/pull/4909, and should resolve https://github.com/tootsuite/mastodon/issues/12455. Andrew Lin (https://github.com/onethreeseven) is thanked for his assistance in root cause analysis and solution brainstorming * remove getSnapshotBeforeUpdate from status * remove componentWillUnmount from status * persist last-intersected status update and restore when ScrollableList is restored e.g. when navigating from home-timeline to a status conversational thread and <Back again * cache currently-viewing status id to avoid calling redux with identical value * refactor collapse toggle to pass explicit boolean
2019-02-06Fix IntersectionObserverArticle not hiding some out-of-view items (#9982)ThibG
IntersectionObserverArticle is made to save on RAM by avoiding fully rendering items that are far out of view. However, it did not work for items spawned outside the intersection observer.
2018-08-23Fix off-by-one error in aria-posinset (#8388)Eugen Rochko
Fix #8191
2017-09-30Improve IntersectionObserverArticle perf (#5152)Nolan Lawson
2017-09-22Eliminate re-renders for intersection_observer_article.js (#5036)Nolan Lawson
2017-09-13Fix height cache (#4909)abcang
2017-08-28Generalized the infinite scrollable list (#4697)abcang