about summary refs log tree commit diff
path: root/app/javascript/mastodon/reducers/timelines.js
AgeCommit message (Collapse)Author
2022-12-19Enable eslint:recommended ruleset (#22433)Nick Schonning
* Enable ESLint recommended ruleset * Disable failing ESLint recommended rules * Remove rules shadowed by eslint:recommended
2022-04-07Fix potentially missing statuses when reconnecting to websocket (#17981)Claire
* Fix potentially missing statuses when reconnecting to websocket * Add gap on reconnect rather than maintaining it constantly
2022-04-07Fix older items possibly disappearing on timeline updates (#17980)Claire
In some rare cases, when receiving statuses out of order from the streaming API then polling from the REST API, it was possible for the `expandNormalizedTimeline` function to remove older items from the timeline. This commit ensures that any item from the replaced slice that is older than the oldest item retrieved from the API gets added back to the replaced slice.
2022-04-06Fix possible duplicate statuses in timelines in some edge cases (#17971)Claire
In some rare cases, when receiving statuses out of order from the streaming API then polling from the REST API, it was possible for the `expandNormalizedTimeline` function to insert duplicates in the timeline, which would then result in several bugs. This commits ensures that there are no duplicates inserted in the timeline.
2021-05-07Change home timeline to reload after follow recommendations in web UI (#16160)Eugen Rochko
2020-04-28Refactor/cleanup TIMELINE_DELETE-related code (#13175)ThibG
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-09-23Revert "Change timelines to add new items to pending items when scrolled ↵Eugen Rochko
down #11867" (#11921) Fix #11912
2019-09-18Fix “load more” adding older toots/notifications to pending items (#11883)ThibG
2019-09-16Change timelines to add new items to pending items when scrolled down (#11867)ThibG
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-16Add option to disable real-time updates in web UI (#9984)Eugen Rochko
Fix #9031 Fix #7913
2019-06-05Fix refreshing featured toots when the new collection is empty (#10971)ThibG
Fixes #10945
2019-03-24Do not empty timeline of blocked users on block (#10359)ThibG
Fixes #10226
2019-03-07Fix public timelines being broken by new toots when they are not mounted ↵Eugen Rochko
(#10131)
2019-03-01Fix home timeline perpetually reloading when empty (#10130)Eugen Rochko
Regression from #6876
2018-12-30Fix crash when clearing uninitialized timeline (#9662)ThibG
2018-12-14Fix timeline pagination in the WebUI (#9516)ThibG
The `hasMore` property of timelines in redux store was set whenever an API request returned only one page of results, *even* if the query only requested newer statuses (using `since_id`), causing `hasMore` to be incorrectly set to false whenever fetching new toots in a timeline, which happens each time an account's timeline or media gallery is visited.
2018-11-05Allow joining several hashtags in a single column (#8904)James Kiesel
* Nascent tag menu on frontend * Hook up frontend to search * Tag intersection backend first pass * Update yarnlock * WIP * Fix for tags not searching correctly * Make radio buttons function * Simplify radio buttons with modeOption * Better naming * Rearrange options * Add all/any/none functionality on backend * Small PR cleanup * Move to service from scope * Small cleanup, add proper service tests * Don't use send with user input :D * Set appropriate column header * Handle auto updating timeline * Fix up toggle function * Use tag value correctly * A bit more correct to use 'self' rather than 'all' in status scope * Fix some style issues * Fix more code style issues * Style select dropdown more better * Only use to_id'ed value to ensure no SQL injection * Revamp frontend to allow for multiple selects * Update backend / col header to account for more flexible tagging * Update brakeman ignore * Codeclimate suggestions * Fix presenter tag_url * Implement initial PR feedback * Handle additional tag streaming * CodeClimate tweak
2018-05-19Skip pagination logic for pinned account timelines in reducer (#7540)Eugen Rochko
Fix #7516
2018-05-05Fix gap insertion for timeline disconnection (#7363)Akihiko Odaki
2018-04-24Fix ID duplication in timelines (#7251)Akihiko Odaki
2018-04-18Fix comparing id (#7180)abcang
2018-03-24Allow clients to fetch statuses made while they were offline (#6876)Akihiko Odaki
2018-01-19Do not throw away statuses obtained via websocket when API request finishes ↵ThibG
(#6302)
2018-01-17Fix home regeneration (#6251)Eugen Rochko
* Fix regeneration marker not being removed after completion * Return HTTP 206 from /api/v1/timelines/home if regeneration in progress Prioritize RegenerationWorker by putting it into default queue * Display loading indicator and poll home timeline while it regenerates * Add graphic to regeneration message * Make "not found" indicator consistent with home regeneration
2017-11-24Don't remove originals of boosted toots from timeline (#5479)sdukhovni
* Don't remove originals of boosted toots from timeline * Remove unused argument to updateTimeline
2017-10-17When unreblog arrives over streaming API, just delete in UI (#5439)Eugen Rochko
2017-10-16Filter out duplicate IDs in timelines reducer (#5417)Eugen Rochko
Possibly the cause of #5379, #5377
2017-10-13When unfollowing, remove from home in web UI immediately (#5369)Eugen Rochko
Do NOT send "delete" through streaming API when unmerging from home timeline. "delete" implies that the original status was deleted, which is not true!
2017-07-11refactor: Rewrite immutablejs import statements using destructuring (#4147)Sorin Davidoi
2017-06-23Remove unused variables (#3906)Yamagishi Kazutoshi
2017-06-11Fix #3665 - Refactor timelines reducer (#3686)Eugen Rochko
* Move ancestors/descendants out of timelines reducer * Refactor timelines reducer All types of timelines now have a flat structure and use the same reducer functions and actions * Reintroduce some missing behaviours * Fix wrong import in reports * Fix includes typo * Fix issue related to "next" pagination in timelines and notifications * Fix bug with timeline's initial state, expandNotifications
2017-05-31Fix load more on account timelines (regression from #3311) (#3475)unarist
This prevents `next` state from being overridden on the loading *new* statuses.
2017-05-26Remove status context construction in the React side (#3331)unarist
because it may causes flicker on the conversation when it contains blocked/muted user's status. We use `/api/v1/statuses/{id}/context` to obtain status ids in the conversation which filters blocked/muted user, but also uses internal cache constructed from `in_reply_to_id` by `normalizeStatus()` in `reducers/timelines.js` on each status loading which doesn't filter. So statuses appears in conversation if those are cached, even those statuses are from blocked/muted user. Then context cache will be updated with the result of the context API and those statuses will be removed. I have left the `normalizeStatus()` function itself which is called many functions in the file as a placeholder for now, but maybe it should be removed completely.
2017-05-25More use of next link header on account (media) timelines (#3311)unarist
This will reduce requests on who have only few statuses. - Use next link header to detect more items from first request - Omit next link header if result items are fewer than requested count (It had omit it only if result was empty before)
2017-05-25Fix load more feature on the Account media gallery (#3293)unarist
* Add load more button for large screens * Fix `next` state value on the first loading * Don't load if `isLoading || !hasMore` * Start load on near the bottom
2017-05-20Improve eslint rules (#3147)Yamagishi Kazutoshi
* Add semi to ESLint rules * Add padded-blocks to ESLint rules * Add comma-dangle to ESLint rules * add config/webpack and storyboard * add streaming/ * yarn test:lint -- --fix
2017-05-20Add account media gallery view to web UI (#3120)Eugen Rochko
* Add account media gallery view to web UI * Link media view from account dropdown * Adjust link
2017-05-03Replace sprockets/browserify with Webpack (#2617)Eugen Rochko
* Replace browserify with webpack * Add react-intl-translations-manager * Do not minify in development, add offline-plugin for ServiceWorker background cache updates * Adjust tests and dependencies * Fix production deployments * Fix tests * More optimizations * Improve travis cache for npm stuff * Re-run travis * Add back support for custom.scss as before * Remove offline-plugin and babili * Fix issue with Immutable.List().unshift(...values) not working as expected * Make travis load schema instead of running all migrations in sequence * Fix missing React import in WarningContainer. Optimize rendering performance by using ImmutablePureComponent instead of React.PureComponent. ImmutablePureComponent uses Immutable.is() to compare props. Replace dynamic callback bindings in <UI /> * Add react definitions to places that use JSX * Add Procfile.dev for running rails, webpack and streaming API at the same time