Skip to content

Headlines feed sorted by date #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Aug 4, 2025
Merged

Conversation

fulleni
Copy link
Member

@fulleni fulleni commented Aug 4, 2025

Description

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

fulleni added 11 commits August 4, 2025 16:06
- Updated appEnvironment constant from AppEnvironment.demo to AppEnvironment.development in main.dart
- Add descending sort by 'updatedAt' field to readAll calls in HeadlinesFeedBloc
- This ensures that newly fetched headlines are always sorted by the latest update time
- Add descending sort by 'updatedAt' field to readAllHeadlines requests in EntityDetailsBloc
- Update both initial and paginated headline requests
…oad more

- Add sort parameter to readHeadlinesByTerm and readAll calls
- Set sort order to descending (newest first)
- Update affects both initial search and load more operations
- Add ascending sort by 'name' for topics and sources in headlines search
- Implement consistent sorting across paginated search results
- Import SortOption and SortOrder from core package
- Add sorting parameter to headlines repository request
- Sort similar headlines in descending order based on updated time
- Add descending sort by 'name' when fetching all countries
- Add descending sort by 'updatedAt' when fetching more countries
- Add descending sort by name to readAll and readAfter methods in topics requests
- Update made in TopicsFilterBloc class
- Add sorting by name to the sources list retrieval
- Update import statements for better clarity
- Convert pending task comment to a TODO with assigned username
- Add sorting to the readAll() method in TopicsRepository
- Sort topics by 'name' in ascending order
- Add a TODO comment for potential future pagination implementation
- Implement client-side sorting for saved headlines, followed topics, and followed sources
- Add _sortPreferences method to AccountBloc
- Update relevant emit statements to use sorted preferences
- Improve user experience by ensuring consistent and predictable ordering of preferences
@fulleni fulleni merged commit cf4592b into main Aug 4, 2025
0 of 2 checks passed
@fulleni fulleni deleted the headlines-feed-sorted-by-date branch August 4, 2025 16:16
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @fulleni, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

I've refactored the application's data handling to ensure consistent sorting across various content feeds and user preferences. This change primarily focuses on ordering headlines by their update date and other entities like topics, sources, and countries by name, improving the user experience by presenting information in a predictable and logical sequence.

Highlights

  • Consistent Data Sorting: I've implemented explicit sorting parameters for data fetched from repositories, ensuring headlines are sorted by "updatedAt" (descending) and topics, sources, and countries are sorted by "name" (ascending or descending as appropriate).
  • Client-Side Preference Sorting: I introduced a new utility method "_sortPreferences" in "AccountBloc" to locally sort user-saved headlines, followed topics, and followed sources. This addresses backend limitations for sorting these specific user preferences, ensuring they are always presented in a consistent order.
  • Environment Configuration Update: I updated the application's default environment configuration from "demo" to "development" in "main.dart".
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors multiple Blocs to sort data fetched from repositories, which is a great improvement for user experience. The changes correctly add sorting for headlines by date across the app. However, there are a few inconsistencies and a bug related to sorting:

  • The sorting of user preferences is incomplete.
  • Sorting for countries and topics filters uses a descending order for names, which is inconsistent with other parts of the app.
  • There's a critical bug in the countries filter where pagination uses a different sort key from the initial load, which will break the list ordering.
  • A configuration change in main.dart seems temporary and should be reviewed.

I've left specific comments with suggestions to address these points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant