Skip to content

Expose modified_gmt on PostMetadataCollectionItem #1690

Open

Description

@nbradbury

EntityMetadata already carries modified_gmt from the list metadata fetch, but the collection item macro in wp_mobile/src/collection/mod.rs only copies id, parent and menu_order onto PostMetadataCollectionItem (lines ~130–219). Please expose modified_gmt: Option<WpGmtDateTime> on the item too, the same way parent and menu_order are: from list metadata, available before the full post is fetched.

Why: WordPress-Android now sorts its Drafts and Trashed lists by orderby=modified (wordpress-mobile/WordPress-Android#23429), and shows and groups each row by that date. A row's position comes from the fresh list metadata, but its date can only come from the cached entity. So for Stale, FetchingWithData and FailedWithData items the row moves to its new position while still showing the old modified date, and it can open an out-of-order date header ("Last month" between "Today" rows). The mismatch lasts until the entity re-fetch lands. For FailedWithData it lasts until the next refresh.

With modified_gmt on the item, the app would use item.modifiedGmt ?: data.modifiedGmt, so the date always matches the position.

Reported in review: wordpress-mobile/WordPress-Android#23429 (comment 6317096026).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions