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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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 86.44%. Comparing base (75749e6) to head (08bf005).

🚀 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
@ildyria ildyria force-pushed the backend-timeline branch from 97fcc72 to 5458450 Compare May 27, 2025 15:15
@ildyria ildyria changed the base branch from master to refactoring-photo-album-relation May 27, 2025 19:48
@ildyria ildyria force-pushed the backend-timeline branch from 2c45144 to 86f46d4 Compare May 28, 2025 16:28
@ildyria ildyria force-pushed the refactoring-photo-album-relation branch from 9ba1a70 to 916e593 Compare May 28, 2025 16:44
@ildyria ildyria force-pushed the backend-timeline branch from 86f46d4 to 79c16fe Compare May 28, 2025 16:44
@ildyria ildyria force-pushed the refactoring-photo-album-relation branch from 916e593 to bcca8f7 Compare May 28, 2025 18:24
@ildyria ildyria force-pushed the backend-timeline branch from 79c16fe to 002a68e Compare May 28, 2025 18:27
@ildyria ildyria force-pushed the refactoring-photo-album-relation branch from 6cbc89d to 6e39bb0 Compare May 28, 2025 18:33
@ildyria ildyria force-pushed the backend-timeline branch from 002a68e to 9814f19 Compare May 28, 2025 18:33
@ildyria ildyria removed the parked - will revisit later This PR needs more work but some things need to be fixed before. label May 28, 2025
@ildyria ildyria force-pushed the backend-timeline branch from 8ac37d8 to b89975e Compare May 29, 2025 16:39
@ildyria ildyria marked this pull request as ready for review May 29, 2025 16:40
@ildyria ildyria changed the title 🚧 Backend implementation for timeline page Backend implementation for timeline page May 29, 2025
@ildyria ildyria force-pushed the refactoring-photo-album-relation branch from 6e39bb0 to b68cb45 Compare June 8, 2025 08:53
@ildyria ildyria force-pushed the backend-timeline branch 2 times, most recently from 7198efb to 00c717b Compare June 8, 2025 09:51
Base automatically changed from refactoring-photo-album-relation to master June 11, 2025 12:13
@ildyria ildyria force-pushed the backend-timeline branch from 6eefc2a to 6829366 Compare June 11, 2025 13:07
@ildyria ildyria force-pushed the backend-timeline branch from 6829366 to 08bf005 Compare June 11, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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