Adds a Changes button to drafts-enabled collections and globals. Clicking it opens a drawer showing a field-by-field diff against the published version, using the same diff UI as the Versions view. It is registered in the plugins array and needs a small change to the Payload layout file to register a server function. It requires Payload 3.84 or later.
Installation
npm i @shefing/changes-button183
Stars
8
Forks
89
Open Issues
3 months ago
Last Updated
43
Weekly Downloads
v0.1.3
npm Version
394.8 KB
Unpacked Size
1
Dependencies
183+4 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 183 |
| Dec 5, 2026 | 183 |
| Dec 4, 2026 | 183 |
| Dec 3, 2026 | 183 |
| Dec 2, 2026 | 183 |
| Dec 1, 2026 | 183 |
| Nov 30, 2026 | 183 |
| Nov 29, 2026 | 183 |
| Nov 28, 2026 | 183 |
| Nov 27, 2026 | 183 |
| Nov 26, 2026 | 183 |
| Nov 25, 2026 | 182 |
| Nov 24, 2026 | 182 |
| Nov 23, 2026 | 182 |
| Nov 22, 2026 | 182 |
| Nov 21, 2026 | 182 |
| Nov 20, 2026 | 182 |
| Nov 19, 2026 | 182 |
| Nov 18, 2026 | 182 |
| Nov 17, 2026 | 182 |
| Nov 16, 2026 | 183 |
| Nov 15, 2026 | 183 |
| Nov 14, 2026 | 183 |
| Nov 13, 2026 | 183 |
| Nov 12, 2026 | 183 |
| Nov 11, 2026 | 183 |
| Nov 10, 2026 | 183 |
| Nov 9, 2026 | 182 |
| Nov 8, 2026 | 182 |
| Nov 7, 2026 | 182 |
| Nov 6, 2026 | 182 |
| Nov 5, 2026 | 182 |
| Nov 4, 2026 | 182 |
| Nov 3, 2026 | 181 |
| Nov 2, 2026 | 181 |
| Nov 1, 2026 | 181 |
| Oct 31, 2026 | 181 |
| Oct 30, 2026 | 181 |
| Oct 29, 2026 | 181 |
| Oct 28, 2026 | 181 |
| Oct 27, 2026 | 181 |
| Oct 26, 2026 | 181 |
| Oct 25, 2026 | 181 |
| Oct 24, 2026 | 181 |
| Oct 23, 2026 | 181 |
| Oct 22, 2026 | 181 |
| Oct 21, 2026 | 180 |
| Oct 20, 2026 | 180 |
| Oct 19, 2026 | 180 |
| Oct 18, 2026 | 180 |
| Oct 17, 2026 | 180 |
| Oct 16, 2026 | 180 |
| Oct 15, 2026 | 180 |
| Oct 14, 2026 | 180 |
| Oct 13, 2026 | 180 |
| Oct 12, 2026 | 180 |
| Oct 11, 2026 | 180 |
| Oct 10, 2026 | 180 |
| Oct 9, 2026 | 180 |
| Oct 8, 2026 | 180 |
| Oct 7, 2026 | 180 |
| Oct 6, 2026 | 180 |
| Oct 5, 2026 | 180 |
| Oct 4, 2026 | 180 |
| Oct 3, 2026 | 180 |
| Oct 2, 2026 | 180 |
| Oct 1, 2026 | 180 |
| Sep 30, 2026 | 180 |
| Sep 29, 2026 | 180 |
| Sep 28, 2026 | 180 |
| Sep 27, 2026 | 180 |
| Sep 26, 2026 | 180 |
| Sep 25, 2026 | 180 |
| Sep 24, 2026 | 179 |
| Sep 23, 2026 | 179 |
| Sep 22, 2026 | 179 |
| Sep 21, 2026 | 179 |
| Sep 20, 2026 | 179 |
| Sep 19, 2026 | 179 |
| Sep 18, 2026 | 179 |
| Sep 17, 2026 | 179 |
| Sep 16, 2026 | 179 |
| Sep 15, 2026 | 179 |
| Sep 14, 2026 | 179 |
| Sep 13, 2026 | 179 |
| Sep 12, 2026 | 179 |
| Sep 11, 2026 | 179 |
| Sep 10, 2026 | 179 |
| Sep 9, 2026 | 179 |
| Sep 8, 2026 | 179 |
| Sep 7, 2026 | 179 |
Shared by 4 plugins in shefing/payload-tools.
43+31 since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 43 |
| Dec 5, 2026 | 27 |
| Dec 4, 2026 | 35 |
| Dec 3, 2026 | 31 |
| Dec 2, 2026 | 24 |
| Dec 1, 2026 | 28 |
| Nov 30, 2026 | 26 |
| Nov 29, 2026 | 27 |
| Nov 28, 2026 | 34 |
| Nov 27, 2026 | 81 |
| Nov 26, 2026 | 175 |
| Nov 25, 2026 | 180 |
| Nov 24, 2026 | 178 |
| Nov 23, 2026 | 176 |
| Nov 22, 2026 | 182 |
| Nov 21, 2026 | 177 |
| Nov 20, 2026 | 128 |
| Nov 19, 2026 | 38 |
| Nov 18, 2026 | 30 |
| Nov 17, 2026 | 28 |
| Nov 16, 2026 | 28 |
| Nov 15, 2026 | 26 |
| Nov 14, 2026 | 23 |
| Nov 13, 2026 | 19 |
| Nov 12, 2026 | 33 |
| Nov 11, 2026 | 123 |
| Nov 10, 2026 | 126 |
| Nov 9, 2026 | 129 |
| Nov 8, 2026 | 128 |
| Nov 7, 2026 | 133 |
| Nov 6, 2026 | 145 |
| Nov 5, 2026 | 166 |
| Nov 4, 2026 | 73 |
| Nov 3, 2026 | 70 |
| Nov 2, 2026 | 68 |
| Nov 1, 2026 | 64 |
| Oct 31, 2026 | 59 |
| Oct 30, 2026 | 44 |
| Oct 29, 2026 | 5 |
| Oct 28, 2026 | 4 |
| Oct 27, 2026 | 7 |
| Oct 26, 2026 | 7 |
| Oct 25, 2026 | 9 |
| Oct 24, 2026 | 16 |
| Oct 23, 2026 | 16 |
| Oct 22, 2026 | 20 |
| Oct 21, 2026 | 29 |
| Oct 20, 2026 | 40 |
| Oct 19, 2026 | 39 |
| Oct 18, 2026 | 46 |
| Oct 17, 2026 | 38 |
| Oct 16, 2026 | 43 |
| Oct 15, 2026 | 61 |
| Oct 14, 2026 | 54 |
| Oct 13, 2026 | 40 |
| Oct 12, 2026 | 40 |
| Oct 11, 2026 | 33 |
| Oct 10, 2026 | 36 |
| Oct 9, 2026 | 35 |
| Oct 8, 2026 | 21 |
| Oct 7, 2026 | 27 |
| Oct 6, 2026 | 39 |
| Oct 5, 2026 | 49 |
| Oct 4, 2026 | 50 |
| Oct 3, 2026 | 61 |
| Oct 2, 2026 | 68 |
| Oct 1, 2026 | 64 |
| Sep 30, 2026 | 62 |
| Sep 29, 2026 | 51 |
| Sep 28, 2026 | 41 |
| Sep 27, 2026 | 37 |
| Sep 26, 2026 | 25 |
| Sep 25, 2026 | 17 |
| Sep 24, 2026 | 16 |
| Sep 23, 2026 | 15 |
| Sep 22, 2026 | 14 |
| Sep 21, 2026 | 17 |
| Sep 20, 2026 | 17 |
| Sep 19, 2026 | 14 |
| Sep 18, 2026 | 12 |
| Sep 17, 2026 | 9 |
| Sep 16, 2026 | 5 |
| Sep 15, 2026 | 6 |
| Sep 14, 2026 | 3 |
| Sep 13, 2026 | 5 |
| Sep 12, 2026 | 7 |
| Sep 11, 2026 | 6 |
| Sep 10, 2026 | 8 |
| Sep 9, 2026 | 8 |
| Sep 8, 2026 | 11 |
| Sep 7, 2026 | 12 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/888484677-changes-button)<a href="https://payloaddirectory.dev/plugins/888484677-changes-button"><img src="https://payloaddirectory.dev/badge/888484677-changes-button.svg" alt="Payload Directory"></a>README
A Payload CMS plugin that adds a Changes button to drafts-enabled documents. Clicking it opens a slide-in drawer that shows a field-by-field diff between the current document state (or the latest draft) and the currently published version — using the same diff UI as the built-in Versions view.
payload / @payloadcms/next release without waiting for new exports to land upstream.src/labels.ts (en/ar/es/fr/he/zh) and are picked up via useTranslation().i18n.language.Two upstream Payload PRs would let the plugin install with a single line and zero layout edits, but they have not been merged yet:
| Feature | Issue | PR |
|---|---|---|
@payloadcms/next/views/diff subpath export | #16496 | #16498 |
config.admin.serverFunctions registry | #16497 | #16499 |
Until they ship, this package vendors the diff pipeline from @payloadcms/next/src/views/Version/RenderFieldsToDiff/ (see src/vendor/diff/) and requires a small (payload)/layout.tsx change to register the server function. Once both PRs land, the vendor copy can be deleted and the layout edit removed.
pnpm add @shefing/changes-button
payload.config.tsimport { buildConfig } from 'payload'
import { changesButtonPlugin } from '@shefing/changes-button'
export default buildConfig({
// ...
plugins: [
changesButtonPlugin({
// optional — exclude collections / globals from receiving the button
excludedCollections: ['users'],
excludedGlobals: [],
}),
],
})
handleServerFunctions in app/(payload)/layout.tsxThe plugin needs a server function (shefing/changes-button:render-diff) registered alongside Payload's built-in ones. Until upstream PR #16499 lands, this is done by wrapping the serverFunction you pass to <RootLayout />:
// app/(payload)/layout.tsx
import type { ServerFunctionClient } from 'payload'
import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts'
import { wrapServerFunctions } from '@shefing/changes-button/server'
import config from '@payload-config'
import { importMap } from './admin/importMap.js'
const baseServerFunction: ServerFunctionClient = async function (args) {
'use server'
return handleServerFunctions({ ...args, config, importMap })
}
const serverFunction = wrapServerFunctions(baseServerFunction)
export default async function Layout({ children }: { children: React.ReactNode }) {
return (
<RootLayout config={config} importMap={importMap} serverFunction={serverFunction}>
{children}
</RootLayout>
)
}
wrapServerFunctions intercepts only the shefing/changes-button:render-diff key and forwards every other call to the base handler unchanged.
| Option | Type | Default | Description |
|---|---|---|---|
excludedCollections | string[] | [] | Slugs of collections that should NOT receive the Changes button. |
excludedGlobals | string[] | [] | Slugs of globals that should NOT receive the Changes button. |
disabled | boolean | false | Disable the plugin entirely without removing it from plugins. |
The button is rendered only when all of the following are true for the open document:
versions.drafts is configured).modified or unpublishedVersionCount > 0.For brand-new entities (no published baseline) the diff renders against an empty baseline so every populated field shows as an addition.
All user-facing strings are declared in src/labels.ts and consumed via the getLabel(key, locale) helper. The active locale is read from useTranslation().i18n.language so the button automatically follows the admin UI language.
Built-in locales: en, ar, es, fr, he, zh. Missing keys/locales fall back to English.
If you don't want to use wrapServerFunctions, register the handler explicitly in your serverFunctions map:
import { renderChangesDiffHandler, SERVER_FUNCTION_KEY } from '@shefing/changes-button/server'
const serverFunction: ServerFunctionClient = async function (args) {
'use server'
return handleServerFunctions({
...args,
config,
importMap,
serverFunctions: { [SERVER_FUNCTION_KEY]: renderChangesDiffHandler },
})
}
The vendored diff pipeline lives in src/vendor/diff/ — a snapshot of @payloadcms/next/src/views/Version/RenderFieldsToDiff/ (minus *.spec.ts). When upstream PR #16498 ships in a release:
src/server/renderChangesDiff.tsx with import { countChangedFields, RenderDiff } from '@payloadcms/next/views/diff'.src/vendor/diff/ and the copied SelectedLocalesContext.tsx.@payloadcms/next peerDependency to the release that exposes the subpath.When PR #16499 ships, additionally:
config.admin.serverFunctions self-registration in ChangesButtonPlugin.ts (see git history).wrapServerFunctions step from this README — the plugin will be a single-line install again.See the consolidated ROADMAP.md at the repo root and the live RoadMap issues for Changes Button.
summarize adapter (openai, anthropic, custom). The plugin sends the structured diff + collection field metadata; receives a markdown summary + bullet list of risky changes.(docId, fromVersion, toVersion).admin.custom.changesButton.aiSummary.change-request record (or hooking into authorization roles).comments plugin's Lexical mark on changed fields.src/vendor/diff and the (payload)/layout.tsx edit.MIT — © shefing
Topics
pages
Adds a versioned pages collection with configurable page types, localized fields, drafts and autosave
6430/wk0v4
payload plugin comments
Inline comment threads on Lexical rich text with a sidebar panel, in English and French
589/wk0v3
payload visual editor
Visual live preview editor in the Payload admin edit view for collections and globals
4958/wk315v2
content freeze
Block create, update and delete on chosen collections and globals while a content freeze is active
85207/wk115v4
payload better editor
Side-by-side live-preview iframe with a sidebar for editing individual blocks in the Payload edit view
781.2k/wk119v3
payload plugin docs
Keeps a reviewed docs page for each feature your site lists, with a publish-time lint for internal details
78367/wk0v3