Skip to content

feat: prepare media date navigation by month - #4199

Merged
marinofaggiana merged 31 commits into
masterfrom
jump-to-date
Jul 24, 2026
Merged

feat: prepare media date navigation by month#4199
marinofaggiana merged 31 commits into
masterfrom
jump-to-date

Conversation

@marinofaggiana

@marinofaggiana marinofaggiana commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

This PR introduces a major refresh of the Media view, improving navigation, performance and overall user experience.

Navigation

  • Group media into monthly sections.
  • Add dedicated section headers.
  • Overlay section headers on top of the media grid.
  • Move the current date indicator into the navigation bar.
  • Add a SwiftUI-based month/year picker to quickly jump through the media timeline.
  • Display the currently visible date range while scrolling.

Performance

  • Build the media data source off the MainActor.
  • Refactor the data source to use compact metadata.
  • Optimize media data source updates.
  • Debounce and cancel stale reload operations.
  • Cancel pending media tasks when the view disappears.
  • Preload media images around the visible range.
  • Simplify image cache management.
  • Avoid repeated disk reads for missing cached images.
  • Reload the image cache when returning to the foreground.
  • Fix an image cache observer retain cycle.

UI

  • Improve media date button appearance.
  • Add smoother header gradient transitions.
  • Improve media grid layout calculations.
  • Reduce the maximum number of grid columns on large displays.
  • Improve media grid updates and media viewer selection consistency.

Overall these changes provide smoother scrolling, faster loading, more responsive updates and much easier navigation through large media libraries.

馃 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Replace the media date label with a button and index the first media item for each year and month.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
@marinofaggiana
marinofaggiana marked this pull request as draft July 22, 2026 05:27
@marinofaggiana marinofaggiana self-assigned this Jul 22, 2026
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Use a compact custom sheet and apply date selections as the picker changes.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Remove the media header gradient and activity indicator, and format the visible date range as a navigation bar item.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
@marinofaggiana
marinofaggiana marked this pull request as ready for review July 22, 2026 09:39
@marinofaggiana
marinofaggiana marked this pull request as draft July 22, 2026 13:51
Use safe column counts and collection view bounds, calculate content height across all columns, and rebuild accurate union and footer geometry.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Refresh the media layout when pinch gestures change column counts, use hydrated metadata for previews, and guard asynchronous viewer selection against reused cells.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Add month and year section headers, update section-aware navigation and selection, and show media totals only in the final section footer.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Display month and year in a reusable media section header while preserving the existing empty-state header.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Increase section header spacing and add leading padding for clearer media grouping.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Guard media data loading against cancellation and inactive views, and build media sections more efficiently.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Revalidate the active media view before updating the collection view.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Build compact metadata and sections in a single pass, and update affected sections directly when removing items.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Prevent outdated search and data source tasks from updating the media view after cancellation or account changes.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Avoid retaining the media controller in asynchronous tasks and load the data source directly after delegate registration.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Fetch and normalize compact media metadata directly from Realm, filtering Live Photo videos before constructing media sections.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Increase the minimum item width for collection and media grids and simplify media placeholder sizing.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Use compact media metadata to rebuild the preview cache efficiently.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Ensure the cache loading flag is reset on every exit path.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Cache previews of all supported sizes and load media thumbnails asynchronously on demand.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Centralize cache key creation, clarify the cache size setting, and safely capture the cache in lifecycle observers.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Reset and rebuild the cache window when the layout, account, or media data changes.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Track missing image keys within each cache session and clear them alongside the image cache. Add cache-window diagnostics for hits, disk reads, missing images, and cancellations.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
Improve header readability with white text and a shadow, and clear reused header titles.

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
@marinofaggiana
marinofaggiana marked this pull request as ready for review July 24, 2026 09:45
@marinofaggiana
marinofaggiana merged commit fa7ca6b into master Jul 24, 2026
9 checks passed
@marinofaggiana
marinofaggiana deleted the jump-to-date branch July 24, 2026 10:15
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