-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/content management filter and UI overhaul #91
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
Feat/content management filter and UI overhaul #91
Conversation
- Add collection package to pubspec.yaml - Update collection package dependency in pubspec.lock
Ignore the 'avoid_positional_boolean_parameters' lint rule in analysis_options.yaml. This rule is causing issues with the code, and ignoring it will help resolve CI failures.
- Add new localization strings for filter tooltip and button - Include titles for different filter dialogs - Add search field hint texts for headlines, topics, and sources - Update both Arabic and English localization files
- Add events for publishing, restoring, and deleting headlines, topics, and sources - Enhance existing events with filtering capabilities - Refactor event classes to remove unnecessary comments and improve consistency
…n and snackbar support - Add lastPendingDeletionId and snackbarMessage to ContentManagementState - Improve documentation for existing properties - Refactor enum documentation - Update class documentation to use Dartdoc template
- Add handlers for publishing, restoring, and deleting content - Implement optimistic UI updates for delete operations with undo capability - Enhance load requests to support filtering by status - Refine conditions for refetching content to include filter changes
- Add HeadlinesFilterEvent base class - Implement HeadlinesSearchQueryChanged event - Implement HeadlinesStatusFilterChanged event - Implement HeadlinesFilterApplied event
- Create a new state class for managing headlines filter UI - Include properties for search query and selected content statuses - Implement copyWith method for state immutability - Extend Equatable for efficient state comparison
- Create HeadlinesFilterBloc to manage headlines filter UI state - Add event handlers for search query changes and status filter toggles - Implement logic to prevent deselecting the last status filter
- Create SourcesFilterState class to manage search query and selected content statuses - Implement copyWith method for state immutability - Extend Equatable for efficient state comparison
- Add SourcesFilterEvent base class - Implement SourcesSearchQueryChanged event - Implement SourcesStatusFilterChanged event - Implement SourcesFilterApplied event
- Add SourcesFilterBloc to manage sources filter UI state - Handle search query changes and status filter selections - Implement logic to prevent deselecting the last status filter
- Add TopicsFilterBloc to manage topics filter UI state - Implement event handlers for search query changes and status filter toggles - Ensure at least one status filter is always selected
- Add TopicsFilterEvent base class - Implement TopicsSearchQueryChanged event - Implement TopicsStatusFilterChanged event - Implement TopicsFilterApplied event
- Create TopicsFilterState class to manage search query and selected content statuses - Implement copyWith method for state immutability - Define props for state comparison
- Add filter dialog and blocs for headlines, topics, and sources - Implement filtering logic for different content types - Update UI to include filter button and floating action button for adding new items - Refactor existing code to support new filtering features
…design and functionality - Add LayoutBuilder to detect screen size and adjust table columns - Remove 'Source Name' column for mobile view - Add conditional action buttons based on headline status - Improve code readability and formatting
…nality - Add responsive design for mobile devices (hide source type column) - Enhance data table with additional features (checkbox, first/last buttons) - Optimize row height and spacing for better readability - Implement conditional action buttons based on source status - Add delete forever option for sources
- Add mobile layout support using LayoutBuilder - Enhance topic actions based on topic status - Improve data table styling and behavior - Update topic actions to include publish, restore, and delete forever options
- Create a full-screen dialog for applying filters to content management lists - Implement search text field and filter chips for content status - Design the dialog to work with different filter BLoCs (HeadlinesFilterBloc, TopicsFilterBloc, SourcesFilterBloc) - Add localization support for various languages - Implement logic to handle different active tabs and update respective BLoCs
… routes - Add MultiBlocProvider to ContentManagementPage for filter blocs - Remove routes for archived and draft pages - Update imports to remove unused view files - Simplify router configuration by removing archived and draft routes
…ment route - Removed unnecessary MultiBlocProvider wrapper from content-management route - Simplified route builder to directly return ContentManagementPage
- Replace direct return of FilterDialog with a Builder widget - This change ensures that the FilterDialog has access to the correct context, which is important for accessing inherited widgets and theme data - Improve code readability and maintainability by using a consistent approach for dialog construction
…pics, and sources - Add HeadlinesFilterBloc, TopicsFilterBloc, and SourcesFilterBloc to the app's_bloc provider list - These new filters will enhance the content management functionality by allowing users to filter headlines, topics, and sources more effectively
- Add Arabic translation for "edit" tooltip - Add English translation for "edit" tooltip - Update arb files with new translations
…onButtons widget - Remove inline action buttons in DataTable - Integrate ContentActionButtons widget for better code maintainability - Improve readability and reduce code complexity in headlines_page.dart
…onButtons widget - Remove inline action buttons in sources table - Introduce ContentActionButtons widget for better code organization - Simplify modification of action buttons for different content types
…dget - Remove inline action buttons in topics table - Integrate ContentActionButtons widget for better code reusability - Simplify table cell content and improve readability
…tedItems - Replace selectedItem with selectedItems in SearchableSelectionInput widgets - Update onChanged handlers to work with list of items - Adjust logic for nullable source, topic, and eventCountry - Maintain single selection by passing items?.first to bloc events
…tedItems - Replace selectedItem with selectedItems in SearchableSelectionInput widgets for Source, Topic, and Country - Update onChanged handlers to work with list of items instead of single item - Adjust initial values and event handling to maintain single selection behavior
…tedItems - Replace selectedItem with selectedItems in SearchableSelectionInput widgets - Update onChanged handlers to work with list of items - Adjust initial values to be a list instead of a single item - This change allows for better future implementation of multiple selection
…tedItems - Replace selectedItem with selectedItems in SearchableSelectionInput widgets - Update onChanged handlers to work with list of items - Adjust initial values to handle null cases
- Move HeadlinesFilterBloc, TopicsFilterBloc, and SourcesFilterBloc providers above ContentManagementBloc - Inject headlinesFilterBloc, topicsFilterBloc, and sourcesFilterBloc into ContentManagementBloc - Remove redundant bloc providers below ContentManagementBloc
- Add FilterDialogBloc import - Wrap FilterDialog with BlocProvider - Initialize FilterDialogBloc with necessary repositories - Dispatch FilterDialogInitialized event after creation - Pass repositories to FilterDialog constructor
…ialization - Remove BlocProvider from FilterDialog and handle it in the parent widget - Simplify FilterDialogBloc initialization using context.read - Update comments to reflect new implementation details
- Add static constants for filter dialog path and route name - Update searchable selection path to remove leading slash
- Import necessary packages: core, data_repository - Add new route for FilterDialog in content management - Include required blocs and repositories for filter functionality - Implement GoRoute for filter dialog with page builder - Set up FilterDialogBloc and provide necessary repositories
- Clarify that FilterDialogBloc is now provided by a GoRouter route - Remove mention of ContentManagementPage in BlocProvider comment
- Remove direct dialog show logic from content management page - Add route push for filter dialog using GoRouter - Pass necessary parameters through route arguments - Update imports to reflect removal of FilterDialog dependency
- Introduce new constant kSnackbarDuration with a value of 5 seconds - This constant will be used for snackbar message display duration - It will also serve as the undo duration for pending deletions
- Add new event to handle deletion events from PendingDeletionsService - Implement necessary properties and methods for the new event
… service - Add PendingDeletionsService to handle deletions with undo functionality - Update ContentManagementBloc to use the new service for handling deletions - Implement undo functionality for headlines, topics, and sources - Refactor filter map building functions to be public - Add subscription to deletion events from the service - Update close method to cancel new subscription
- Add BlocListener for ContentManagementBloc to show snackbar with undo option - Implement undo logic for headlines, topics, and sources -feat Move filter map building logic to ContentManagementBloc (content- Simpl_managementify): listener conditions implement and undo functionality filter map creation for deletions
- Remove _buildHeadlinesFilterMap function from _HeadlinesPageState - Add buildHeadlinesFilterMap method to ContentManagementBloc - Update filter calls in headlines_page.dart to use the new method
…nality - Remove conditional rendering of source type column - Replace custom filter map logic with bloc method - Update loading state icon to rss_feed - Adjust data table column sizing and content - Remove redundant isMobile parameter from data source
- Removed _buildTopicsFilterMap function from TopicsPage - Added buildTopicsFilterMap method to ContentManagementBloc - Updated filter usage in TopicsPage to use the new method from ContentManagementBloc
- Inject PendingDeletionsService into the app's provider list - Enable dependency injection for PendingDeletionsService in the App widget
… elements - Add Arabic translations for "resetFiltersButtonText" and "noResultsWithCurrentFilters" in app_ar.arb - Add English translations for "resetFiltersButtonText" and "noResultsWithCurrentFilters" in app_en.arb - Improve hint text for selecting headquarters in both language files
- Introduce FilterDialogReset event to reset all temporary filter selections - This enhancement allows users to easily revert filter changes back to their initial state
- Add event handler for FilterDialogReset event - Implement _onFilterDialogReset method to reset filter selections - Update FilterDialogBloc to handle reset functionality
- Add IconButton to reset filters in FilterDialog - Implement logic to dispatch reset event and apply default filters - Update UI to reflect reset state after reset action
- Implement a new UI state to display when no topics are found with active filters - Add a reset filters button to allow users to clear filters and try again - Introduce a helper function to check if any filters are active - Update the TopicsPage to handle the new state and display appropriate UI
- Implement a new UI state for when no sources are found with active filters - Add a button to reset filters when no results are displayed - Introduce a private method _areFiltersActive to check filter state - Update build method to handle the new UI logic
…ality - Add UI for when no headlines are found with active filters - Implement filter reset button to clear all active filters - Create _areFiltersActive function to check for active filters - Update build method to handle empty headlines list with
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 a significant overhaul to the content management system, focusing on improved architecture and user experience. It centralizes content state and deletion logic within a single BLoC, while delegating filtering responsibilities to new, dedicated filter BLoCs. The changes culminate in a new, feature-rich filter dialog that empowers users with advanced options to refine their content views, making content discovery and management more efficient. 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 significant and well-executed refactoring of the content management section, focusing on filtering and UI overhaul. The state management is now centralized in ContentManagementBloc
, and dedicated filter BLoCs have been introduced, which is a great improvement for separation of concerns. The UI has been updated to support these new filters, including a new filter dialog and responsive data tables.
My review highlights a few areas for improvement: refactoring some duplicated code in the main BLoC, addressing a potential data loading issue in the new filter dialog, and reconsidering a change to the static analysis options that weakens code clarity standards. Overall, this is a very strong contribution that greatly enhances the codebase's structure and functionality.
Status
READY
Description
This pull request introduces a significant overhaul to the content management system, focusing on improved architecture and user experience. It centralizes content state and deletion logic within a single BLoC, while delegating filtering responsibilities to new, dedicated filter BLoCs. The changes culminate in a new, feature-rich filter dialog that empowers users with advanced options to refine their content views, making content discovery and management more efficient.
Type of Change