···402402 state = state.copyWith(loadedPosts: updatedPosts);
403403 }
404404405405+ /// Removes a post at the specified index from the feed
406406+ /// and adjusts the current index if necessary.
407407+ void removePostAtIndex(int index) {
408408+ if (index < 0 || index >= state.length) return;
409409+410410+ final postToRemove = state.loadedPosts[index];
411411+ final updatedPosts = [...state.loadedPosts]..removeAt(index);
412412+413413+ // Clean up extraInfo for the removed post
414414+ final updatedExtraInfo = LinkedHashMap<AtUri, ({List<Label> postLabels})>.from(state.extraInfo)..remove(postToRemove.uri);
415415+416416+ // Adjust current index: if we removed a post before current position,
417417+ // decrement index to stay on the same visual post
418418+ final newIndex = state.index > index ? state.index - 1 : state.index;
419419+420420+ state = state.copyWith(
421421+ loadedPosts: updatedPosts,
422422+ extraInfo: updatedExtraInfo,
423423+ index: newIndex,
424424+ );
425425+ }
426426+405427 /// Checks if a post should be hidden based on its labels and user preferences
406428 Future<bool> _shouldHidePost(AtUri uri, List<Label> postLabels) async {
407429 final settings = ref.read(settingsProvider.notifier);
+20-2
lib/src/features/feed/ui/pages/feed_page.dart
···4040 super.dispose();
4141 }
42424343+ /// Scrolls to the next post and removes the current one from the feed.
4444+ /// This allows users to quickly advance through their feed while
4545+ /// removing posts they've already seen.
4646+ Future<void> scrollToNextAndRemovePrevious() async {
4747+ final state = ref.read(feedProvider(widget.feed));
4848+ final notifier = ref.read(feedProvider(widget.feed).notifier);
4949+ final currentIndex = state.index;
5050+5151+ // Check if there's a next post to scroll to
5252+ if (currentIndex >= state.length - 1) return;
5353+5454+ // Remove the current post. Since the PageController is at currentIndex,
5555+ // and we're removing the item at currentIndex, the next post naturally
5656+ // takes its place at the same index. The PageView will rebuild with
5757+ // the new item at this index, effectively showing the "next" post.
5858+ notifier.removePostAtIndex(currentIndex);
5959+ }
6060+4361 @override
4462 Widget build(BuildContext context) {
4563 super.build(context); // Required for AutomaticKeepAliveClientMixin
···146164 if (shouldBeActive) {
147165 return Stack(
148166 children: [
149149- FeedPostWidget(index: index, feed: widget.feed),
167167+ FeedPostWidget(index: index, feed: widget.feed, onBlockAndAdvance: scrollToNextAndRemovePrevious),
150168 const Positioned(
151169 bottom: 10,
152170 left: 10,
···175193 : const DecoratedBox(decoration: BoxDecoration(color: AppColors.black));
176194 } else {
177195 if (shouldBeActive) {
178178- return FeedPostWidget(index: index, feed: widget.feed);
196196+ return FeedPostWidget(index: index, feed: widget.feed, onBlockAndAdvance: scrollToNextAndRemovePrevious);
179197 } else {
180198 // Return SizedBox to maintain scroll position but hide content
181199 return const DecoratedBox(decoration: BoxDecoration(color: AppColors.black));