Skip to content

Enhance content managment datat fetching mechanism #48

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 7 commits into from
Aug 1, 2025

Conversation

fulleni
Copy link
Member

@fulleni fulleni commented Aug 1, 2025

Status

READY/IN DEVELOPMENT/HOLD

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 7 commits August 1, 2025 09:53
…hing process

- Add detailed comments in both create_source_bloc.dart and edit_source_bloc.dart
- Explain the reason for using background fetching for countries and languages
- Highlight UI consistency and technical limitations as motivations
- Describe how the UI updates progressively in the background
- Add detailed comments in both create_headline_bloc.dart and edit_headline_bloc.dart
- Explain the reason for using background fetching for countries
- Highlight UI consistency and technical limitations as motivations
- Describe how the UI updates progressively in the background
…ntries dropdown

- Add _FetchNextCountryPage event to handle asynchronous data fetching
- Modify _onDataLoaded to trigger background fetching
- Implement throttling and state management for ongoing requests
- Update documentation to explain the new approach
… for countries dropdown

- Introduce _FetchNextCountryPage event for paginated data fetching
- Replace while loop with event-driven approach for better performance
- Add loading state for countries to improve user experience
- Optimize code structure and formatting for better readability
…pdowns

- Add _FetchNextCountryPage and _FetchNextLanguagePage events
- Implement background fetching for countries and languages
- Update UI to reflect loading state for dropdown pagination
- Remove inline pagination logic from CreateSourceDataLoaded event
…pdowns

- Add _FetchNextCountryPage and _FetchNextLanguagePage events
- Implement background fetching for countries and languages
- Update UI to reflect loading state for dropdown pagination
- Remove inline pagination logic from EditSourceLoaded event handler
- Add helper text to indicate loading state in country dropdown
- Disable country selection when more countries are being loaded
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!

This pull request enhances the content management data fetching mechanism by transitioning from synchronous, blocking data retrieval for paginated lists to an asynchronous, event-driven background process. This change aims to improve the user experience by ensuring the UI remains responsive while large datasets for dropdowns are loaded progressively.

Highlights

  • Asynchronous Data Fetching: I've refactored the data fetching mechanism for paginated lists (countries and languages) in the CreateHeadlineBloc, CreateSourceBloc, EditHeadlineBloc, and EditSourceBloc. Instead of a blocking while loop that fetches all data upfront, the BLoCs now initiate an event-driven, throttled background process to fetch subsequent pages after the initial page is loaded.
  • Improved UI Responsiveness: This change significantly improves UI responsiveness, especially for forms containing dropdowns with potentially large datasets. The UI remains interactive while the full list of options is progressively populated in the background.
  • New BLoC Events and Handlers: New internal BLoC events (_FetchNextCountryPage, _FetchNextLanguagePage) and their corresponding handlers (_onFetchNextCountryPage, _onFetchNextLanguagePage) have been introduced to manage this background fetching process.
  • UI Feedback and Interaction Control: The create_headline_page.dart UI has been updated to provide visual feedback (a 'loading full list' helper text) when background fetching is active. Additionally, user interaction with the country dropdown is temporarily disabled during this background loading to prevent inconsistencies.
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.

@fulleni fulleni merged commit f8cca99 into main Aug 1, 2025
1 check failed
@fulleni fulleni deleted the enhance-content-managment-datat-fetching-mechanism branch August 1, 2025 09:41
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 enhances the data fetching mechanism for dropdowns by implementing a non-blocking, event-driven background process. This significantly improves UI responsiveness. The review focuses on maintainability, suggesting the extraction of 'magic numbers' into named constants and refactoring duplicated code into a generic method.

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