about summary refs log tree commit diff
path: root/app/javascript/mastodon/components/scrollable_list.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
2022-03-06Spelling (#17705)Josh Soref
* spelling: account Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: affiliated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: appearance Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: autosuggest Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: cacheable Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: component Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: conversations Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: domain.example Clarify what's distinct and use RFC friendly domain space. Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: environment Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: exceeds Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: functional Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: inefficiency Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: not Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: notifications Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: occurring Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: position Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: progress Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: promotable Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: reblogging Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: repetitive Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: resolve Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: saturated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: similar Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: strategies Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: success Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: targeting Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: thumbnails Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unauthorized Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unsensitizes Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: validations Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: various Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-07-13Improve modal flow and back button handling (#16499)Claire
* Refactor shouldUpdateScroll passing So far, shouldUpdateScroll has been manually passed down from the very top of the React component hierarchy even though it is a static function common to all ScrollContainer instances, so replaced that with a custom class extending ScrollContainer. * Generalize “press back to close modal” to any modal and to public pages * Fix boost confirmation modal closing media modal
2020-07-18Fix keyboard navigation in scrollable lists (#14348)ThibG
Fixes #14347
2020-07-09Freeze scroll position when a dropdown menu is open in the TL (#14271)ThibG
* Freeze scroll position when a dropdown menu is open in the TL * Apply this to direct TL as well * Fix case when mouse leaves the menu
2020-06-14Add hints about incomplete remote content to web UI (#14031)Eugen Rochko
2020-03-17Fix WebUI crash in single-column mode on prehistoric browsers (#13267)ThibG
Fixes #13266
2020-01-20Fix “X new items” not showing up for slow mode on empty timelines (#12875)ThibG
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-31refactor IntersectionObserver to observe viewport in single-column mode (#12735)Matt Panaro
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-09-23Fix unread indicator not updating for notifications (#11923)Eugen Rochko
Regression from #11898
2019-09-21Fix updates being hidden behind pending items on unmounted components (#11898)Eugen Rochko
2019-09-16Fix “slow mode” issues (#11859)ThibG
* Fix weird scroll-jumping behavior with pending items * Treat pending items as unread items * Fix scroll position being altered because of the “X new items” button
2019-07-19Change single-column mode to scroll the whole page (#11359)Eugen Rochko
Fix #10840
2019-07-16Add option to disable real-time updates in web UI (#9984)Eugen Rochko
Fix #9031 Fix #7913
2019-02-11Fix timeline jumps (#10001)ThibG
* Avoid two-step rendering of statuses as much as possible Cache width shared by Video player, MediaGallery and Cards at the ScrollableList level, pass it down through StatusList and Notifications. * Adjust scroll when new preview cards appear * Adjust scroll when statuses above the current scroll position are deleted
2018-12-19Fix unnecessary loadMore calls when the end of a timeline has been reached ↵ThibG
(#9581) Fixes #9568
2018-12-12Various fixes to scrollable lists and media gallery (#9501)ThibG
* Always use the scrollable class for the ScrollList component Fixes #9499 as well as empty timelines' scrollbar “blinking” between loading state and empty state. * Do not display empty message when the list is known to have more elements Fixes #9500 * Fix LoadMore usage in account media gallery (Even though that codepath is probably never actually used…) * Make account media gallery more consistent with account timeline Fixes #9498 Display “load more” more consistently, add a loading indicator on first load. * Fix “load more” button when no data has been fetched
2018-11-11Only consider mouse move in scrolling on item insertion (#9262)Les Orchard
Fixes #9259
2018-11-09Identify manual scrolling to cancel scroll to top reset on mouse idle (#9245)Les Orchard
2018-11-08Use local instead of global loading indicator for timelines, account ↵Eugen Rochko
timelines (#9224) So that opening a profile feels faster. Also, pinned toots are not shown before other toots have loaded. Also, if no toots are loaded, added empty message
2018-11-08Cancel list scroll reset after mouse move on wheel scroll (#9233)Les Orchard
- Use object properties rather than component state for mouseMovedRecently and scrollToTopOnMouseIdle flags - Remove redundant scrollToTop prop call, also fixing an attempt to call an undefined prop. Fixes #9217
2018-11-05Temporarily hold timeline if mouse moved recently (fixes #8630) (#9200)Les Orchard
- On recent mouse movement, hold timeline position so statuses remain in place for interactions in progress. - If the timeline had been scrolled to the top before mouse movement, restore scroll on mouse idle.
2018-08-29Fix followers/follows layout issues from #8418 (#8505)Jakub Mendyk
* Add alwaysShowScrollbar prop to ScrollableList * Fix followers/follows layout issues from #8418
2018-05-29Always display tab navigation on local/federated timeline even when empty ↵Eugen Rochko
(#7663) Fix #7659
2018-05-06Fixes/rollback scroll changes (#7387)ThibG
* Revert "Do not re-position scroll when loading more (inserting items from below) (#7344)" This reverts commit 8c601b54ccf530bd193b4500fee439aa4e9162d0. * Revert "Prevent timeline from moving when cursor is hovering over it (fixes #7278) (#7327)" This reverts commit 58852695c8ec490239ed3812f82971f8c1e6c172.
2018-05-03Do not re-position scroll when loading more (inserting items from below) (#7344)ThibG
2018-05-03Prevent timeline from moving when cursor is hovering over it (fixes #7278) ↵ThibG
(#7327)
2018-04-16Fix scrolling behavior (#7151)ThibG
* Update React.JS * Use React's new lifecycles for scrollable lists * Clean up dead code * Make CodeClimate happy
2018-03-24Allow clients to fetch statuses made while they were offline (#6876)Akihiko Odaki
2018-03-05Replace onScrollToBottom with onLoadMore (#6615)Akihiko Odaki
onScrollToBottom was a function to run instead of onScrollToTop and onScroll when scrolling to the bottom. The behavior to prevent onScrollToTop was inconvenient because the viewport can be at the bottom and at the top at the same time if the viewport is larger than the container. onScrollToBottom was also called when the button to load more is clicked on contray to the name suggests, which led notifications and status_list_container components to mark the scrolled location is not at the top mistakenly. onLoadMore is a replacement for onScrollToBottom. It will be called independently from onScrollToTop and onScroll.
2017-11-01Replace react-router-scroll to react-router-scroll-4 (#5568)Yamagishi Kazutoshi
2017-10-06Implement hotkeys for web UI (#5164)Eugen Rochko
* Fix #2102 - Implement hotkeys Hotkeys on status list: - r to reply - m to mention author - f to favourite - b to boost - enter to open status - p to open author's profile - up or k to move up in the list - down or j to move down in the list - 1-9 to focus a status in one of the columns - n to focus the compose textarea - alt+n to start a brand new toot - backspace to navigate back * Add navigational hotkeys The key g followed by: - s: start - h: home - n: notifications - l: local timeline - t: federated timeline - f: favourites - u: own profile - p: pinned toots - b: blocked users - m: muted users * Add hotkey for focusing search, make escape un-focus compose/search * Fix focusing notifications column, fix hotkeys in compose textarea
2017-10-02Toggle contain:strict on fullscreen (#5159)Nolan Lawson
* Toggle contain:strict on fullscreen * Fix scss lint issue * fix scss whitespace lint issue
2017-09-16Fix invisible load more button (#4962)unarist
* Fix behavior while the button is invisible e.g. pointer cursor, couldn't open contextmenu * Avoid rendering the button to remove blank space if no more items are available or no items are rendered
2017-09-13Fix height cache (#4909)abcang
2017-09-09Disable mouse-based pause from #4859 (#4865)Eugen Rochko
It wasn't working ideally and introduced some annoying false positivies
2017-09-09Fix scroll behavior and others on paused timeline (#4864)unarist
Resolved: * Lot of redundant renders while mouse moving * Scroll jumping when timeline loaded * Scroll position isn't kept when statuses below the scrollTop was deleted then new status arrived Unresolved: * Scroll position isn't kept when statuses over the scrollTop was deleted then new status arrived -> It needs to know which statuses are over the scrollTop * New status indicator should be active when new statuses arrived while mouse moved recently -> It needs a) update indicator in ScrollableList, or b) set scrollTop status while mouse moving
2017-09-09Fix #1004 - Temporarily pause timeline if there's been recent mouse movement ↵Eugen Rochko
(#4859)
2017-09-06fix scroll position (#4821)Clworld
2017-08-28Generalized the infinite scrollable list (#4697)abcang