Skip to content

Grid view in the new media screen#25561

Draft
crazytonyli wants to merge 21 commits into
task/media-v2-foundationfrom
task/media-v2-grid
Draft

Grid view in the new media screen#25561
crazytonyli wants to merge 21 commits into
task/media-v2-foundationfrom
task/media-v2-grid

Conversation

@crazytonyli
Copy link
Copy Markdown
Contributor

@crazytonyli crazytonyli commented May 14, 2026

Note

This PR will be merged after #25560.

Description

Similar to the existing Media screen, the grid view is 4 columns in compact width and 5 in regular, supports the same aspect-ratio / square toggle as V1 (sharing the UserDefaults key, so the preference carries over between the two screens), and renders per-kind cells for image, video, audio, and document.

Analytics for filter, search, and the grid toggle are routed through MediaTrackerAdapter to Tracks under new WPAnalyticsStat cases that mirror V1's event names.

Aspect Ratio Mode Grid Mode

@dangermattic
Copy link
Copy Markdown
Collaborator

3 Warnings
⚠️ Modules/Package.swift was changed without updating its corresponding Package.resolved.

If the change includes adding, removing, or editing a dependency please resolve the Swift packages as appropriate to your project setup (e.g. in Xcode or by running swift package resolve).

If the change to the Package.swift did not modify dependencies, ignoring this warning should be safe, but we recommend double checking and running the package resolution just in case.
.

⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@crazytonyli crazytonyli force-pushed the task/media-v2-grid branch from c106304 to 512afad Compare May 14, 2026 06:33
@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented May 14, 2026

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

@crazytonyli crazytonyli force-pushed the task/media-v2-grid branch from 512afad to 3abc15a Compare May 14, 2026 09:46
Distinct accessibility label for failed-without-data placeholders so
VoiceOver doesn't read "Loading media" over an error icon. Inner image
content takes the 4pt rounding in aspect-ratio mode, leaving the outer
cell square for non-square images to match V1's container-level rounding.
Comment updates for loadItems' intentional log-only error path, setFilter
analytics flow, and MediaGridDuration's deliberate locale-neutral format.
Video cells now render via CachedAsyncImage(videoUrl:) instead of the
generic play icon, restoring V1 surface parity for video thumbnails.
Documents-filter narrowing vs V1 documented inline on MediaKind so the
wp-rs Phase 0 follow-up is visible from the code. Adds eight unit tests
for MediaGridLayoutMath covering V1's 4-per-row / 5-per-row threshold,
spacing modes, and cell-size rounding.
Inner image .aspectRatio(.fit) on a .resizable() CachedAsyncImage was
rendering at intrinsic pixel-derived size under an infinite frame
proposal, overflowing the cell horizontally into adjacent grid positions.
Wraps the cell body in a GeometryReader so the inner image content gets
an explicit square frame constraint. Accepts the small V1-parity
deviation flagged by code-review-1 finding 2 (outer cell rounds whole vs
V1's inner-container-only) because the alternative caused this overflow
bug.
@crazytonyli crazytonyli force-pushed the task/media-v2-grid branch from 883a054 to 18ef295 Compare May 17, 2026 22:43
@wpmobilebot
Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number32246
VersionPR #25561
Bundle IDorg.wordpress.alpha
Commit18ef295
Installation URL1ka1tvlc2h9e8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number32246
VersionPR #25561
Bundle IDcom.jetpack.alpha
Commit18ef295
Installation URL4oqi37moa3dco
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

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.

3 participants