-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/define user generated content data #85
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
Introduces the `EngagementMode` enum as part of the new User-Generated Content (UGC) feature. This enum will be used in the `EngagementConfig` to allow remote configuration of the available user engagement features, specifically toggling between `reactionsOnly` and `reactionsAndComments`.
Introduces the `CommentStatus` enum to manage the moderation workflow for user comments. This enum includes states like `pendingReview`, `approved`, `rejected`, `flaggedByAI`, and `hiddenByUser`, providing a robust foundation for both manual and future automated moderation systems.
Introduces the `ReactionType` enum, which defines the set of possible emoji-based reactions a user can apply to a headline. This allows for a structured and extensible way to manage user reactions.
Introduces the `ReportableEntity` enum to create a strongly-typed discriminator for the reporting system. This enum identifies whether a report pertains to a `headline`, `source`, or `comment`, enabling flexible and type-safe handling of reports.
Introduces the `ReportStatus` enum to manage the lifecycle of a user-submitted report. It includes states like `submitted`, `inReview`, and `resolved`, which are essential for building a moderation dashboard to process user reports.
Introduces the `HeadlineReportReason` enum, providing a set of specific, actionable reasons for reporting a headline. This enhances the moderation process by giving clear context to why a headline was flagged, with reasons like `MISINFORMATION_OR_FAKE_NEWS` and `CLICKBAIT_TITLE`.
Introduces the `SourceReportReason` enum, providing specific reasons for reporting a news source. These reasons, such as `LOW_QUALITY_JOURNALISM` and `HIGH_AD_DENSITY`, are designed to be actionable and can feed data into future systems like an automated content scraper.
Introduces the `CommentReportReason` enum, which provides a clear and specific set of reasons for reporting a user comment. This is a critical component for community self-moderation, with reasons including `SPAM_OR_ADVERTISING` and `HARASSMENT_OR_BULLYING`.
Introduces the `Comment` data model, which represents a user-submitted comment on a headline. The model is designed for a robust moderation system, including a `status` field (`CommentStatus`) to track its state through the review process. It also includes fields for `headlineId`, `userId`, and `content`.
Introduces the `HeadlineReaction` model to track individual user reactions to headlines. This model links a `userId` to a `headlineId` with a specific `ReactionType`, preventing duplicate reactions and providing a rich dataset for engagement analysis.
Introduces the `Report` data model, a flexible structure for handling user reports across different entity types. It uses a `ReportableEntity` enum and `entityId` to dynamically target headlines, sources, or comments. The model includes the report reason, additional comments, and a `ReportStatus` for the moderation workflow.
Introduces the `EngagementConfig` model to be part of the remote configuration. This model allows administrators to remotely enable/disable the entire engagement system, switch between `reactionsOnly` and `reactionsAndComments` modes, and toggle a flag for future AI moderation.
Introduces the `ReportingConfig` model for remote configuration. This allows administrators to enable or disable the reporting functionality for each reportable entity (`headline`, `source`, `comment`) individually.
Introduces the `ReviewFunnelConfig` model for remote configuration. This model makes the "Smart Review Funnel" behavior configurable from a dashboard, allowing admins to set the `positiveInteractionThreshold` required to trigger the prompt and the `initialPromptCooldownDays`.
Updates the `FeaturesConfig` model to include the new configuration models for user-generated content: `EngagementConfig`, `ReportingConfig`, and `ReviewFunnelConfig`. This centralizes all feature-related remote configurations.
Updates the `UserLimitsConfig` model to include new role-based limits for user-generated content. This adds `commentsPerDay` and `reportsPerDay` as configurable limits per user role, ensuring the system can be scaled and managed effectively.
- Updated class name from ReviewFunnelConfig to AppReviewConfig - Updated file name from review_funnel_config.dart to app_review_config.dart - Updated documentation to reflect new class name and feature description
- Introduce CommunityConfig to encapsulate engagement, reporting, and app review configurations - Replace EngagementConfig, ReportingConfig, and ReviewFunnelConfig with CommunityConfig in FeaturesConfig - Update imports and usages accordingly
… review funnel - Expand documentation to describe the two-layer app review funnel system - Detail the trigger, prompt, and action steps of the review process - Clarify the behavior of the system in response to user actions - Update the description to reflect the strategic prompting of engaged users
- Add detailed information about the community & engagement system - Include models for reactions, comments, and reporting - Describe the smart app review funnel feature - Explain the advantages of implementing these systems
- Add foundational data models for user reactions, comments, and reporting - Introduce multi-entity reporting system and app review funnel - Implement remote configuration via Unified `CommunityConfig` model - Extend `UserLimitsConfig` for role-based comment and report limits - Include previously committed notification system features - Refactor `UserPreferenceConfig` for scalable, role-based user limits - Add comprehensive unit tests for new and refactored models
- Add breaking change note for identity pivot refactor - Consolidate feat entries into a single comprehensive entry - Remove duplicate entries for notification system changes
- Move feed-related models to a new 'feed' directory - Update imports for feed-related models - Rename 'feed_decorators' to 'feed' for consistency - Remove redundant 'core' exports - Update 'models.dart' to reflect new directory structure
…and premium users - Add commentsPerDay and reportsPerDay limits for different user roles - Implement community engagement and reporting configurations - Set up app review configuration with positive interaction threshold and initial prompt cooldown
- Add unit tests for EngagementMode enum - Verify correct enum values and string representations - Test enum creation from string values
- Add unit tests for CommentStatus enum values - Verify correct string representation of enum values - Test creation of enum values from string representations
- Add unit tests for EngageableType enum values - Verify serialization and deserialization behavior - Test toString representation - Ensure proper error handling for invalid values
- Add comprehensive tests for Comment constructor, fromJson/toJson, copyWith, and Equatable properties - Verify correct instance creation, round trip serialization, and equality checks - Ensure copyWith method correctly updates fields and generates new timestamp
- Add comprehensive tests for Engagement model constructor, fromJson/toJson, copyWith, and Equatable properties - Verify correct instance creation, JSON serialization, and equality checks - Include test cases for both populated and null comment scenarios
- Add comprehensive tests for Reaction model constructor, fromJson/toJson, copyWith, and Equatable properties - Verify correct instance creation, round trip serialization, and equality checks - Ensure copyWith method correctly updates specified fields while leaving others unchanged - Validate that props list includes all relevant fields for equality comparison
- Create unit tests for Report model - Verify instantiation, equality, JSON serialization, and copyWith functionality
- Remove `aiModerationEnabled` property from EngagementConfig class - Update constructors, toJson, fromJson, and copyWith methods to exclude AI moderation - Adjust unit tests to reflect changes
…t System - Add mentions of foundational data models, fixtures, and tests for user reactions, comments, and reporting system - Improve clarity of the system's remote configurability via `CommunityConfig` model - Expand on the refactor of data models and configuration for the news aggregator pivot - Include information on the introduction of filter-based push notification system and updates to `UserPreferenceConfig`
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 delivers a major new feature: a comprehensive Community & Engagement System. This system empowers users to interact with content through reactions and comments, and provides robust reporting mechanisms for various entities, alongside a strategic app review funnel. These new capabilities are fully configurable remotely and integrate seamlessly with existing user role-based limits. The changes also include significant refactoring of core data models and fixtures to enhance scalability and align with the project's evolving identity as a news aggregator. 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 comprehensive Community & Engagement system, including data models, enums, fixtures, and configurations for reactions, comments, reporting, and an app review funnel. The changes are extensive and well-structured, with a large number of new files and refactoring of existing ones to support the new features. The addition of tests for the new models and enums is a great practice.
I've identified a few areas for improvement:
- An unused constant in the engagement fixtures.
- Inefficient data generation in the reports fixture.
- A minor typo in a doc comment.
- An unconventional and incomplete
copyWithimplementation in theCommentmodel that could lead to unexpected behavior.
Overall, this is a significant and well-executed feature addition. Addressing the feedback will improve code quality and maintainability.
- Introduce ValueWrapper class to distinguish between unset and explicitly null fields - Modify Report.copyWith to use ValueWrapper for additionalComments parameter - Update Report.copyWith logic to handle explicit null values correctly
- Modify comment fixtures to accept dynamic `now` and `languageCode` parameters - Update test cases to use a fixed date and language code for consistency - Adjust tests to ensure instances with different properties are not equal
…le parameters - Modify engagement test cases to use a fixed `DateTime.now()` value - Add `languageCode` parameter to `getEngagementsFixturesData` function - Update test cases to handle null comment scenarios consistently - Ensure Equatable tests compare instances with the same properties
…groups - Replace inline Report instantiation with fixture data - Add test groups for constructor, fromJson/toJson, copyWith, and Equatable - Enhance test coverage for Report model methods and properties
- Deleted the predefined list of engagementsFixturesData - This change allows for more flexibility in generating engagement fixtures - The getEngagementsFixturesData function can still be used to generate fixtures as needed
- Refactor Comment, Reaction, and Engagement models for better clarity - Enhance engagementsFixturesData to generate more realistic fixture data - Remove unnecessary properties and methods - Update related tests to reflect changes
…ity.engagement` - Update `ReportableEntity` enum: - Rename `comment` to `engagement` - Update JSON value to 'engagement' - Update related tests - Update fixtures to use `engagement` instead of `comment` - Update models to include missing fields and adjust serialization
Status
READY
Description
This pull request delivers a major new feature: a comprehensive Community & Engagement System. This system empowers users to interact with content through reactions and comments, and provides robust reporting mechanisms for various entities, alongside a strategic app review funnel. These new capabilities are fully configurable remotely and integrate seamlessly with existing user role-based limits. The changes also include significant refactoring of core data models and fixtures to enhance scalability and align with the project's evolving identity as a news aggregator.
Type of Change