Content list shows "Pending changes" for scheduled or draft entries that were never published
Description
In the content list, an entry that has never been published (status draft or scheduled, liveRevisionId null) shows the Pending changes badge as soon as it has been saved more than once, i.e. as soon as it has a draftRevisionId.
The list computes the badge as
// packages/admin/src/components/ContentList.tsx
hasPendingChanges={!!item.draftRevisionId && item.draftRevisionId !== item.liveRevisionId}which is always true when there is no live revision. The editor treats the same entry differently: getContentPublishingState (packages/admin/src/lib/content-publishing-state.ts) returns "scheduled" / "draft" whenever the entry is not live, and getDraftStatus (packages/admin/src/lib/api/content.ts) returns "unpublished". So the list says "Pending changes" for an entry the editor considers a plain draft/scheduled post.
For editors this reads as "there is something unsaved or not yet applied" on a post that is complete and scheduled. On our site, three of four scheduled posts carried the badge only because they had been saved twice (e.g. sent again from an external tool to add the featured image).
Expected: show "Pending changes" only when the entry has a live revision and the draft differs from it, consistent with the editor:
hasPendingChanges={!!item.liveRevisionId && !!item.draftRevisionId && item.draftRevisionId !== item.liveRevisionId}Steps to reproduce
- In a collection with revisions, create a post and schedule it (never publish it).
- Edit and save it once more (in the admin, or via
PUT /_emdash/api/content/{collection}/{id}). - Open the content list: the row shows Scheduled and Pending changes.
- Open the post in the editor: it is shown as scheduled, without pending changes.
A post that is created and scheduled in one step and never edited again shows only Scheduled, which is the expected display for both cases.
Environment
- emdash version: 0.41.0 (the same list code is on
mainat 67ff362) - Node.js version: 22 (node:22-alpine)
- Runtime: Node (Astro Node adapter), SQLite
- OS: Linux (container)
Screenshots
Posted from the CLI, so described in text: the Posts list shows four scheduled posts. One (created and scheduled in a single request) shows only the blue "Scheduled" badge; the other three (saved again after creation) show "Scheduled" plus the orange "Pending changes" badge, although none of them has ever been published.
Source: emdash-cms/emdash