Skip to content

Enhance content management #50

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 48 commits into from
Aug 2, 2025
Merged

Enhance content management #50

merged 48 commits into from
Aug 2, 2025

Conversation

fulleni
Copy link
Member

@fulleni fulleni commented Aug 2, 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 30 commits August 2, 2025 10:21
- Rename DeleteHeadlineRequested to ArchiveHeadlineRequested
- Rename DeleteTopicRequested to ArchiveTopicRequested
- Rename DeleteSourceRequested to ArchiveSourceRequested
- Update comments to reflect the change from deletion to archiving
…es, topics, and sources

- Rename DeleteHeadlineRequested, DeleteTopicRequested, and DeleteSourceRequested events to ArchiveHeadlineRequested, ArchiveTopicRequested, and ArchiveSourceRequested respectively
- Update event handlers to archive items instead of deleting them
- Implement optimistic UI updates for archiving items
- Revert UI changes if archive operation fails
- Change delete icon to archive icon in headlines page
- Update tooltip to reflect archive action
- Dispatch ArchiveHeadlineRequested event instead of DeleteHeadlineRequested
- Change icon from delete to archive
- Update tooltip to 'Archive' (temporary solution)
- Replace DeleteSourceRequested event with ArchiveSourceRequested event

This change improves the user experience by implementing a reversible action instead of permanent deletion.
- Replaced delete icon with archive icon
- Updated tooltip to 'Archive' (to be localized in future)
- Changed event from DeleteTopicRequested to ArchiveTopicRequested
- Wrap headline title Text widget in DataCell with maxLines set to 2
- Add TextOverflow.ellipsis to handle overflow
- This change prevents layout issues with long headline titles
…ency

- Make topic name text ellipsis for long text
- Adjust TODO comment format
- Modify DataCell to support multiline text with ellipsis overflow
- Improve readability for long source names in the sources table
- Remove loading indicator row from _HeadlinesDataSource
- Add LinearProgressIndicator for loading state
- Adjust row count logic in _HeadlinesDataSource
- Update tooltip text for archive button (TODO: to be fixed in l10n phase)
- Refactor PaginatedDataTable2 widget for better layout
- Remove loading row from PaginatedDataTable2
- Add LinearProgressIndicator for loading state
- Adjust row count logic to remove extra row for loading state
- Update TopicsDataSource to remove loading row handling
- Remove loading row from _SourcesDataSource
- Add LinearProgressIndicator to _SourcesPageState
- Adjust row count logic in _SourcesDataSource
- Remove isLoading parameter from _SourcesDataSource constructor
- Import ArchivedContentPage in router.dart
- Add new GoRoute for archived content page
- Define routes for archived content in routes.dart
- Add IconButton for archived items in ContentManagementPage
- Update tooltip for add new item button
- Replace "Consider localizing" with "TODO(you): Will be fixed in l10n phase" for both tooltips
- Create a new page for viewing and managing archived content
- Implement a TabBar for navigating between archived headlines, topics, and sources
- Add placeholder text for each tab section
- TODO: Implement proper localization for the page title
- Replace 'archivedContent' with more specific routes for content management
- Add 'archivedHeadlines', 'archivedTopics', and 'archivedSources' routes
- Update corresponding route names for each new path
- Define ArchivedContentTab enum for available tabs
- Define ArchivedContentStatus enum for operation statuses
- Create ArchivedContentState class with properties for each tab
- Implement copyWith method for state immutability
- Override props for Equatable comparison
- Create ArchivedContentEvent base class
- Add events for tab changes and loading archived content
- Implement restore and delete events for headlines, topics, and sources
- Add ArchivedContentBloc for managing archived content
- Implement logic for handling headlines, topics, and sources
- Include functionality for loading, restoring, and deleting archived items
- Handle pagination and state management for archived content
- Remove ArchivedContentBloc and related files
- Delete archived_content_bloc.dart, archived_content_event.dart, and archived_content_state.dart
- This refactoring removes the entire bloc responsible for managing archived content, which is no longer in use
- Create ArchivedHeadlinesBloc class with initial state
- Define ArchivedHeadlinesEvent and ArchivedHeadlinesState classes
- Set up basic structure for handling archived headlines events
- Create ArchivedTopicsBloc, ArchivedTopicsEvent, and ArchivedTopicsState classes
- Implement basic structure for handling archived topics using bloc pattern
- Create ArchivedSourcesBloc class
- Define ArchivedSourcesEvent sealed class
- Define ArchivedSourcesState sealed class
- Add ArchivedSourcesInitial state
- Remove ArchivedContentPage widget and its related code
- This page was likely unused and incomplete, as indicated by the TODO comment and placeholder text
- Update archived items button to navigate to different archived pages
  based on the active tab in ContentManagementBloc
- Replace single navigation route with conditional navigation to
  archivedHeadlines, archivedTopics, or archivedSources based on the
  active tab
- Remove ArchivedContentPage import and route
- Add separate routes for archived headlines, topics, and sources
- Implement placeholder pages for new archived content routes
- Add LoadArchivedHeadlinesRequested event to request loading of archived headlines
- Add RestoreHeadlineRequested event to restore an archived headline
- Add DeleteHeadlineForeverRequested event to permanently delete an archived headline
- Update ArchivedHeadlinesEvent props to allow nullable objects
…ment

- Replace sealed class with enum for status representation
- Expand ArchivedHeadlinesState with additional properties
- Implement copyWith method for state immutability
- Update props list for Equatable
- Import core package in archived_headlines_bloc.dart
fulleni added 18 commits August 2, 2025 12:09
@fulleni fulleni merged commit 7ff06b2 into main Aug 2, 2025
1 check failed
@fulleni fulleni deleted the enhance-content-management branch August 2, 2025 11:51
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 significantly enhances the content management system by introducing a robust archiving feature. Instead of direct deletion, content items (headlines, topics, and sources) can now be archived, providing a soft-delete mechanism. This change includes new dedicated views for managing archived content, updated BLoC logic to support archiving and restoration, and various UI improvements for a better user experience.

Highlights

  • Content Archiving Feature: Implemented a new content archiving mechanism for Headlines, Topics, and Sources. Instead of permanent deletion, items are now moved to an 'archived' status, allowing for future restoration or permanent deletion from a dedicated archive view.
  • Dedicated Archived Views: Introduced new UI pages (ArchivedHeadlinesPage, ArchivedSourcesPage, ArchivedTopicsPage) to display and manage archived content, including options to restore items or delete them permanently.
  • BLoC State Management for Archived Content: Created separate BLoC components (ArchivedHeadlinesBloc, ArchivedSourcesBloc, ArchivedTopicsBloc) to manage the state and logic for loading, restoring, and permanently deleting archived items, ensuring clear separation of concerns.
  • Optimistic UI Updates: Modified the main content management BLoC to perform optimistic UI updates when archiving items, providing a smoother user experience by immediately removing the item from the active list and reverting if the backend operation fails.
  • UI/UX Enhancements: Updated the main content management pages to include an 'Archived Items' button for easy navigation to the new archive views. Also, improved table cell rendering for titles/names with maxLines and overflow properties, and refined loading indicators.
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 introduces a valuable archiving feature, replacing hard deletes. The changes are extensive, adding new BLoCs, pages, and routes for managing archived content. While the overall structure is good, I've found several critical and high-severity issues that need to be addressed. These include bugs in the optimistic UI state management that prevent proper rollback on error, broken pagination in data tables, and incorrect route definitions for the new pages. Please see the detailed comments for specific suggestions on how to fix these issues.

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