diff --git a/CHANGELOG.md b/CHANGELOG.md index ec73b612a..c7747a7fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,9 @@ - Updated NetworkTimeline, fix remote comment urls. ([308acc91](https://github.com/pixelfed/pixelfed/commit/308acc91)) - Updated Timeline component, abstracted reusable partials. ([858f3f9e](https://github.com/pixelfed/pixelfed/commit/858f3f9e)) - Updated Timeline, fix suggested posts. ([3ba5c88c](https://github.com/pixelfed/pixelfed/commit/3ba5c88c)) +- Updated Timeline, disable new post update checker and hide reaction bar on network timeline. ([1e3d3a69](https://github.com/pixelfed/pixelfed/commit/1e3d3a69)) +- Updated PublicApiController, improve network timeline perf. ([e5f683fd](https://github.com/pixelfed/pixelfed/commit/e5f683fd)) +- Updated Network Timeline, use existing Timeline component. ([0deaafc0](https://github.com/pixelfed/pixelfed/commit/0deaafc0)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.0 (2021-06-01)](https://github.com/pixelfed/pixelfed/compare/v0.10.10...v0.11.0) diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index a6a44a525..2eafe7044 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -15,7 +15,7 @@ use App\{ StatusView, UserFilter }; -use Auth,Cache; +use Auth, Cache; use Carbon\Carbon; use League\Fractal; use App\Transformer\Api\{ @@ -27,6 +27,8 @@ use App\Transformer\Api\{ use App\Services\{ AccountService, PublicTimelineService, + StatusService, + SnowflakeService, UserFilterService }; use App\Jobs\StatusPipeline\NewStatusPipeline; @@ -498,6 +500,7 @@ class PublicApiController extends Controller $max = $request->input('max_id'); $limit = $request->input('limit') ?? 3; $user = $request->user(); + $amin = SnowflakeService::byDate(now()->subDays(90)); $key = 'user:last_active_at:id:'.$user->id; $ttl = now()->addMinutes(5); @@ -513,61 +516,41 @@ class PublicApiController extends Controller $timeline = Status::select( 'id', 'uri', - 'caption', - 'rendered', - 'profile_id', 'type', - 'in_reply_to_id', - 'reblog_of_id', - 'is_nsfw', 'scope', - 'local', - 'reply_count', - 'comments_disabled', - 'place_id', - 'likes_count', - 'reblogs_count', 'created_at', - 'updated_at' )->where('id', $dir, $id) ->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album']) ->whereNotNull('uri') ->whereScope('public') - ->where('created_at', '>', now()->subMonths(3)) + ->where('id', '>', $amin) ->orderBy('created_at', 'desc') ->limit($limit) - ->get(); + ->get() + ->map(function($s) { + return StatusService::get($s->id); + }); + $res = $timeline->toArray(); } else { - $timeline = Status::select( - 'id', - 'uri', - 'caption', - 'rendered', - 'profile_id', - 'type', - 'in_reply_to_id', - 'reblog_of_id', - 'is_nsfw', - 'scope', - 'local', - 'reply_count', - 'comments_disabled', - 'created_at', - 'place_id', - 'likes_count', - 'reblogs_count', - 'updated_at' - )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album']) - ->with('profile', 'hashtags', 'mentions') - ->whereNotNull('uri') - ->whereScope('public') - ->where('created_at', '>', now()->subMonths(3)) - ->orderBy('created_at', 'desc') - ->simplePaginate($limit); + $timeline = Status::select( + 'id', + 'uri', + 'type', + 'scope', + 'created_at', + )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album']) + ->whereNotNull('uri') + ->whereScope('public') + ->where('id', '>', $amin) + ->orderBy('created_at', 'desc') + ->limit($limit) + ->get() + ->map(function($s) { + return StatusService::get($s->id); + }); + $res = $timeline->toArray(); } - $fractal = new Fractal\Resource\Collection($timeline, new StatusTransformer()); - $res = $this->fractal->createData($fractal)->toArray(); return response()->json($res); } diff --git a/public/js/network-timeline.js b/public/js/network-timeline.js deleted file mode 100644 index d8d8cac0d..000000000 Binary files a/public/js/network-timeline.js and /dev/null differ diff --git a/public/js/profile-directory.js b/public/js/profile-directory.js index ec442eacf..78d265d64 100644 Binary files a/public/js/profile-directory.js and b/public/js/profile-directory.js differ diff --git a/public/js/profile.js b/public/js/profile.js index 8805d6973..18f9c2e78 100644 Binary files a/public/js/profile.js and b/public/js/profile.js differ diff --git a/public/js/quill.js b/public/js/quill.js index d18b5786f..c729e43a2 100644 Binary files a/public/js/quill.js and b/public/js/quill.js differ diff --git a/public/js/rempos.js b/public/js/rempos.js index c3fce86a4..93fd6fa7c 100644 Binary files a/public/js/rempos.js and b/public/js/rempos.js differ diff --git a/public/js/rempro.js b/public/js/rempro.js index 74e5c8008..0bad41ba4 100644 Binary files a/public/js/rempro.js and b/public/js/rempro.js differ diff --git a/public/js/search.js b/public/js/search.js index 1a4fb5a00..fc8e92345 100644 Binary files a/public/js/search.js and b/public/js/search.js differ diff --git a/public/js/status.js b/public/js/status.js index 6eded60ea..63b0e7e36 100644 Binary files a/public/js/status.js and b/public/js/status.js differ diff --git a/public/js/story-compose.js b/public/js/story-compose.js index c3361d98c..84256a502 100644 Binary files a/public/js/story-compose.js and b/public/js/story-compose.js differ diff --git a/public/js/theme-monokai.js b/public/js/theme-monokai.js index 37080367b..88f12f95b 100644 Binary files a/public/js/theme-monokai.js and b/public/js/theme-monokai.js differ diff --git a/public/js/timeline.js b/public/js/timeline.js index 8428a86ca..98a560970 100644 Binary files a/public/js/timeline.js and b/public/js/timeline.js differ diff --git a/public/js/vendor.js b/public/js/vendor.js index 70d7fe465..f43c3454e 100644 Binary files a/public/js/vendor.js and b/public/js/vendor.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index f7ab36385..1bbf03443 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/assets/js/components/NetworkTimeline.vue b/resources/assets/js/components/NetworkTimeline.vue deleted file mode 100644 index d8dd685b7..000000000 --- a/resources/assets/js/components/NetworkTimeline.vue +++ /dev/null @@ -1,2197 +0,0 @@ - - - - - diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue index fd192fb4c..eed3f5c9d 100644 --- a/resources/assets/js/components/Timeline.vue +++ b/resources/assets/js/components/Timeline.vue @@ -105,6 +105,7 @@ @@ -707,7 +708,8 @@ discover_feed: [], recentFeed: this.scope === 'home' ? true : false, recentFeedMin: null, - recentFeedMax: null + recentFeedMax: null, + reactionBar: this.scope === 'network' ? false : true } }, @@ -831,7 +833,8 @@ this.fetchHashtagPosts(); } // this.fetchStories(); - this.rtw(); + // this.rtw(); + setTimeout(function() { document.querySelectorAll('.timeline .card-body .comments .comment-body a').forEach(function(i, e) { i.href = App.util.format.rewriteLinks(i); @@ -902,10 +905,10 @@ if(self.ids.indexOf(d.id) == -1) { self.feed.push(d); self.ids.push(d.id); - vids.push({ - sid: d.id, - pid: d.account.id - }); + // vids.push({ + // sid: d.id, + // pid: d.account.id + // }); } }); this.min_id = Math.max(...this.ids).toString(); @@ -913,9 +916,9 @@ this.page += 1; $state.loaded(); this.loading = false; - axios.post('/api/status/view', { - '_v': vids, - }); + // axios.post('/api/status/view', { + // '_v': vids, + // }); } else { $state.complete(); } diff --git a/resources/assets/js/components/partials/StatusCard.vue b/resources/assets/js/components/partials/StatusCard.vue index e920d4a37..9f654e6da 100644 --- a/resources/assets/js/components/partials/StatusCard.vue +++ b/resources/assets/js/components/partials/StatusCard.vue @@ -74,7 +74,7 @@
-
+

@@ -140,6 +140,11 @@ recommended: { type: Boolean, default: false + }, + + reactionBar: { + type: Boolean, + default: true } }, diff --git a/resources/assets/js/network-timeline.js b/resources/assets/js/network-timeline.js deleted file mode 100644 index e66d90ce5..000000000 --- a/resources/assets/js/network-timeline.js +++ /dev/null @@ -1,49 +0,0 @@ -Vue.component( - 'notification-card', - require('./components/NotificationCard.vue').default -); - -Vue.component( - 'photo-presenter', - require('./components/presenter/PhotoPresenter.vue').default -); - -Vue.component( - 'video-presenter', - require('./components/presenter/VideoPresenter.vue').default -); - -Vue.component( - 'photo-album-presenter', - require('./components/presenter/PhotoAlbumPresenter.vue').default -); - -Vue.component( - 'video-album-presenter', - require('./components/presenter/VideoAlbumPresenter.vue').default -); - -Vue.component( - 'mixed-album-presenter', - require('./components/presenter/MixedAlbumPresenter.vue').default -); - -Vue.component( - 'post-menu', - require('./components/PostMenu.vue').default -); - -Vue.component( - 'network-timeline', - require('./components/NetworkTimeline.vue').default -); - -Vue.component( - 'announcements-card', - require('./components/AnnouncementsCard.vue').default -); - -Vue.component( - 'story-component', - require('./components/StoryTimelineComponent.vue').default -); diff --git a/resources/views/timeline/network.blade.php b/resources/views/timeline/network.blade.php index 436a1718d..224411b32 100644 --- a/resources/views/timeline/network.blade.php +++ b/resources/views/timeline/network.blade.php @@ -2,12 +2,12 @@ @section('content') - + @endsection @push('scripts') - + @endpush diff --git a/webpack.mix.js b/webpack.mix.js index edbc889a8..877cad9a4 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -27,18 +27,10 @@ mix.js('resources/assets/js/app.js', 'public/js') .js('resources/assets/js/collections.js', 'public/js') .js('resources/assets/js/profile-directory.js', 'public/js') .js('resources/assets/js/story-compose.js', 'public/js') -// .js('resources/assets/js/embed.js', 'public') .js('resources/assets/js/direct.js', 'public/js') .js('resources/assets/js/admin.js', 'public/js') -// .js('resources/assets/js/micro.js', 'public/js') .js('resources/assets/js/rempro.js', 'public/js') .js('resources/assets/js/rempos.js', 'public/js') -//.js('resources/assets/js/timeline_next.js', 'public/js') -// .js('resources/assets/js/memoryprofile.js', 'public/js') -// .js('resources/assets/js/my2020.js', 'public/js') -.js('resources/assets/js/network-timeline.js', 'public/js') -// .js('resources/assets/js/drive.js', 'public/js') -// .js('resources/assets/js/register.js', 'public/js') .extract([ 'lodash',