-
Notifications
You must be signed in to change notification settings - Fork 0
feat filter bookmarked entry model #56
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
Conversation
- Create a new model to represent user-defined filter combinations - Include properties for topics, sources, and countries - Implement JSON serialization and deserialization - Add copyWith method for easy modification
- Add generated code for SavedFilter model serialization - IncludefromJsonandtoJsonmethods for SavedFilter class - Cover topics, sources, and countries serialization in the process
- Add unique identifiers for saved filter fixtures in fixture_ids.dart - Create new saved_filter.dart file with predefined saved search data - Update fixtures.dart to export new saved filter fixtures
- Add new fields for saved filters limits for guest, authenticated, and premium users - Update constructor and toJson method to include new fields - Modify class copyWith method to support new fields - Update documentation to reflect new saved filters limits
- Add SavedFilter import to user_content_preferences.dart - Include savedFilters in UserContentPreferences properties - Update fromJson and toJson methods to handle savedFilters - Modify copyWith method to include savedFilters
- Add mock saved filter to test fixtures - Update tests to cover saved filters field in UserContentPreferences - Modify existing tests to include saved filters in round trip and copyWith scenarios
- Add guestSavedFiltersLimit, authenticatedSavedFiltersLimit, and premiumSavedFiltersLimit to RemoteConfig fixture - Set values to 3, 10, and 25 respectively to reflect different user capabilities
- Update import path for SavedFilter model to user_presets package - Make sources list in kSavedFilterId2 fixture const
- Create user_presets directory inside models - Move saved_filter.dart and saved_filter.g.dart to user_presets directory - Update models.dart to export user_presets - Rename user_presets directory inside models - Update saved_filter.dart to fix typos in method names
- Change import path for saved_filter from 'models/saved_filter.dart' to 'models/user_presets/saved_filter.dart' in user_preference_config.dart and user_content_preferences.dart - This refactor ensures consistency in the directory structure for user-related models
- Rename 'user_app_settings_fixtures.dart' to 'user_app_settings.dart' - Rename 'user_content_preferences_fixtures.dart' to 'user_content_preferences.dart'
- Add code to handle empty 'savedFilters' list - Ignore inference failure on collection literal - Ensure round trip test passes with empty lists
- Add comprehensive tests for SavedFilter constructor, fromJson/toJson, copyWith, and Equatable properties - Cover cases with populated data and empty lists - Verify correct behavior of copyWith method with and without updates - Ensure proper equality checks for instances with same and different properties
- Include `SavedFilter` model in the User Presets section of README.md - Describe `SavedFilter` as a model for storing user-defined filter combinations
- Update pubspec.yaml with new version number
- Add SavedFilter model for user-defined filters - Link SavedFilter to UserContentPreferences - Add saved filter limits to UserPreferenceConfig - Refactor saved models into `user_presets` directory - Update tests and documentation for new features - Add fixture data for SavedFilter and related models
Summary of ChangesHello @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 introduces the ability for users to save and manage custom filter combinations for news headlines. It achieves this by adding a new Highlights
Using Gemini Code AssistThe 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 by creating a comment using either
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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. 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
|
There was a problem hiding this 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 introduces a new SavedFilter model, allowing users to save combinations of filters. The changes are well-structured and include updates to related models like UserContentPreferences and UserPreferenceConfig, the addition of corresponding limits, and the creation of necessary fixtures and tests. My review includes a few suggestions to improve code consistency and address a potential issue in the tests.
test/src/models/user_preferences/user_content_preferences_test.dart
Outdated
Show resolved
Hide resolved
- Remove unused savedFilters assignment in user_content_preferences_test.dart - Simplify test case for round trip with empty lists
- Changed the comment for kSavedFilterId1 to "Saved filters Fixture IDs" - This provides a more accurate description of the following constants
- Import `meta` package to use `@immutable` annotation - Add `@immutable` annotation to `SavedFilter` class to indicate that it is intended to be immutable
Status
READY
Description
This pull request introduces the ability for users to save and manage custom filter combinations for news headlines. It achieves this by adding a new SavedFilter data model, integrating it into the existing user content preferences, and implementing configurable limits for these saved filters based on user tiers. The changes also include a structural refactor to better organize user preset models, along with corresponding updates to documentation, tests, and fixture data.
Type of Change