Skip to content

🚧 Backend implementation for timeline page #3251

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ildyria
Copy link
Member

@ildyria ildyria commented Apr 18, 2025

This pull request introduces a comprehensive implementation of a new "Timeline" feature for photo albums, including backend logic, API endpoints, and supporting structures. The changes span multiple files and focus on enabling granular timeline views, handling requests, and providing configuration options. Below is a summary of the most important changes grouped by theme:

Timeline Feature Implementation

  • app/Actions/Photo/Timeline.php: Added a new Timeline class that provides methods to query photos by timeline granularity, count photos younger than a given date or photo, and retrieve distinct timeline dates. This class integrates with configurations and policies to apply filters and sorting.

  • app/Http/Controllers/Gallery/TimelineController.php: Introduced a new controller to handle timeline-related API requests, including fetching photos, initializing the timeline, and retrieving timeline dates.

  • app/Http/Requests/Timeline/IdOrDatedTimelineRequest.php and app/Http/Requests/Timeline/GetTimelineRequest.php: Added request validation classes to handle timeline-specific parameters such as photo IDs and dates, ensuring proper authorization and validation. [1] [2]

Timeline Granularity and Formatting

  • app/Enum/TimelinePhotoGranularity.php and app/Enum/TimelineAlbumGranularity.php: Extended enums to include a format() method for returning ISO date formats based on granularity (e.g., year, month, day, hour). These changes support the dynamic formatting of timeline data. [1] [2]

  • app/Exceptions/Internal/TimelineGranularityException.php: Added a custom exception to handle invalid timeline granularities, ensuring robust error handling for unsupported configurations.

Configuration and Initialization

  • app/Http/Resources/GalleryConfigs/InitConfig.php: Updated the initialization resource to include timeline-specific configurations, such as the default homepage and whether the timeline page is enabled. [1] [2]

  • app/Http/Resources/Timeline/InitResource.php: Added a new resource to initialize the timeline view, providing layout configurations and user rights.

Utility and Middleware Updates

  • app/Http/Resources/Models/Utils/TimelineData.php: Enhanced the utility class to include methods for generating timeline data from dates and photos, supporting multiple granularities.

  • app/Http/Middleware/ConfigIntegrity.php: Added new configuration keys for timeline quick access date formats, ensuring integrity checks for these settings.

Minor Enhancements

  • app/Contracts/Http/Requests/RequestAttribute.php: Added a new constant DATE_ATTRIBUTE to standardize the handling of date attributes in requests.

  • app/Http/Controllers/VueController.php: Introduced a new method viewNoArgs() for rendering the Vue app without arguments, likely for timeline-related views.

@ildyria ildyria requested a review from a team as a code owner April 18, 2025 14:36
@ildyria ildyria added the Review: medium Medium review expected: not many files, some attention to details required. label Apr 18, 2025
@ildyria ildyria marked this pull request as draft April 18, 2025 17:12
@ildyria ildyria force-pushed the localization-timeline branch from 5c39470 to dde31e5 Compare April 21, 2025 18:21
Copy link

codecov bot commented Apr 21, 2025

Codecov Report

Attention: Patch coverage is 69.32515% with 50 lines in your changes missing coverage. Please review.

Project coverage is 90.71%. Comparing base (55cc518) to head (97fcc72).
Report is 9 commits behind head on master.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ildyria
Copy link
Member Author

ildyria commented Apr 22, 2025

Will need to be parked until refactoring of link between photos and albums, otherwise we are spammed by duplicates in the timeline...

Base automatically changed from localization-timeline to master April 22, 2025 18:20
@ildyria ildyria changed the title Backend implementation for timeline page 🚧 Backend implementation for timeline page Apr 22, 2025
@ildyria ildyria added the parked - will revisit later This PR needs more work but some things need to be fixed before. label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parked - will revisit later This PR needs more work but some things need to be fixed before. Review: medium Medium review expected: not many files, some attention to details required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant